Skip to content

Add BRC-157 entropy derivation helper - #4

Closed
rohenaz wants to merge 1 commit into
mainfrom
codex/brc157-derivation
Closed

Add BRC-157 entropy derivation helper#4
rohenaz wants to merge 1 commit into
mainfrom
codex/brc157-derivation

Conversation

@rohenaz

@rohenaz rohenaz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Implements the generic BRC-157 entropy-rooted wallet derivation helper in ToolboxWallet.

  • validates all BIP-39 entropy sizes and the secp256k1 scalar range
  • generates 32-byte entropy and 24-word mnemonics for new wallets
  • derives profiles at hardened m/0-prime/i-prime without changing legacy MnemonicRestore
  • preserves original mnemonic entropy length across BRC-140 share recovery
  • pins the worked BRC vector and independently generated TypeScript profile vectors
  • redacts secret material from diagnostic descriptions

Verification:

  • focused BRC157Tests: 11 passed
  • full Swift suite: 176 passed, 10 environment-gated live tests skipped
  • strict formatting lint and diff checks passed

This is the reusable dependency for the separate unreleased 1Sat mobile cutover that will delete random profile pads rather than migrate them.

@rohenaz

rohenaz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by opldotdev/swift-sdk#7 after independent boundary review. BRC-157 is a reusable composition of SDK-owned BIP-39, BIP-32, secp256k1, and BRC-140 primitives, so duplicating it in the concrete ToolboxWallet package would be the wrong dependency boundary. The SDK PR preserves the reviewed behavior/vectors and also aligns the underlying BRC-140 edge semantics.

@rohenaz rohenaz closed this Aug 31, 2026
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