Introducing LeekWallet Zcash: a DIY hardware wallet you can build for about $25

Hi all,

I’m 0xOucan. For ZECATHON (Wildcard track) I turned LeekWallet, an open-source ESP32 hardware wallet I first built for Ethereum, into a Zcash-only one. I’m posting it here to get it in front of people who know Zcash well and to hear what I got wrong.

What it is: a small signer on an ESP32-S3 board with a 128×128 OLED, a rotary knob (turn to move, press for OK) and one Cancel button. It holds the seed. Your phone or computer syncs, builds the transaction and creates the proofs. The board checks the transaction against its own keys, shows you what you’re about to sign, and signs only if you accept.

How it works

 phone / PC                                  LeekWallet board
 ──────────                                  ────────────────
 sync, build PCZT  ── PCZT (ZIP 374) ──▶  parse, check the spends are ours,
                     USB · BLE · SD          recompute the sighash, rebuild the notes,
                                             show the outputs and the memo
 prove, broadcast  ◀── signatures ─────  you press ACCEPT: RedPallas spend-auth sigs
  • The board is a PCZT signer. Proving happens on the companion, so the board never needs the proving keys.
  • It signs a compact view of the PCZT (~1.4 KB). It rebuilds the parts it can recompute (note commitments, value commitments, the encrypted memo) itself, so the memo it encrypts is the memo it showed you.
  • It returns signatures only (~110 bytes), bound to the SHA-256 of the exact bytes it reviewed.
  • Address check: before the app shows you a receive address, the board proves that address is its own. That includes rotated diversified addresses: the Orchard pk_d = [ivk]·g_d check, with the index recovered by FF1. It refuses foreign or mixed addresses.
  • Pairing: an encrypted session (X25519, HKDF, ChaCha20-Poly1305), confirmed by a six-digit code shown on both screens.
  • Pools: Ironwood (NU6.3), Orchard, and transparent inputs, so it can shield. Mainnet or testnet is a setting on the board, and it refuses requests for the other network.

The ecosystem around it

  • Zodl fork: two Android apps (mainnet and testnet) with an account whose keys stay on the board, signed over USB or Bluetooth.
  • Zcash LeekWallet app (Linux, Windows, macOS, Android): a full light wallet. It sends and shields with signatures from the board, supports watch-only wallets, and does ZEC swaps through NEAR Intents.
  • Chrome extension: librustzcash compiled to WebAssembly, talking to the board over Web Serial and Web Bluetooth.
  • zecz CLI and the Rust libraries that all of the above use, plus a simulated board for testing without hardware.

It has signed real testnet transactions over USB, Bluetooth and SD card, and its first mainnet sends, a shield, and a ZEC → USDC swap.

Please read before you use it

  • It is experimental and not audited.
  • Flash encryption and secure boot are not enabled. On the ESP32 they are one-way eFuse burns, so I left them off for now. Anyone who holds the board can read its flash. If you store the seed on the board behind a PIN, my own audit estimates a 4–8 digit PIN falls to a GPU in minutes once the flash is dumped (the vault uses PBKDF2). Three wrong PINs on the device wipe it, but that doesn’t help against a dumped flash.
    • If physical theft is in your threat model, use the stateless mode: you type the seed at each boot and nothing is stored. Or keep the seed in an encrypted file on the microSD card protected by a long passphrase.
  • Use small amounts on mainnet. Testnet is the default.
  • Verify downloads first. Each release ships a SHA256SUMS signed with my SSH key, and the firmware build is reproducible. Building it yourself is the recommended way.

How it was built: I’m a solo dev, and I wrote this with heavy help from an AI coding assistant (Claude). I review, test and flash everything on real hardware myself, and the signing code has two independent implementations (C on the device, Rust on the host) cross-checked against shared test vectors generated from librustzcash. That still doesn’t replace a review by someone who knows this cryptography. If that’s you, I’d really value your eyes on it, especially on the PCZT checks and the PIN vault.

