Zakura Common: High Performance Zcash Cryptography

Technical drawing of the zakura flower inked on gridded paper: five outlined petals over construction circles and dashed radial guides, golden-ratio dimension lines labeled 61.8, 100, and 161.8, and a pink five-spoke stamen, with the zakura brush wordmark above the word COMMON to the right.Blueprint of the zakura flower in white line art on a dark gridded field: five outlined petals over construction circles and dashed radial guides, golden-ratio dimension lines labeled 61.8, 100, and 161.8, and a pink five-spoke stamen, with the zakura brush wordmark above the word COMMON to the right.

Our team is excited to release Zakura Common, a large collection of cryptography and protocol libraries for the Zcash ecosystem. These libraries are being developed to accelerate our full node Zakura, and to improve wallet performance for everyday users.

The optimizations in this release are among the most significant in Zcash's history. Our benchmark hardware reports:

  • Mobile proof generation is more than 14x faster. (Desktop is more than 5x faster.)
  • Sinsemilla hashing is more than 21x faster.
  • Trial decryption is more than 1.5x faster.
  • zk-SNARK verification is between 4x and 8x faster.

In discussions about scaling Zcash we often mention goals like sub-second confirmation times. But all users today spend over three seconds just waiting for their wallets to create a transaction. Zakura Common's highly optimized cryptography allows a user to instead wait less than 200ms in many cases — practically imperceptible.

Wallets using this new stack will sync much faster. Full nodes running Zakura additionally benefit from reduced orphan rates and faster transaction propagation; our network can already handle the 25-second block times proposed for NU7, but with these optimizations we can go even further.

None of our improvements require a network upgrade and all of them are publicly available today, under the standard MIT / Apache 2.0 dual license. Zakura has completely switched to this new stack in its upcoming 1.3.0 release, and Tachyon has too. We'll be writing about this in separate announcements.

Zakura Common 1.0

The root of our work is contained in the Zakura Common monorepo, zakura-core/common, which contains modified forks of librustzcash and several other crates as well.

In some cases, our performance improvements derive from well-known techniques in the broader cryptography and compiler worlds, but in others they stem from novel ideas our team has developed just for Zcash.

These results aren't all from one big optimization. Each headline component did substantially improve. But Amdahl's law is real. Once you optimize one component, some other serial process becomes a bottleneck. Much of our effort was spent on constant factor improvements to things that would normally be considered asymptotically efficient.

zakura-core/wallet-libraries

We are also developing a separate zakura-core/wallet-libraries repository that contains Rust crates useful for shielded wallets or other integrations. Zakura, being a full node, does not depend on these libraries.

These libraries integrate directly with our Zakura Common stack, and thus inherit many of the performance benefits we've discussed. Longer term, they will contain our PIR work.

Next Steps

Zakura Common speeds up full nodes and wallets significantly compared to the legacy librustzcash stack. We're inviting wallets to switch to our cryptography libraries so that they can enjoy the performance benefits on today's Zcash network.

As mentioned, Zakura's 1.3.0 release is forthcoming and will switch to Zakura Common. We'll be blogging about that soon.