zcash-testnet-wallet
v0.1.1
Published
A working Zcash testnet wallet in one command: npx zcash-testnet-wallet
Maintainers
Readme
A working Zcash testnet wallet in one command.
npx zcash-testnet-walletNo Rust, no 30-minute build. It installs a prebuilt zcash-devtool for your machine, creates a testnet wallet, prints a utest1 address with a QR code, funds it from zcash-faucet, and shows your balance.
A real run on testnet (QR trimmed):
✔ Wallet created ~/.zcash-testnet-wallet/wallet
████ ▄▄▄▄▄ ██▄█▄▀▀█ ▀▄▄█▀ █▀ █▄█▀ ▀▀▄▀▄█▀ ▀▀ ▄▀▄██▀▀██ █ ▄▄▄▄▄ ████
████ █ █ █ ▀▀██▄ █▀▀ ▄█▀▀█▄ ▄█▀▄▀ ▄██▄▀█▄█▀ ▀▄ ██ █ ▄ █ █ █ ████
████ █▄▄▄█ █ █▀▀ ▀ ██▄ ▀▄██ ▄█▄ ▄▄▄ ▄█▀▀▀█▄▄▀ ▀▄▄ ▀ ▄██ █▄▄▄█ ████
… ← scan it with any testnet wallet
Address utest1kqynmm95ru8r2jd86wu08s6jfc4pgxyla8ku8806…0nqfaa
Unified address with Orchard, Sapling and transparent receivers: any testnet wallet can pay it.
Funding it from zcash-faucet…
✔ Proof-of-work done (3,351 hashes in 12.9s, no account needed)
ⓩ 0.1 TAZ on its way to utest1kqynmm95…0nqfaa
txid 2afa604240880eacc631db06235ab1890d4e394621d0457e657bfa4ea7d0b19c
Waiting for the next block (~75s)…
ⓩ Balance 0.1 TAZ (0 TAZ spendable)
New funds become spendable after a few confirmations.🚀 Usage
npx zcash-testnet-wallet # create (or reuse) your wallet, show address + QR, fund it
npx zcash-testnet-wallet balance # sync and show the balance
npx zcash-testnet-wallet send <utest1…> 0.01 --memo "hi"
npx zcash-testnet-wallet viewkey # your viewing key (UFVK)
npx zcash-testnet-wallet watch --ufvk <key> --memo order-42| Option | What it does |
| --- | --- |
| --no-fund | Don't ask the faucet for TAZ |
| --server <s> | lightwalletd to use: zecrocks (default, testnet.zec.rocks) or host:port |
| --dir <path> | Wallet folder (default ~/.zcash-testnet-wallet/wallet) |
| ZCASH_DEVTOOL=/path | Use your own zcash-devtool build instead of downloading one |
Running it again reuses the same wallet and address. It only asks the faucet for coins when the balance is zero.
Prebuilt for: macOS (Apple Silicon + Intel). Linux and Windows are next; until then, build zcash-devtool yourself (cargo install --git https://github.com/zcash/zcash-devtool --features qr zcash-devtool) and set ZCASH_DEVTOOL.
👀 Payment watcher
Give it a viewing key and the memo you expect. It prints one JSON line when the payment is mined, and one more when it is confirmed. Each transaction fires once per stage, even across restarts.
npx zcash-testnet-wallet watch --ufvk uviewtest1… --memo order-42 --confirmations 3
{"stage":"mined","txid":"9f2c…","zat":10000000,"taz":0.1,"memos":["order-42"],"height":4560012,"confirmations":1}
{"stage":"confirmed","txid":"9f2c…","zat":10000000,"taz":0.1,"memos":["order-42"],"height":4560012,"confirmations":3}From code:
import { watchPayments } from "zcash-testnet-wallet/watch";
await watchPayments({
ufvk: process.env.UFVK, // view-only: it can see payments, never spend
memo: "order-42", // omit to see every incoming payment
confirmations: 3,
onPayment: (e) => e.stage === "confirmed" && markPaid(e.txid),
});It keeps a view-only zcash-devtool wallet, syncs it every 30 seconds and reads the wallet's own database. Payments are reported from the block they're mined in; a mempool ("seen") stage is on the roadmap.
🧠 How it works
npx zcash-testnet-wallet
│
├─ 1. npm installs zcash-testnet-wallet-<os>-<cpu>, which holds zcash-devtool for your machine
│ (an optionalDependency, like esbuild does it; npm checks its integrity hash)
├─ 2. zcash-devtool wallet init -n test → seed encrypted to a local age identity
├─ 3. zcash-devtool wallet list-addresses → utest1 address + QR
├─ 4. npx zcash-faucet <address> → 0.1 TAZ
└─ 5. zcash-devtool wallet sync / balance → wait for the next block, show the balanceThe binaries are zcash-devtool built unmodified from a pinned commit (0b3436b) with --features qr. You can rebuild them yourself.
🔒 Safety
- Your keys never leave your machine. The seed is stored encrypted under
~/.zcash-testnet-wallet/wallet. - Back up the seed:
zcash-devtool wallet -w ~/.zcash-testnet-wallet/wallet display-mnemonic --enable -i ~/.zcash-testnet-wallet/wallet/identity.txt(the binary lives inzcash-testnet-wallet-<os>-<cpu>/bin/zcash-devtoolinside the npx cache, or use your own build). - Testnet only. TAZ has no value. Never reuse this seed for real funds.
🛠 Development
npm test # runs the CLI against a stand-in zcash-devtool, plus the watcher logic on a real SQLite fileRelease (all from your own machine, same version everywhere):
sh scripts/publish-platform.sh <path/to/zcash-devtool> darwin arm64 # once per platform binary
npm publish # then the main packageBinaries for other platforms: run the build-only build-binaries workflow, download the artifact, and publish it with the same script.
MIT © anukulpandey · built on zcash-devtool, zec.rocks and zcash-faucet
