banner
hellohappy

hellohappy

一些web3杂碎的学习笔记

Learn about zero-knowledge proofs starting from the "User Login Case" 🔑

Zero-knowledge proof (ZK) is a cryptographic technique that can help us achieve trusted interactions over the internet while protecting privacy.

Case:
Suppose there is a website, and Happy needs to log in to access it.

  1. The first time, Happy uses the traditional user login method, which usually involves password verification. Happy needs to send their password to the website, and then the website matches it with the password stored in its database. In this verification method, the user's password will be sent to the website server, and if the server is attacked, the user's password may be stolen, which is very dangerous.
  2. The second time, Happy uses the "zero-knowledge proof technology". Happy does not need to send their password to the website, but instead generates a proof on their local computer to prove their identity's legitimacy. This proof only needs to include some data related to the user's password, without directly including the user's password. In this way, the user's password will not be exposed during the transmission, thereby improving account security.

Defining Zero-Knowledge Proof
Zero-knowledge proof is an encryption protocol that allows you to prove to others that you possess certain knowledge without revealing specific information to them. In the example of user login, this means that Happy can prove to the website that she is the account owner without revealing the account password to the website. It can enhance security in scenarios such as user credential verification. Zero-knowledge proof is often applied in the field of privacy protection.

Involved Roles
Prover: Happy, who needs to prove to the website that she is the account owner without showing the specific account password.
Verifier: The website, which needs to verify the legitimacy of Happy's identity without knowing the specific account password.

Three Properties of Zero-Knowledge Proof

  1. Completeness:
    If the prover provides a "correct proof" to prove the identity is true, no matter how the verifier (website) checks, they will conclude that the identity is true. This ensures that all "proofs" are correctly verified, ensuring completeness of verification.
  2. Soundness:
    Because the verifier cannot be deceived, they will not accept incorrect proofs as long as the proof is wrong. This ensures the reliability of verification.
  3. Zero-knowledge:
    The prover does not reveal any additional information about the proof during the proof process, only providing the necessary proof information.

Zero-knowledge proof is an important technology for privacy protection and data security in blockchain, and it also has significant implications for improving transaction efficiency and trustworthiness.

Applications of Zero-Knowledge Proof in Blockchain

  • Enhancing Privacy Protection:
    Blockchain is a public database where all transactions are public. By using zero-knowledge proof, we can prove the correctness of certain data without revealing the data itself, protecting the identity and privacy of participants.
  • Reducing Data Storage:
    Using zero-knowledge proof can reduce the need for data storage, as proof data only needs to be stored on the chain. The original data can be stored elsewhere.
  • Improving Processing Speed:
    Zero-knowledge proof technology can increase processing throughput because proof time is usually shorter than actual data transmission, and the recipient does not need to verify the data.

Zero-knowledge proof has been widely applied in the field of blockchain, such as in "anonymous coins" (ZCash), secure data exchange, and access control in smart contracts. It is an important technology for protecting data privacy and ensuring data trustworthiness, and it also has significant implications for the future development of blockchain.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.