Subject: Re: [Bitcoin-development]To prevent arbitrary data storage in txouts — The Ultimate Solution

From: Peter Todd <[email-masked]>
Date: Wed, 10 Apr 2013 02:53:16 -0400

On Tue, Apr 09, 2013 at 11:03:01PM -0400, Peter Todd wrote:
> On Tue, Apr 09, 2013 at 07:53:38PM -0700, Gregory Maxwell wrote:
> 
> Note how we can already do this: P2SH uses Hash160, which is
> RIPE160(SHA256(d)) We still need a new P2SH *address* type, that
> provides the full 256 bits, but no-one uses P2SH addresses yet anyway.

We can keep the length 160bits:

scriptPubKey: OP_HASH160 OP_HASH160 <Hash160(P2SHv2 address)> OP_EQUALVERIFY

You don't need to change the address type at all if new software is
written to check for both forms of txout in the actual
blockchain/transaction code at the deeper level. Basically now a P2SH
address could actually mean one of two scriptPubKey forms, must like a
normal address can mean either the hashed or bare OP_CHECKSIG form.

Of course, either way you have the odd side-effect that it's now
difficult to pay further funds to a random txout seen on the
blockchain... strange, although possibly not a bad thing.

-- 
'peter'[:-1]@petertodd.org