Skip to content

Latest commit

 

History

History
457 lines (312 loc) · 42.3 KB

bip-0352.mediawiki

File metadata and controls

457 lines (312 loc) · 42.3 KB

  BIP: 352
  Layer: Applications
  Title: Silent Payments
  Author: josibake <josibake@protonmail.com>
          Ruben Somsen <rsomsen@gmail.com>
  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0352
  Status: Draft
  Type: Informational
  Created: 2023-03-09
  License: BSD-2-Clause

Table of Contents

Introduction

Abstract

This document specifies a protocol for static payment addresses in Bitcoin without on-chain linkability of payments or a need for on-chain notifications.

Copyright

This BIP is licensed under the BSD 2-clause license.

Motivation

Using a new address for each Bitcoin transaction is a crucial aspect of maintaining privacy. This often requires a secure interaction between sender and receiver so that the receiver can hand out a fresh address, a batch of fresh addresses, or a method for the sender to generate addresses on-demand, such as an xpub.

However, interaction is often infeasible and in many cases undesirable. To solve for this, various protocols have been proposed which use a static payment address and notifications sent via the blockchain [1]. These protocols eliminate the need for interaction, but at the expense of increased costs for one-time payments and a noticeable footprint in the blockchain, potentially revealing metadata about the sender and receiver. Notification schemes also allow the receiver to link all payments from the same sender, compromising sender privacy.

This proposal aims to address the limitations of these current approaches by presenting a solution that eliminates the need for interaction, eliminates the need for notifications, and protects both sender and receiver privacy. These benefits come at the cost of requiring wallets to scan the blockchain in order to detect payments. This added requirement is generally feasible for full nodes but poses a challenge for light clients. While it is possible today to implement a privacy-preserving light client at the cost of increased bandwidth, light client support is considered an area of open research (see Appendix A: Light Client Support).

Goals

We aim to present a protocol which satisifies the following properties:

  • No increase in the size or cost of transactions
  • Resulting transactions blend in with other bitcoin transactions and can't be distinguished
  • Transactions can't be linked to a silent payment address by an outside observer
  • No sender-receiver interaction required
  • No linking of multiple payments to the same sender
  • Each silent payment goes to a unique address, avoiding accidental address reuse
  • Supports payment labeling
  • Uses existing seed phrase or descriptor methods for backup and recovery
  • Separates scanning and spending responsibilities
  • Compatible with other spending protocols, such as CoinJoin
  • Light client/SPV wallet support
  • Protocol is upgradeable

Overview

We first present an informal overview of the protocol. In what follows, uppercase letters represent public keys, lowercase letters represent private keys, || refers to byte concatenation, and G represents the generator point for secp256k1. Each section of the overview is incomplete on its own and is meant to build on the previous section in order to introduce and briefly explain each aspect of the protocol. For the full protocol specification, see Specification.

Simple case

Bob publishes a public key B as a silent payment address. Alice discovers Bob's silent payment address, selects a UTXO with private key a, public key A and creates a destination output P for Bob in the following manner:

  • Let P = B + hash(a·B)·G
  • Encode P as a BIP341 taproot output
Since a·B == b·A (Elliptic Curve Diffie-Hellman), Bob scans with his private key b by collecting the input public keys for each transaction with at least one unspent taproot output and performing the ECDH calculation until P is found (e.g. calculating P = B + hash(b·A)·G and seeing that P is present in the transaction outputs).

Creating more than one output

In order to allow Alice to create more than one output for Bob[2], we included an integer in the following manner:

  • Let n = 0
  • Let P0 = B + hash(a·B || n)·G
  • For additional outputs:
    • Increment n by one (n++)
    • Let Pi = B + hash(a·B || n)·G
Bob detects this output the same as before by searching for P0 = B + hash(b·A || 0)·G. Once he detects the first output, he must:

  • Check for P1 = B + hash(b·A || 1)·G
  • If P1 is not found, stop
  • If P1 is found, continue to check for P2 and so on until an additional output is not found
