public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
* [bitcoin-dev] MAST with OP_EVAL and OP_CAT
@ 2015-09-10 17:18 jl2012
  0 siblings, 0 replies; only message in thread
From: jl2012 @ 2015-09-10 17:18 UTC (permalink / raw)
  To: bitcoin-dev

Inspired by Pieter's Tree Signatures, I believe Merkleized Abstract 
Syntax Trees (MAST) could be implemented with only OP_CAT and OP_EVAL 
(BIP12).

The idea is very simple. Using a similar example in Pieter's paper,

scriptSig = <sig> <serialized sub-script 10> Z1 0 1 1 X6 1 K9 0 
<serialized script>
scriptPubKey = DUP HASH160 <hash serialized script> EQUALVERIFY EVAL
serialized script = 8 PICK SHA256 (SWAP IF SWAP ENDIF CAT SHA256)*4 <R> 
EQUALVERIFY EVAL

This will run the 10-th sub-script, when there are 11 sub-scripts in the 
MAST

I think this is the easiest way to enable MAST since the reference 
implementation for BIP12 is already there. We could enable OP_CAT only 
inside OP_EVAL so this will be a pure softfork.

Ref:
Tree Signatures: https://blockstream.com/2015/08/24/treesignatures/
BIP12: https://github.com/bitcoin/bips/blob/master/bip-0012.mediawiki


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-10 17:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-10 17:18 [bitcoin-dev] MAST with OP_EVAL and OP_CAT jl2012

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