Skip to content

Release 0.7.0: the reviewed upstream reference implementation - #214

Open
BenWestgate wants to merge 6 commits into
masterfrom
claude/release-0.7.0
Open

BenWestgate wants to merge 6 commits into
masterfrom
claude/release-0.7.0

Conversation

@BenWestgate

@BenWestgate BenWestgate commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

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 Codex32String attributes, and the version is 0.7.0.

How:

  • d554908, 925be0b, c24a4d4 are the three upstream commits applied unchanged in content. After them, src/ and tests/ match reference/python-codex32 at 2ecd191, apart from master's py.typed and a tests/data/README.md note.
  • e34a143 sets the version to 0.7.0. The README keeps master's banner and its Python 3.10–3.15 line.
  • df6b257 and 96c40b9 make Codex32String attributes 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/decode drop hrp, shares can't be built from bytes, attributes are read-only, and segwit_addr is 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.0 on master. python-publish.yml runs when a release is published.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MDsbGqZmvVThoJrs4vzc4K

BenWestgate and others added 4 commits November 4, 2026 03:05
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 BenWestgate self-assigned this Nov 4, 2026
@BenWestgate
BenWestgate marked this pull request as ready for review November 4, 2026 15:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T15:36:26.327959Z 96c40b9 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/codex32/bip93.py Resolved

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant