[Bitcoin-development] Anti DoS for tx replacement

Peter Todd pete at petertodd.org
Thu Jul 18 16:09:54 UTC 2013


On Thu, Jul 18, 2013 at 07:13:53AM -0400, Peter Todd wrote:
> Note that with OP_DEPTH we can remove the small chance of the payee
> vanishing and putting the funds in limbo:
> 
>     <height + n> OP_DEPTH OP_LESSTHAN
>     IF 2 PK1 PK2 CHECKMULTISIG
>     ELSE PK1 CHECKSIG
>     ENDIF
> 
> Though that shows how to implement OP_DEPTH as a true soft-fork we're
> probably best off doing it as part of a script v2 using the soft-fork
> mechanism I outlined before when talking about fidelity-bonded ledgers.
> (best to do MAST (merklized abstract syntax tree) support at the same
> time)

jl2012 pointed out we already have an OP_DEPTH instruction that returns
the number of items on the stack. In the future we should use the terms
OP_BLOCKHEIGHT, OP_TXOUTHEIGHT, OP_TXOUTDEPTH to talk about hypothetical
instructions that put the block height, confirmed txout height, and
confirmed txout depth on the stack. Thus the above example would now be:

     <height + n> BLOCKDEPTH LESSTHAN
     IF 2 <pk-payor> <pk-payee> CHECKMULTISIG
     ELSE <pk-payor> CHECKSIG
     ENDIF

-- 
'peter'[:-1]@petertodd.org
0000000000000013030f49fe3eed5e7f9388c4ecc237b7a847ca93255836bc3b
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20130718/81681c3c/attachment.sig>


More information about the bitcoin-dev mailing list