What is Nostr?
Amir Taaki [ARCHIVE] /
npub1ep4ā€¦3rel
2023-06-07 03:13:21
in reply to nevent1qā€¦2wkv

Amir Taaki [ARCHIVE] on Nostr: šŸ“… Original date posted:2012-03-18 šŸ“ Original message:Hi, Is this an accurate ...

šŸ“… Original date posted:2012-03-18
šŸ“ Original message:Hi,

Is this an accurate and precise summary of the changes needed for P2SH and BIP 16?

== Block validation (starting with ProcessBlock) ==

* SigOpCount is now a LegacySigOpCount (CheckBlock)
* Main body of AcceptBlock() and rest of ProcessBlock() is unchanged.
* AddToBlockIndex() unchanged
* Some nice efficient improvements to SetBestChain(), but not related to BIP 16
* ConnectBlock() has new SigOp calculation.
* No important changes to FetchInputs()/ConnectInputs()

== Script ==

* Solver has special case to check for TX_SCRIPTHASH. Returns hash of input eval script
* Another Solver which a) returns signature of pubkey script or b) TX_SCRIPTHASH - finds redeem script in KeyStore and returns it.
* ExtractAddress(es)
* VerifyScript:
** After running input script (scriptSig), copy stack
** Evaluate script as normal
** if block date (fValidatePayToScriptHash) and output script (scriptPubKey) is P2SH:
*** scriptSig must be only push operations
*** evaluate last item of copied stack as a script using the copied stack as the stack
* SigOpCount (used inside CBlock::ConnectBlock main loop) does scoring checksigs and multisigs.
** Newly added DecodeOP_N to normal SigOpCount

== Address ==

* Set main hash160 data with a beginning byte (nVersion) of 0x05
Author Public Key
npub1ep4j5tjp6cd2774hrx96vh845dwqzhe3z7n3a2a9uxdm2dajqpgscm3rel