Why Nostr? What is Njump?
2023-06-07 17:39:55
in reply to

jl2012 at xbt.hk [ARCHIVE] on Nostr: 📅 Original date posted:2015-09-10 📝 Original message:Inspired by Pieter's Tree ...

📅 Original date posted:2015-09-10
📝 Original message: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
Author Public Key
npub1kc0zulxt7j4a0ayhzhrz7jk84y7tm4026qcky7w97hlfkxxap24qnwjfw4