{"id":13692378,"url":"https://github.com/omgnetwork/plasma-mvp","last_synced_at":"2025-05-02T19:31:57.286Z","repository":{"id":48746389,"uuid":"117854795","full_name":"omgnetwork/plasma-mvp","owner":"omgnetwork","description":"OmiseGO's research implementation of Minimal Viable Plasma","archived":true,"fork":false,"pushed_at":"2019-03-04T13:24:28.000Z","size":403,"stargazers_count":561,"open_issues_count":11,"forks_count":159,"subscribers_count":95,"default_branch":"master","last_synced_at":"2025-03-13T07:02:20.267Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omgnetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-17T15:28:47.000Z","updated_at":"2024-08-21T09:39:18.000Z","dependencies_parsed_at":"2022-09-12T14:26:24.349Z","dependency_job_id":null,"html_url":"https://github.com/omgnetwork/plasma-mvp","commit_stats":null,"previous_names":["omisego/plasma-mvp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omgnetwork%2Fplasma-mvp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omgnetwork%2Fplasma-mvp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omgnetwork%2Fplasma-mvp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omgnetwork%2Fplasma-mvp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omgnetwork","download_url":"https://codeload.github.com/omgnetwork/plasma-mvp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252095306,"owners_count":21693898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T17:00:57.287Z","updated_at":"2025-05-02T19:31:56.941Z","avatar_url":"https://github.com/omgnetwork.png","language":"Python","funding_links":[],"categories":["Implementations"],"sub_categories":["Plasma MVP and MoreVP"],"readme":"# Notice!\nThis is an old research repo. No active work is being done here. Efforts in the direction of production-ready MVP plasma chain (MoreVP, ERC20, audits) are in https://github.com/omisego/plasma-contracts.\n\n# Plasma MVP\n\nWe're implementing [Minimum Viable Plasma](https://ethresear.ch/t/minimal-viable-plasma/426). This repository represents a work in progress and will undergo large-scale modifications as requirements change.\n\n## Overview\n\nPlasma MVP is split into four main parts: `root_chain`, `child_chain`, `client`, and `cli`. Below is an overview of each sub-project.\n\n### root_chain\n\n`root_chain` represents the Plasma contract to be deployed to the root blockchain. In our case, this contract is written in Solidity and is designed to be deployed to Ethereum. `root_chain` also includes a compilation/deployment script.\n\n`RootChain.sol` is based off of the Plasma design specified in [Minimum Viable Plasma](https://ethresear.ch/t/minimal-viable-plasma/426). Currently, this contract allows a single authority to publish child chain blocks to the root chain. This is *not* a permanent design and is intended to simplify development of more critical components in the short term.\n\n### child_chain\n\n`child_chain` is a Python implementation of a Plasma MVP child chain client. It's useful to think of `child_chain` as analogous to [Parity](https://www.parity.io) or [Geth](https://geth.ethereum.org). This component manages a store of `Blocks` and `Transactions` that are updated when events are fired in the root contract.\n\n`child_chain` also contains an RPC server that enables client interactions. By default, this server runs on port `8546`.\n\n### client\n\n`client` is a simple Python wrapper of the RPC API exposed by `child_chain`, similar to `Web3.py` for Ethereum. You can use this client to write Python applications that interact with this Plasma chain.\n\n### cli\n\n`cli` is a simple Python application that uses `client` to interact with `child_chain`, via the command line. A detailed documentation of `cli` is available [here](#cli-documentation).\n\n## Getting Started\n\n### Dependencies\n\nThis project has a few pre-installation dependencies.\n\n#### [Solidity ^0.5.0](https://solidity.readthedocs.io/en/latest/installing-solidity.html)\n\nMac:\n```sh\nbrew update\nbrew upgrade\nbrew tap ethereum/ethereum\nbrew install solidity\n```\n\nLinux:\n```sh\nsudo add-apt-repository ppa:ethereum/ethereum\nsudo apt-get update\nsudo apt-get install solc\n```\n\nWindows:\n\nFollow [this guide](https://solidity.readthedocs.io/en/latest/installing-solidity.html#prerequisites-windows)\n\n\n#### [Python 3.2+](https://www.python.org/downloads/)\n\nMac:\n```sh\nbrew install python\n```\n\nLinux:\n```sh\nsudo apt-get install software-properties-common\nsudo add-apt-repository ppa:deadsnakes/ppa\nsudo apt-get update\nsudo apt-get install python3\n```\n\nWindows:\n```sh\nchoco install python\n```\n\n#### [Ganache CLI 6.1.8+](https://github.com/trufflesuite/ganache-cli)\n\n### Installation\n\nNote: we optionally recommend using something like [`virtualenv`](https://pypi.python.org/pypi/virtualenv) in order to create an isolated Python environment:\n\n```\n$ virtualenv env -p python3\n```\n\nFetch and install the project's dependencies with:\n\n```\n$ make\n```\n\n### Testing\n\nBefore you run tests, make sure you have an Ethereum client running and an JSON RPC API exposed on port `8545`. We recommend using `ganache-cli` to accomplish this when running tests. Start it with the command-line argument `-m=\"plasma_mvp\"`.\n\nProject tests can be found in the `tests/` folder. Run tests with:\n\n```\n$ make test\n```\n\nIf you're contributing to this project, make sure you also install [`flake8`](https://pypi.org/project/flake8/) and lint your work:\n\n```\n$ make lint\n```\n\n### Starting Plasma\n\nThe fastest way to start playing with our Plasma MVP is by starting up `ganache-cli`, deploying everything locally, and running our CLI. Full documentation for the CLI is available [here](#cli-documentation).\n\n```bash\n$ ganache-cli -m=plasma_mvp # Start ganache-cli\n$ make root-chain           # Deploy the root chain contract\n$ make child-chain          # Run our child chain and server\n```\n\n## CLI Documentation\n\n`omg` is a simple Plasma CLI that enables interactions with the child chain. Full documentation is provided below.\n\n### `help`\n\n#### Description\n\nShows a list of available commands.\n\n#### Usage\n\n```\n--help\n```\n\n### `deposit`\n\n#### Description\n\nCreates a deposit transaction and submits it to the child chain.\n\n#### Usage\n\n```\ndeposit \u003camount\u003e \u003caddress\u003e\n```\n\n#### Example\n\n```\ndeposit 100 0xfd02EcEE62797e75D86BCff1642EB0844afB28c7\n```\n\n### `sendtx`\n\n#### Description\n\nCreates a transaction and submits it to the child chain.\n\n#### Usage\n\n```\nsendtx \u003cblknum1\u003e \u003ctxindex1\u003e \u003coindex1\u003e \u003cblknum2\u003e \u003ctxindex2\u003e \u003coindex2\u003e \u003ccur12\u003e \u003cnewowner1\u003e \u003camount1\u003e \u003cnewowner2\u003e \u003camount2\u003e \u003ckey1\u003e [\u003ckey2\u003e]\n```\n\n#### Example\n\n```\nsendtx 1 0 0 0 0 0 0x0 0xfd02EcEE62797e75D86BCff1642EB0844afB28c7 50 0x4B3eC6c9dC67079E82152d6D55d8dd96a8e6AA26 45 3bb369fecdc16b93b99514d8ed9c2e87c5824cf4a6a98d2e8e91b7dd0c063304\n```\n\n### `submitblock`\n\n#### Description\n\nSigns and submits the current block to the root contract.\n\n#### Usage\n\n```\nsubmitblock \u003ckey\u003e\n```\n\n#### Example\n\n```\nsubmitblock 3bb369fecdc16b93b99514d8ed9c2e87c5824cf4a6a98d2e8e91b7dd0c063304\n```\n\n### `withdraw`\n\n#### Description\n\nCreates an exit transaction for the given UTXO.\n\n#### Usage\n\n```\nwithdraw \u003cblknum\u003e \u003ctxindex\u003e \u003coindex\u003e \u003ckey1\u003e [\u003ckey2\u003e]\n```\n\n#### Example\n\n```\nwithdraw 1000 0 0 3bb369fecdc16b93b99514d8ed9c2e87c5824cf4a6a98d2e8e91b7dd0c063304\n```\n\n### `withdrawdeposit`\n\n#### Description\n\nWithdraws from a deposit.\n\n#### Usage\n\n```\nwithdrawdeposit \u003cowner\u003e \u003cblknum\u003e \u003camount\u003e\n```\n\n#### Example\n\n```\nwithdrawdeposit 0xfd02EcEE62797e75D86BCff1642EB0844afB28c7 1 100\n```\n\n\n## CLI Example\n\nLet's play around a bit:\n\n1. Deploy the root chain contract and start the child chain as per [Starting Plasma](#starting-plasma).\n\n2. Start by depositing:\n```\nomg deposit 100 0xfd02EcEE62797e75D86BCff1642EB0844afB28c7\n```\n\n3. Send a transaction:\n```\nomg sendtx 1 0 0 0 0 0 0x0 0xfd02EcEE62797e75D86BCff1642EB0844afB28c7 50 0x4B3eC6c9dC67079E82152d6D55d8dd96a8e6AA26 45 3bb369fecdc16b93b99514d8ed9c2e87c5824cf4a6a98d2e8e91b7dd0c063304\n```\n\n4.  Submit the block:\n```\nomg submitblock 3bb369fecdc16b93b99514d8ed9c2e87c5824cf4a6a98d2e8e91b7dd0c063304\n```\n\n5. Withdraw the original deposit (this is a double spend!):\n\n```\nomg withdrawdeposit 0xfd02EcEE62797e75D86BCff1642EB0844afB28c7 1 100\n```\n\nNote: The functionality to challenge double spends from the cli is still being worked on.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomgnetwork%2Fplasma-mvp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomgnetwork%2Fplasma-mvp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomgnetwork%2Fplasma-mvp/lists"}