Add entropy command: derive raw BIP-85 entropy at any path - #73
Open
akarve wants to merge 1 commit into
Open
Conversation
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>
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.
Summary
bipsea entropycommand: 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/--pathtakes the raw path (',h, orHhardened markers).-ntruncates to the first n bytes (default 64, matching the spec'sDERIVED ENTROPYlines).-dinstead reads n bytes from the BIP85-DRNG for applications that consume more than 64 bytes.-x/pipe input matchesderive.m/83696968'.entropyagainstderive -a hexat 16/32/64 bytes.test_bad_ntypo that invoked a nonexistententropycommand and passed vacuously (any unknown command prints "Error").Example
Test plan
poetry run pytest -n auto -m ""— 451 passed, 1 xfailed (known spec xfail)isort,black,flake8cleanMade with Cursor