Equilibrium Infra Bulletin #14: zkWASMs, Hardware-Optimised SNARKs, and Overview of Redstone
Equilibrium Labs builds the state-of-the-art of decentralized infrastructure. We are a global team of ~30 people who tackle challenges around security, privacy, and scaling.
This newsletter allows us to share more about what we read, what excites us, and what we think is relevant to the space. In addition, you will get a glimpse into the organization and our culture. You can also find us on Telegram.
If you have 2-mins to spare, we would appreciate feedback through this form!
We are collaborating with Token Terminal, a leading blockchain data provider, to give away 5x three-month subscriptions to Token Terminal Pro for free to the top five referrers. Winners will be announced on the 21st of December, so there is still time to take part!
The Pro subscription unlocks the full range of features in Token Terminal and enables you to better understand the fundamental drivers behind crypto protocols. If this sounds appealing to you - make sure to use the button below and start referring friends and colleagues 👇
Research, Articles and Industry News:
📚 Polygon Labs and NEAR Foundation Collaborate to Build a zkWasm L2 Prover - Recommended by Teemu:
Polygon and NEAR Foundation recently announced that they are collaborating to create a zkWASM prover for the Polygon CDK. To understand why this will help bridge the gap between the Ethereum ecosystem and WASM-based blockchains, let’s break down the different components:
WASM, or WebAssembly, is a framework that provides a way to run code written in multiple languages (C/C++, Rust…) with near native speed, making it possible to run high-performing applications in the browser. Other benefits include sandboxing (can run untrusted programs), deterministic behavior (with a few exceptions), and integration with a lot of existing tooling.
zkWASM is the same as above but with the added benefit of being able to prove the validity of state transitions. Examples of blockchains that use WASM virtual machines as their runtime include NEAR and Polkadot.
Polygon’s CDK (chain development kit) is a toolkit that makes it easy to launch L2 chains on Ethereum. It offers flexibility by allowing builders to tailor the chain to best fit their needs and choose from a range of options within execution/VM, DA, sequencer type, and more. The framework is similar to the OP stack but uses validity proofs rather than optimistic proofs.
zkWASM combines two important themes - making it easier to build applications on blockchains (developers can use familiar programming languages rather than being restrained to Solidity) and using validity proofs to prove the correct execution of state transitions. However, WASM wasn’t designed with zero-knowledge cryptography in mind, which means that the overhead with proving is quite significant compared to more optimized environments. As an example, we initially considered doing proving for Gevulot in WASM, but the overhead compared to native proving or doing it in a Nanos unikernel was more than 20x, which is why we eventually chose to go down the unikernel route.
Key Takeaway: Polygon embracing the zkWASM and adding it to their CDK gives more options for builders looking to leverage the toolkit and enables existing WASM-based chains to get closer to Ethereum with an L2 solution. While WASM wasn’t built with ZKPs in mind and hence suffers from performance overhead compared to more optimized environments - the tradeoff between useability and performance is worthwhile for some use cases.
📚 Binius: A Hardware-Optimized SNARK - Recommended by Hannes:
The Keccak-256 hash function is used throughout the Ethereum protocol, yet it’s a notorious bottleneck for zk-SNARKs. The main problem stems from a mismatch between the fundamental data types used by computers (mostly 8-bit bytes and 32- or 64-bit words) and those used by today's SNARKs (often computed over 256-bit prime fields). Ulvetanna, a cryptography acceleration team, offers a new approach to SNARK construction with Binius (full paper here).
Previous breakthroughs in performance from teams such as Polygon Zero and RISC Zero have come from moving to smaller fields - on the order of 64- and 32-bits respectively. With Binius, Ulvetanna attempts to extend the advantages of small fields down to the smallest field: the single-bit field. In addition, the Binius construction applies to a whole family of binary fields of power-of-two sizes, known as a tower of binary fields - not only to GF(2).
The paper highlights three main advantages of binary tower field SNARKs:
Lower memory usage and computational cost by maximizing benefits of small fields: Already 50x more efficient than the second best in their benchmark, plonky2, at committing 1-bit elements.
Compatible with standard hash functions: Binary tower field SNARKs can efficiently perform bitwise operations like XOR and logical shifts, which are heavily used throughout SHA-256, Keccak-256, and other symmetric cryptography primitives.
Hardware-friendly implementation: Binary field arithmetic operations rely solely on simple logic gates (eg. XOR) and bit-shifts. This is in contrast to prime fields, which require complex, wide integer multipliers.
Key Takeaway: While the adoption of ZKPs is expanding to several different use cases, we need SNARKs to be fast and cheap to matter in the long run. Ulvetanna, who also builds hardware for ZKP acceleration, proposes a new SNARK called Binius. It’s more hardware-friendly and extends previous benefits achieved by moving to smaller fields, by moving to the smallest possible field - the single-bit field.
📚 Introducing: Redstone (Lattice) - Recommended by Joakim:
Games are high-requirement but low-stakes applications, which makes them ideal for testing and innovating around infrastructure. Fully on-chain games are currently constrained by the performance of the underlying blockchains and the two main costs are storage and execution. Rollups solve the latter by turning execution costs into data storage costs but still face high storage costs. Existing options to reduce costs include using external DA networks (Avail, Celestia, EigenDA…) and Data Availability Committees/DAC (relying on the reputation of a few centralized providers).
Redstone is a new L2 built on the OP stack, which aims to offer a hybrid solution to this problem - a DAC that can be challenged. It’s built by Lattice, which is the same team behind the on-chain game engine MUD. Redstone operates like a traditional optimistic rollup, except that instead of posting the input state to L1, it only posts a data commitment hash which reduces the data published from 120kb to only 32 bytes. While the actual transaction data is stored off-chain, Redstone also comes with a data availability challenge contract on L1 - allowing anyone to permissionlessly challenge if they believe the data hasn’t been stored properly (visualized below). However, Mustafa from Celestia raised a valid concern that data availability challenges with off-chain DA solution doesn't work, due to the fisherman's dilemma. We would need more details on the Redstone implementation to be convinced of the validity of their solution.
Key takeaway: While games require high performance and low cost, they can be a bit more relaxed with security requirements compared to high-value transactions (such as DeFi). Redstone aims to provide a sufficiently secure chain with performance that aims to match the demands of on-chain gaming. However, given the concerns around the fisherman’s dilemma, it’s unclear what the difference between a challengeable DAC and a traditional DAC is in practice.
Personal recommendations from our team:
📚Reading: The Age Of Surveillance Capitalism: Whether we like it or not, our data is being collected, used, and sold in various creative ways. Even though the book came out in 2018, the findings are still surprising (worse than you think), which caused some internal discussion.
🎧Listening: Park Your Car On My Face by Louis Cole: The song is groovy, but the music video is somewhat questionable. See for yourself 🔍
💡Other: A Coder Considers The Waning Days Of The Craft - An exploration of how ChatGPT and other tools have changed the craft of coding, which ended with the conclusion below:
I shouldn’t worry that the era of coding is winding down. Hacking is forever.