[bitcoin-dev] BIP draft: Scripting System in Merkelized Abstract Syntax Tree

Johnson Lau jl2012 at xbt.hk
Fri Apr 29 05:48:10 UTC 2016


https://github.com/jl2012/bips/blob/mastopcodes/bip-mastopcodes.mediawiki

This BIP defines the scripting system in Merkelized Abstract Syntax Tree (BIP114). It re-enables some of the previously disabled opcodes, introduces new opcodes, and defines expandable opcodes for future extension.

It will:
	• re-enable CAT, SUBSTR, LEFT, RIGHT, INVERT, AND, OR, XOR, LSHIFT, and RSHIFT;
	• introduce new opcodes: DUPTOALTSTACK, DUPFROMALTSTACK, SWAPSTACK, SWAPCAT, and RESIZE;
	• define expandable opcodes for future softforks of stack manipulating opcodes: EXPAND1 to EXPAND32.


This BIP is based on the BIP114 MAST: https://github.com/bitcoin/bips/blob/master/bip-0114.mediawiki

Reference implementation, including the BIP9 logic and script tests, could be found at https://github.com/jl2012/bitcoin/tree/segwit_mast . This branch is rebased on top of the #7910 segwit PR. However, I have not tested the BIP9 activation.

The implementation of the re-enabled opcode are mostly taken from the Elements Project.

-------------

This BIP does not describe changes in CHECKSIG (e.g. new hash type, Schnorr sig), which I think should be another BIP.

I have also considered more radical changes. For example, make all comparison opcode to be “VERIFY” type, and a script passes if and only if the stack is exactly empty after evaluation.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 671 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20160429/dfca9def/attachment.sig>


More information about the bitcoin-dev mailing list