BIP 16 changes (list inside) [combined summary]



Individual post summaries: Click here to read the original discussion on the bitcoin-dev mailing list

Published on: 2012-03-18T18:11:48+00:00


Summary:

On March 18, 2012, Amir Taaki reached out to inquire about the accuracy of a summary regarding changes needed for P2SH and BIP 16. He suggested using his 0.4.x backport from GitHub but cautioned that it still needed auditing since no one else had reviewed it yet. Although the backport could cover the minimal changes required for P2SH validation, it would not address the standard rule changes necessary for accepting them into blocks.The discussion highlights the changes needed for P2SH (Pay to Script Hash) and BIP 16 (Bitcoin Improvement Proposal). These changes are divided into two categories: block validation and script.In terms of block validation, the CheckBlock function uses LegacySigOpCount instead of SigOpCount. The ConnectBlock function undergoes some modifications, including a new SigOp calculation. However, FetchInputs() and ConnectInputs() remain unchanged. There are also some efficient improvements made to SetBestChain(), although they are unrelated to BIP 16.Regarding the script changes, the Solver function has a special case to check for TX_SCRIPTHASH, which returns the hash of the input eval script. Another solver returns the signature of the pubkey script or TX_SCRIPTHASH, finding the redeem script in KeyStore and returning it. ExtractAddress(es) and VerifyScript are also included.If the fValidatePayToScriptHash block date and output script (scriptPubKey) are P2SH, then the scriptSig must consist only of push operations. The last item of the copied stack is evaluated as a script using the copied stack as the stack.A SigOpCount is used within the CBlock::ConnectBlock main loop to perform scoring checksigs and multisigs. Additionally, a newly added DecodeOP_N is used alongside the normal SigOpCount.Lastly, in the Address component, the main hash160 data is set with a beginning byte (nVersion) of 0x05.Overall, the discussion provides detailed insights into the changes required for P2SH and BIP 16, covering both block validation and script modifications. It also addresses the caution regarding the need for auditing the suggested backport and mentions some efficient improvements made to SetBestChain() that are unrelated to BIP 16.


Updated on: 2023-08-01T03:23:55.786057+00:00