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.mediawikiPublished at
2023-06-07 17:39:55Event JSON
{
"id": "14d2074d7931de67e5d13fd08bc18e8c343237be56f92381ce9dcb0a6b2fb723",
"pubkey": "b61e2e7ccbf4abd7f49715c62f4ac7a93cbdd5ead0316279c5f5fe9b18dd0aaa",
"created_at": 1686159595,
"kind": 1,
"tags": [
[
"e",
"f5c95ea9b9b6c1cb20d9fd4c97e93c70d8d8f1b2aaee8aa5fe3e4c882d7d4b6a",
"",
"reply"
],
[
"p",
"a23dbf6c6cc83e14cc3df4e56cc71845f611908084cfe620e83e40c06ccdd3d0"
]
],
"content": "📅 Original date posted:2015-09-10\n📝 Original message:Inspired by Pieter's Tree Signatures, I believe Merkleized Abstract \nSyntax Trees (MAST) could be implemented with only OP_CAT and OP_EVAL \n(BIP12).\n\nThe idea is very simple. Using a similar example in Pieter's paper,\n\nscriptSig = \u003csig\u003e \u003cserialized sub-script 10\u003e Z1 0 1 1 X6 1 K9 0 \n\u003cserialized script\u003e\nscriptPubKey = DUP HASH160 \u003chash serialized script\u003e EQUALVERIFY EVAL\nserialized script = 8 PICK SHA256 (SWAP IF SWAP ENDIF CAT SHA256)*4 \u003cR\u003e \nEQUALVERIFY EVAL\n\nThis will run the 10-th sub-script, when there are 11 sub-scripts in the \nMAST\n\nI think this is the easiest way to enable MAST since the reference \nimplementation for BIP12 is already there. We could enable OP_CAT only \ninside OP_EVAL so this will be a pure softfork.\n\nRef:\nTree Signatures: https://blockstream.com/2015/08/24/treesignatures/\nBIP12: https://github.com/bitcoin/bips/blob/master/bip-0012.mediawiki",
"sig": "6139846b648e615a8fb3ab0e2e2b80876136d770cad9ee5f53197d55066b6f43f2ce0de26a4b2834285d5e66b0428dc5b9d9cb0bc1d7795fe519faaf73b379e8"
}