Zero Knowledge Proof(ZKP) Explained.

Zero Knowledge Proof(ZKP) Explained.

Have you ever thought of how transactions are verified on the blockchain despite it being an open and transparent system? or how to prevent a malicious user from having access to private transaction data illegally, such as account balances and addresses.? I am certain right now you are thinking of something to do with cryptography, well you are not wrong.

Although guaranteeing transparency and privacy may seem incompatible it is actually possible with a cryptographic technique called Zero Knowledge Proof (ZKP).

What's Zero Knowledge Proof.

Zero Knowledge Proof (ZKP) enables one party to prove the knowledge to another party without conveying any information about the knowledge. We can also define Zero Knowledge Proof as a protocol that enables one party called "prover" to convince another called "verifier" that a statement about a certain data is true without leaking or disclosing any extra information beyond the veracity of the statement.

Authenticity of statements that concern private data is made possible with zero knowledge proof. Here are examples of statements a prover can create proof of:

"This transaction privately transfers an NFT",in this instance no information regarding the initial owner, type of NFT and current owner will be disclosed by the prover.

"I know the private key that correspond to this NFT's sender public key",No information about the private key will be revealed by the proof in this case.

"I know the pre-image of this NFT's hash Value",the proof shows that the prover knows pre-image but would not reveal any information about its value.

ZK-SNARK is one of the most interesting Zero Knowledge Proof based protocols for a blockchain, but what is it and what does it really do?

ZK-SNARK

ZK-SNARK("zero knowledge succinct arguments of knowledge) is one of the most powerful cryptographic technology to come out in the last decade.A zk-SNARK allows you to generate proof that a certain computation output is true while keeping the input of the same computation hidden,this attribute of zk-SNARK is powered by the ZK(Zero Knowledge).

snark.jpg How zk-SNARKS work

A computer programmer/developer provides pre-compiled input (high level circuit definition) which is compiled to low-level descriptions(connected addition and multiplication gates) ,which is then taken by the crypto compiler. The compiler produces a verification key and a proving key. The cryptographic material (proofing key) from the crypto compiler is then used by the prover to produce proof.The verification key will be used by the verifier(Smart contract) to determine whether the proof is valid or not.

Applications

ZK-Proof has two very powerful applications in the blockchain context.

1.Privacy

ZKPs can be applied to enhance the authentication process and enhance privacy of payments. For example as used in ZCash blockchain and Tornado cash.ZKP can potentially be applied in preventing connected vehicles (CV) data in realtime traffic management systems from potential attacks

2.Scalability

ZKPs are applied to blockchains to improve network scalability. For instance the emergence Decentralized Finance (DEFI) has prompted to the need of improvements of Transaction Per Second to numerous blockchain networks,As a result the idea and adoption of ZK-Rollups came up.The ZK-Rollups concept works in a way that mass transfers (deposits and withdrawals) processing are bundled into one transaction and Zero Knowledge is used to verify its correctness and finality. An example of a layer2 blockchain that apply ZK-Rollups is Polygon Hermez which comes with an added benefit of high TPS and low gas cost.