Building a Zig foothold in the Zcash ecosystem - starting with address encoding

I’ve been exploring what it would take to bring Zig into the Zcash ecosystem, and wanted to share the first concrete result.

zcash-addr.zig is a pure-Zig library for encoding and decoding all Zcash address types - transparent, Sapling, and Unified Addresses.

The Zcash stack today is almost entirely C++ (zcashd) and Rust (Zebra, librustzcash). That’s a strong foundation, but a Zig presence would complement it in specific ways:

Hardware wallets - Zig targets bare metal with no libc, making it more practical than Rust for constrained signing devices that need Sapling/Orchard key derivation.

WebAssembly - Zig compiles to WASM natively and produces smaller binaries than Rust for equivalent logic, which matters for browser-based wallet tooling.

Cross-language verification - An independent implementation in a different language helps catch spec ambiguities.

C ecosystem bridge — Any C project can link a Zig library directly. This could open Zcash address support to embedded systems, IoT, and legacy codebases without pulling in the full Rust toolchain.

I see this as step one of a longer project. Equihash verification, light client protocol, and eventually Sapling key derivation (Jubjub arithmetic in Zig) are all on the roadmap.

Would love input from the community on what would be most valuable to tackle next, and any protocol-level feedback on the current implementation.

5 Likes

I fixed how the library reads and writes Zcash unified addresses (the long u… / utest… strings). Before, a couple of example addresses were handled with a shortcut instead of really parsing them. That could hide mistakes. Now every address is decoded the normal, rules-based way, the same approach used in Zcash’s official test data. I also made sure the scrambling step (F4Jumble) and the padding at the end of the data match what Zcash’s reference tools expect, and I support future / unknown receiver types so they aren’t dropped. Now unified addresses should behave more like the real Zcash spec.

It was nice to chat to you on discord. I’m sorry that I thought you are somebody vibing with OpenClaw :grin:

As you probably already noticed, the top-level engineering decision in Zcash ecosystem is “oxidize everything” - zcashd is being depreciated.

I will catch you on discord later, watch your DMs :slightly_smiling_face:

1 Like

Thank you.
I’ve sent friend request on discord.