Giter Site home page Giter Site logo

alvarlaigna / plasma-erc721 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from loomnetwork/plasma-cash

0.0 3.0 0.0 2.29 MB

Initial Release of an ERC721 compatible Plasma Cash Contract & Client

Home Page: https://loomx.io/developers

License: Other

Shell 1.10% JavaScript 25.83% TypeScript 5.66% Makefile 0.40% Go 20.50% Python 37.30% Solidity 9.21%

plasma-erc721's Introduction

Plasma Cash - ERC721 Version

Architecture

Client connects to the Child Chain Service, the Root Chain Plasma Contract and the Root Chain Token Contract

Send tx: Client -> Child Chain Service sendtx -> Child Chain server listens to that request and calls child chain sendtransaction, tx gets added to the block

Child Chain ALWAYS listens for events on the RootChain contract and acts on them accordingly

Installation

  1. In plasma_cash folder follow the README.md
cd plasma_cash
mkvirtualenv erc721plasma --python=/usr/bin/python3.6
pip install -r requirements.txt

On OSX + Homebrew (may need this)

source /usr/local/bin/virtualenvwrapper.sh
  1. In server folder follow the README.md
cd server
npm install

Demos

To run demo, execute the integration test script:

./integration_test.sh

Under demos/ there are various scenarios which can occur. You should have initialized both the smart contracts from the server/ directory, and launched a Plasma Chain instance, as described in the corresponding READMEs.

Demo 1

  1. Alice registers and is given coins 1-5
  2. Alice deposits Coin 1, Coin 2, Coin 3 in the plasma chain
  3. 3 Deposit Blocks have been generated in the child chain, each one having 1 UTXO at slots 0,1,2 repsectively
  4. Alice sends a Coin 1 to Bob, adding a transaction to the current block.
  5. Operator calls submitBlock, checkpointing the block merkle root which includes the transaction that gives ownership to charlie. At this point, both the child chain and the root chain, have checkpointed alice's transaction at block number 1000.
  6. Bob transfers the previous UTXO to Charlie and the operator submits that block as well
  7. Charlie tries to exit coin 1, Alice & Bob do not challenge
  8. After challenge period passes, charlie should be able to withdraw his coin

Loom SDK integration

To see the integrations run againist the Loom SDK instead of the prototype server

cd server
npm install
cd .. 

cd loom_test
make clean
make deps
make

cd ..
./go_integration_test.sh

Under the loom_test directory there is all the samples in Go, that directly interact with Loom SDK. Usually the SDK is behind our latest research prototypes. As we only move stable Plasma features into the Loom SDK.

For Developers

Using monkeypatched web3.py 4.2.1 version for ganache issues

https://github.com/jordanjambazov/web3.py/commit/a61b382dd5c11de1102779868d377408c7590839 Also ethereum/web3.py#827

Signing locally

http://web3py.readthedocs.io/en/latest/web3.eth.account.html#prepare-message-for-ecrecover-in-solidity

License info

Please note different directories have different licenses. Please see license file in each folder respectively

  • server directory -> GPLv2 License
  • plasma_cash directory -> GPLv2 License
  • loom_test directory -> Loom Public License License

plasma-erc721's People

Contributors

gakonst avatar aupiff avatar mattkanwisher avatar enlight avatar tstxni97 avatar adyromantika avatar

Watchers

Alvar Laigna avatar James Cloos 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.