{"type":"rich","version":"1.0","author_name":"npub1tfk373zg9dnmtvxnpnq7s2dkdgj37rwfj3yrwld7830qltmv8qps8rfq0n","author_url":"https://nostr.ae/npub1tfk373zg9dnmtvxnpnq7s2dkdgj37rwfj3yrwld7830qltmv8qps8rfq0n","provider_name":"njump","provider_url":"https://nostr.ae","html":"📅 Original date posted:2017-09-30\n📝 Original message:I've put together a first draft for what I hope to be a good next step for \nSegwit and Bitcoin scripting:\n    https://github.com/luke-jr/bips/blob/witnessv1/bip-witnessv1.mediawiki\n\nThis introduces 5 key changes:\n\n1. Minor versions for witnesses, inside the witness itself. Essentially the \nwitness [major] version 1 simply indicates the witness commitment is SHA256d, \nand nothing more.\n\nThe remaining two are witness version 1.0 (major 1, minor 0):\n\n2. As previously discussed, undefined opcodes immediately cause the script to \nexit with success, making future opcode softforks a lot more flexible.\n\n3. If the final stack element is not exactly true or false, it is interpreted \nas a tail-call Script and executed. (Credit to Mark Friedenbach)\n\n4. A new shorter fixed-length signature format, eliminating the need to guess \nthe signature size in advance. All signatures are 65 bytes, unless a condition \nscript is included (see #5).\n\n5. The ability for signatures to commit to additional conditions, expressed in \nthe form of a serialized Script in the signature itself. This would be useful \nin combination with OP_CHECKBLOCKATHEIGHT (BIP 115), hopefully ending the \nwhole replay protection argument by introducing it early to Bitcoin before any \nfurther splits.\n\nThis last part is a big ugly right now: the signature must commit to the \nscript interpreter flags and internal \"sigversion\", which basically serve the \nsame purpose. The reason for this, is that otherwise someone could move the \nsignature to a different context in an attempt to exploit differences in the \nvarious Script interpretation modes. I don't consider the BIP deployable \nwithout this getting resolved, but I'm not sure what the best approach would \nbe. Maybe it should be replaced with a witness [major] version and witness \nstack?\n\nThere is also draft code implementing [the consensus side of] this:\n    https://github.com/bitcoin/bitcoin/compare/master...luke-jr:witnessv1\n\nThoughts? Anything I've overlooked / left missing that would be \nuncontroversial and desirable? (Is any of this unexpectedly controversial for \nsome reason?)\n\nLuke"}
