secretchaingirl / enigma-millionaires-problem

Implementation of Yao's Millionaires' Problem using Enigma secret contracts
MIT License
9 stars 1 forks source link
enigma rust-programming-language secret-contracts yao-millionaires

Enigma Millionaires Problem

Yao's Millionaires' Problem

Allows "millionaires" to enter their net worth and see who is the richest without revealing their wealth.

Implementation of the articles that introduce Enigma, the Rust programming language, the process of creating your first Enigma secret contract, and React/Redux front-end, using the latest improvements for writing secret contracts.

Instructions

Install the CLI for the Enigma Protocol Developer Testnet: npm install -g @enigmampc/discovery-cli

  1. git clone https://github.com/lauraweindorf/enigma-millionaires-problem
  2. cd enigma-millionaires-problem
  3. npm install
  4. In another terminal, start : discovery start
  5. Compile the contracts: discovery compile
  6. Migrate: discovery migrate
  7. Run the tests: discovery test

Now you're all set to run the DApp front-end:

  1. cd client
  2. npm install
  3. npm start

For more information on the client front-end, see the discovery-template-dapp repo on GitHub.

NOTE: The DApp uses the Http Web3 provider to connect to the local Ethereum blockchain (Ganache network) configured in truffle.js. An alternative implementation would be to set the Web3 provider to use MetaMask and change the address field from a dropdown to a text field.

More Info

Dependencies

For instructions on how to install and setup the Enigma Developer Testnet see the link above for Getting Started with Enigma: An Intro to Secret Contracts.

Contributors

Resources