Hi Zcash Community,
I am very proud to deliver what will be our final update for this phase of WebZjs. I am happy to report we (ec2 and myself) have concluded work on the library which is now has the features required to support wallet development.
We are in the process of handing it off to another team within ChainSafe for the next phase which is developing the Zcash MetaMask snap and accompanying production ready web wallet.
This marks the beginning of WebZjs as a tool that can be used and contributed to by the community with ChainSafe being the first consumer! We expect a lot of bugs to emerge in the first few weeks of use and so are planning to wait before cutting an official release on npm.
Please check out:
For the demo wallet do not use it to hold any significant value and do not import wallets you are about. Keys and seed phrases are not handled securely in the demo.
Please submit a new github issues for any problems that come up using the library or demo rather than posting in the forum.
Grant details
All milestones as set in the original grant proposal have been completed. See further details below
-
MS1 Key Generation
- This was implemented early in the engagement as there were no real blockers in exposing the required key derivation functions
- UnifiedFullViewingKey | API | WebZjs Documentation
- generate_seed_phrase | API | WebZjs Documentation)
-
MS2 - Storage Abstraction
- This was the most difficult milestone by far and consumed a large chunk of our allocated time
- We ended up writing a memory backend for librustzcash that can be used in the browser and supports serialization. The library consumers can then decide where/how to manage persistance (e.g. IndexDB, filesystem, browser plugin)
- This currently lives in our fork but there is a push to have this upstreamed and maintained as part of the official librustzcash. More on this in a follow-up post
- librustzcash/zcash_client_memory at ec2/memwallet · ChainSafe/librustzcash · GitHub
-
MS3 - Wallet Sync
- Using librustzcash we were able to support the existing sync strategies
- As part of this we did have to deploy some additional infrastructure to allow lightwalletd to be supported in the web. gRPC-web proxies to zec.rocks are currently hosted at https://zcash-mainnet.chainsafe.dev/ and https://zcash-testnet.chainsafe.dev/
- The sync method uses WebWorkers to allow syncing to take place in the background and expensive operations support multi-threading. The wallet remains responsive during sync.
- WebWallet | API | WebZjs Documentation
- Syncing is slower than on desktop but not significantly. I would estate it to be about half as fast.
-
MS4 - Transaction Proving
- Similarly the tx proving from librustzcash was usable in the browser context
- This also runs in a separate worker to keep the page responsive
- Proving for a simple Orchard transaction takes around 10 seconds
- See example in https://chainsafe.github.io/WebZjs/api/class/WebWallet#send_authorized_transactions
-
MS5 - POC / Doc
- We developed a demo wallet application to demonstrate usage of WebZjs. This is not intended for use but mainly as a tech demo and as documentation
- The demo can:
- import or generate multiple accounts
- Sync with the network in the background
- Persist sync state between page reloads
- Generate QR codes to receive ZEC
- Propose, prove and send orchard transactions
- WebZjs/packages/demo-wallet at main · ChainSafe/WebZjs · GitHub
- https://webz-demo.netlify.app/
We are really proud of what we were able to achieve here and can’t wait to see it improve over time and to see the new uses of Zcash that is unlocks!