Docs (setup, security and limits, diagrams, release verification) are coming soon at https://zcash.leekwallet.xyz/docs

Trust assumptions

To be explicit about what you’re trusting when you sign with LeekWallet today:

  1. You trust the firmware: open source, a reproducible build, not audited.
  2. You trust the ESP32-S3 and its toolchain (ESP-IDF). There is no secure element yet.
  3. You trust the board’s screen to show what the firmware decoded. The board rebuilds and checks the PCZT itself instead of trusting the companion, but it’s still a single screen.
  4. You trust librustzcash, on the companion side, for syncing, building and proving.
  5. You trust your lightwalletd server for the chain data (balances and history), but not for what you sign.
  6. You trust whoever had physical access to the board, since its flash isn’t encrypted (see above).

Vision (not a roadmap)

At ZCon7 I showed the board to a lot of community members. Thank you to everyone who gave it their time, held it and asked hard questions. Some of those conversations were about possible integrations with Zodl, Zingo and Zillions. I’ve also showcased the Ledger Nano X attack as you can see here: 0xoucan.eth 🥷 The DIY HardwareWallet Gangsta LFG on X: "Supply-chain attacks against hardware wallets aren't going away. And that's something the entire crypto industry needs to take seriously. Following the recent Ledger Nano X hardware implant research brought to public attention by @MagicalTu… / X

Those conversations also made one thing clear to me: LeekWallet isn’t ready yet in terms of standards. Today each wallet would have to integrate with my own protocol. So rather than promising dates, here is the direction, starting with the most concrete:

  • Release the docs site. Setup, the security model, the protocol, diagrams, and how to verify releases. Almost done.
  • A LeekWallet SDK. A clean, documented way for any Zcash wallet to talk to the board, built on standard communication formats: PCZT (ZIP 374) in and signatures out, over USB, Bluetooth and SD. The goal is for integrating LeekWallet to be a small, reviewable change instead of a fork.
  • An independent transaction checker. In the spirit of safe-tx-hashes-util for Safe multisigs: an offline tool that decodes a PCZT on a separate machine and prints the network, recipients, amounts, fee and memo. It also prints a short review code that the board shows too. You check the board and the tool against each other, so you don’t depend on a single screen or a single implementation.
  • Optional native tools, on and off the board: passphrase support across the companion apps, and research into multisig. For shielded Zcash that means FROST threshold signatures rather than script multisig.
  • Secure element research. I have Infineon OPTIGA Trust M chips on the bench for study and testing: keeping the PIN check and key storage in a secure element instead of plain flash. This is research, not a feature yet.
  • Mid to long term: a LeekWallet OS. One board, one BIP39 seed, with chains and tokens as optional add-ons or plugins: Zcash first, Bitcoin and EVM chains as modules you choose to install. Since the seed is standard BIP39, one device could hold several chains. This could bring holders of other coins over to Zcash, and give Zcash users one place to hold their other assets.

The Zcash firmware stays Zcash only and minimal. Anything multi-chain would be a separate, opt-in build, never extra code inside the signer you use for ZEC.

FAQ

Why build your own hardware wallet when Keystone and others exist?

To have an open, cheap Zcash signer that anyone can build and read end to end: about $25 of parts, every line of firmware and every companion app open source. It’s also a learning platform for PCZT-based signing. It is not a replacement for an audited commercial device holding serious funds.

Does the seed ever leave the board?

No. The companion gets only the viewing key, and the board returns only signatures. What physical access can read is covered in “Please read before you use it” above.

Why isn't flash encryption on?

On the ESP32-S3, enabling flash encryption and secure boot burns eFuses permanently, and a mistake can brick the board or lock it to one key. While the firmware is changing this fast, I chose not to burn them. Until then, the stateless and SD-card modes are the answer to physical theft.

Why PBKDF2 and not Argon2id?