Since Bob will only perform these subsequent checks after a transaction with at least one output paying him is found, the increase to his overall scanning requirement is negligible.

Preventing address reuse

If Alice were to use a different UTXO from the same public key A for a subsequent payment to Bob, she would end up deriving the same destination P. To prevent this, Alice should include a hash of the outpoint in the following manner:

  • Let outpoint_hash = hash(txid || vout)
  • Let P0 = B + hash(outpoint_hash·a·B || 0)·G
Bob must include the same outpoint_hash when scanning.

Using all inputs

In our simplified example we have been referring to Alice's transactions as having only one input A, but in reality a Bitcoin transaction can have many inputs. Instead of requiring Alice to pick a particular input and requiring Bob to check each input separately, we can instead require Alice to perform the tweak with the sum of the input public keys[3]. This significantly reduces Bob's scanning requirement, makes light client support more feasible[4], and protects Alice's privacy in collaborative transaction protocols such as CoinJoin[5].

Alice performs the tweak with the sum of her input private keys in the following manner:

  • Let outpoints_hash = hash(txid0 || vout0 || … txidn || voutn)
  • Let a = a0 + a1 … + an
  • Let P0 = B + hash(outpoints_hash·a·B || 0)·G
Spend and Scan Key

Since Bob needs his private key b to check for incoming payments, this requires b to be exposed to an online device. To minimize the risks involved, Bob can instead publish an address of the form (Bscan, Bspend). This allows Bob to keep bspend in offline cold storage and perform the scanning with the public key Bspend and private key bscan. Alice performs the tweak using both of Bob's public keys in the following manner:

  • Let P0 = Bspend + hash(outpoints_hash·a·Bscan || 0)·G
Bob detects this payment by calculating P0 = Bspend + hash(outpoints_hash·bscan·A)·G with his online device and can spend from his cold storage signing device using (bspend + hash(outpoints_hash·bscan·A)) mod p as the private key.

Labels

For a single silent payment address of the form (Bscan, Bspend), Bob may wish to differentiate incoming payments. Naively, Bob could publish multiple silent payment addresses, but this would require him to scan for each one, which becomes prohibitively expensive. Instead, Bob can label his spend public key Bspend with an integer m in the following way:

  • Let Bm = Bspend + m·G
  • Publish (Bscan, B0), (Bscan, B1) …
Alice performs the tweak as before using one of the published (Bscan, Bm) pairs. Bob detects the labeled payment in the following manner:

  • Let P0 = Bspend + hash(outpoints_hash·bscan·A || 0)·G
  • Subtract P0 from each of the transaction outputs and check if the remainder matches any of the labels (1·G, 2·G ..) that the wallet has previously used
It is important to note that an outside observer can easily deduce that each published (Bscan, Bm) pair is owned by the same entity as each published address will have Bscan in common. As such, labels are not meant as a way for Bob to manage separate identities, but rather a way for Bob to determine the source of an incoming payment.

Labels for change

Bob can also use labels for managing his own change outputs. To do so, he can reserve a secret change label in the following manner:

  • Let Bchange = Bspend + hash(bscan)·G
Now, whenever Bob is spending (to a silent payment address or otherwise), he can create a change output for himself using the silent payments protocol and his change label in the following manner:

  • Let a = a0 + a1 … + an represent the private keys of the inputs Bob is using to fund the transaction
  • Let Pchange = Bchange + hash(outpoints_hash·a·Bscan || 0)·G
This gives Bob an alternative to using BIP32 for managing change, while still allowing him to know which of his unspent outputs were change when recovering his wallet from the master key. The change label needs to remain a secret in order to ensure nobody else can label payments as change.

Specification

We use the following functions and conventions:

  • outpoint (36 bytes): the COutPoint of an input (32-byte txid, least significant byte first || 4-byte vout, least significant byte first)[6]
  • 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.
For everything not defined above, we use the notation from BIP340.

Versions

