BIP321: make all example addresses intentionally invalid #2229

pull fametrano wants to merge 1 commits into bitcoin:master from fametrano:invalidate-example-addresses changing 1 files +7 −5
  1. fametrano commented at 9:03 PM on July 31, 2026: contributor

    One of three mutually exclusive options for the same problem — see the table at the bottom. This is the one I'd recommend merging.

    BIP 21's example address 175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W has a deliberately broken checksum (the final character was replaced, per @TheBlueMatt in #119), and #1861 documented that intent with a note. BIP 321 inherited the address but not the note, and the addresses added to BIP 321 after the fork from BIP 21 do not follow the convention — their checksums are valid:

    Address Status on master
    175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W invalid checksum (intentional)
    bc1qufgy354j3kmvuch987xe4s40836x3h0lg8f5n2 valid bech32, witness v0, mainnet
    bc1p5swkugezn97763tl0yty6556856uug0q6jflljvep9m4p7339x5qzyrh4g valid bech32m, witness v1, mainnet
    tb1qghfhmd4zh7ncpmxl3qzhmq566jk8ckq4gafnmg valid bech32, witness v0, testnet

    So the document currently ships two spendable mainnet addresses in its examples — exactly the accident #119 and #1861 were about.

    This PR

    Applies the existing convention to the remaining addresses by altering the final checksum character of each, then adds BIP 21's note verbatim, which is now accurate for every address in the document:

    Note: The addresses used in these examples are intentionally invalid to prevent accidental transactions.

    Properties preserved:

    • Bech32 detects any single-character substitution, so the modified strings cannot be valid addresses under either the bech32 or bech32m constant. I verified all of them against a reference implementation of both.
    • Human-readable part, charset and length are unchanged (42 and 62 characters), so the examples stay structurally representative of P2WPKH and P2TR and remain usable as negative test vectors.
    • The uppercase QR-code variants are updated to match.
    • The changed testnet address in the "Invalid URIs" section still demonstrates its point, which is the HRP/parameter-key mismatch (a tb address in the bc parameter), not the checksum.

    The three options

    PR Approach Diff
    #2228 keep the addresses, word the note to match reality +2
    #2229 invalidate every address, add BIP 21's note verbatim +7 / -5 this PR, my preference
    #2230 make every address valid, warn against paying them +18 / -16

    Only one should be merged; I'll close the other two.

    My preference is this PR. It is the only one of the three that leaves no spendable address anywhere in the document, it makes BIP 21's existing wording literally true here so the two documents stay in sync, and the whole cost is four characters. #2228 is the minimal-diff fallback if maintainers would rather not touch strings that downstream implementations may already be using as test vectors. #2230 is on the table because #119 was closed for lack of author consensus rather than on the merits, so the option deserves to be stated explicitly rather than assumed dead — but it is the one I would close first.

  2. 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>
    644e484d4a
  3. fametrano referenced this in commit 932d3f0a44 on Jul 31, 2026
  4. jonatack commented at 9:23 PM on July 31, 2026: member

    Approach ACK. Per #119 (comment), the BIP author doesn't mind either way and this follows what was already done in #1861.

  5. jonatack added the label Fixups on Jul 31, 2026
  6. jonatack approved
  7. jonatack commented at 3:52 AM on August 3, 2026: member

    ACK

  8. jonatack merged this on Aug 3, 2026
  9. jonatack closed this on Aug 3, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-05 15:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me