The PIN vault is inherited from the original LeekWallet firmware, and the iteration count is limited by the ESP32’s speed: one unlock already takes about 1.5 s. A memory-hard KDF is the better choice. With 8 MB of PSRAM, Argon2id is feasible, and it’s on my list. Until then, with no flash encryption, a short PIN is not a strong secret against someone holding the board, so I don’t present it as one.

Which pools and transaction types?

Ironwood (NU6.3) and Orchard spends, plus transparent P2PKH inputs (for shielding), to shielded or transparent outputs, with memos. Multiple accounts on the board are not done yet.

Does it work with Zodl / Zashi?

Through our fork of Zodl, which adds LeekWallet as a hardware signer (sideloaded APKs, Android only, arm64). I’d like to offer this upstream once it has a proper account type.

Can I use it fully air-gapped?

Yes, with the SD card: the PCZT goes to the board on the card and the signatures come back the same way, with no cable or radio. QR signing works in the lab but is still research.

What hardware do I need?

An ESP32-S3-N16R8 “CAM” board, a 1.5" SH1107 128×128 I2C OLED, an EC11 rotary encoder and one push button. The wiring is in the repo, and the website has a flasher (Chrome or Edge) that runs only after the verify step.

Multisig?

Not yet. For shielded (Orchard) funds, the path is FROST threshold signatures, where several boards each hold a share of a key. It’s on the research list, not something LeekWallet does today.

Will it support Bitcoin or EVM chains?

Not in the Zcash firmware: that stays Zcash only. A multi-chain LeekWallet OS with optional plugins is a mid- to long-term idea (see Vision). It would be a separate, opt-in build.

Is there a secure element?

Not today. I’m studying Infineon OPTIGA Trust M chips as a way to protect the PIN and keys against someone who has the board in hand. Until that ships, the honest answer is that the board can be read by anyone who has it.

Is it audited? Is there a bug bounty?

Not audited, and no bounty yet. Issues and reviews on GitHub are very welcome. Security findings can go to me privately on X (@0xOucan).

Thanks for reading. Questions, criticism and “this is wrong because…” are all welcome.

X: @gmLeekWallet · @0xOucan

10 Likes

I like the idea of a cold wallet that you can build yourself (and will hopefully support multisig or MPC at some point). Prefab single-signer cold wallets always scared me off, and unfortunately my fears have been reinforced by recent news articles. It’s incredible how successful the attackers have been with such obvious tampering. Like people didn’t even unscrew it for inspection.

Beware that your weak point is “the website has a flasher”. The permaweb with an ArNS domain can harden you against a wide variety of attacks. Context is provided in my reply to the “Zafe multisig is launched” thread (sorry, not allowed to post links). No matter what you expect, you’ll have to update the flasher executable from time to time, for example, to improve boot block recovery, support new flash parts, and so forth.

It sounds like you’re aware of reproducible builds, which is good, but also assume that someone has attacked your firmware supply chain every single time you try to build a new version from some random Github repos.

Assume DNS is lying to you most of the time.

I can’t suggest how you might prove that a supply chain attack hasn’t happened but at least you’re aware. You could start by diffing from source code trees that you download previously. Or offline AI could at least do some of that for you. Pros and cons.

2 Likes

PKI could be used. Sign builds with a trusted key(s)

2 Likes

Good point. Ideally, every dev should follow that advice. The problem is that the supply chain is actually vast, even for a simple app these days, and most of it is neither signed nor reviewed with advanced AI. Even when it is, devs don’t necessarily respond to vuln reports. I wish I had a better solution. I don’t. I’m just trying to illustrate how deep the rabbit hole actually is.

2 Likes

OP, there are some other hazards you should be aware of but I’m not going to post them here. DM me if you want the details. I will connect spammers directly to my AI.

2 Likes