This document defines Silent Payments v0. Version is communicated through the address in the same way as native Segwit addresses. Future upgrades to silent payments will require a new version. As much as possible, future upgrades should support receiving from older wallets (e.g. a silent payments v0 wallet can send to both v0 and v1 addresses). Any changes that break compatibility with older silent payment versions should be a new BIP.

Future Silent Payments versions will use the following versioning scheme:

0 1 2 3 4 5 6 7 Compatibility
+0 q p z r y 9 x 8 backwards compatible
+8 g f 2 t v d w 0
+16 s 3 j n 5 4 k h
+24 c e 6 m u a 7 -

v31 (l) is reserved for a backwards incompatible change, if needed. For Silent Payments v0:

  • If the receiver's silent payment address version is:
    • v0: check that the data part is exactly 66-bytes. Otherwise, fail
    • v1 through v30: read the first 66-bytes of the data part and discard the remaining bytes (if any)
    • v31: fail
  • Receiver addresses are always BIP341 taproot outputs[7]
  • The sender should sign with one of the sighash flags ALL, SINGLE, NONE (ANYONECANPAY is unsafe). It is strongly recommended implementations only use SIGHASH_ALL for silent payments[8]
  • Inputs used to derive the shared secret are from the Inputs For Shared Secret Derivation list

Scanning transactions

A transaction is a Silent Payments v0 transaction and MUST be scanned if and only if all of the following are true:

  • The transaction contains at least one BIP341 taproot output
  • The transaction has at least one input from the Inputs For Shared Secret Derivation list
  • The transaction does not contain a new, undefined output type (e.g. SegWit versions > 1)[9]
  • The transaction nVersion is < 4
Otherwise, skip the transaction. This is to ensure forward compatibility with future versions of silent payments without requiring future versions to scan a transaction multiple times with different rule sets.

Address encoding

A silent payment address is constructed in the following manner:

  • Let Bscan, bscan = Receiver's scan public key and corresponding private key
  • Let Bspend, bspend = Receiver's spend public key and corresponding private key
  • Let Bm = Bspend + m·G, where m an optional integer tweak for labeling
    • In the case of m = 0, no label is applied and Bm = Bspend
  • The final address is a Bech32m encoding of:
    • The human-readable part "sp" for mainnet, "tsp" for testnets (e.g. signet, testnet)
    • The data-part values:
      • The character "q", to represent a silent payment address of version 0
      • The 66 byte concatenation of the receiver's public keys, serP(Bscan) || serP(Bm)
Note: BIP173 imposes a 90 character limit for Bech32 strings, whereas a silent payment address requires 117 characters.

Outpoints hash

The sender and receiver MUST calculate an outpoints hash for the transaction in the following manner:

  • Collect each outpoint used as an input to the transaction
  • Let outpoints = outpoint0 || … || outpointn, sorted by txid and vout, ascending order[10]
  • Let outpoints_hash = sha256(outpoints)

Inputs For Shared Secret Derivation

While any UTXO with known output scripts can be used to fund the transaction, the sender and receiver MUST use inputs from the following list when deriving the shared secret:

  • P2TR
  • P2WPKH
  • P2SH-P2WPKH
  • P2PKH
Inputs with conditional branches or multiple public keys (e.g. CHECKMULTISIG) are not included as this introduces malleability and would allow a sender to re-sign with a different set of public keys after the silent payment output has been derived. This is not a concern when the sender controls all of the inputs, but is an issue for CoinJoins and other collaborative protocols, where a malicious participant can participate in deriving the silent payment address with one set of keys and then re-broadcast the transaction with signatures for a different set of public keys. P2TR can have hidden conditional branches (script path), but we work around this as described below.

P2TR

The sender MUST use the private key corresponding to the taproot output key (i.e. the tweaked private key for a key path spend). This can be a single private key or an aggregate key (e.g. taproot outputs using MuSig2 or FROST)[11]. If this key is not available, the output cannot be included as an input to the transaction. The receiver always uses the taproot output key when scanning, regardless of whether the taproot output is using a key path spend or a script path spend[12].

