Difference between revisions of "Legacy Sighash Algorithm"

Line 1: Line 1:
 
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.
 
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.  
+
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. Contrary to the use of hashes in the new sighash algorithm, the modification is simply to remove strings or to replace strings with zeros or one in the transaction. 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/master/src/script/interpreter.cpp
 
The detail can be found at https://github.com/bitcoin-sv/bitcoin-sv/blob/master/src/script/interpreter.cpp
 
by searching "CTransactionSignatureSerializer".
 
by searching "CTransactionSignatureSerializer".

Revision as of 16:50, 19 February 2020

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. Contrary to the use of hashes in the new sighash algorithm, the modification is simply to remove strings or to replace strings with zeros or one in the transaction. 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/master/src/script/interpreter.cpp by searching "CTransactionSignatureSerializer".