New tool for recovering ZecWallet Lite funds with YWallet

Hello Zcash family!
Once again I’m seeing a lot of users with problems recovering their funds from ZecWallet Lite.
Even though we advanced a lot on this regard, with ZExCavator for instance, few users are still having trouble recovering their ZEC.

One of the main issues with recovering funds from ZecWallet Lite is the way that wallet derived keys and addresses. So even if thee user has their mnemonic phrase back up, they can’t recover funds with funds were on addresses derived with ZecWallet Lite.

Roughly speaking, and the engineers can correct me if i’m wrong, Most wallets works by having 1 master key, and many diversified addresses.
ZecWallet Lite on the other hand has 1 master key, many derived child keys and 1 address (per child key).

So, this new tool can convert ZecWallet Lite style addresses to a YWallet database, that can be plugged in and used directly with the YWallet app.

While ZecWallet Lite is something like “1 account, multiple addresses”, YWallet is "Multiple Accounts, single address (actually 1 for each pool plus diversified addresses).

So each address on ZecWallet Lite is converted to 1 account on YWallet:

7 addresses are converted to 7 accounts:

Each Ywallet accounts contains 1 orchard, 1 sapling and 1 transparent address related to that child derivation index on ZecWallet lite.

On my tests, I could successfully sync and build the transactions history:

Even tough I didn’t thoroughly tested it, I believe everything is working.

How to use it?

As I said on other opportunity, even though I share a good amount of respect and trust from the community, I don’t encourage members to download software on the internet, claiming to “solve your problems”. That’s why I’m not releasing any binary or executables. But here is how to compile the source code and use this app:
clone the repo GitHub - james-katz/uzw-parser: Universal Zcash Wallet Parser

$ git clone https://github.com/james-katz/uzw-parser.git
$ cd uzw-parser/

Build and run:

$ cargo run -- --from-seed "your 24 words seed" --num-addresses 7

The --num-addresses flag takes the argument and derives that many addresses. If you remember how many addresses you had in ZecWallet Lite, input it here, if you don’t remember, take a estimated guess, this is the most important information to do right (well, I guess the mnemonic phrase is the most important, but you know what i’m saying).

OR, if you have an zecwallet-light-wallet.dat file, you can provide it to the app, and it will convert to a YWallet database:

$ cargo run -- --from-path /path/to/zecwallet-light-wallet.dat

This one does not need the --num-addresses, it will extract every key directly from the .dat file.

Using it with YWallet

Now that the app generated a .db file (default name is generated_from_zwl.db), you will rename it to zec.db and place it into the YWallet databases folder. On my linux distro it’s located on $HOME/databases/
WARNING always backup any existing db files!!!

Then start up YWallet, it should display the all the created accounts on the main screen. Last step is to go for Rescan and select your wallet birthday (if unknown, take an estimated guess).

IIRC, YWallet syncs all accounts at once, so large number of addresses/accounts may be really slow to sync to the tip.

Alternative

If you don’t like messing with CLI and databases, you can slo try this hack of ZecWallet Lite with NU6.1 and zip317 support, and with working server. Although I don’t reccomend using such an outdated wallet. My recommendations is to use it to sync and see if any addresses has fund in them, and then exporting each and individual private key.

Ok, that’s it. I really, really hope this can help users recover their “lost” ZEC.

14 Likes

Appreciate the documentation. I generated the new db as you advise. Seem to work fine. However, when I launch ywallet with the new zec.db, it asks for a database password. I’m running MacOS.

1 Like

Did you try your system password or pin (your sudo password)?

Certain wallet functions will be behind your regular password (or biometrics) unless you change that in the settings.

(This generic password to open a wallet is not the same password as when you encrypt your db. It could be the same if you chose the same one for it but otherwise is a seperate password from your system pass or pin.)

1 Like

I tried the system password and others. No luck. Below is what I see when I open YWallet.

1 Like

That’s weird.
Are you sure you’re using the correct .db file?

Try opening the generated database with a db visualizer

This is how it should look like

1 Like

I tried the DB visualizer and confirmed the validity of the db file created by uzw-parser (although I got a minor error when opening).

When I renamed the uzw-parser db file to zec.db and moved it to the ywallet Database folder, I opened ywallet and rescanned the entire blockchain. I kept getting periodic errors during the rescan ( internal error: Unexpected EOF encoding stream Metadata metamap headers). But it kept scanning/running and ultimately, the missing shielded address was exposed by viewing the additional account under Ywallet:more→accounts.

Really appreciate your support on this.

5 Likes

We also need a private key extractor for WinZec.

2 Likes

(It’s a Berkeley DB, I think this is the browser)

1 Like

We have plans to complete “key-sweeper” functionality in ZExCavator, but we didn’t receive funding from the @ZCG to prioritize the work right now.

3 Likes

Hi @ChristopherA , it looks like the grant Grant Application - Zcash Extensible Wallet Interchange Format (ZeWiF) · Issue #3 · ZcashCommunityGrants/zcashcommunitygrants · GitHub

is completed, but I don’t understand what to expect from this part:

  1. LEGACY WALLET CLI TOOL. Expand the Rust abscissa CLI into a single-purpose tool that extracts legacy wallet.dat files from ZecWallet Fullnode and zcashd via the ZeWiF format, syncs the wallet, and exports the updated wallet via ZeWiF for compatible consumers. This will provide an important community utility, as well as a proof of concept of the advantages offered by the standard ZeWiF format.

    • Deliverable # 4.1: Full legacy wallet CLI tool (ZExCavator).

Could you clarify what it is able to do?

1 Like

This might be helpful: Grant Proposal: Zcash Extensible Wallet Interchange Format (ZeWiF) - #45 by zancas.

Note that zmigrate and zexcavator are different programs. The latter is able to ingest zecwallet wallets, while the former ingests zcashd wallets.

1 Like