Satoshi Nakamoto's Transaction Chain Diagram Hash Value

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?

Jazimov

Posted 2018-05-22T03:36:37.437

Reputation: 207

Answers

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.

Andrew Chow

Posted 2018-05-22T03:36:37.437

Reputation: 40 910

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 2018-05-22T12:58:13.063

The diagram is largely abstract and does not contain what is actually being hashed. A more specific explanation can be found in BIP 144: https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki#hashes

Andrew Chow 2018-05-22T16:13:07.653