Giter Club home page Giter Club logo

simple-multisig-paxos's Introduction

Forked from: https://github.com/christianlundkvist/simple-multisig

simple-multisig

Introduction

This is Paxos Simple Multisig, based off of the original. It is an Ethereum smart contract designed to be as simple as possible. The original is described further in this medium post. Paxos has extended the contract to add a setOwners feature allowing a quorum of signers to change the entire set of signers. We have a blogpost introducing this system here.

The main idea behind the contract is to pass in a threshold of detached signatures into the execute function and the contract will check the signatures and send off the transaction.

The original audit report by ConsenSys Diligence' can be found here.

The updated audit report by ConsenSys Diligence' can be found here.

Data to be signed

The Simple MultiSig uses the EIP712 standard to package and hash the data to be signed. Each signer will sign a message over the following data fields, which encode the ethereum transaction to execute:

  • address destination - The target address for the transaction
  • uint256 value - The value of the transaction expressed in Wei
  • bytes data - The data of the transaction in hex format
  • uint256 nonce - The nonce for this transaction. Must match the current nonce in the multisig contract.
  • address executor - Specifies which Ethereum address is allowed to call the execute function. It is allowed to specify the zero address as an executor, in which case any address can call the execute function. This field is mainly to address concerns about replay attacks in some edge cases.
  • uint256 gasLimit - Specifies how much gas to pass on to the final call, independently of how much gas is supplied to the transaction calling the execute function. This can be used to constrain what kind of computations can be performed by the target smart contract. If the signers do not need this level of control a very high gasLimit of several million can be used for this data field.

The data to be signed also includes the following EIP712 Domain data that specifies the context of the signed data:

  • Name ("Simple MultiSig")
  • Version ("1")
  • ChainId (Integer marking current chain, e.g. 1 for mainnet)
  • Contract Address (Address of the specific multisig contract instance)
  • Salt (0x251543af6a222378665a76fe38dbceae4871a070b7fdaf5c6c30cf758dc33cc0, unique identifier specific to SimpleMultisig)

Setting Owners

Paxos Simple Multisig adds setOwners functionality to be able to add and remove owners directly using a quorum of signers.

Installation and testing

Install global dependencies:

  • npm install -g truffle
  • npm install -g ganache-cli

To run the tests:

  • Make sure ganache-cli is running in its own terminal window.
  • npm install
  • npm run test

Testing signatures in a browser

If you have the MetaMask browser extension you can open the page browsertest/index.html in your browser and test signing data. The signature will be returned in a (r,s,v) format which can be plugged into the execute function.

simple-multisig-paxos's People

Contributors

coder5876 avatar bmperrea avatar ripper234 avatar maurelian avatar silvia-anderson avatar naterush avatar ethers 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.