feat(reset): ResetDevice.dice_only selects the dice-only derivation - #122
Draft
BitHighlander wants to merge 2 commits into
Draft
feat(reset): ResetDevice.dice_only selects the dice-only derivation#122BitHighlander wants to merge 2 commits into
BitHighlander wants to merge 2 commits into
Conversation
dice_entropy alone is now the MIXED mode: the device commits its own 32-byte
draw as 24 BIP-39 words before the rolls are entered, then derives
seed = SHA256d("KK\x01SM" || draw || SHA256("KK\x01D" || rolls)). With
dice_only the derivation is seed = SHA256(rolls) and the draw is discarded,
matching Coldcard's Dice-Rolls-Only byte for byte.
The mode is a host-side selection so a wallet can explain what is coming --
99 rolls, and for MIXED 24 words to copy down -- before the ceremony starts.
The device still shows a consent screen naming the mode the host chose, so a
host cannot select dice-only silently. In both modes the host's EntropyAck is
consumed and its bytes dropped; the wire flow is otherwise unchanged.
dice_only without dice_entropy is rejected with a SyntaxError.
Reports that ResetDevice.dice_only, the on-device consent screen and the tagged MIXED derivation are implemented. Needed because nanopb skips unknown fields: a host that sends dice_only to older firmware gets the older ceremony and a different wallet, with no error. Hosts and the test suite gate on this bit rather than on a version.
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.
One field.
dice_entropyalone becomes the MIXED mode (device draw shown as 24 words before rolling,seed = SHA256d("KK\x01SM" || draw || SHA256("KK\x01D" || rolls))); withdice_onlythe derivation isseed = SHA256(rolls), Coldcard's Dice-Rolls-Only byte for byte. Host-side selection so a wallet can explain what is coming; the device shows a consent screen naming the mode.dice_onlywithoutdice_entropyis refused.Firmware unit: BitHighlander/keepkey-firmware
audit/715-dice-only. Host tests: keepkey/python-keepkeyfeat/dice-modes.A twin of this commit on the products' current pin (
feat/dice-only-field-7.14.3, off8545cd5b6) is what the firmware unit pins, because the products lack.optionsfor the EIP-712 streaming fields between8545cd5b6and this branch's base. It retires when the products advance toup/release-protocol.Draft: not to be merged until the firmware unit is accepted on both products.