We're implementing the Minimum Viable Plasma
This is the MVP Plasma repo for Blockchain @ Berkeley's Plasma team. It currently relies heavily on David Knott's MVP: https://github.com/omisego/plasma-mvp
Proposed Changes:
- Use cosmos-sdk for the child chain implementation, eventually transition to running Tendermint consensus.
- Create reward scheme to incentive fraud proofs from third-party.
- Create fraud proofs for invalid blocks and slash block proposer's stake.
Current TODOs:
- Refactor PrioirityQueue.sol to allow for parallel exit challenges.
- Create reward scheme in RootContract.sol by rewarding successful challenger with exiter's bond.
- Create withdraw method rather than forcing transfers.
- Determine how to aggregate signatures from previous owners in startExit
- Determine how to efficiently prove that block is invalid on-chain.
- Enforce block ordering by proposer before block is sent to smart contract.
Install dependencies with:
make
The MVP requires Solidity 0.4.18.
How to run Plasma MVP:
- Start root chain with:
ganache-cli -m=plasma_mvp
- Deploy contract to the root chain with:
make root-chain
- Start the child chain server with:
make child-chain
- Start the client with:
omg start
Note: Validations need to be added to the child chain as right now it accepts invalid transactions.
Now let's play around a bit:
- We'll start by depositing with:
deposit 100 3bb369fecdc16b93b99514d8ed9c2e87c5824cf4a6a98d2e8e91b7dd0c063304
- Then we'll send a tx with:
send_tx 1 0 0 0 0 0 0xfd02ecee62797e75d86bcff1642eb0844afb28c7 50 0x4b3ec6c9dc67079e82152d6d55d8dd96a8e6aa26 45 5 3bb369fecdc16b93b99514d8ed9c2e87c5824cf4a6a98d2e8e91b7dd0c063304
- Next we'll submit the block with:
submit_block 3bb369fecdc16b93b99514d8ed9c2e87c5824cf4a6a98d2e8e91b7dd0c063304
- Now we'll withdraw our original deposit, double spending:
withdraw 1 0 0 3bb369fecdc16b93b99514d8ed9c2e87c5824cf4a6a98d2e8e91b7dd0c063304
Note: The functionality to challenge double spends from the cli is still being worked on. - Now we'll sync with the child chain (the deposit and the block we just submitted) locally with:
sync
- And finally we'll close the client with:
ctrl c
To run tests:
``make test``