The one exception is script path spends that use NUMS point H as their internal key (where H = lift_x(0x50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0) which is constructed by taking the hash of the standard uncompressed encoding of the secp256k1 base point G as X coordinate, see BIP341: Constructing and spending Taproot outputs for more details), in which case the output will be skipped for the purposes of shared secret derivation[13].

P2WPKH

The sender performs the tweak using the private key for the output and the receiver obtains the public key from the witness.

P2SH-P2WPKH

The sender performs the tweak using the private key for the nested P2WPKH output and the receiver obtains the public key from the witness.

P2PKH

The sender performs the tweak using the private key for the output and SHOULD sign using the standard script template:

    scriptSig: <Signature> <Public Key>

The receiver obtains the public key from the scriptSig. The receiver MUST parse the scriptSig for the public key, even if the scriptSig is non-standard (e.g. <dummy> OP_DROP <Signature> <Public Key>). This is to address the third-party malleability of P2PKH scriptSigs.

Sender

Selecting inputs

The sending wallet performs coin selection as usual with the following restrictions:

  • At least one input MUST be from the Inputs For Shared Secret Derivation list
  • Exclude inputs with witness version > 1 (see Scanning transactions)
  • For each taproot output spent the sending wallet MUST have access to the private key corresponding to the taproot output key, unless H is used as the internal public key

Creating outputs

After the inputs have been selected, the sender can create one or more outputs for one or more silent payment addresses in the following manner:

  • Collect the private keys for each input from the Inputs For Shared Secret Derivation list
  • For each private key ai corresponding to a BIP341 taproot output, check that the private key produces a point with an even y-value and negate the private key if not[14]
  • Let a = a0 + a1 + … an, where each ai has been negated if necessary
  • Generate the outpoints_hash, using the method described above
  • Group receiver silent payment addresses by Bscan (e.g. each group consists of one Bscan and one or more Bm)
  • For each group:
    • Let ecdh_shared_secret = outpoints_hash·a·Bscan
    • Let n = 0
    • For each Bm in the group:
      • Let tn = sha256(serP(ecdh_shared_secret) || ser32(n))
      • Let Pmn = Bm + tn·G
      • Encode Pmn as a BIP341 taproot output
      • Optionally, repeat with n++ to create additional outputs for the current Bm
      • If no additional outputs are required, continue to the next Bm with n++[15]
    • Optionally, if the sending wallet implements receiving silent payments, it can create change outputs in the following manner:
      • Let Achange = Aspend + sha256(ser256(ascan))·G
      • Let change_shared_secret = outpoints_hash·a·Ascan
      • Let n = 0
      • For each change output desired:
        • Let cn = sha256(serP(change_shared_secret) || ser32(n))
        • Let Cn = Achange + cn·G
        • Encode Cn as a BIP341 taproot output
        • Repeat with n++ for additional change outputs

Receiver

Key Derivation

Two keys are needed to create a silent payments address: the spend key and the scan key. While these keys can be generated independently, wallet software SHOULD use BIP32 derivation[16] to ensure compatibility across wallets.

A scan and spend key pair using BIP32 derivation are defined (taking inspiration from BIP44) in the following manner:

    Spend private key: m / purpose' / coin_type' / account' / 0' / 0
     Scan private key: m / purpose' / coin_type' / account' / 1' / 0

Wallet software MUST use hardened derivation to ensure the master key is not exposed in the event the scan private key is compromised. Purpose is a constant set to 352 following the BIP43 recommendation. Refer to BIP43 and BIP44 for more details.

Scanning

