Legacy Sighash Algorithm

Revision as of 16:45, 19 February 2020 by Wei (talk | contribs) (Created page with "The legacy sighash algorithm was used to generate a hash value that is signed by an ECDSA signature. The input to the algorithm consists of a transaction and sighash flags. W...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The legacy sighash algorithm was used to generate a hash value that is signed by an ECDSA signature. The input to the algorithm consists of a transaction and sighash flags.

Within the algorithm, it calls an serialisation algorithm that is used to serialise transaction, "CTransactionSignatureSerializer". Depending on the sighash flags, different parts of the transaction will be modified before the transaction is fed to the serialisation algorithm. Once serialised, the transaction is then fed to double SHA256 to produce a hash value for either ECDSA signature creation or verification.

The detail can be found at https://github.com/bitcoin-sv/bitcoin-sv/blob/88ee5b7012e03eb99ccaf695eab0b2f0fff7cb5c/src/script/interpreter.cpp by searching "CTransactionSignatureSerializer".