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

research: Explore populating in memory wallet from zebra #8358

Closed
oxarbitrage opened this issue Mar 18, 2024 · 3 comments
Closed

research: Explore populating in memory wallet from zebra #8358

oxarbitrage opened this issue Mar 18, 2024 · 3 comments
Assignees

Comments

@oxarbitrage
Copy link
Contributor

oxarbitrage commented Mar 18, 2024

In zcash/librustzcash#1293 a memory wallet is introduced into the zcash_client_backend crate.

Inside there are structs like MemoryWalletDb that will need to be populated with Zebra data.

This ticket is to explore that possibility, check if it is doable and end up with a proof of concept if possible to work forward.

@oxarbitrage
Copy link
Contributor Author

oxarbitrage commented Apr 16, 2024

Possible Course of Action

Based on a possible spec and some discussion.

Current Status in librustzcash:

These methods (create_account and put_block) will form the backbone of our initial proof of concept.

Current Developments in Zebra:

  • Zebra supports adding a Sapling viewing key and scanning for related transactions, which are then stored in a database.
  • This functionality relies on zcash_client_backend::scanning::scan_block, returning ScannedBlocks for each scan, aligning with what the memory wallet needs.

Proof of Concept Implementation:

  • A prototype is available at: Zebra Integration Prototype
  • Challenges include duplicated dependencies due to the use of draft branches for the memory wallet. This might be streamlined in the future.
  • The prototype features an external_client.rs in Zebra, acting as a wrapper around the memory wallet backend. This includes type conversions between Zebra and zcash_client_backend formats.

Immediate Next Steps:

  • Upon create_account, initiate the scan task to send the viewing key for transaction scanning. Link to implementation: Zebra Scan Task
  • Send ScannedBlocks from Zebra to the memory wallet with the put_block method. Detailed implementation here: Scan and Insert Block
  • Test these integrations.

Medium-term Objectives:

  • Extend Zebra's scanning capabilities to include Orchard.
  • As new functionalities are added in the librustzcash side, mirror these in Zebra's external client.
  • Explore the development of gRPC methods for functions like create_account, while evaluating which methods should remain internal versus those exposed for client use.

Long-term Vision:

  • Consider separating the zebra-scan functionality into its own repository.
  • Implement a permanent storage solution for the memory wallet within Zebra, similar to how transaction data is currently handled, utilizing RocksDB.

Open Questions:

  • Address the capability and responsibility for sending transactions. Determine if this should be integrated as part of this project or handled externally. The memory wallet in the librustzcash side don't have any transaction sending functionality.

@mpguerra
Copy link
Contributor

@oxarbitrage is there anything else you would like to do here or are you happy to close this one with the research and meetings already done?

@mpguerra
Copy link
Contributor

mpguerra commented Jul 5, 2024

I think we are done here

@mpguerra mpguerra closed this as completed Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants