Provision a locker with a mint's note subtree - #69
Merged
Conversation
The wallet half. A locker can now hold notes this seed phrase can find again. LUD-25 derives note secrets under m/139'/d1/d2/d3/d4/i', but that path hangs off the BIP-32 master and a locker keeps no seed: it stores a tree root from a different branch, and the recovery phrase only ever exists on the owner's screen. So this wallet derives one mint's domain node and hands it over. Beneath that node only i' remains, which is why it works on hardware with no elliptic curve at all. cashDomainNodeFor goes through mintEntry rather than taking a raw string, for two reasons. The host is then spelled the way serverOf spells it, and one byte of difference is a different tree whose notes neither side can see. And a mint this wallet does not track is one whose counter it cannot keep in step with the device's, which is how an index gets handed out twice. It returns the next index alongside the node so the device can be raised to meet this wallet rather than re-issuing a secret already minted at. device-node needs --force, and the refusal says why rather than being coy. This is the only command that prints key material the holder did not ask to spend, and unlike a note it is not bounded by an amount: whoever reads it can derive every note this wallet ever mints at that mint, forever, with no way to revoke. The warning goes to stderr and the node to stdout, so a deliberate pipe still works. 328 tests.
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.
The wallet half of
forgesworn/heartwood-esp32#105..#108andforgesworn/notelocker#1. A locker can now hold notes this seed phrase can find again.LUD-25 derives note secrets under
m/139'/d1/d2/d3/d4/i', but that path hangs off the BIP-32 master and a locker keeps no seed — it stores a tree root from a different branch, and the recovery phrase only ever exists on the owner's screen. So this wallet derives one mint's domain node and hands it over. Beneath that node onlyi'remains, which is why it works on hardware with no elliptic curve at all.cashDomainNodeForgoes throughmintEntry, not a raw stringTwo reasons, both about things that fail silently:
serverOfspells it. One byte of difference is a different tree, whose notes neither side can see.k1.It returns the next index alongside the node, so the device can be raised to meet this wallet rather than re-issuing a secret already minted at.
device-nodeneeds--force, and the refusal says whyThis is the only command that prints key material the holder did not ask to spend, and unlike a note it is not bounded by an amount: whoever reads it can derive every note this wallet ever mints at that mint, forever, with no way to revoke.
The warning goes to stderr and the node to stdout, so a deliberate pipe still works.
Also
VaultClientgainsprovisionCashNode(gated — it waits on the button),forgetCashNode,listCashMintsandsetCashIndex.newSecret/newSecretPairtake an optional host and derive when given one; the device refuses a host it has no subtree for rather than quietly drawing at random, which is the answer this wallet wants.328 tests.