From 75351f2587ebdf220a92ac9c89119343f4cf8584 Mon Sep 17 00:00:00 2001 From: Brandon Black Date: Wed, 24 Apr 2024 14:34:29 -0700 Subject: [PATCH] Add bip-internalkey --- README.mediawiki | 7 +++++ bip-internalkey.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 bip-internalkey.md diff --git a/README.mediawiki b/README.mediawiki index ebe1c14c..476a963b 100644 --- a/README.mediawiki +++ b/README.mediawiki @@ -1121,6 +1121,13 @@ Those proposing changes should consider that ultimately consent may rest with th | Standard | Draft |- style="background-color: #cfffcf" +| [[bip-internalkey.md|internalkey]] +| Consensus (soft fork) +| OP_INTERNALKEY +| Brandon Black, Jeremy Rubin +| Standard +| Draft +|- style="background-color: #cfffcf" | [[bip-0350.mediawiki|350]] | Applications | Bech32m format for v1+ witness addresses diff --git a/bip-internalkey.md b/bip-internalkey.md new file mode 100644 index 00000000..38cb59ec --- /dev/null +++ b/bip-internalkey.md @@ -0,0 +1,70 @@ +``` +BIP: XXX +Layer: Consensus (soft fork) +Title: OP_INTERNALKEY +Author: Brandon Black , Jeremy Rubin +Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-XXXX +Status: Draft +Type: Standards Track +Created: 2023-12-22 +License: BSD-3-Clause +``` + +## Abstract + +This BIP describes a new tapscript opcode (`OP_INTERNALKEY`) which +pushes the taproot internal key to the stack. + +## Specification + +When verifying taproot script spends having leaf version `0xc0` (as defined in +[BIP 342]), `OP_INTERNALKEY` replaces `OP_SUCCESS203` (0xcb). `OP_INTERNALKEY` +pushes the taproot internal key, as defined in [BIP 341], to the stack. + +## Motivation + +### Key spend with additional conditions + +When building taproot outputs, especially those secured by an aggregate key +representing more than one signer, the parties may wish to collaborate on +signing with the taproot internal key, but only with additional script +restrictions. In this case, `OP_INTERNALKEY` saves 8 vBytes. + +### 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 8 vBytes. + +Note: The internal key must be the X coordinate of a point on the SECP256K1 +curve, so any such hash must be checked and modified until it is such an X +coordinate. This will typically take approximately 2 attempts. + +## Reference Implementation + +A reference implementation is provided here: + +https://github.com/bitcoin/bitcoin/pull/29269 + +## 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 `OP_SUCCESS203`, `OP_INTERNALKEY` would +invalidate their spend. + +## Deployment + +TBD + +## Credits + +TODO + +## Copyright + +This document is licensed under the 3-clause BSD license. + +[BIP 341]: https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki + +[BIP 342]: https://github.com/bitcoin/bips/blob/master/bip-0342.mediawiki