Git Product home page Git Product logo

toonsegers / verifiable_mpc Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 3.0 378 KB

A scheme that produces a zero-knowledge proof of correctness for an MPC computation. The scheme allows anyone, particularly someone external to the secure computation, to check the correctness of the output, while preserving the privacy properties of the MPC protocol.

License: MIT License

Python 100.00%
mpc secure-multi-party-computation verifiable-mpc cryptography threshold-cryptography snark zero-knowledge-proof zero-knowledge-compiler

verifiable_mpc's Introduction

Build Status

Verifiable MPC

The 'Verifiable MPC' Python package implements the verifiable secure multi-party computation (MPC) scheme.

Verifiable MPC scheme

Electronic voting protocols are prime examples of secure multi-party computation (MPC) that separate input and compute parties. In this setting, there are many input parties that outsource the tallying operation to a set of compute parties. This setting introduces new requirements versus classical MPC protocols where parties are considered both input and compute party. A necessary requirement for voting protocols is public verifiability. While voting protocols specialize in the linear operation of tallying votes, the focus of this work is a scheme that defines publicly verifiable MPC for general arithmetic circuits.

The compute parties produce a zero-knowledge proof of correctness of the computation that allows anyone, particularly someone external to the secure computation, to check the correctness of the output, while preserving the privacy properties of the MPC protocol.

Our scheme addresses the challenge of general arithmetic circuits using recent results in zero-knowledge proof systems, particularly compressed Sigma-protocols [https://eprint.iacr.org/2020/152] by Attema and Cramer (AC20), and Bulletproofs [https://eprint.iacr.org/2017/1066] by Bünz, Bootle, Boneh, Poelstra, Wuille and Maxwell (BBB+17).

Our construction is based on AC20, which reconciles Bulletproofs with Sigma-protocol theory. The construction yields proofs of logarithmic size and does not require a trusted setup, i.e., the setup does not require knowledge of a trapdoor.

For our implementation we use the MPyC framework: [https://github.com/lschoe/].

Please find the write-up of this work in Chapter 8 of this Horizon2020 deliverable (published on June 30, 2021): [https://media.voog.com/0000/0042/1115/files/D3.3%20-%20Revision%20of%20Extended%20Core%20Protocols.pdf]

Note: This implementation is work-in-progress. Expect many bugs/issues.

Installation

This implementation depends on MPyC (version 0.8 or above), which is automatically installed with the following command. In the project root, enter:

pip install .

Or alternatively:

pip install -e .

to overwrite the directory in site-packages with a symbolic link to this local project directory, making local changes directly available.

Preferably, install 'gmpy2' for better performance:

pip install gmpy2   				# for Linux (first running `apt install libmpc-dev` may be necessary)
pip install gmpy2-[version etc].whl	# for Windows, see Gohlke's unofficial binaries [https://www.lfd.uci.edu/~gohlke/pythonlibs/]

Demos

The following demos are included:

  • demo_circuit_builder.py to use standard Python and automatically construct an arithmetic circuit in memory;
  • demo_zkp_*ac20*.py to use the AC20/Bulletproofs proof system to prove correctness of the (MPC) computation;
  • demo_zkp_pynocchio.py and *trinocchio.py to use the Pinocchio zk-SNARK to prove correctness of the (MPC) computation.

Run the demos as follows. From the project root, for example:

python ./demos/demo_zkp_mpc_ac20.py -M3 --elliptic

This runs the prover side of the AC20 ZK-proof system in MPC using three local parties and the Ed25519 elliptic curve group.

Testing

Run the following commands:

python -m unittest discover .

Acknowledgements

This work has received funding from the European Union's Horizon 2020 research and innovation program under grant agreements No 780477 (PRIViLEDGE).

verifiable_mpc's People

Contributors

lschoe avatar marcusmjh avatar toonsegers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

verifiable_mpc's Issues

setup.py contains old package name

In setup.py, the package verifiable_mpc.ac20_circuit_sat is referenced, but this has been renamed to ac20. Installation therefore breaks now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.