bitcoin-dev

BIP for OP_INTERNALKEY

BIP for OP_INTERNALKEY

Original Postby Garlo Nicon

Posted on: April 26, 2024 08:09 UTC

In the exploration of the choice behind the opcode 0xcb as OP_INTERNALKEY, there's a significant discussion around the potential reuse of existing opcodes for new functionalities within the realm of Bitcoin scripting, specifically in the context of Taproot scripts.

The correspondence delves into the historical assignment of opcodes like OP_PUBKEY (assigned to 0xfe) and OP_PUBKEYHASH (assigned to 0xfd), which, although invalid in non-Taproot scripts, were originally intended for constructions such as "OP_PUBKEY OP_CHECKSIG" and "OP_DUP OP_HASH160 OP_PUBKEYHASH OP_EQUALVERIFY OP_CHECKSIG". These opcodes, if reused, could possibly streamline script commands by enabling operations like picking the next key from the stack, essentially serving as the internal key in certain cases.

The dialogue further speculates on the future expansion of script capabilities, suggesting an innovative approach where opcodes like OP_PUBKEY could facilitate more complex script constructs. An example provided illustrates a scenario involving multiple OP_PUBKEY operations linked with checksig commands, envisioning a separate stack of public keys that would work analogously to the OP_FROMALTSTACK operation but would exclusively handle public keys. This concept underscores the potential for scripts to evolve, allowing for more intricate verification processes, especially considering the first key of such a stack being the internal Taproot key. This speculative advancement points toward a broader vision for enhancing script flexibility and functionality, reflecting a proactive stance on future-proofing Bitcoin's scripting language.