#practice

Hi all!

Today we will talk about how the Zero Knowledge Proof (ZKP) consensus protocol works.

Vitalik Buterin has repeatedly stated that, in his opinion, this is the most promising technology that will allow crypto-payments to be integrated into everyday life.

Why is that? Let's find out!

Imagine living in a world where any product or service can be paid for with Bitcoin. You came to your favorite coffee shop to buy a vanilla cappuccino, pay in Bitcoin, and the seller, seeing from which wallet the payment came from, can see the total balance of your wallet in a couple of clicks, and if you have several dozen Bitcoins lying there, then one day you may not get home , you get the idea.

The point of blockchains built on the ZKP protocol is that users, validators, nodes, developers, etc. I don’t know who has what balance in their wallet, this information is encrypted.

There are quite a lot of blockchain projects built on this principle: zkSynk, Celo, Zcash, Mina, Polygon supports this technology. We see teams developing their projects based on the ZKP protocol attracting hundreds of millions of dollars in venture capital investment.

In a recent analysis of the IronFish project (https://t.me/block4block/354), we talked about how the team added an additional private key to each user so that they could provide them to regulatory authorities, while outside observers cannot see the value of assets on a specific wallet, unlike public blockchains such as Bitcoin or Ethereum.

The attentive reader might already have a question.

How do the nodes processing transactions come to a general consensus on the truth of them if all information about the state of balances is encrypted, and how do they agree to add a pool of transactions to the block?

It’s not easy to answer this question without getting too boring, so we’ll tell you a fairy tale.

The story about Alice and Ali Baba (interpretation by Block4Block)

Pay attention to the picture. We see a labyrinth in the middle of which there are 2 doors locked with a password. Alice claims to Ali Baba that she knows the password for each of them, but she cannot tell them.

Ali Baba must make sure that Alice is not lying, for this he goes through the second entrance to door number 2. Meanwhile, Alice goes through another entrance to door number 1, opens it, goes to door number 2 and knocks on Ali Baba from the back. So, Ali Baba understands that Alice knows the password to the first door.

Then they change places. Ali Baba goes through the first entrance to door 1, and Alice goes through the second entrance, opens door number 2 and knocks on the first door from the back. So Ali Baba verified the truth of Alice’s knowledge, without gaining access to the door passwords.

This story allows you to roughly imagine how you can prove the truth of any information without revealing its details. Protocols for interaction between nodes allow them to reach a consensus and confirm the truth of the information, while maintaining the privacy of the wallets participating in the transaction.

Zero-knowledge protocols are a work of art in the field of cryptography. By the way, the Zcash team was the first to develop a blockchain based on this technology.