{"type":"rich","version":"1.0","title":"Ethan Heilman [ARCHIVE] wrote","author_name":"Ethan Heilman [ARCHIVE] (npub1ga…gac47)","author_url":"https://yabu.me/npub1gaszwl7qd0tjmnwcaamgzzgsmzzjlvle6kz0td66pwa8z69vsxsqxgac47","provider_name":"njump","provider_url":"https://yabu.me","html":"📅 Original date posted:2019-10-03\n📝 Original message:\nTo avoid derailing the NO_INPUT conversation, I have changed the\nsubject to OP_CAT.\n\nResponding to:\n\"\"\"\n* `SIGHASH` flags attached to signatures are a misdesign, sadly\nretained from the original BitCoin 0.1.0 Alpha for Windows design, on\npar with:\n[..]\n* `OP_CAT` and `OP_MULT` and `OP_ADD` and friends\n[..]\n\"\"\"\n\nOP_CAT is an extremely valuable op code. I understand why it was\nremoved as the situation at the time with scripts was dire. However\nmost of the protocols I've wanted to build on Bitcoin run into the\nlimitation that stack values can not be concatenated. For instance\nTumbleBit would have far smaller transaction sizes if OP_CAT was\nsupported in Bitcoin. If it happens to me as a researcher it is\nprobably holding other people back as well. If I could wave a magic\nwand and turn on one of the disabled op codes it would be OP_CAT.  Of\ncourse with the change that size of each concatenated value must be 64\nBytes or less.\n\n\nOn Tue, Oct 1, 2019 at 10:04 PM ZmnSCPxj via bitcoin-dev\n\u003cbitcoin-dev at lists.linuxfoundation.org\u003e wrote:\n\u003e\n\u003e Good morning lists,\n\u003e\n\u003e Let me propose the below radical idea:\n\u003e\n\u003e * `SIGHASH` flags attached to signatures are a misdesign, sadly retained from the original BitCoin 0.1.0 Alpha for Windows design, on par with:\n\u003e   * 1 RETURN\n\u003e   * higher-`nSequence` replacement\n\u003e   * DER-encoded pubkeys\n\u003e   * unrestricted `scriptPubKey`\n\u003e   * Payee-security-paid-by-payer (i.e. lack of P2SH)\n\u003e   * `OP_CAT` and `OP_MULT` and `OP_ADD` and friends\n\u003e   * transaction malleability\n\u003e   * probably many more\n\u003e\n\u003e So let me propose the more radical excision, starting with SegWit v1:\n\u003e\n\u003e * Remove `SIGHASH` from signatures.\n\u003e * Put `SIGHASH` on public keys.\n\u003e\n\u003e Public keys are now encoded as either 33-bytes (implicit `SIGHASH_ALL`) or 34-bytes (`SIGHASH` byte, followed by pubkey type, followed by pubkey coordinate).\n\u003e `OP_CHECKSIG` and friends then look at the *public key* to determine sighash algorithm rather than the signature.\n\u003e\n\u003e As we expect public keys to be indirectly committed to on every output `scriptPubKey`, this is automatically output tagging to allow particular `SIGHASH`.\n\u003e However, we can then utilize the many many ways to hide public keys away until they are needed, exemplified in MAST-inside-Taproot.\n\u003e\n\u003e I propose also the addition of the opcode:\n\u003e\n\u003e     \u003csighash\u003e \u003cpubkey\u003e OP_SETPUBKEYSIGHASH\n\u003e\n\u003e * `sighash` must be one byte.\n\u003e * `pubkey` may be the special byte `0x1`, meaning \"just use the Taproot internal pubkey\".\n\u003e * `pubkey` may be 33-byte public key, in which case the `sighash` byte is just prepended to it.\n\u003e * `pubkey` may be 34-byte public key with sighash, in which case the first byte is replaced with `sighash` byte.\n\u003e * If `sighash` is `0x00` then the result is a 33-byte public key (the sighash byte is removed) i.e. `SIGHASH_ALL` implicit.\n\u003e\n\u003e This retains the old feature where the sighash is selected at time-of-spending rather than time-of-payment.\n\u003e This is done by using the script:\n\u003e\n\u003e     \u003cpubkey\u003e OP_SETPUBKEYSIGHASH OP_CHECKSIG\n\u003e\n\u003e Then the sighash can be put in the witness stack after the signature, letting the `SIGHASH` flag be selected at time-of-signing, but only if the SCRIPT specifically is formed to do so.\n\u003e This is malleability-safe as the signature still commits to the `SIGHASH` it was created for.\n\u003e\n\u003e However, by default, public keys will not have an attached `SIGHASH` byte, implying `SIGHASH_ALL` (and disallowing-by-default non-`SIGHASH_ALL`).\n\u003e\n\u003e This removes the problems with `SIGHASH_NONE` `SIGHASH_SINGLE`, as they are allowed only if the output specifically says they are allowed.\n\u003e\n\u003e Would this not be a superior solution?\n\u003e\n\u003e Regards,\n\u003e ZmnSCPxj\n\u003e _______________________________________________\n\u003e bitcoin-dev mailing list\n\u003e bitcoin-dev at lists.linuxfoundation.org\n\u003e https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev"}
