diff --git a/ch06.asciidoc b/ch06.asciidoc index 34e6b4a1..dc1ecbe9 100644 --- a/ch06.asciidoc +++ b/ch06.asciidoc @@ -615,6 +615,12 @@ In addition, there is a modifier flag +SIGHASH_ANYONECANPAY+, which can be combi | SINGLE\|ANYONECANPAY | 0x83 | Signature applies to one input and the output with the same index number |======================= +These flag combinations are summarized in <> + +[[sighash_combinations]] +.Summary of different sighash combinations +image::images/sighash_combinations.png["Summary of different SIGHASH flag combinations"] + The way +SIGHASH+ flags are applied during signing and verification is that a copy of the transaction is made and certain fields within are truncated (set to zero length and emptied). The resulting transaction is serialized. The +SIGHASH+ flag is added to the end of the serialized transaction and the result is hashed. The hash itself is the "message" that is signed. Depending on which +SIGHASH+ flag is used, different parts of the transaction are truncated. The resulting hash depends on different subsets of the data in the transaction. By including the +SIGHASH+ as the last step before hashing, the signature commits the +SIGHASH+ type as well, so it can't be changed (e.g., by a miner). [NOTE] diff --git a/images/sighash_combinations.png b/images/sighash_combinations.png new file mode 100644 index 00000000..9974e61f Binary files /dev/null and b/images/sighash_combinations.png differ