BIP93: Refactor format and seed sections #2285

pull BenWestgate wants to merge 1 commits into bitcoin:master from BenWestgate:bip93-master-seed-refactor changing 1 files +97 −96
  1. BenWestgate commented at 8:52 AM on September 12, 2026: contributor

    Motivation: the Specification should move from most general to specific cases.

    Group the regular and long checksum definitions together in the codex32 format section. Move Master seed format application to after of the codex32 format specification and keep seed-specific checksum motivation in the rationale.

    This is a behavior-neutral organization change on top of #2258.

    There is also interest to add here:

    A bits vs bytes consistency fixup commit; and https://github.com/bitcoin/bips/pull/2258/changes#r3894597745 https://github.com/bitcoin/bips/pull/2258/changes#r3894609812 https://github.com/bitcoin/bips/pull/2258/changes#r3894685643

    A cautionary warning to not convert bytes to shares. #2258 (comment)

    Optional: a changelog. #2258 (comment)

    Lastly, I nit there are too many items in the TOC:

    ====Checksum==== seems like it belongs in ===codex32=== with bold, like it is in BIP173 and BIP350.

    We first describe the general checksummed SSSS-aware base32 format called codex32 and then define a BIP-0032 master seed encoding using it.

    Implies codex32 header is required for every application.

    We first describe the general checksummed base32 format called codex32 and then define a secret sharing scheme and BIP-0032 master seed encoding using it.

    codex32 header belongs in ===SSSS-awareness=== or ===Secret Sharing Scheme=== and the final part of ==Specification== should be ===Master seed format===.

    I'm undecided if every application must use the codex32 header, I think they can be free to choose and they may use it even if they do not support SSS, like CL1 rejected threshold != 0 invalidating shared secrets even if another application did the secret recovery.

    It's most flexible and Bech32-like to not require it. OTOH, every application has used it thus far so making codex32_decode(hrp, data) continue to require:

        if codex[pos+1].isalpha() or codex[pos+1] == "0" and codex[pos+6] != "s":
            return None
    

    improves the certainty damaged base32 data is codex32. If saving 6 characters were top priority, they'd Bech32-encode anyhow.

    Nevertheless, it feels like it belongs as the only === section between ===codex32=== and ===Master seed format===.

    nit: TOC may also need a casing fixup.

  2. BIP93: Separate format and seed sections
    Group the regular and long checksum definitions in the codex32 format
    section. Move the master-seed application profile to the end of the
    specification and keep seed-specific checksum motivation in the
    rationale.
    
    This is a behavior-neutral organization change on top of the #2258
    profile commit.
    eb7bb6c097
  3. BenWestgate commented at 9:15 AM on September 12, 2026: contributor

    eb7bb6c097fe9fc340ffa7f8b7cf8344b38fa84f is ready for review.

    Most of the PR description is extra seasoning or nice-to-have house-keeping before I rebase #2040 on this PR. @roconnor if you'd like you can propose a bits vs bytes consistency fixup commit and I will add it to this PR.

    I'll add commits for any cACK'd idea in the description

  4. apoelstra commented at 12:09 PM on September 12, 2026: contributor

    A bits vs bytes consistency fixup commit; and

    I wouldn't mind adding this here in a separate commit. Up to you.

    A cautionary warning to not convert bytes to shares.

    Let's defer to another PR. This might require some discussion about whether we should allow shares to bytes, whether we should allow bytes to shares if you're super careful, etc etc

    Optional: a changelog [for #2258]

    Yes please!

  5. apoelstra commented at 12:15 PM on September 12, 2026: contributor

    In the existing text we say "String validity may be further restricted by specific applications, see Master seed format below.". This is a run-on sentence. Can we change the "," to a "." and capitalize See?

    (This is unrelated to the current diff but this PR seems like we could fit it in here since you also fixed a couple other typos/formatting things.)

    Lol @ the old text saying overwhelming (1 - 2^65) probability. without a negative sign in front of 65. Negative 2^65 probability is overwhelming!

    Other than these nits eb7bb6c097fe9fc340ffa7f8b7cf8344b38fa84f looks good to me. This PR has no functional changes and is easy to review.


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-09-13 03:10 UTC

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