What are zero-knowledge proofs?

Rhinolearn: What Are Zero-Knowledge (ZK) Proofs And Why Do We Need Them?

Zero-knowledge, or ZK, proofs enable us to process and validate transactions on rhino.fi with minimal on-chain computation, and thereby bring speed and scalability to our users.

The ZK technology created by our partner, StarkWare, enables us to update users’ balances without posting every single one of their transactions on the blockchain (as would be the case with other technologies). And, crucially, we aren’t required to make any details of the transactions themselves public, which means additional privacy for your transactions.

The innovations engineered by StarkWare and other ZK leaders have the potential to make blockchain technology significantly faster, and spare users the punishing gas fees they find on Ethereum layer 1. However the subject is highly complex and prone to misunderstandings, so in this edition of RhinoLearn we’re going to unpack it as best we can.

How does ZK work?

Let’s say you want to make a sequence of transactions on rhino.fi. For example you may want to swap Bitcoin for Matic using our cross-chain feature. Then you want to buy some USDT and finally sell some Avax. 

A normal ‘proving engine’ (usually a smart contract) would have to prove each of these transactions separately and post an individual record on the main Ethereum blockchain to demonstrate your updated balance, and thus your ability to make the next trade. That not only takes time, it drains your funds because you need to pay gas fees each time the blockchain updates itself.

However, with StarkWare’s ZK technology, we can batch all these transactions together, prove them off-chain, and then provide a single proof of all the activity to the layer 1 Ethereum blockchain. Ethereum performs some quick calculations, and then updates the chain.

So the amount of work we have to do on the congested layer 1, and thus the amount of gas we have to pay, is kept to a minimum.

Of course, this places a considerable burden on the technology itself. On-chain computation provides transparency and proven security, so our off-chain engine needs to be able to deliver the correct results, no matter the pressure it is subjected to.

Not only that, but one of the main USPs of ZK technology is that it can validate a trade or swap without requiring any actual information about the transaction itself. In other words, it doesn’t need to reveal the individual transaction details, or any details about the people making them. This makes the technology extremely private, but it also requires some complex engineering at the back end.

So ZK leaders like StarkWare have created an engine with two separate parts:

  • A prover, which goes through all the transactions, performs rigorous computation to ensure they’re correct, and generates a proof – essentially, a stamp of approval which confirms that all the transactions happened in the right order, and according to the rules of the blockchain.
  • A verifier, an on-chain contract which checks the proof and commits a state change (updates the blockchain with the user’s new balance) if the proof is valid.

And here’s the critical bit: When checking the proofs, the verifier challenges the prover to complete a series of complex calculations, using information that it could not possess unless it had done the correct computation when generating the proofs in the first place.

A good way to think of this is like a maze, which offers a reward for anyone who follows the correct route. A series of doors have been placed along this route, with a number above it. 

Upon completion of the route, the challenger (or the prover) has to provide all the numbers to the maze-master in the correct sequence. By doing so, they prove that they have followed the correct path without revealing any essential details, so their disclosure is useless to anyone who may be listening in. 

It would, theoretically, be possible for the prover to ‘guess’ the correct information, so to minimise this risk, the verifier sets a large number of challenges – so large, in fact, that the chances of inaccuracy are miniscule.

When the engine submits a proof and the on-chain verifier recognises it as valid, there’s no need to then repeat the full calculations on layer 1. Simply by verifying the proof, Ethereum knows we’ve followed the right steps. 

The StarkWare verifier is open source and is deployed to the main Ethereum chain, therefore its correctness can be confirmed by any interested third parties. 

Why is ZKP so important?

The main Ethereum blockchain can currently only process around 15 transactions per second – a tiny fraction of the number required. However, if ZK technology is rolled out on a mass scale, this number could increase to several thousand – and allow Ethereum to solve the scalability challenges that have hampered its adoption up to now.

ZK proofs mean that transactions are faster and cheaper, without losing any of the usual security protections. So users get all the benefits of Ethereum, with none of the downsides.

As time goes by, we expect the technology will improve still further. We’ll see ZK proving systems become even faster, even more flexible, and even easier for developers to build on top of. 

So, in summary:

  • Zero-knowledge proofs provide both scalability and security.
  • Crucially, it allows us to prove transactions without compromising a user’s information.
  • ZKPs are crucial to the scalability offered by rhino.fi and other layer 2 projects.

If you’ve enjoyed getting your teeth into this highly complex topic, check out our post on API trading, which shows you how to make automated trades.

Share this post

Latest Posts

Sign up now!Sign up to our newsletter now to hear all about rhino.fi’s upcoming mystery airdrop, new chain launches and yield opportunities and be in with a chance of winning $5000.
Sign up now!Sign up to our newsletter now to hear all about rhino.fi’s upcoming mystery airdrop, new chain launches and yield opportunities and be in with a chance of winning $5000.
Sign up now!Sign up to our newsletter now to hear all about rhino.fi’s upcoming mystery airdrop, new chain launches and yield opportunities and be in with a chance of winning $5000.
Sign up now!Sign up to our newsletter now to hear all about rhino.fi’s upcoming mystery airdrop, new chain launches and yield opportunities and be in with a chance of winning $5000.
Sign up now!Sign up to our newsletter now to hear all about rhino.fi’s upcoming mystery airdrop, new chain launches and yield opportunities and be in with a chance of winning $5000.
Sign up now!Sign up to our newsletter now to hear all about rhino.fi’s upcoming mystery airdrop, new chain launches and yield opportunities and be in with a chance of winning $5000.

Sign up now

Sign up to our newsletter now to hear all about rhino.fi’s upcoming mystery airdrop, new chain launches and yield opportunities and be in with a chance of winning $5000 (split between 50 wallets).

Earn 19% APY on your stablecoins