Giter Club home page Giter Club logo

supersig's Introduction

SuperSig

sign stuff

Supersig is a multisig written in vyper. It can be used in coordination with the supersig frontend.

The motivation for writing the supersig contract itself is to help avoid monoculture around decentralized tools. Vyper was specifically chosen as most multisig tooling is currently written in Solidity.

At this point in time this repo is a proof of concept. The mechanism design can be improved, and the code has not been closely reviewed. It is unit tested using ApeWorx, and it does work in a very basic sense.

At a high level, Supersig works like this:

  1. You deploy supersig with a list of owners and a minimum number of approvals (can be done via UI)
  2. Someone propose's a proposal
    • a proposal is very simple. It consists of an id, which is a number, and a proposal hash.
    • a proposal hash is a 32 byte commitment to the intended transaction. The commitment is keccak256(target_address . target_calldata . target_transaction_value)
  3. Owners call approve on a proposal ID
  4. Someone executes the proposal, providing the full intended transaction. The proposal only executes if the keccak256 of the provided transaction matches the proposed commitment hash.

The intent of Supersig is to keep all approval and proposal actions on-chain, without revealing the intent of the proposal until it's executed.

Supersig was written as part of the ETHNYC 2022 Hackathon. It uses Apeworx, Vyper, Pokt, and Privy who were among the awesome sponsors of the event.

For an offline, EIP712-based multisig in vyper, also see ricobank/multisig

Setup

Recommend using miniconda

  1. Create a new environment and activate
$> conda create --name supersig python==3.10.4
$> conda activate supersig
  1. Install apeworx
$> (supersig) python -m pip install -U pip
$> (supersig) python -m pip install eth-ape
$> (supersig) ape plugins install vyper
  1. Make sure stuff works
$> ape test
========================================== test session starts ===========================================
platform darwin -- Python 3.10.4, pytest-7.1.2, pluggy-0.13.1
rootdir: /Users/Dan/scontract/supersig
plugins: eth-ape-0.3.3, web3-5.29.2
collected 15 items                                                                                       

tests/test_supersig.py ...............                                                             [100%]

========================================== 15 passed in 19.94s ===========================================

Deploying to Testnet

(assumes you have a wallet with some Testnet eth)

  1. Import the wallet to ape and give it the testnet
$> (supersig) ape accounts import testnet
  1. Create three signer addresses for testing
$> (supersig) ape accounts generate signer1
$> (supersig) ape accounts generate signer2
$> (supersig) ape accounts generate signer3
  1. Run deploy job
$> (supersig) ape run scripts/deploy_testnet.py --network ethereum:rinkeby

supersig's People

Contributors

dmfxyz avatar fubuloubu avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

supersig's Issues

Explore ordering algorithm

Sketch of an idea:

  • have each proposal contain a [parallel] set of proposal hashes that must be executed first (NOTE: "parallel" here means "not a part of the proposal, but committed in parallel to it)
  • Set can be changed at any time, but it resets the approvals
  • When executing, for each hash in the set, iterate backwards through the queue of previously-executed proposals to search for a match
  • If proposal has not been found in queue, revert

This should work even for large size queues because typically, the setting is for usually 10 or less items to clear out the queue. If the number gets too large, you may experience gas exhaustion attacks, but the solution to that is to clear the pending transactions and reset the set of IDs so that it is much smaller and more recent. This also holds for when there is mutual reference between two proposals

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.