If each of the checks in Scanning transactions passes, the receiving wallet must:

  • Generate the outpoints_hash, using the method described above
  • Let A = A0 + A1 + … An, where each Ai is the public key of an input from the Inputs For Shared Secret Derivation list
  • Let ecdh_shared_secret = outpoints_hash·bscan·A
  • Check for outputs:
    • Let outputs_to_check = the taproot output key from each unspent taproot output in the transaction
    • Starting with n = 0:
      • Let tn = sha256(serP(ecdh_shared_secret) || ser32(n))
      • Compute Pn = Bspend + tn·G
      • For each output in outputs_to_check:
        • If Pn equals output:
          • Add Pn to the wallet
          • Remove output from outputs_to_check and rescan outputs_to_check with n++
        • Else, if the wallet has precomputed labels (including the change label, if used)[17]:
          • Compute m·G = output - Pn
          • Check if m·G exists in the list of labels used by the wallet
          • If a match is found:
            • Add the Pn + m·G to the wallet
            • Remove output from outputs_to_check and rescan outputs_to_check with n++
          • If the label is not found, negate output and check again
      • If no matches are found, stop

Backup and Recovery

Since each silent payment output address is derived independently, regular backups are recommended. When recovering from a backup, the wallet will need to scan since the last backup to detect new payments.

If using a seed phrase only style backup, the user can recover the wallet's unspent outputs from the UTXO set (by only scanning transactions with at least one unspent taproot output) and can recover the full wallet history by scanning the blockchain, starting from the wallet birthday. If a wallet uses labels, this information SHOULD be included in the backup. If the user does not know whether or not labels were used, they can precompute a large number of labels based on a safe upper bound (e.g. 100k labels) to use when re-scanning.

Backward Compatibility

Silent payments introduces a new address format and protocol for sending and as such is not compatible with older wallet software or wallets which have not implemented the silent payments protocol.

Test Vectors

A collection of test vectors in JSON format are provided, along with a python reference implementation. Each test vector consists of a sending test case and corresponding receiving test case. This is to allow sending and receiving to be implemented separately. Test cases use the following schema:

test_case

    {
        "comment": "Comment describing the behavior being tested",
        "sending": [<array of sender test objects>],
        "receiving": [<array of recipient test objects>],
    }

sender

    {
        "given": {
            "outpoints": [<array of tuples, where each tuple represents an outpoint: (txid, vout)>],
            "input_priv_keys": [<array of tuples, where each tuple is a hex encoded private key and boolean for taproot: (priv_key, is_taproot)>],
            "recipients": [<array of tuples, where each tuple is a bech32m string representing a silent payment address and an float amount: (silent_payment_address, amount)>]
        },
        "expected": {
            "outputs": [<array of key, value objects, where the key is the hex encoding of 32-byte x-only public key and the value an integer amount: {taproot_x_only_key: amount}]
        },
    }

recipient

    {
        "given": {
            "outpoints": [<array of tuples, where each tuple represents an outpoint: (txid, vout)>],
            "input_pub_keys": [<array of hex encoded public keys, either 33-byte compressed or 32-byte x-only>],
            "bip32_seed": "byte data for generating a bip32 master seed",
            "labels": {<dictionary object, where the key is the hex encoding (33-byte compressed) of m*G and the value is the integer m>},
         },
         "expected": {
             "addresses": [<array of bech32m strings, one for the silent payment address and each labeled address (if used)>],
             "outputs": [
                 {
                     "pub_key": <hex encoded x-only public key>,
                     "priv_key_teak": <hex encoded private key tweak data>.
                     "signature": <hex encoded signature for the output (produced with spend_priv_key + priv_key_tweak)>
                 },
                 ...
             ]
         }
     }

Wallets should include inputs not in the Inputs For Shared Secret Derivation list when testing to ensure that only inputs from the list are being used for shared secret derivation. Additionally, receiving wallets should include non-silent payment outputs for themselves in testing to ensure silent payments scanning does not interfere with regular outputs detection.

Functional tests

Below is a list of functional tests which should be included in sending and receiving implementations.

Sending

  • Ensure taproot outputs are excluded during coin selection if the sender does not have access to the key path private key (unless using H as the taproot internal key)
  • Ensure the silent payment address is re-derived if inputs are added or removed during RBF

