Repository navigation
Release 0.7.0: the reviewed upstream reference implementation - #214
Open
BenWestgate wants to merge 6 commits into
Open
BenWestgate wants to merge 6 commits into
BenWestgate wants to merge 6 commits into
Conversation
Shares are now made only by interpolation. encode() and from_seed() reject share indices other than 's', and decode() returns no seed bytes or padding for shares. Codex32String keeps the string it was given instead of re-encoding from bytes, so attributes are no longer writable aliases. Drop code a reference implementation should not carry: - the bip32 dependency and the fingerprint default identifier (BIP-93 leaves the identifier to the user; coincurve also fails to build on Python 3.13) - segwit_addr.py, Bech32/Bech32m constants and their tests - unused HRP_CODES, IDX_ORDER and IdNotLength4 Claude-Session: https://claude.ai/code/session_01PYQtm2qPkBYqZ9WuNvhv51
- "ms" strings must have an encoded length of 48, 54, 61, 67, 74 or 127, and master seeds must be 16, 20, 24, 28, 32 or 64 bytes. - Select the checksum by expanded codeword length (HRP expansion plus data part): regular up to 93, long from 96 to 1023; 94 and 95 are invalid. - Limit the HRP to 83 characters. - Add Test vectors 6-8 from BIP-93 master and 9-11 plus the new invalid vectors from bips#2320. Drop the long-HRP boundary vectors that encoded the old data-length checksum selection. Claude-Session: https://claude.ai/code/session_01PYQtm2qPkBYqZ9WuNvhv51
codex32_decode now checks only what every codex32 string has: the checksum and the header (digit threshold, share index "s" when k=0). ms32_verify adds the BIP-93 "ms" length rule, and Codex32String uses it for "ms" strings, so generic strings with other HRPs no longer need byte-aligned payloads. encode() and decode() only handle codex32-encoded master seeds, so they drop their hrp argument. Codex32String stores the HRP, header and payload characters and gets bytes from data(), which only works for "ms" secrets. The seed-size check and InvalidSeedLength are gone since the "ms" lengths already imply the seed sizes. Claude-Session: https://claude.ai/code/session_01PYQtm2qPkBYqZ9WuNvhv51
Publish the reference implementation merged upstream in BlockstreamResearch/codex32#74 (apoelstra utACK 2ecd191). src/ and tests/ now match reference/python-codex32 at 2ecd191; the README keeps the banner and Python 3.15 support. Claude-Session: https://claude.ai/code/session_01MDsbGqZmvVThoJrs4vzc4K
BenWestgate
marked this pull request as ready for review
November 4, 2026 15:04
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e34a1432a3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: PyPI and master ship 0.6.1/0.6.2, which is the code apoelstra originally ACKed (4857e18). That code still encodes shares from bytes, depends on
bip32, bundles segwit-address code, and predates the BIP-93 master length and checksum rules.After: master carries the reference implementation that was merged upstream in BlockstreamResearch/codex32#74 (apoelstra utACK 2ecd191), plus immutable
Codex32Stringattributes, and the version is 0.7.0.How:
d554908,925be0b,c24a4d4are the three upstream commits applied unchanged in content. After them,src/andtests/matchreference/python-codex32at 2ecd191, apart from master'spy.typedand atests/data/README.mdnote.e34a143sets the version to 0.7.0. The README keeps master's banner and its Python 3.10–3.15 line.df6b257and96c40b9makeCodex32Stringattributes immutable and test that. This answers Codex's finding that reassigned attributes went stale. These two commits are not in the upstream tree yet.0.7.0 is a minor bump because the API breaks:
encode/decodedrophrp, shares can't be built from bytes, attributes are read-only, andsegwit_addris removed. The v1 rebuild (#142) would then become 0.8.0.Checks: CI is green on 96c40b9 (build 3.10–3.15, CodeQL), and Codex found nothing on that commit.
Publishing: after merge, publish a GitHub release tagged
v0.7.0on master.python-publish.ymlruns when a release is published.🤖 Generated with Claude Code
https://claude.ai/code/session_01MDsbGqZmvVThoJrs4vzc4K