Skip to content

feat(keyring-sdk): add new entropy support#603

Open
ccharly wants to merge 1 commit into
mainfrom
cc/feat/entropy
Open

feat(keyring-sdk): add new entropy support#603
ccharly wants to merge 1 commit into
mainfrom
cc/feat/entropy

Conversation

@ccharly

@ccharly ccharly commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Temporarily add the new entropy support in our keyring-sdk package.

We might re-consider this choice and put that somewhere else, but for now that will do.


Note

Medium Risk
Touches cryptographic fingerprinting of wallet entropy; algorithm or ID format changes would break stable identifiers across clients, though scope is additive and well-tested with golden vectors.

Overview
Adds entropy source modeling to @metamask/keyring-sdk: exported types (Entropy, EntropyId, EntropyType, category/implementation unions) and helpers to derive stable identifiers without exposing raw secrets.

fingerprint and toEntropyFingerprint use HMAC-SHA256 over entropy bytes with the fixed message metamask:fingerprint (UUID v4 from the first 16 digest bytes, or full hex for auditing). toEntropyId builds IDs as entropy:{category}:{implementation}:{uuid}, using that fingerprint when material is available or _ when it is omitted (e.g. hardware wallets). APIs are async for future Web Crypto compatibility.

Also adds @noble/hashes, re-exports the module from the package entry, documents the feature in the changelog, and covers behavior with unit tests including golden vectors.

Reviewed by Cursor Bugbot for commit bdafc36. Bugbot is set up for automated code reviews on this repo. Configure here.

@ccharly
ccharly force-pushed the cc/feat/entropy branch 2 times, most recently from ef348c9 to d1ef1fe Compare July 22, 2026 17:12
@ccharly
ccharly marked this pull request as ready for review July 22, 2026 17:26
@ccharly
ccharly requested a review from a team as a code owner July 22, 2026 17:27
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