Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete ledger integration #3

Merged
5 commits merged into from Jul 22, 2022
Merged

Complete ledger integration #3

5 commits merged into from Jul 22, 2022

Conversation

ghost
Copy link

@ghost ghost commented Jul 17, 2022

This PR completes the integration work:

  • ledger-backed wallet can be saved/restored from file
  • allow tx decryption (nullifier calculation)

Details and notes about ledger wallet backup/restore:
1 SECP256K1 public key is stored in the file, this is used to identify the ledger in use, then N and M derivation paths are stored, which are used to retrieve all the keys when the wallet is restored, this is shows as a delay in the wallet initialization
The serialization format changes to the version have been updated accordingly.

Details and notes about notes and nullifiers:
Notes have been changed (not in the zcash lib) to not require storing the EXTFVK but rather only the IVK, this allows decryption to be done by the ledger as we don't need to retrieve the FVK (not possible on the ledger).
As a consequence, the code has been refactored to request the nullifier from the ledger, or just compute it like before if the keystore is not the ledger

feat(ledger): device ""id""
refactor(keys:adapters): use `Self` instead of enum name
chore: bump wallet serialization version
refactor: adjust spendable notes based on ivk only
feat(keystores): method to retrieve all spendable ivks
refactor(wallet): initialize `Keystores` from file
refactor: don't force memory keys for lock/unlock encrypt/decrypt operations
refactor(data): use ivk in SaplingNoteData instead of extfvk,
refactor(data): also for SpendableNotes
refactor(sync): compute nullifier via keystore
refactor(sync): use ivk instead of extfvk
refactor(builder): use ivk instead of vk for adding sapling spends
misc: use `to_repr()` to compare ivks
@ghost ghost merged commit bf1a924 into master Jul 22, 2022
@ghost ghost deleted the feat/more-ledger branch September 29, 2022 11:25
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant