Skip to content

feat(reset): ResetDevice.dice_only selects the dice-only derivation - #122

Draft
BitHighlander wants to merge 2 commits into
up/release-protocolfrom
feat/dice-only-field
Draft

feat(reset): ResetDevice.dice_only selects the dice-only derivation#122
BitHighlander wants to merge 2 commits into
up/release-protocolfrom
feat/dice-only-field

Conversation

@BitHighlander

Copy link
Copy Markdown
Collaborator

One field. dice_entropy alone becomes the MIXED mode (device draw shown as 24 words before rolling, seed = SHA256d("KK\x01SM" || draw || SHA256("KK\x01D" || rolls))); with dice_only the derivation is seed = 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_only without dice_entropy is refused.

Firmware unit: BitHighlander/keepkey-firmware audit/715-dice-only. Host tests: keepkey/python-keepkey feat/dice-modes.

A twin of this commit on the products' current pin (feat/dice-only-field-7.14.3, off 8545cd5b6) is what the firmware unit pins, because the products lack .options for the EIP-712 streaming fields between 8545cd5b6 and this branch's base. It retires when the products advance to up/release-protocol.

Draft: not to be merged until the firmware unit is accepted on both products.

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.
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