Thank you, I really appreciate you taking the time to write all this. The tampering stories are a big part of why I like the DIY approach: you buy generic parts (an ESP32-S3 board, a screen, a knob) from any shop, and no seller knows they’re shipping a wallet, so there’s no “wallet in the mail” to intercept. You still have to trust those parts, which is why a secure element is on my research list.

Multisig is on that list too: for shielded funds that means FROST, with several boards each holding a share of the key. LeekWallet doesn’t do it today, but it’s a big part of why a cheap, open board interests me: several signers cost about $25 each.

Agreed, and that’s a fair point. The flasher exists to make the first try easy for people who have never built firmware. It isn’t meant to be the trusted path. Here’s what it does today:

  • Every release ships a SHA256SUMS file signed with my SSH key (SHA256SUMS.sig), plus signed git tags.
  • The website only hosts firmware after that signature has been verified against my key and every image matches its signed hash. A bad signature stops the deploy before any binary is fetched.
  • The Download buttons don’t download directly. They first open a verify step that recommends building from source, and shows the ssh-keygen -Y verify and sha256sum -c commands to check a download yourself.

But you’re right that none of this helps if the website itself, or the DNS pointing to it, is what’s compromised: a lying site can serve a lying flasher. That’s why the key is also published somewhere the website doesn’t control. The release signing key is the same ed25519 key on my GitHub profile (github.com/0xOucan.keys), so you can check a release without trusting zcash.leekwallet.xyz at all.

In the ideal world, everyone builds the firmware themselves from source. The build is reproducible, so two clean builds of the same tag are byte-identical. If your build matches the published hashes, the release is the source you read. If it doesn’t match, something is wrong (or your toolchain differs; the build info is in the release).

Thanks also for the permaweb/ArNS pointer. I’ll read your reply in the Zafe thread.

Yes, that’s the approach today, with a single key (mine). Moving to more than one signer, for example independent people rebuilding and co-signing the hashes, would be the natural next step once there’s anyone else building it.

Fully agree, and I don’t have a full answer either. Signatures and reproducible builds prove the binary matches the source. They don’t prove the source, ESP-IDF or the Rust crates underneath are clean. What I try to do is pin exact versions and lockfiles, keep dependencies small, and be honest that it isn’t audited.

Yes please, I’ll send you a DM. Thank you!

2 Likes

@zeckzodel I just replied your message, thank you lot!

1 Like

I think this hardware wallet from 0xOucan is very relevant, especially in light of recent events involving Keystone and Ledger. 0xOucan is a crypto OG in Mexico, and most of his contributions have been within the Ethereum ecosystem, building communities and winning several hackathons.

I had the opportunity to spend a lot of time with him at Zcon7, and I believe I was the first person to see his demo on how to hack a Ledger.

I’m very pleased to see him join the Zcash community, and we’re already planning to organize some great events in Mexico for next year.

I hope we all give him a warm welcome.

3 Likes

Thanks for the support! Lots of stuff comming for LeekWallet!

1 Like

here you have the updates regarding this matter

Update: LeekWallet now signs fully air-gapped over QR from Zingo.

Zingo shows the transaction as an animated QR code, the board’s camera reads it, you review and approve it on the board, and the board shows its signature as a QR code that Zingo scans back. Neither a cable nor Bluetooth is involved. USB and Bluetooth still work, so you pick the link each time you sign.

