bitcoin-dev

BIP for OP_INTERNALKEY

BIP for OP_INTERNALKEY

Original Postby Brandon Black

Posted on: April 25, 2024 05:22 UTC

The discussion focuses on the introduction of a new tapscript opcode, OP_INTERNALKEY, which is aimed at enhancing the functionality and efficiency of Bitcoin's scripting capabilities, particularly under the taproot framework.

This proposal is encapsulated in a Bitcoin Improvement Proposal (BIP) that seeks to allow scripts to directly access the taproot internal key, offering a more byte-efficient approach for certain operations. The opcode is designed to push the taproot internal key onto the stack when executing taproot script spends that have a leaf version of 0xc0, effectively replacing the OP_SUCCESS203 opcode.

The motivation behind this proposed addition stems from the desire to facilitate key spend transactions that might require additional conditions or constraints not covered by the standard key path spend. Specifically, it addresses scenarios where multiple parties collaborate on a transaction secured by an aggregate key. Incorporating OP_INTERNALKEY allows these participants to enforce script-based restrictions while engaging with the taproot internal key, ultimately saving 8 vBytes per transaction. This can be especially beneficial in applications such as hash-locked transactions, where the internal key could represent a Nothing-Up-My-Sleeve (NUMS) point, thus mitigating the overhead associated with control blocks in script path spending.

The implementation of OP_INTERNALKEY is detailed in a reference provided on GitHub (reference implementation). This document outlines how this change can be integrated into the Bitcoin protocol in a backward-compatible manner through a soft fork, by redefining the behavior of an existing OP_SUCCESS opcode. Nevertheless, it also highlights a potential compatibility issue where reliance on the original OP_SUCCESS203 behavior could lead to invalidated spends following the deployment of OP_INTERNALKEY.

This proposal is still in the drafting stage with its deployment details yet to be determined, indicating ongoing discussions and considerations within the Bitcoin development community. The BIP document, including this proposal, is licensed under the 3-clause BSD license, ensuring that the information and code related to this proposal remain open and accessible for further review and contribution by interested parties.