Receiving

  • Ensure the public key can be extracted from non-standard P2PKH scriptSigs
  • Ensure taproot script path spends are included, using the taproot output key (unless H is used as the taproot internal key)
  • Ensure the scanner can extract the public key from each of the input types supported (e.g. P2WPKH, P2SH-P2WPKH, etc)

Appendix A: Light Client Support

This section proposes a few ideas for how light clients could be supported in ways that preserve bandwidth and privacy. While this is out of scope for the current BIP, it is included to movitate further research into this topic. In this context, a light client refers to any bitcoin wallet client which does not process blocks and does not have a direct connection to a node which does process blocks (e.g. a full node). Based on this definition, clients that directly connect to a personal electrum server or a bitcoin node are not light clients.

This distinction makes the problem for light clients more clear: light clients need a way to source the necessary data for performing the tweaks and a way of determining if any of the generated outputs exist in a block.

Tweak Data

Recall that a silent payment eligible transaction is any transaction with at least one input from the Inputs for Shared Secret Derivation list and at least one unspent taproot output. Full nodes (or any index server backed by a full node, such as electrum server) can build an index which collects all of the eligible public keys for a silent payments eligible transaction, sums them up, multiplies the sum by the outpoints_hash, and serves them to clients. This would be 32 bytes per silent payment eligible transaction.

For a typical bitcoin block of ~3500 txs, lets assume every transaction is a silent payments eligible transaction. This means a client would need to request 32 bytes * 3500 of data per block (roughly 100 kb per block). If a client were to request data for every block, this would amount to ~450MB per month, assuming 100% taproot usage and all outputs remain unspent for > 1 month. As of today, these numbers are closer to 2kb - 10kb per block (10MB - 40MB per month)[18].

Transaction cut-through

It is unlikely a light client would need to scan every block and as such can take advantage of transaction cut-through, depending on how often they choose to scan for new blocks. Empirically, ~75% of transactions with at least one unspent taproot output will have spent all taproot UTXOs in 326 blocks or less[18]. This means a client which only scans once every 3 days could significantly cut down on the number of blocks and the number of transactions per block that they need to request by only asking for data on transactions that were created since their last scan and that still have at least one unspent taproot output as of the current block height. Assuming 100% taproot usage, a client that scans once a month would likely only need around 50MB worth of data. Based on current taproot adoption, a light client scanning once every 3 days would use roughly 15MB per month and a client scanning once per month would use less than 5MB per month.

File:bip-0352/scan_data_downloader_per_month.png

BIP158

Once a light client has the tweak data for a block, they can determine whether or not an output to them exists in the block using BIP158 block filters. Per BIP158, they would then request the entire block and add the transaction to their wallet, though it maybe be possible to only request the prevout txids and vouts for all transactions with at least one taproot output, along with the scriptPubKeys and amounts. This would allow the client to download the necessary data for constructing a spending transaction, without downloading the entire block. How this affects the security assumptions of BIP158 is an open question.

Out-of-band notifications

