As of the time of writing this article, we’re in the final stages of preparing for our test-net release while also actively exploring avenues to optimize gas usage to the fullest extent possible. In this article, our focus will be on zk-SNARKs and their potential applications in enhancing the efficiency of the CH3SS project.
zk-Snarks, a short introduction
Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge (zk-SNARKs) are a type of cryptographic proof system. Let’s delve into zk-SNARKs, breaking down this complex concept into more manageable parts:
- [Argument of knowledge] It allows one party (the prover) to prove to another party (the verifier) that they possess certain information,
- [Zero-knowledge] without revealing the information itself, and
- [Non-interactive] without the need for interaction between the parties.
- [succinct] The size of the proof and complexity of the verifier algorithm is short and independent from proof memory and computational complexities.
zk-SNARKs come with some intriguing features that could have significant implications for the design and implementation of decentralized applications (DApps). These features include:
- Reduced gas consumption due to the relatively compact memory requirements for storing transactions on the Ethereum blockchain (succinctness).
- The ability to conduct privacy-preserving transactions on a public blockchain.
- Uniform gas usage for both transaction proof and verification.
So, where do CH3SS and zk-SNARKs intersect?
While our code optimization efforts are ongoing, our performance analysis indicates that we have surpassed current Ethereum-based argument of knowledge implementations. Currently, there isn’t a specific use case for zero-knowledge proofs in move transactions, but that doesn’t mark the end of our exploration.
- The uniform gas usage property offered by zk-SNARKs could prove highly valuable in our scenario, making it worthwhile to find a way to apply succinct argument of knowledge to store move transactions.
- Further enhancements may be achievable in the realm of zk-SNARKs, making even more concise proofs feasible.
- Consider the potential for utilizing Snarks when batching multiple moves, whether from multiple games or the same game. This presents an opportunity to enhance overall efficiency.
To gauge the efficiency of our current design, we’ve initiated the process of rewriting our logic code on the ZoKrates platform. Based on available zk-SNARK implementations, we anticipate achieving gas usage of around 300,000 per move, which aligns closely with our analysis of our currently implemented code.
In CH3SS, we remain steadfast in our commitment to enhancing the core code through any available means and embracing new technologies as we encounter them.