public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [Bitcoin-development] BIP 16 changes (list inside)
@ 2012-03-18 14:04 Amir Taaki
  2012-03-18 18:11 ` Luke-Jr
  0 siblings, 1 reply; 2+ messages in thread
From: Amir Taaki @ 2012-03-18 14:04 UTC (permalink / raw)
  To: bitcoin-development

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Bitcoin-development] BIP 16 changes (list inside)
  2012-03-18 14:04 [Bitcoin-development] BIP 16 changes (list inside) Amir Taaki
@ 2012-03-18 18:11 ` Luke-Jr
  0 siblings, 0 replies; 2+ messages in thread
From: Luke-Jr @ 2012-03-18 18:11 UTC (permalink / raw)
  To: bitcoin-development, Amir Taaki

On Sunday, March 18, 2012 10:04:27 AM Amir Taaki wrote:
> Is this an accurate and precise summary of the changes needed for P2SH and
> BIP 16?

You might find my 0.4.x backport helpful:
    https://github.com/luke-jr/bitcoin/commit/bip16_0.4.x
Be aware, this still needs auditing (nobody else has looked it over), but I 
believe should cover only the minimal changes required to get P2SH validation 
(though not the "standard" rule changes to accept them into blocks).



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-18 18:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-18 14:04 [Bitcoin-development] BIP 16 changes (list inside) Amir Taaki
2012-03-18 18:11 ` Luke-Jr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox