TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A peek under Bitcoin’s hood: Writing a client that can create a transaction

241 pointsby samlewisalmost 8 years ago

9 comments

mason55almost 8 years ago
Article says<p>&gt; <i>This is also why address reuse in Bitcoin is encouraged as to sign a transaction you need to reveal your public key. If you don&#x27;t reuse an address after sending a transaction from the address, you don&#x27;t need worry about the private key of that address being exposed.</i><p>Shouldn&#x27;t that say &quot;address reuse in Bitcoin is <i>discouraged</i>&quot;? Otherwise I don&#x27;t think I understand what he&#x27;s trying to say.
评论 #14489724 未加载
评论 #14488136 未加载
评论 #14489685 未加载
评论 #14488069 未加载
评论 #14490591 未加载
hdhzyalmost 8 years ago
Very cool. This could be used to implement offline wallet with minimal amount of third party code.<p>One issue I&#x27;d like to point is I wish the author used proper random generated private key. Examples on the internet have a nasty habits of being copy pasted and reused verbatim :(
评论 #14488221 未加载
评论 #14490673 未加载
afeezazizalmost 8 years ago
Hi Sam,<p>If you&#x27;re reading the comments, can you do this treatment but for Ethereum and the smart contracts built on top of it?<p>I find that your article gives a good explanation especially for beginner to understand from the code perspective.
评论 #14489145 未加载
评论 #14491831 未加载
ryan-calmost 8 years ago
Looks like there was bitcoin left in the address he published the private key for until about 30 minutes ago. I hope that was a deliberate giveaway.<p><a href="https:&#x2F;&#x2F;blockchain.info&#x2F;tx&#x2F;2685ff794de17cebdf94eb0f111e8b8c03529a9ae628909cef4090663b54e565" rel="nofollow">https:&#x2F;&#x2F;blockchain.info&#x2F;tx&#x2F;2685ff794de17cebdf94eb0f111e8b8c0...</a>
评论 #14490583 未加载
评论 #14490423 未加载
nurettinalmost 8 years ago
&gt;&gt; 0xFACEBEEF and sent it 0.0005 BTC.. 1 month later and someone had stolen my 0.0005 BTC! I guess people must occasionally trawl through addresses with simple&#x2F;common private keys.<p>This made it worth reading the article. Such cyberpunk!
评论 #14489249 未加载
donpdonpalmost 8 years ago
This is an excellent writeup! If any readers are looking for an already-written and tested bitcoin client library and can use javascript, <a href="https:&#x2F;&#x2F;bitcoinjs.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bitcoinjs.org&#x2F;</a> is great. I wrapped a simple cli tool around the library to make the &#x27;coindust&#x27; npm package to do simple operations with bitcoin addresses and public bitcoin APIs.
ryan-calmost 8 years ago
I am actually really surprised it took a month for someone to swipe the BTC he sent to an address with a private key of 0xfacebeef. That could be found via an incremental search in under an hour of CPU search time on one computer.<p>I note that compressed public keys are not being used in these examples - it&#x27;s highly recommended to use them, since they reduce transaction size and cost.<p>Regarding weak keys - there have been a lot of weak key generation techniques in bitcoin where hiding the public key won&#x27;t do you any good.
评论 #14489406 未加载
philfrastyalmost 8 years ago
Can someone explain why bitcoin adresses can be created (offline) without blockchain-validation for duplicates?<p>Even if the chances are very small I mean...like....gone is gone...no bank to call for a false transaction.
评论 #14488717 未加载
评论 #14488508 未加载
评论 #14489595 未加载
评论 #14488458 未加载
sprtalmost 8 years ago
Wrt transactions, I don&#x27;t understand why you need to send yourself the unspent BTCs. Why does it make things significantly easier?
评论 #14503454 未加载
评论 #14493096 未加载
评论 #14491624 未加载