blockchain-audit / labs

Our creative space
Other
1 stars 41 forks source link

T22 - Cairo and Starknet #70

Open henry-hz opened 4 months ago

henry-hz commented 4 months ago

Starknet

Lurk

Lean4

Telegram

Solidity

Risc0

Circom

Vitalik Series

Sure! Let's imagine you have a secret, like the location of a hidden treasure. You want to prove to your friend that you know where the treasure is, but you don't want to tell them the actual location because you want to keep it a secret. This is similar to what a "zero-knowledge proof" is.

The Magic Cave Story

The Characters:

The Setup:

Imagine there's a magical cave with two paths, Path A and Path B. The two paths go around a giant rock and meet at a hidden door on the other side of the cave. Only someone who knows the magic password can open the door from either side.

The Plan:

You want to prove to your friend that you know the magic password without actually telling them the password.

The Proof:

  1. Step 1: You go into the cave and choose either Path A or Path B. Your friend waits outside and doesn't see which path you took.
  2. Step 2: After you are inside, your friend comes to the entrance of the cave and shouts which path they want you to come out from (Path A or Path B).
  3. Step 3: If you know the magic password, you can open the door inside the cave and come out from whichever path your friend chooses.
  4. Step 4: You come out from the path your friend shouted. Your friend sees this and gets convinced that you know the password because you could come out from the correct path.

Repeat to Be Sure:

To make absolutely sure you know the password and it's not just a lucky guess, your friend asks you to do this many times. Each time you go into the cave, choose a random path, and then come out from the path your friend shouts. After seeing you come out correctly many times, your friend is convinced that you must know the magic password.

What Happened Here?

This is a fun and simple way to understand how zero-knowledge proofs work! They let someone prove they know something without revealing the actual information.

henry-hz commented 4 months ago

Lurk programs deal with a concept called zero-knowledge proofs. Imagine you want to prove you know something without revealing what it is. Lurk programs let you do this for computations.

Here's the breakdown:

This is the magic of zero-knowledge proofs. You can prove you did a computation with some private data, without showing the data itself!

Here are some benefits of this:

Lurk is a specific programming language designed for this kind of zero-knowledge proofs, especially useful for something called zk-SNARKs (zero-knowledge succinct non-interactive arguments of knowledge). It's a bit technical, but hopefully this explanation gives you a good idea of how Lurk programs and zero-knowledge proofs work together to keep your data secret.

While Lurk programs are designed for specific cryptographic applications, the concept of zero-knowledge proofs with private inputs has broader applications. Here are 5 use cases that reflect the breakdown steps:

  1. Age Verification System:

    • Private Input: Your date of birth.
    • Prover Needs Data: The system proving you're above 18 needs your birthdate.
    • Final Proof Hides Data: It reveals only that you're above a certain age without showing your exact birth year.
  2. Medical Record Sharing:

    • Private Input: Specific medical conditions in your record.
    • Prover Needs Data: You want to prove you have a certain condition for treatment, but not all details.
    • Final Proof Hides Data: The proof shows you have the condition relevant to the treatment without revealing your entire medical history.
  3. Secure Voting System:

    • Private Input: Your vote for a candidate.
    • Prover Needs Data: The system needs to verify your cast vote.
    • Final Proof Hides Data: The proof confirms your participation without revealing who you voted for.
  4. Cryptographic Wallets:

    • Private Input: Your private key to access your cryptocurrency.
    • Prover Needs Data: The system needs to verify you own the funds for a transaction.
    • Final Proof Hides Data: The proof shows you have the necessary funds without revealing your private key.
  5. Cloud Gaming Platform:

    • Private Input: Specifications of your local gaming device.
    • Prover Needs Data: The platform needs to verify your device meets the minimum requirements to run the game.
    • Final Proof Hides Data: The proof shows compatibility without revealing your device's specific configuration.