Author: Amir Taaki 2012-03-18 14:04:27
Published on: 2012-03-18T14:04:27+00:00
The discussion mentions the changes required for P2SH( Pay to Script Hash) and BIP 16(Bitcoin Improvement Proposal). The changes are listed in two categories: block validation and script. In block validation, a LegacySigOpCount is used instead of SigOpCount in CheckBlock. Changes are made only to ConnectBlock() which has a new SigOp calculation, however, there are no important changes to FetchInputs()/ConnectInputs(). Some efficient improvements are made to SetBestChain(), but they are not related to BIP 16. In script, Solver has a special case to check for TX_SCRIPTHASH which returns hash of input eval script. Another solver returns signature of pubkey script or TX_SCRIPTHASH; it finds the redeem script in KeyStore and returns it. ExtractAddress(es) and VerifyScript are also included. If the fValidatePayToScriptHash block date and output script (scriptPubKey) are P2SH, then scriptSig must be only push operations and evaluate the last item of copied stack as a script using the copied stack as the stack. A SigOpCount is used inside CBlock::ConnectBlock main loop that does scoring checksigs and multisigs. A newly added DecodeOP_N to normal SigOpCount is also used.Lastly, in Address, the main hash160 data is set with a beginning byte (nVersion) of 0x05.
Updated on: 2023-06-06T03:41:23.931082+00:00