To allow for maximal compatibility with existing systems, proofs are formatted as regular Bitcoin
transactions. However, one small adaptation to the transaction is made that has two functions:
# make the transaction unspendable to avoid putting funds at risk
# link the proof to the issuer of the proof to prevent copying proofs from other custodians
The resulting construction is a Bitcoin transaction with the following
characteristics:
* The first input (the "commitment input")
** MUST have the txid part of the previous outpoint set to the SHA-256 hash of the commitment message prefixed with "Proof-of-Reserves: "<ref>If the message is "Some Message", the txid part should be <tt>SHA-256("Proof-of-Reserves: Some Message")</tt> with the string encoded as UTF-8.</ref> and index 0.
* The remaining inputs
** MUST have signatures that commit to the commitment input (e.g. using <tt>SIGHASH_ALL</tt>).
* The transaction MUST have a single output that is the exact sum of all the inputs, assuming the commitment input to have 0 value; this means the transaction has no miner fee.
The existence of the first input (which is just a commitment hash) ensures
that this transaction is invalid and can never be confirmed.
===PSBT (BIP 174) extension===
The "commitment input" detailed in the proof format section does not spend an
existing UTXO and thus shouldn't be signed (empty <tt>scriptSig</tt> and
witness). This can cause some problems when signing this type of transactions.
For example, hardware wallets often require the signer to provide information
about all inputs of transactions they are signing, such as the previous output
or previous transaction; this data obviously doesn't exist for the commitment
inputs.
For most existing devices, it's possible to circumvent these requirements by
providing dummy data or by instructing the device to ignore this specific
input. However, there is still a UX problem. Because the hardware wallet
device doesn't recognize the transaction as a proof-of-reserves transaction it
will think it is signing a regular transaction that is spending all the money
in the UTXOs. Most devices will ask for confirmation with a message along the
lines of "Are you sure you want to send XXX BTC to address [...]?". This is
not the best user experience.
An addition to the BIP 174 PSBT format could help signing devices to recognize proof-of-reserve transactions.
The following field is added to the BIP 174 <tt>INPUT</tt> map:
An implementation of the custom proof PSBTs is part of the [https://bitcoindevkit.org/ BDK], and can be found here: https://crates.io/crates/bdk-reserves