From c4b7f50cd4565bb7e093b8ba4dfd0f3a96cbd71b Mon Sep 17 00:00:00 2001 From: nymius <155548262+nymius@users.noreply.github.com> Date: Mon, 19 Jan 2026 19:00:00 -0300 Subject: [PATCH] BIP376: Spending Silent Payment outputs with PSBTs --- README.mediawiki | 7 ++ bip-0376.mediawiki | 159 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 166 insertions(+) create mode 100644 bip-0376.mediawiki diff --git a/README.mediawiki b/README.mediawiki index 55580ee0aa..65994426f0 100644 --- a/README.mediawiki +++ b/README.mediawiki @@ -1297,6 +1297,13 @@ users (see also: [https://en.bitcoin.it/wiki/Economic_majority economic majority | Specification | Draft |- +| [[bip-0376.mediawiki|376]] +| Applications +| Spending Silent Payment outputs with PSBTs +| nymius +| Specification +| Draft +|- | [[bip-0379.md|379]] | Applications | Miniscript diff --git a/bip-0376.mediawiki b/bip-0376.mediawiki new file mode 100644 index 0000000000..c505a3d7c3 --- /dev/null +++ b/bip-0376.mediawiki @@ -0,0 +1,159 @@ +
+  BIP: 376
+  Layer: Applications
+  Title: Spending Silent Payment outputs with PSBTs
+  Authors: nymius 
+  Status: Draft
+  Type: Specification
+  Assigned: 2026-02-05
+  License: BSD-2-Clause
+  Discussion: 2024-05-17: https://delvingbitcoin.org/t/bip352-psbt-support/877/30 [delving bitcoin post] Original discussion
+              2025-12-05: https://gist.github.com/nymius/b3dd0b8a08c6735d617e6216b73c4260 [gist] First draft
+              2025-12-15: https://gnusha.org/pi/bitcoindev/R53cG3TeXgXDUUS4kH_q226GlaFCjI0DZVT6mdTQzSQdj3RnNqWA-bFT7uGgGQFJG6938kDGvDJVoFQj8ItEMsJ6NyOjCTvpVEarYiyW6-8=@proton.me/ [bitcoin-dev] [BIP Proposal] Add PSBT_IN_SP_TWEAK field
+  Version: 0.1.0
+  Requires: 352, 370, 371
+
+ +== Introduction == + +=== Abstract === + +This document proposes additional per input fields for BIP 370 PSBTv2 that allows BIP 352 Silent Payment tweaks to be included in a PSBT of version 2. These fields will be relevant to Silent Payment outputs spending. + +=== Motivation === + +BIP 352 specifies the Silent Payment protocol, which provides a new way to create P2TR outputs and spend them. + +The existing PSBT fields are unable to support Silent Payment without changes, due to the new method by which outputs are created. + +BIP 375 and complementary BIP 374 specify how to create outputs locked with Silent Payment keys using PSBTs. But they don't specify how to unlock these outputs in a transaction.''' Why not including this new field in BIP 375?''' Historically, Silent Payment has been categorized by the perspective of the user of the protocol: receiver or sender. BIP 375 has followed this convention, and its stated on its title: Sending Silent Payments with PSBTs. Given that spending belongs to the sphere of the receiver, and considering this convention, this specification should be a different BIP. + +Therefore new fields must be defined to allow PSBTs to carry the information necessary for tweaking taproot keys without following the BIP 341 tagging scheme. + +== Specification == + +We use the following functions and conventions: + +* ser32(i): serializes a 32-bit unsigned integer ''i'' as a 4-byte sequence, most significant byte first. +* ser256(p): serializes the integer p as a 32-byte sequence, most significant byte first. +* serP(P): serializes the coordinate pair P = (x,y) as a byte sequence using SEC1's compressed form: (0x02 or 0x03) || ser256(x), where the header byte depends on the parity of the omitted Y coordinate. +* ''hashtag(x)'': refers to ''SHA256(SHA256(tag) || SHA256(tag) || x)''. + +=== Fields === + +This document specifies new fields and new field inclusion/exclusion requirements. + +The new per-input types are defined as follows: + +{| class="wikitable" +! Name +! +! +! Description +! +! Description +! Versions Requiring Inclusion +! Versions Requiring Exclusion +! Versions Allowing Inclusion +|- +| Silent Payment Spend Key BIP 32 Derivation Path''' Why only considering BIP 32 for spend key generation?''' Although alternative key derivation methods exist (e.g., FROST) and have devised mechanisms to interact with PSBTs without modifying the format, the vast majority of hardware wallets are architected around BIP 32 derivation scheme. As primary consumers of the PSBT format, these devices have significantly influenced its design. Consequently, this BIP avoids preemptively enforcing a shift away from the established BIP 32 paradigm. +| PSBT_IN_SP_SPEND_BIP32_DERIVATION = 0x1f +| <33-byte spend key> +| The 33-byte spend public key used to derive the key locking this input. +| <4-byte fingerprint> <32-bit little endian uint path element>* +| The master key fingerprint as defined by BIP 32 concatenated with the derivation path of the spend public key. The derivation path is represented as indexed 32-bit unsigned integers concatenated with each other. Finalizers should remove this field after PSBT_IN_FINAL_SCRIPTWITNESS is constructed. +| +| 0 +| 2 +|- +| Silent Payment Tweak +| PSBT_IN_SP_TWEAK = 0x20 +| None +| No key data +| <32-byte tweak> +| A 32 byte raw tweak. Finalizers should remove this field after PSBT_IN_FINAL_SCRIPTWITNESS is constructed. +| +| 0 +| 2 +|} + +Per [https://github.com/bitcoin/bips/blob/master/bip-0352.mediawiki#spending BIP 352 spending] the <32-byte tweak> is ''hashBIP0352/SharedSecret(serP(ecdh_shared_secret) || ser32(k))'' + +or ''hashBIP0352/SharedSecret(serP(ecdh_shared_secret) || ser32(k)) + hashBIP0352/Label(ser256(bscan) || ser32(m))'', + +where ''hashBIP0352/Label(ser256(bscan) || ser32(m))'' is the optional label derived by some integer ''m''. + +=== Roles === + +This document modifies some existing roles. + +==== Updater ==== + +The Updater must add PSBT_IN_SP_TWEAK when an input spends a Silent Payment output. + +The Updater must add PSBT_IN_SP_SPEND_BIP32_DERIVATION when spending a Silent Payment output using BIP 32 derivation scheme. If the Updater does not want to reveal the fingerprint or derivation path, it can set the value to a 4-byte zero fingerprint with no derivation paths. + +==== Signer ==== + +For each input that has a PSBT_IN_SP_TWEAK field set, the Signer must determine the spend private key ''bspend'' using the derivation path provided in PSBT_IN_SP_SPEND_BIP32_DERIVATION. If this field is not present, or the Signer does not have the key matching the indicated fingerprint and path, the Signer must skip this input. + +The Signer must compute the signing private key ''d = (bspend + tweak) mod n'', where ''tweak'' is the value of PSBT_IN_SP_TWEAK. Let ''P'' be the output key from the PSBT_IN_WITNESS_UTXO output script. If the y coordinate of ''d·G'' is odd (i.e. does not match the x-only output key ''P''), the Signer must negate ''d''. + +The Signer must verify that the x coordinate of ''d·G'' equals ''P''. If they are not equal, the Signer must fail, as the tweak does not correspond to the spent output.''' Why must the Signer verify the tweak?''' The tweak is provided by the Updater and could be incorrect, either through error or malice. Without verification, the Signer would produce a valid Schnorr signature for a key it does not control, which could be used to steal funds. Verifying that the tweaked key matches the output key ensures the Signer is signing for the expected output. + +The Signer must produce a BIP 340 Schnorr signature using the private key ''d'' and set the result in the PSBT_IN_TAP_KEY_SIG field as defined in BIP 371. + +==== Finalizer ==== + +For each input that has a PSBT_IN_SP_TWEAK field set, the Finalizer must verify that a PSBT_IN_TAP_KEY_SIG field is present. If not, the input is not fully signed and cannot be finalized. + +The Finalizer must construct the PSBT_IN_FINAL_SCRIPTWITNESS containing the single witness element from PSBT_IN_TAP_KEY_SIG, as per the BIP 341 key path spending rule. The Finalizer must then remove the PSBT_IN_SP_TWEAK, PSBT_IN_SP_SPEND_BIP32_DERIVATION, PSBT_IN_TAP_KEY_SIG, and PSBT_IN_WITNESS_UTXO fields. + +== Rationale == + +On PSBTs, when spending non Silent Payment outputs, one can rely on the PSBT_IN_BIP32_DERIVATION or any of the allowed PSBT_IN_TAP_* combinations available to get the right private keys to sign for each input. + +To spend Silent Payment outputs you have to combine the private key with the tweak obtained from the transaction corpus. + +Passing the prevouts together with the PSBT to allow the computation of the tweaks, forces more computation on the Signer side. + +Once a Silent Payment UTXO is scanned, is easier to store the output together with the tweak that generated it. + +To avoid the burden on the Signer it would be better to pass this data into the PSBT together with the input spending the Silent Payment output. Currently, there is no field prescribed for this. + +The use of proprietary fields is possible but brittle, as one may end up having to perform extra lookups for keys that are not unified across implementations. + +For the Silent Payment spending tweak, the PSBT_IN_BIP32_DERIVATION field cannot be used because of its different nature, neither can the PSBT_IN_TAP_MERKLE_ROOT field because of the tagged hash used for tweaking. + +Assuming different tweaking schemes available, PSBT_IN_TAP_RAW_TWEAK would be a more general solution, but PSBT fields are usually specified as to the nature of the contents, and is unclear how a hardware wallet will determine what the content of the field were in the first more general case. + +The inclusion of the tweak in the PSBT is insufficient in isolation; it must be accompanied by the information required to derive the correct private key. Silent Payment spend public key cannot utilize PSBT_IN_TAP_BIP32_DERIVATION because BIP 352 specifies 33-byte spend keys