Home

Awesome

MPC Millionaires

Alice, Bob and Charlie are all millionaires.

They would like to know their total wealth and how they compare to each other over 3 years, without disclosing their actual wealth to each other.

This is a somewhat more elaborated version of the famous Yao's Millionaires' problem which demonstrates the ability of CipherCompute EAP to perform confidential computations mixing arithmetic and non-linear operations.

Hack it !

The code is heavily documented and under MIT license as it is meant to be hacked for your purpose.

It is actually very easy to generalize this code to most confidential Key Performance Indicators comparisons across entities with minor modifications.

Do not hesitate to open issues and PRs to improve the quality of this code and its documentation.

Editing and testing

Once you have cloned this repository locally, edit the code; we recommend that you use the free VSCode and rust-analyzer extension.

To check the validity of your code, simply run cargo build. The build process outputs WASM which is what is actually fed as an intermediate representation to the CipherCompute engine.

To facilitate testing without having to run CipherCompute EAP, 2 facilities are provided via 2 scripts:

Testing inside the CipherCompute MPC engine

  1. Make a change and test it using ./simulate.sh

  2. commit the change to the local git and note the git commit

  3. Then use the git-daemon.sh script to launch a git daemon which exposes this project at git://localhost:9418/mpc_millionaires

From the UI on the CipherCompute EAP version

  1. Create/update a computation using the git URL above and the git commit you want to test
  2. Run the computation from the UI

See the CipherCompute EAP Quick Start Guide on how to use its UI to configure a computation.