LeekWallet Zcash update: an SDK for wallet integrations, docs, a colour screen build and a pre-ZIP

Hi all, LeekWallet Zcash is an open-source DIY hardware wallet for Zcash that you can build for about $25 in parts (introduction thread). It’s experimental and not audited, so use small amounts.

Here’s what has happened since the ZECATHON submission. In short:

  • Docs: live.
  • Colour screen build: ready, with hardware tests in the next few days.
  • SDK: developed, but it still needs testing.
  • Pre-ZIP: open for discussion.
  • Retroactive grant: I’ll apply in the next few days, in its own post.

The repository’s main branch stays as the snapshot the judges review. All new work happens on the zecathon branch, and the docs follow that branch.

What ZCon7 changed

At ZCon7 I showed the board to a lot of people, and the Zodl, Zingo and Zillions app teams approached me about integrating it. Thank you to everyone who held it and asked hard questions.

Those conversations made me realise that without a communication standard, LeekWallet is just hard to integrate into any wallet app, so I decided to make the SDK.

An SDK instead of one integration per app

If every wallet integrates the board its own way, that’s extra work for each wallet team and for LeekWallet, and it multiplies the code that has to be reviewed. With one SDK, a wallet team can add LeekWallet as a signer without learning the wire protocol, there’s one implementation to review, and each new wallet gets easier to add.

It’s also good for both sets of users. LeekWallet users can choose whichever wallet they prefer, and that wallet’s users find out about LeekWallet and can do their own research on it.

  • leek-zcash (Rust):
    • It checks the PCZT before sending it (preflight) and builds what the board needs to show.
    • It signs, then verifies every signature the board returns before applying it.
    • It saves the signed result and its txid before broadcast, so a crash can’t lead to a second transaction for the same approval.
    • It checks that what was mined matches what was signed.
    • Errors have stable codes and recovery hints.
  • leek-zcash-ffi: the same SDK for Kotlin (Android) and Swift (iOS), through UniFFI. The app owns the USB or Bluetooth connection, and progress and cancel are built in. WASM/TypeScript is next.

Where it stands: the SDK is developed but needs testing, and it isn’t in a release. Our Zodl fork, the companion app, the Chrome wallet and zecz-cli already work with the board over the same protocol, but none of them use the SDK yet. Moving them onto it comes next, starting with the Zodl fork.

To be clear, the Zingo and Zillions integrations are conversations so far, and there’s no published code for them. The plan is to fork wallets, integrate the SDK, and offer each team the result to review and merge, or to do it their own way.

A colour screen build

There’s now a second build option: a 240×240 colour screen kit with the knob and Cancel button built in. The firmware builds for it and the wiring is in the docs. It goes into hardware testing in the next few days, and it isn’t in a release until that’s done. The original OLED build stays as it is.

Docs are live

The docs are meant to work for both kinds of reader: someone who just wants to build a board and use it safely, and someone who wants to check how it works or build on it.

  • Getting started: a shopping list for your country (AliExpress, Amazon, Temu, Mercado Libre and eBay), wiring, flashing, and how to verify a release before you trust it. Shopping-list suggestions for your country are welcome.
  • Security and limits: what the board protects against and what it doesn’t.
  • Developers: an integration guide for wallets, build from source, the simulator and the test vectors.
  • Reference: imported straight from the repositories, with the firmware, the protocol, the audits and the SDK.
  • Search runs locally. Pages that come from the development branch say so at the top.

Firmware changes

  • The viewing key now takes a press. Before giving an app the UFVK, the board asks “Share view key?” and shows the account, the network and the pairing code. A yes lasts until that connection ends.
  • A call that only identifies the board. Apps recognise which seed is connected by its fingerprint, without asking for the viewing key every time.
  • The 6-digit pairing code is required on every connection. The board remembers no hosts. A remembered permission is exactly what a malicious host or a Bluetooth attacker would want to reuse.
  • No answer in plaintext. A request that arrived encrypted is never answered in plaintext, even if the session ends while the board is waiting for the user.
  • Duplicate action keys refused. The board refuses a transaction in which two actions share the same rk (Keystone does the same).
  • Safer storage writes: an audit of the SD-card and flash writes, with power cuts simulated after every write.
    • A vault the board can’t read is no longer treated as empty. It now gets a fault screen instead of being overwritten.
    • An interrupted upgrade of the PIN key storage is now safe to repeat after a crash.
  • Secure element, in progress: an Infineon OPTIGA Trust M bring-up, read-only for now.

The new firmware passes the simulator tests (42 suites) and builds for both boards. It hasn’t been tested on the hardware yet; that’s the next step, so it isn’t in a release.

A pre-ZIP for discussion: App Storage Keys

A light wallet that uses a hardware wallet still stores the UFVK and a database with your whole history on the phone or computer. The draft proposes that the signer give each app its own Storage Key to encrypt that data:

  • The key is derived from the seed with ZIP 32 Registered key derivation, from the app’s ID, the network and the account.
  • It’s released only after an OK on the board, so the app keeps only ciphertext.
  • Restoring the seed restores access, so there’s nothing new to back up.

For everyday use, an app can also offer a quick unlock with your fingerprint or phone PIN, guarded by the phone’s security chip (never a PIN checked only in software). It protects a stolen device or a backup. It doesn’t protect against a malicious app while it’s open. A viewing key that has been shared can’t be taken back, so a user who feels watched should move their funds to a new seed.

Discussion is in its own thread: Pre-ZIP: Hardware-wallet App Storage Keys (encrypting a light wallet's data with a key from the signer). Feedback from wallet teams and other hardware-wallet folks is very welcome, especially on whether it should be its own ZIP or part of ZIP 325.

Next

  • Hardware tests of the new firmware, the colour kit and the SDK, then a release.
  • A retroactive grant application in the next few days, in its own post, so the discussion can happen there.
  • The SDK in the Zodl fork through the Kotlin bindings; WASM/TS bindings.
  • Secure element tests on the hardware.
  • Research into anti-exfiltration signing (the random signing nonce is a possible covert channel).
  • A permanent copy of each release’s signed checksums on Arweave, as suggested in the introduction thread.
  • Video tutorials: building the board, flashing and verifying the firmware, and making a first transaction.

Thanks to everyone who has reviewed, asked hard questions and pointed out holes. It has made the project better.

NU7 update for LeekWallet Zcash :onion:

After block 3,543,405 (~02:30 UTC Nov 6), sends from current apps are expected to fail until you update. Your funds are safe. Avoid sending around activation.
New firmware + apps are on the way, with board tests next.

zcash.leekwallet.xyz/docs/releases/known-issues/