Giter Site home page Giter Site logo

lorenzb / libsubmarine Goto Github PK

View Code? Open in Web Editor NEW
224.0 8.0 31.0 141 KB

Implementation of a novel practical scheme for submarine commitments

Home Page: https://libsubmarine.org

License: Other

Python 79.07% Solidity 20.93%
ethereum solidity python smartcontracts

libsubmarine's Introduction

LibSubmarine

Build Status

                    | \
                     '.|
     _-   _-    _-  _-||    _-    _-  _-   _-    _-    _-
       _-    _-   - __||___    _-       _-    _-    _-
    _-   _-    _-  |   _   |       _-   _-    _-
      _-    _-    /_) (_) (_\        _-    _-       _-
              _.-'           `-._      ________       _-
        _..--`                   `-..'       .'
    _.-'  o/o                     o/o`-..__.'        ~  ~
 .-'      o|o                     o|o      `.._.  // ~  ~
 `-._     o|o                     o|o        |||<|||~  ~
     `-.__o\o                     o|o       .'-'  \\ ~  ~
LGB       `-.______________________\_...-``'.       ~  ~
                                    `._______'.

A work-in-progress implementation of better submarine sends for Ethereum.

Submarine Steps

  • A User
  • B Commit Address (No Private key)
  • C Libsubmarine
  • D Dapp, Application (e.g Auction, DEX, ICO, etc.)
  • MPT Merkle-Patricia Proof of TxCommit Inclusion on-chain
     TxCommit (1)
A +-------------------> B
+                       +
|                       |   TxUnlock (3)
|                       | (calls unlock)
|                       v
+---------------------> C < - - - - - - - - - - - - -+ D
                         (overload) onSubmarineReveal
    TxReveal (2)           (query) revealedAndUnlocked(submarineId)
 (call reveal + MPT
 + RLP-encoded TxUnlock)
                                                        

Workflow and API Guide

For a more in-depth discussion of what the workflow / steps from a user's perspective for a Submarine transaction looks like, refer to WORKFLOW.md.

For an in-depth discussion of how to incorporate LibSubmarine into your existing application, as well as some software architecture notes, see API.md.


Contract Unit Tests / Examples / Offchain Components

Install Solc (Installation guide)

Use pip to install python dependencies (we recommend using a virtualenv with >= python3.6):

pip3 install -r requirements.txt

Run the tests:

python3 test/test_whateverComponent.py

The tests are particularly useful to see as a reference, since they basically model an end-users interaction with LibSubmarine from start to finish.


Disclaimer

This project is a Work in Progress. It has not undergone a formal security audit from an independent 3rd party (though we would like to have that done).

For a high level discussion around the research of Submarine Sends and some historical implementations, please refer to the blog post: To Sink Frontrunners, Send in the Submarines.


Authors

LibSubmarine's development was started by the Submarines group at the 2018 IC3 Ethereum bootcamp, but is now an open source project. Anyone is encouraged to contribute.

IC3 Ethereum Bootcamp <3 2018

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.