Skip to content

Commit

Permalink
update commit
Browse files Browse the repository at this point in the history
  • Loading branch information
reardencode committed Jan 7, 2024
1 parent b346b21 commit 8697678
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bip-csfs.mediawiki
Expand Up @@ -54,7 +54,7 @@ BIP340 signature verification and ECDSA signature verification respectively.

# Message hashing: ECDSA requires the message to be securely hashed to 32-bytes before being used in the signing protocol, so a SHA256 hash is taken before the message is passed for ECDSA signing. BIP340 is compatible with any size of message and does not require it to be a securely hashed input, so the message is not hashed prior to BIP340 signing.
# Verify NOP upgrade: To bring both ECDSA and BIP340 signing to bitcoin script, a NOP upgrade path was chosen for <code>OP_CHECKSIGFROMSTACKVERIFY</code>. This necessarily means leaving the 3 arguments on the stack when executing <code>OP_CHECKSIGFROMSTACKVERIFY</code>. Scripts will need to drop or otherwise manage these stack elements.
# Add/multisig: No concession is made to ```OP_CHECKMULTISIG``` or ```OP_CHECKSIGADD``` semantics with <code>OP_CHECKSIGFROMSTACK(VERIFY)</code>. In Tapscript, add semantics can be implemented with 1 additional vByte per key (<code>OP_TOALTSTACK OP_CHECKSIGFROMSTACK OP_FROMALTSTACK OP_ADD OP_TOALTSTACK</code>).
# Add/multisig: No concession is made to <code>OP_CHECKMULTISIG</code> or <code>OP_CHECKSIGADD</code> semantics with <code>OP_CHECKSIGFROMSTACK(VERIFY)</code>. In Tapscript, add semantics can be implemented with 1 additional vByte per key (<code>OP_TOALTSTACK OP_CHECKSIGFROMSTACK OP_FROMALTSTACK OP_ADD OP_TOALTSTACK</code>).
# Splitting R/S on the stack: Implementing split/separate signatures is left as an exercise for future bitcoin upgrades, such as <code>OP_CAT</code>.
# BIP118-style Taproot internal key: Rather than introducing an additional key type in this change, we suggest implementing OP_INTERNALKEY or separately introducing that key type for all Tapscript signature checking operations in a separate change.
# Unknown key lengths: The semantics of other signature checking opcodes in their respective script types (legacy, segwit-v0, tapscript-c0) are applied.
Expand All @@ -71,22 +71,22 @@ types.

When combined with <code>OP_CHECKTEMPLATEVERIFY</code> (BIP119/CTV),
<code>OP_CHECKSIGFROMSTACK</code> (CSFS) can be used in Lightning Symmetry channels.
The construction <code>OP_CHECKTEMPLATEVERIFY &lt;pubkey&gt; OP_CHECKSIGFROMSTACK</code> is
logically equivalent to <code>&lt;bip118_pubkey&gt; OP_CHECKSIG</code> and a signature over
The construction <code>OP_CHECKTEMPLATEVERIFY <pubkey> OP_CHECKSIGFROMSTACK</code> is
logically equivalent to <code><bip118_pubkey> OP_CHECKSIG</code> and a signature over
<code>SIGHASH_ALL|SIGHASH_ANYPREVOUTANYSCRIPT</code>. The <code>OP_CHECKSIGFROMSTACK</code>
construction is 8 vBytes larger.

===Delegation===

Using a script like:
<code>OP_DUP &lt;pubkey&gt; OP_CHECKSIGFROMSTACK OP_DROP OP_CHECKSIG</code>
<code>OP_DUP <pubkey> OP_CHECKSIGFROMSTACK OP_DROP OP_CHECKSIG</code>
A script can delegate signing to another key.

==Reference Implementation==

A reference implementation is provided in provided here:

https://github.com/brandonblack/bitcoin/commit/bf375614f7bd73a2a84cdd4b660e6c02ad4bcbc3
https://github.com/brandonblack/bitcoin/commit/5aae0503ceab93101c459748347a111e4a4852c4

==Backward Compatibility==

Expand Down

0 comments on commit 8697678

Please sign in to comment.