Blockchain breakthrough: First live use of ZK-STARKs for scaling
What does the state of the art look like, and how does it work?
This week Ethereum-based decentralised exchange DeversiFi (formerly known as Ethfinex) became the highest throughput decentralised exchange (DEX) on the planet, by a very large margin, live testing at over 9,000 transactions per second. It achieved this by becoming the first DEX to press StarkWare's ZK-STARK technology into live use.
"DeversiFi is the first self-custodial Ethereum exchange to integrate StarkWare’s zero-knowledge batching technology on mainnet," said DeversiFi COO Daniel Yanev. "DeversiFi and StarkWare have tested the technology over the past several months and have measured 9,000 transactions per second."
"9,000+ TPS (transactions per second) capacity is a milestone for self-custodial Ethereum exchanges," he added. "Before now, the fastest 'DEX' would have technically been Loopring at roughly 2,000 TPS. Before Layer 2, DEXs would have been able to process a very small amount of trades, we’re talking maybe 5 a second at best so this really is a significant leap in the industry."
On the whole, this is a notable development for Ethereum and the wider blockchain world, and an excellent example of how quickly the space is developing.
To better understand why, here's some context.
This "Layer 2" refers to Ethereum's (and Bitcoin's) chief scaling strategy. Scaling, in this case, refers to the things a blockchain needs to do if it ever wants to be successfully used by billions of people around the world. A key part of this is the ability to process more transactions faster. In their most basic form, Bitcoin and Ethereum can only handle about 5 - 15 transactions per second. That's simply not enough throughput to do anything very exciting, which is why you need scaling solutions.
Some of these scaling solutions are "on-chain", which refers to things you do to the actual blockchain itself, such as increasing block size the way Bitcoin Cash did when it forked off of Bitcoin.
Others are off-chain, in the form of separate-but-connected systems. "Layer 2" solutions are off-chain. The basic idea of Layer 2 solutions is that you can run transactions across these side networks, which helps reduce bloat on the main network while also being faster and cheaper in its own right.
But for Layer 2 solutions to work, they need to be able to "bridge" with the main blockchain. These bridges are where cryptocurrency and other data can safely move back and forth between the Layer 2 and the main blockchain without it being spied on, lost, stolen or delayed.
Unfortunately, making good, safe bridges is hard. Making good, safe bridges that work without undermining the whole point of blockchain is even harder.
For example, the Bitcoin Lightning Network is a Layer 2 scaling solution for Bitcoin. You can send Bitcoin from the main blockchain to the Lightning Network, and once it's in there it can be moved fast and cheaply. However, the only way it can work is if its users collectively lock up more money than they want to transfer, which undermines the whole point of digital currencies.
Ethereum's Layer 2 projects have also encountered numerous challenges. One of the main ones is that moving data back and forth across the bridges is often extremely slow and unwieldy, which limits the usefulness of Layer 2 solutions, raises security issues and generally detracts from the user experience.
That's where much of blockchain's current cutting edge is, and where things like ZK-STARKs come in.
ZK-STARKs coming in
Zero knowledge proofs (ZKPs) are a cryptographic technique that boil down to being able to prove something without saying what it is.
In the cryptocurrency world it's probably best known for its implementation in Zcash, where zero knowledge proofs let users "prove to the blockchain" that their transaction is all in order, without needing to disclose the details of that transaction to the public blockchain. The end result is private transactions.
While it's most commonly thought of as a privacy-enhancing technique, it has also proved to be a convenient way of bundling up transactions into more convenient packages to better lug them back and forth across the bridges and speed them along networks.
So instead of herding a lot of separate transactions around, you can roll them all up into a convenient ball. Because you rolled them up using a suitable ZKP technique, the contents of the ball can still be reliably proven without anyone knowing what all the individual transactions are.
Voila – you now theoretically have privacy and high throughput on a Layer 2 with safe and robust bridges to the main blockchain.
While zero knowledge proofs have been around since 1989, the idea of using them to improve Ethereum's scalability only started gaining traction in 2018, and a lot of different flavours and sub-flavours of ZKPs have been tried and tested since then, each with different pros and cons.
"ZK-Rollups" for example, play nicely with the main blockchain and are especially good at rolling up transactions into those compact balls, but they're not completely 100% trustless, and may not fare too well in the face of quantum computing. And ZK-SNARKs, which is what Zcash, Loopring and others use, also require a tiny degree of trust which creates a tiny degree of uncertainty around them.
ZK-STARKs change things up by removing the need for trust entirely, introducing quantum-resistance and being especially good at rolling up more complex data. On paper, it appears to be just a holistic and substantial step up from SK-SNARKs. The 9,000 transactions per second attests to that.
ZK-STARKs are now live and well on DeversiFi, representing an overall substantial step in the development of the growing Ethereum ecosystem. They also provide a clearer picture of what the overall ecosystem looks like: the central Ethereum chain and a host of bridges to Layer 2 networks, and even other blockchains, with further developments in underlying technologies such as ZK-STARKS (and SNARKs, SNORKs, AZTEKs and other friendly-yet-strained acronyms) opening the door to more and more new applications.
"There are a lot of features that have been discussed. We are excited to use the StarkWare zero-knowledge proofs to build cross blockchain bridges, for example creating a trustless way for physical Bitcoin to be deposited on DeversiFi," Yanev suggested.
"The DeversiFi roadmap towards a high speed self-custodial exchange was first established in 2017 when the exchange started life as Ethfinex, incubated by Bitfinex. Work started on the current high speed DeversiFi platform in 2019 and DeversiFi spun out from Bitfinex to be a separate entity in 2019. It has been 18 months of solid work to reach mainnet and the response from the Ethereum community has been fantastic so far."
Disclosure: The author holds BNB, BTC at the time of writing.