pepper-project / pequin

A system for verifying outsourced computations, and applying SNARKs. Simplified release of the main Pepper codebase.
Other
122 stars 46 forks source link

Add prover-knows-factorization zkp example: factors remain private. #37

Closed jimouris closed 5 years ago

jimouris commented 5 years ago

Implementation of another realistic use-case as in PR #27. A prover claims that knows the factors of a big number.

Description:

  1. Verifier sets up the P and V keys: ./pepper_compile_and_setup_V.sh prover_knows_factorization prover_knows_factorization.vkey prover_knows_factorization.pkey

  2. Prover claims that she knows the factors of the big number (located in the exo1 file). Note: exo1 should be executable and placed inside pequin/pepper/bin directory ./pepper_compile_and_setup_P.sh prover_knows_factorization

  3. Verifier generates and provides the number (located in the prover_knows_factorization.inputs file) bin/pepper_verifier_prover_knows_factorization gen_input prover_knows_factorization.inputs

  4. Prover generates a proof (prover_knows_factorization.proof) that he knows the factors bin/pepper_prover_prover_knows_factorization prove prover_knows_factorization.pkey prover_knows_factorization.inputs prover_knows_factorization.outputs prover_knows_factorization.proof

  5. Finally, Verifier checks the computation without ever knowing the factors. bin/pepper_verifier_prover_knows_factorization verify prover_knows_factorization.vkey prover_knows_factorization.inputs prover_knows_factorization.outputs prover_knows_factorization.proof

maxhowald commented 5 years ago

Nice example, thanks! Merged.