Skip to content

Commit

Permalink
Add bip-internalkey
Browse files Browse the repository at this point in the history
  • Loading branch information
reardencode committed Jan 13, 2024
1 parent deae64b commit a24aca4
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions bip-internalkey.mediawiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<pre>
BIP: TBD
Layer: Consensus (soft fork)
Title: INTERNALKEY
Author: Brandon Black <[email protected]>
Comments-Summary: No comments yet.
Status: Draft
Type: Standards Track
Created: 2023-12-22
License: PD
</pre>

==Abstract==

This BIP describes a new tapscript opcode (<code>OP_INTERNALKEY</code>) which
pushes the taproot internal key to the stack.

==Specification==

When verifying taproot script spends having leaf version 0xc0 (as defined in
BIP342), <code>OP_INTERNALKEY</code> replaces <code>OP_SUCCESS203</code>
(0xcb). <code>OP_INTERNALKEY</code> pushes the taproot internal key, as defined
in BIP341, to the stack.

==Motivation==

===Key spend with additional conditions===

When building taproot outputs, especially those secured by an aggregate key
representing more than 1 signer; the parties may wish to collaborate on signing
with the taproot internal key, but only with additional script restrictions. In
this case, <code>OP_INTERNALKEY</code> saves 32 bytes of witness space.

===Mitigated control block overhead for scripts using hash locks===

In cases where script path spending is not desired, the internal key may be set
to a NUMS point whose bytes would otherwise be required in a tapscript. This
could be used with any hash locked transaction, for example, to save 32 witness
bytes.

==Reference Implementation==

A reference implementation is provided here:

https://github.com/brandonblack/bitcoin/commit/985e8c788d5e0f91802200044d31f9b86500255c

==Backward Compatibility==

By constraining the behavior of an OP_SUCCESS opcode, deployment of the BIP can
be done in a backwards compatible, soft-fork manner. If anyone were to rely on
the OP_SUCCESS behavior of <code>OP_SUCCESS203</code>,
<code>OP_INTERNALKEY</code> would invalidate their spend.

==Deployment==

TBD

==Credits==

Jeremy Rubin described most of the ideas for <code>OP_INTERNALKEY</code> to me.

==References==

[https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki BIP 341] Taproot

[https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki BIP 342] Tapscript

==Copyright==

This document is placed in the public domain.

0 comments on commit a24aca4

Please sign in to comment.