比特币(BSV)知识库:比特币协议-传统签名算法(Legacy Sighash Algorithm)

特别提示:

比特币(BSV)知识库-Bitcoin wiki-目前为全英文内容,暂无中文译文,并且仍在持续编写和补充中。欢迎中国的开发者在文章底部评论,进行阐述和探讨。

Legacy Sighash Algorithm

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".

声明:

比特币(BSV)知识库项目由比特币协会(Bitcoin Association)发起并支持,更多信息请参见知识库官网:https://wiki.bitcoinsv.io/

猜你喜欢

转载自blog.csdn.net/BitcoinSV/article/details/106479843
今日推荐