tldr;
- New users of Zecwallet Lite no longer have to do the first time sync. The wallet is ready to use instantly.
- Zecwallet Lite SDK adds a new “verify” command to verify, at any time, that the LightwalletD has not mislead the wallet
- Zecwallet is now compatible with ECC’s LightwalletD. You no longer have to run a custom LightwalletD server
- Preview BlazeSync: A new lightclient sync algorithm that will bring significantly faster sync speeds.
New Wallets now start instantly.
Zecwallet v1.6.0 now will start new wallets instantly! New wallet users no longer have to wait for the initial wallet sync, and Zecwallet achieves this without changing any of the existing security properties of the light wallet. Desktop and mobile versions are now available to download and update. (See the technical details section below for how it works.)
Here’s a quick comparision video
Two weeks ago, @ZcashGrants approved a grant to Zecwallet to work on improving Lightclient user experience. One of the most annoying issues for new users is that when they create a new wallet, there is an annoying sync, that can sometimes take a minute before their wallet is ready to use. We see a lot of new user drop off here, who get annoyed by this sync.
With this new version, the initial sync is so fast that it is not noticeable any more, and so it has been removed from the UX, allowing new users to instantly start using their wallets. They can receive and send shielded transactions immediately!
How it works
The Lightclient sync has two parts - (1) Updating the blocks and keeping track of the sapling commitment root and (2) Scanning all inputs and outputs to see if any transactions belong to the wallet.
When a new wallet is created, the wallet starts to sync from the last checkpoint. If the checkpoint is a few days behind, the initial sync can take a long time.
However, since a new wallet doesn’t have any transactions, there is no point in scanning for transactions belonging to the wallet. Zecwallet Lite v1.6.0 now does only the first part of the sync for new wallets. This is 10x (!) faster, allowing the wallet to scan over 20,000 block headers per second, so it can catch up to the latest block almost instantly.
Note that this doesn’t change any of the security properties - The wallet still scans from the last checkpoint coded into the app, so it has a way to verify if the LightwalletD has intentionally or accidentally omitted some transactions or included rouge ones.
But wait, we can do even better than the 10x faster sync. Since Zecwallet is now compatible with ECC’s LightwalletD, we can request the latest sapling root from the LightwalletD and get the wallet started instantly, while we wait a few seconds for the fast initial block header sync to catch up and verify the what the LightwalletD told us. This only takes a few seconds, even on mobile phones, so well before the user is ready to send their first transaction, the wallet will be ready and verified.
New “verify” command
Zecwallet Lite SDK now has a new “verify” command, that can verify, at any time, whether the LightwalletD has given us all the blocks and all the transactions in the blocks. This works by checking whether the latest sapling commitment root can be reached from a well known checkpoint coded into the SDK. This allows wallets to verify the state before sending or receiving any large transactions (or at any time, really). The verification uses this new fast sync, and only takes a few seconds.
Sneak Peak: BlazeSync
The fast initial sync we are introducing today is a part of “BlazeSync”, a brand new sync algorithm that Zecwallet will introduce over the next few weeks. This algorithm more than doubles sync speed, while also allowing near-instant access to the wallet’s most recent transactions. Some highlights:
- BlazeSync syncs the latest block first, and then works backwards from there. This allows the user to view and spend recent transactions almost immediately, so you don’t have to wait for a sync to finish to spend funds.
- BlazeSync decouples the trial decryptions from keeping sapling notes updated. This allows multiple Sapling spends and outputs to be scanned in parallel (They are all scanned one-by-one today), considerably improving performance
- Since BlazeSync scans backwards, it knows which sapling notes haven’t been spent yet, so it can keep track of the commitment tree only for unspent notes. This saves a lot of compute and battery on phones, especially for rescans or restore-from-seed.
Keep tuned for more details!