1
0
mirror of https://github.com/bitcoin/bips.git synced 2026-08-03 18:21:54 +00:00

BIP321: make all example addresses intentionally invalid

The base58 example address has an intentionally invalid checksum, but
the bech32 and bech32m examples added later have valid checksums, so
they are spendable addresses that a reader may pay by accident -- the
very hazard that motivated the invalid base58 address in #119. Two of
them are mainnet:

  bc1qufgy354j3kmvuch987xe4s40836x3h0lg8f5n2  (bech32, witness v0)
  bc1p5swkugezn...vep9m4p7339x5qzyrh4g        (bech32m, witness v1)
  tb1qghfhmd4zh7ncpmxl3qzhmq566jk8ckq4gafnmg  (bech32, testnet)

Alter the final checksum character of each, and document the intent
with the note BIP 21 received in #1861. Bech32 detects any
single-character substitution, so the modified strings cannot be valid
addresses. The human-readable part, charset and length are unchanged,
so the examples remain structurally representative of P2WPKH and P2TR.

The uppercase QR-code variants are updated to match, and the changed
testnet address in the "Invalid URIs" section still demonstrates the
same point (a `tb` address in the `bc` parameter).

Alternative to #2228, which leaves the addresses untouched and instead
words the note to match them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ferdinando Ametrano
2026-07-31 22:59:39 +02:00
parent 9783d61f1b
commit 644e484d4a

View File

@@ -142,6 +142,8 @@ Any existing BIP 21 implementation should automatically be fully compliant with
=== Examples ===
Note: The addresses used in these examples are intentionally invalid to prevent accidental transactions.
==== URIs ====
Just the address:
@@ -181,14 +183,14 @@ Some future version that has variables which are (currently) not understood but
bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?somethingyoudontunderstand=50&somethingelseyoudontget=999
Multiple segwit addresses may be included for various versions of segwit, note that the human-readable part for all of them is `bc`
bitcoin:?bc=bc1qufgy354j3kmvuch987xe4s40836x3h0lg8f5n2&bc=bc1p5swkugezn97763tl0yty6556856uug0q6jflljvep9m4p7339x5qzyrh4g
bitcoin:?bc=bc1qufgy354j3kmvuch987xe4s40836x3h0lg8f5nq&bc=bc1p5swkugezn97763tl0yty6556856uug0q6jflljvep9m4p7339x5qzyrh4q
Many QR codes utilize all-uppercase URIs, which should be handled fine
BITCOIN:BC1QUFGY354J3KMVUCH987XE4S40836X3H0LG8F5N2?BC=BC1P5SWKUGEZN97763TL0YTY6556856UUG0Q6JFLLJVEP9M4P7339X5QZYRH4G
BITCOIN:?BC=BC1QUFGY354J3KMVUCH987XE4S40836X3H0LG8F5N2&BC=BC1P5SWKUGEZN97763TL0YTY6556856UUG0Q6JFLLJVEP9M4P7339X5QZYRH4G
BITCOIN:BC1QUFGY354J3KMVUCH987XE4S40836X3H0LG8F5NQ?BC=BC1P5SWKUGEZN97763TL0YTY6556856UUG0Q6JFLLJVEP9M4P7339X5QZYRH4Q
BITCOIN:?BC=BC1QUFGY354J3KMVUCH987XE4S40836X3H0LG8F5NQ&BC=BC1P5SWKUGEZN97763TL0YTY6556856UUG0Q6JFLLJVEP9M4P7339X5QZYRH4Q
A testnet segwit addresses must be included in the `tb` parameter
bitcoin:?tb=tb1qghfhmd4zh7ncpmxl3qzhmq566jk8ckq4gafnmg
bitcoin:?tb=tb1qghfhmd4zh7ncpmxl3qzhmq566jk8ckq4gafnmq
Characters must be URI encoded properly.
@@ -207,7 +209,7 @@ Multiple proof of payment URIs must not appear, even if they are sometimes prefi
bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?pop=callback%3a&req-pop=callback%3a
A testnet segwit addresses must be included in the `tb` parameter, not the `bc` parameter.
bitcoin:?bc=tb1qghfhmd4zh7ncpmxl3qzhmq566jk8ckq4gafnmg
bitcoin:?bc=tb1qghfhmd4zh7ncpmxl3qzhmq566jk8ckq4gafnmq
==== Proof of Payment ====