Code Monkey home page Code Monkey logo

mpc-signatures's Introduction

Interview Challange

See challenge.md for problem definition.

The solution presented here can be broken into four pieces. First, the devchain/ directory contains the configuration and setup to run a private, local blockchain with three participating nodes. Next a smart contract resides in store-contract/ as a truffle project. This contract is deployed to the local chain. Lindell's blockchain-crypto-mpc library is used to run EDDSA signatures via MPC for two parties. This process is managed by coordinator.sh in coordinator/. Finally, the coordinator will upload the signature to the deployed contract via the web3 client in the chain-bridge/ directory.

Environment

The following build instructions are for Ubuntu 18.04LTS but will likely work with little modification on other debian-based operating systems.

First Run Setup

  1. Ensure submodules have been pulled.
git submodule init
  1. Install crypto library dependencies and build.
make deps
  1. Follow the instructions in devchain/README.md.

  2. Deploy the truffle contract.

cd store-contract
truffle deploy --network devchain
  1. Install node packages for chain-bridge
cd chain-bridge
npm install

Run

./devchain/start.sh
./alice/alice.sh pay carol $5
./bob/bob.sh pay carol $5

Note to stop the devchain run ./devchain/stop.sh

Note: both alice and bob have the ability to fake a signature using an incorrect key shard. Passing the -f flag to the script enables this behavior. Unfortunately the blockchain-crypto-mpc library crashes when doing this.

Verify Signature

./verify/verify.sh pay carol $5

The verify script will pull the signature from the chain and verify with the message passed in as an argument.

mpc-signatures's People

Contributors

james-choncholas avatar

Watchers

 avatar  avatar

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.