Zingo. This builds on Zingo Labs’ PCZT signing work (zingolib PR #3147 by Dorian), with LeekWallet added through the LeekWallet SDK. It’s our fork for the Zingo team to review, not an official Zingo release yet:

In the app you choose USB, Bluetooth or QR when you send. zingo-cli has the same three: pczt sign_usb, pczt sign_ble and pczt sign_qr, which shows the QR in the terminal or as an HTML page and reads the reply with a webcam or pasted text. The app can also show a receive address on the board, or have the board check it by QR.

Where it works

Wallet USB Bluetooth QR
Zingo (Android, our fork) :white_check_mark: :white_check_mark: :white_check_mark:
zingo-cli (our fork) :white_check_mark: :white_check_mark: :white_check_mark:
Zodl (our LeekWallet fork) :white_check_mark: :white_check_mark: :white_check_mark:
LeekWallet companion (Android and desktop) :white_check_mark: :white_check_mark: :white_check_mark:
zecz (command line) :white_check_mark: :white_check_mark: :white_check_mark:
LeekWallet Chrome extension :white_check_mark: :white_check_mark: :white_check_mark:

The Zodl fork (MIT) also imports the View key by QR: GitHub - 0xOucan/leekwallet-zcash-android: LeekWallet Zcash for Android: Zodl fork with LeekWallet hardware signing over USB, Bluetooth and QR · GitHub

Some testnet sends signed this way:

  • First QR send, both ways: 8f3b9264fddce48f6989396336741512e3fdafe66870826c0ceeb63725e73c7d
  • First QR send from a phone: cf3632647a8bb78a00e28150e2f49c7e69ac4b5cea1ea1f02f6790bba428ce21
  • First signature from Zingo (zingo-cli over USB): 43e42f8cc2e68f332ad36183d6c0f0b412f37b2f35bc7ff7b21a533f59cb9378

SDK. Every wallet above goes through the LeekWallet SDK (Rust, with Kotlin and Swift bindings), so a wallet adds all three links with one integration:

  • USB and Bluetooth through the app’s own connection, with the 6-digit pairing code on every connection.
  • QrEncoder and QrScanner for the animated request (ur:leek-pczt) and the signature reply (ur:leek-zsig).
  • qr_display_hints(): code size and speed for a phone or a big screen, brightness steps, and the tips to show the user.
  • Receive address checks: over USB or Bluetooth the board shows the address; air-gapped, the board’s new Check address scans the wallet’s Receive QR and tells you whether the address is its own, with the account and address number.

Board.

  • Faster QR reading, and 2x zoom at power-up.
  • Automatic exposure that steps darker or brighter when it finds a code but can’t read it.
  • The View key as a QR code.

Tips for signing from a phone: use Big codes, hold the board at 3x zoom about 30 cm away, turn on your phone’s anti-flicker (DC dimming) setting if it has an OLED screen, and change the brightness on the QR page if the board finds the code but doesn’t read it.

The video’s narration is an AI rendition of my own voice.

Code: GitHub - 0xOucan/leekwallet-zcash: DIY Zcash hardware wallet on ESP32-S3: PCZT signer for Ironwood/Orchard, USB/BLE/QR/SD, with Android and CLI companions · GitHub (Apache-2.0). LeekWallet is not audited, so please use small amounts. Feedback from the Zingo team is very welcome.

2 Likes

Is an ESP32 the only supported board at this time? What about other Espressif boards?

At this moment yes only esp32s3
The idea is to create an OS for multiple and different ESP32 variants raspberry pi and others.
At this moment the main focus is Zcash integrations and adoption.
Research. We have Optiga and Atecc sec chips in the lab.
There is no official roadmap but we are shipping :saluting_face:

1 Like

Lmao you and other colleague comment made me deep dive and rabbit hole into the screen and cam ready boards. Expect much development in the next month :saluting_face:

And the same in Zodl: our Zodl fork signs fully air-gapped over QR too.

The fork shows the transaction as an animated QR code, the board reads it with its camera, you check and approve it on the board, and Zodl scans the board’s signature back. You pick the link for each send: QR, USB or Bluetooth.

Setting it up needs no cable either. On the board, Main menu → View key asks before showing anything, then shows the View key as an animated QR. Zodl scans it and adds the account, with the keys still only on the board. It’s one way: nothing is paired by QR, and USB and Bluetooth still ask for the 6-digit code on every connection.

This is our fork, not an official Zodl release, and it’s here for the Zodl team to look at if it’s useful. LeekWallet is not audited, so small amounts only for now. Feedback is very welcome.