1

In Satoshi Nakamoto's diagram:

enter image description here

The line coming from transaction block 1 and going the the "Hash" label in transaction block 2 appears to represent the hash of the entire transaction block (Owner 1's Public Key + Hash + Owner 0's Signature) rather than represent the Hash value shown in transaction block 1 (in which case the line should (technically) be attached to the Hash block rather than to the border of the transaction block). Can anyone confirm exactly how the Hash value shown is computed and whether or not it contains the previous owner's signature?

1 Answer 1

5

Can anyone confirm exactly how the Hash value shown is computed

By taking the raw data for the transaction (as in the bytes that are sent over the wire for the transaction) and passing it through a hash function. For Bitcoin, that is SHA-256 double (SHA-256 done twice).

and whether or not it contains the previous owner's signature?

It depends. For simplicity's sake, you could say that it contains the previous owner's signature.

However, due to the activation of segwit, it does not always contain the signature. For segwit, the hash is not actually the hash of the entire transaction but rather parts of it that are non-segwit. Transactions that are non-segwit will have the signatures as part of the hashed data.

2
  • Awesome, thanks. So when the transaction block does not contain the signature, does the hash of transaction block 2 contain a reference to the computed has of transaction block 1 (i.e., specifically the hash of owner 1's public key + the previous hash)? According to the diagram, nothing other than public key is being hashed unless the signature is included. Is the diagram largely abstracted? Is there a spec I can see that shows exactly what gets hashed--segwit or otherwise?
    – Jazimov
    Commented May 22, 2018 at 12:58
  • The diagram is largely abstract and does not contain what is actually being hashed. A more specific explanation can be found in BIP 144: github.com/bitcoin/bips/blob/master/bip-0144.mediawiki#hashes
    – Ava Chow
    Commented May 22, 2018 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.