We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Brooks Halladay • 8 years ago

Sam, this was a great article. Have you done anything on Ethereum yet?

Random • 8 years ago

Can you elaborate on the last sentence:

"This is called a "Pay-to-Public-Key-Hash" script. However, through Bitcoin script other types of conditions are possible. For example, an output could created that could be spent by anyone that could solve a certain hash or a transaction could be created that anyone could spend."

Sam Lewis • 8 years ago

There's a few different pubkey scripts documented on the Bitcoin wiki: https://en.bitcoin.it/wiki/...

Random • 8 years ago

I meant I'm just trying to wrap my head around that sentence.

Can you rephrase it so its more clear?

Sam Lewis • 8 years ago

Ah, right! So the signature script creates a "locking condition" on the output, the condition normally is "this output can be spent by the person with the private key to a certain public key" but, instead of that, you can have other conditions such as "this output can be spent by anyone" or "this output can be spent by anyone who knows what sha256 hashes to '12345'".

Does that make a little more sense?

Random • 8 years ago

Perfect. Thanks!!

evandrix • 8 years ago

@ http://gobittest.appspot.co...
5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip8JkUM7yP5mxSiidLg

divideoverflowcom • 8 years ago

Sam, nice write-up! Almost sent the coins to your donation address, but someone else's unconfirmed transaction appeared just minutes before I finished "fixing" up the code :)

How do you specify fees in your transaction creation example?

Sam Lewis • 8 years ago

Thanks for the kind words!

The fee will be the difference between the amount in the output and how much you specify to spend. Miners take whatever part of the UTXO that you don't specify.

Talia Sherman • 5 years ago

awesome work gaz!

Maxim Boyarov • 6 years ago

https://checkbitcoinaddress...

Check Bitcoin Address for mentions and abuses.

SC • 8 years ago

This is very helpful, thanks. One question: you say "This involves replacing the placeholder signature script with the real signature script and removing the hash_code_type from the transaction as shown below." But if you delete the hash_code_type, how will the next Tx trying to use the output of this Tx know how to recompute the signature to verify? What if you had signed this with a hash_code_type that wasn't SIGHASH_ALL? Thanks in advance for the response.

evandrix • 8 years ago

There's an error in your first diagram - "ecsda".

digitalroningithub • 8 years ago

Thank you for the great writeup - really useful.

c0diator • 8 years ago

So good. Thanks so much for this detailed write-up.

Francesco • 8 years ago

Amazing article! You made me want to start writing my own client!
Also, I think I'm going to open my first Bitcoin account very soon.
Thanks!

sagivo • 8 years ago

great article. thanks

John Mathews • 8 years ago

I find this really useful. Thanks!

Daniel Pyrathon • 8 years ago

Brilliant! thanks for writing this and educating people about the Bitcoin protocol

paul firth • 8 years ago

I wrote this article describing what a bitcoin actually is on the network a while ago. Your readers may find it useful: https://wildbunny.co.uk/blo...