Skip to content

Add entropy command: derive raw BIP-85 entropy at any path - #73

Open
akarve wants to merge 1 commit into
mainfrom
entropy-path-dev-hatch
Open

Add entropy command: derive raw BIP-85 entropy at any path#73
akarve wants to merge 1 commit into
mainfrom
entropy-path-dev-hatch

Conversation

@akarve

@akarve akarve commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • New bipsea entropy command: a developer hatch that derives raw BIP-85 entropy (HMAC-SHA512("bip-entropy-from-k", k)) at any fully hardened path, for prototyping and testing new applications before they have a named --application (e.g. the age proposal in bip-85: add example use for age key derivation bitcoin/bips#2174).
  • -p/--path takes the raw path (', h, or H hardened markers). -n truncates to the first n bytes (default 64, matching the spec's DERIVED ENTROPY lines). -d instead reads n bytes from the BIP85-DRNG for applications that consume more than 64 bytes. -x/pipe input matches derive.
  • Requires fully hardened paths per the spec; warns on stderr when the path does not begin with m/83696968'.
  • Tests pin the command to BIP-85 spec vectors (Test case 1, Test case 2, the HEX 64-byte vector, and the 80-byte DRNG vector) and cross-check entropy against derive -a hex at 16/32/64 bytes.
  • Fixes a pre-existing test_bad_n typo that invoked a nonexistent entropy command and passed vacuously (any unknown command prints "Error").

Example

bipsea validate -m "$MNEMONIC" | bipsea xprv | bipsea entropy -p "m/83696968'/128169'/32'/0'" -n 32

Test plan

  • poetry run pytest -n auto -m "" — 451 passed, 1 xfailed (known spec xfail)
  • isort, black, flake8 clean
  • Manual smoke: spec Test case 1 vector, HEX 32-byte path, DRNG 80-byte vector, off-purpose warning

Made with Cursor

A developer tool for prototyping and testing new BIP-85 applications
before they have a named --application. Supports truncation (-n) and
BIP85-DRNG reads (-d), requires fully hardened paths, and warns when
the path does not begin with the BIP-85 purpose code.

Also fixes a test_bad_n typo that invoked a nonexistent command and
passed vacuously.

Co-authored-by: Cursor <cursoragent@cursor.com>
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