Assuming a secure messaging protocol exists, the sender can send an encrypted (using the scan public key of the silent payment address) notification to the receiver with the following information:

  • The spend public key (communicates the label)
  • The shared secret portion of the private key (i.e hash(ecdh_shared_secret || n))
  • The outpoint and amount (so it's immediately spendable)
It is important to note that these notifications are not required. At any point, the receiver can fall back to scanning for silent payment transactions if they don't trust the notifications they are receiving, are being spammed with fake notifications, or if they are concerned that they are not receiving notifications.

A malicious notification could potentially cause the following issues:

  • You did not actually receive money to the stated key
    • This can be probabilistically resolved by matching the key against the BIP158 block filters and assuming it's not a false positive, or fully resolved by downloading the block
  • You received money but the outpoint or amount is incorrect, so attempts to spend it will fail or cause you to overpay fees
    • There doesn't seem to be much motivation for malicious senders to ever do this, but light clients need to take into account that this can occur and should ideally check for it by downloading the block
  • The private key is correct but it wasn't actually derived using the silent payment protocol, causing recovery from back-up to fail (unsafe - no implementation should ever allow this)
    • This can be detected by downloading the tweak data of the corresponding block and should be resolved by immediately spending the output
Wallet designers can choose which tradeoffs they find appropriate. For example, a wallet could check the block filter to at least probabilistically confirm the likely existence of the UTXO, thus efficiently cutting down on spam. The payment could then be marked as unconfirmed until a scan is performed and the existence of the UTXO in accordance to the silent payment specification is verified.

Acknowledgements

This document is the result of many discussions and contains contributions by a number of people. The authors wish to thank all those who provided valuable feedback and reviews, including the participants of the BIP47 Prague discussion, the Advancing Bitcoin Silent Payments Workshop, and coredev. The authors would like to also thank w0xlt for writing the initial implementation of silent payments.

Rationale and References

  1. ^ Why not use out-of-band notifications Out of band notifications (e.g. using something other than the Bitcoin blockchain) have been proposed as a way of addressing the privacy and cost concerns of using the Bitcoin blockchain as a messaging layer. This, however, simply moves the privacy and cost concerns somewhere else and increases the risk of losing money due to a notification not being reliably delivered, or even censored, and makes this notification data critical for backup to recover funds.
  2. ^ Why allow for more than one output? Allowing Alice to break her payment to Bob into multiple amounts opens up a number of privacy improving techniques for Alice, making the transaction look like a CoinJoin or better hiding the change amount by splitting both the payment and change outputs into multiple amounts. It also allows for Alice and Carol to both have their own unique output paying Bob in the event they are in a collaborative transaction and both paying Bob's silent payment address.
  3. ^ What about inputs without public keys? Inputs without public keys can still be spent in the transaction but are simply ignored in the Silent Payments protocol.
  4. ^ How does using all inputs help light clients? If Alice uses a random input for the tweak, Bob necessarily has to have access to and check all transaction inputs, which requires performing an ECC multiplication per input. If instead Alice performs the tweak with the sum of the input public keys, Bob only needs the summed 33 byte public key per transaction and only does one ECC multiplication per transaction. Bob can then use BIP158 block filters to determine if any of the outputs exist in a block and thus avoids downloading transactions which don't belong to him. It is still an open question as to how Bob can source the 32 bytes per transaction in a trustless manner, see Appendix A: Light Client Support for more details.
  5. ^ Why does using all inputs matter for CoinJoin? If Alice uses a random input to create the output for Bob, this necessarily reveals to Bob which input Alice has control of. If Alice is paying Bob as part of a CoinJoin, this would reveal which input belongs to her, degrading the anonymity set of the CoinJoin and giving Bob more information about Alice. If instead all inputs are used, Bob has no way of knowing which input(s) belong to Alice. This comes at the cost of increased complexity as the CoinJoin participants now need to coordinate to create the silent payment output and would need to use Blind-Diffie-Hellman to prevent the other participants from learning who Alice is paying.
  6. ^ Why are outpoints little-endian? Despite using big endian throughout the rest of the BIP, outpoints are sorted and hashed matching their transaction serialization, which is little-endian. This allows a wallet to parse a serialized transaction for use in silent payments without needing to re-order the bytes when compute the outpoint hash. Note: despite outpoints being stored and serialized as little-endian, the transaction hash (txid) is always displayed as big-endian.
  7. ^ Why only taproot outputs? Providing too much optionality for the protocol makes it difficult to implement and can be at odds with the goal of providing the best privacy. Limiting to taproot outputs helps simplify the implementation significantly while also putting users in the best eventual anonymity set.
  8. ^ Why recommend SIGHASH_ALL? Since the output address for the receiver is derived from from the sum of the Inputs For Shared Secret Derivation public keys, the inputs must not change once the sender has signed the transaction. If the inputs are allowed to change after the fact, the receiver will not be able to calculate the shared secret needed to find and spend the output. It is currently an open question on how a future version of silent payments could be made to work with new sighash flags such as SIGHASH_GROUP and SIGHASH_ANYPREVOUT.
  9. ^ Why skip transactions that spend unknown output scripts? Skipping transactions that spend unknown output scripts allows us to have a clean upgrade path for Silent Payments by avoiding the need to scan the same transaction multiple times with different rule sets. If a fancy new output type is added in the future and Silent Payments v1 is released with support, we would want to avoid having to first scan the transaction with the silent payment v0 rules and then again with the silent payment v1 rules.
  10. ^ Why are outpoints sorted before hashing? This way the silent payment otuput does not need to be recalculated if the wallet changes the order of inputs, e.g. at signing time or during an RBF bump.
  11. ^ Are key aggregation techniques like FROST and MuSig2 supported? Any taproot output able to do a key path spend is supported. While a full specification of how to do this securely is outside the scope of this BIP, in theory any offline key aggregation technique can be used, such as FROST or MuSig2. This would require participants to perform the ECDH step collaboratively e.g. ECDH = a0·Bscan + a1·Bscan + ... + at·Bscan and P = Bspend + hash(outpoints_hash·ECDH || 0)·G. Additionally, it may be necessary for the participants to provide a DLEQ proof to ensure they are not acting maliciously.
  12. ^ Why not skip all taproot script path spends? This causes malleability issues for CoinJoins. If the silent payments protocol skipped taproot script path spends, this would allow an attacker to join a CoinJoin round, participate in deriving the silent payment address using the tweaked private key for a key path spend, and then broadcast their own version of the transaction using the script path spend. If the receiver were to only consider key path spends, they would skip the attacker's script path spend input when deriving the shared secret and not be able to find the funds. Additionally, there may be scenarios where a sender has access to the key path private key but spends the output using the script path.
  13. ^ Why skip outputs with H as the internal taproot key? If use cases get popularized where the taproot key path cannot be used, these outputs can still be included without getting in the way of making a silent payment, provided they specifically use H as their internal taproot key.
  14. ^ Why do taproot private keys need to be checked? Recall from BIP340 that each x-only public key has two corresponding private keys, d and n - d. To maintain parity between sender and receiver, it is necessary to use the private key corresponding to the even y-value when performing the ECDH step since the receiver will assume the even y-value when summing the taproot x-only public keys.
  15. ^ Why not re-use tn? when paying different labels to the same receiver? If paying the same entity but to two separate labeled addresses in the same transaction without incrementing n, the two outputs would be Bspend + tn·G + i·G and Bspend + tn·G + j·G. The attacker could subtract the two values and observe that the distance between i and j is small. This would allow them to deduce that this transaction is a silent payment transaction and that a single entity received two outputs, but won't tell them who the entity is.
  16. ^ Why use BIP32 hardened derivation? Using BIP32 derivation allows users to add silent payments to an existing master seed. It also ensures that a user's silent payment funds are recoverable in any wallet which supports BIP32 derivation. Using hardened derivation ensures that it is safe to export the scan private key without exposing the master key or spend private key.
  17. ^ Why precompute labels? Precomputing the labels is not strictly necessary: a wallet could track the max number of labels it has used (call it M) and scan for labels by adding m·G to P0 for each label m' up to M and comparing to the transaction outputs. This is more performant than precomputing the labels and checking via subtraction in cases where the number of eligible outputs exceeds the number of labels in use. In practice this will mainly apply to users that choose never to use labels, or users that use a single label for generating silent payment change outputs. If using a large number of labels, the wallet would need to add all possible labels to each output. This ends up being n·M additions, where n is the number of outputs in the transaction and M is the number of labels in the wallet. By precomputing the labels, the wallet only needs to compute m·G once when creating the labeled address and can determine if a label was used via a lookup, rather than adding each label to each output.
  18. a b Data for Appendix A These numbers are based on data from January 2023 until June 2023 (the last 6 months of data at time time of writing). See Silent payments light client data for the full analysis.