diff --git a/bip-csfs.mediawiki b/bip-csfs.mediawiki new file mode 100644 index 0000000000..984514eeee --- /dev/null +++ b/bip-csfs.mediawiki @@ -0,0 +1,90 @@ +
+ BIP: TBD + Layer: Consensus (soft fork) + Title: CHECKSIGFROMSTACK + Author: Brandon Black+ +==Abstract== + +This BIP describes two new opcode for the purpose of checking cryptographic +signatures in bitcoin scripts against data other than bitcoin transactions. + +==Specification== + +We propose replacing OP_NOP5 in bitcoin script with +'''OP_CHECKSIGFROMSTACKVERIFY'''. When verifying taproot script spends having +leaf version 0xc0 (as defined in BIP342), we propose '''OP_CHECKSIGFROMSTACK''' +to replace '''OP_SUCCESS188''' (0xbc). + +'''OP_CHECKSIGFROMSTACK''' and '''OP_CHECKSIGFROMSTACKVERIFY''' have identical +semantics to '''OP_CHECKSIG''' and '''OP_CHECKSIGVERIFY''' respectively, +except: + +* On success the arguments to '''OP_CHECKSIGFROMSTACKVERIFY''' are left unchanged on the stack. +* They read (or pop, respectively) 3 arguments (rather than 2) from the stack in the following order: '''<pubkey> <data> <sig>''' +* Signatures must not have a sighash byte appended +* The message being verified is '''<data>''' +** '''<data>''' may be any length. +** For ECDSA signature verification '''<data>''' is SHA256 hashed before being used as the message. + +==Resource Limits== + +These opcodes are treated identically to other signature checking opcodes and +count against the various sigops limits in their respective script types. + +==Motivation== + +===LN Symmetry=== + +When combined with '''OP_CHECKTEMPLATEVERIFY''' (BIP119/CTV), +'''OP_CHECKSIGFROMSTACK''' (CSFS) can be used in Lightning Symmetry channels. +The construction '''OP_CHECKTEMPLATEVERIFY <pubkey> OP_CHECKSIGFROMSTACK''' is +logically equivalent to '''+ Comments-Summary: No comments yet. + Status: Draft + Type: Standards Track + Created: 2023-12-22 + License: PD +