You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not embed wasm files in repo (interfaces are fine)
vault: Can we store accounts encrypted?
deriveAddress: master key also needs to be accessible
API for notes
Lock structure, containing a list of SpendCondition
SpendCondition containing a list of spend conditions. Basically, mirror the hoon
getNote(Name) -> Note
lookupNotes(Lock) -> Name[]
knownLocks(PKH | null) -> KnownLocks { coinbase: Lock, simple: Lock, custom: index<string, Lock>, ...}. Here, we lookup locks by PKH, or, if null, for current account PKH. Custom locks are something user might be able to define (for custom timelocks, multisigs, etc.) or something we could pull from note-data - not yet clear, but it should exist.
Transaction builder with notes
When building transactions with input notes, we should extract Name from Note, and then lookup the actual Note that the extension stores (do not trust user input)
Builder::simple_spend(SimpleSpend) variant
Send whole builder from SDK to the extension, and process it there
When inputting a note, pass a (Note, Lock) pair. We can't spend a note without a (matching) lock. This might not be needed for simple spends, because we can check coinbase and simple locks fairly easily.
For SimpleSpend, we don't need to pass the Lock, because the wallet should go through all KnownLocks, and match by first-name of the note and the hash of the lock.
Lockstructure, containing a list ofSpendConditionSpendConditioncontaining a list of spend conditions. Basically, mirror the hoongetNote(Name) -> NotelookupNotes(Lock) -> Name[]knownLocks(PKH | null) -> KnownLocks { coinbase: Lock, simple: Lock, custom: index<string, Lock>, ...}. Here, we lookup locks by PKH, or, if null, for current account PKH. Custom locks are something user might be able to define (for custom timelocks, multisigs, etc.) or something we could pull from note-data - not yet clear, but it should exist.NamefromNote, and then lookup the actualNotethat the extension stores (do not trust user input)Builder::simple_spend(SimpleSpend)variant(Note, Lock)pair. We can't spend a note without a (matching) lock. This might not be needed for simple spends, because we can checkcoinbaseandsimplelocks fairly easily.SimpleSpend, we don't need to pass theLock, because the wallet should go through allKnownLocks, and match byfirst-nameof the note and the hash of the lock.NOTE: I couldn't find actual handlers for say
sign-message. If https://github.com/nockbox/wallet-frontend/blob/82dae8351fe52c8af4dea6195e421c6baabc1d58/extension/background/index.ts#L240 is not the place where everything is handled. Can we ensure we have a clear place where the UI responses are being handled as well?