chrischinchilla

3 min read - Posted 14 Jan 19

Minimum Viable Plasma - The Kyokan Implementation

The issues around scaling Ethereum to high-throughput production use cases are well known. There are many solutions to this problem in progress, from state channels to side chains, but an additional complexity is safely transferring transactions between the Ethereum mainchain and these other locations.

Plasma is a framework proposed by Joseph Poon and Vitalik Buterin to address this, and a handful of projects rapidly emerged to try and implement this proposal.

Following this was a post from Vitalik outlining a minimal viable plasma (MVP) implementation that helped developers start working on a handful of programming language implementations of MVP.

Plasma MVP by Kyokan is one of these implementations, written in Golang. For now, the project is focusing purely on payment use cases, and they may move onto generalized smart contracts in the future.

As the project is in development, you may experience problems installing and running it. You can find full installation instructions in the documentation, but at time of writing here's how you install on a Debian-based Linux distribution:

sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 21052518
echo "deb <https://dl.bintray.com/kyokan/oss-deb> any main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install plasma

Next deploy the Plasma smart contract to an Ethereum node using Truffle (or another method you prefer):

cd <KYOKAN_PLASMA_DIR>/contracts/
PRIVATE_KEY=<PRIVATE_KEY_HEX> HOST=<ETHEREUM_NODE> trufle migrate --network <NETWORK_NAME>

A plasma chain has of one root node that receives transactions (mints new blocks every 500 milliseconds), and running the plasma start command packages them into blocks to pass to the Ethereum blockchain. The creator of a Dapp typically runs this node, but more hosted options are likely to emerge in the future.

You configure the Plasma node with command line arguments, or a YAML file and options include database location (LevelDB), keys, addresses, and ports. You can find full details in the documentation. For example, the default which you can find in /etc/plasma/config.yaml:

db: "./database"
node-url: "http://localhost:9545"
contract-addr: "<CONTRACT_ADDRESS>"
private-key: "<PRIVATE_KEY>"

Pass any modified files with the --config parameter:

plasma --config ./local-config.yaml start

A plasma chain also contains any number of validator nodes responsible for verifying blocks that the root node emits and passing transactions from Dapp users to the root node. You start these nodes with the plasma validate command as processes part of the Dapp, or by 3rd parties for ultimate decentralized governance. The two node types communicate by a standard gRPC API.

Kyokan's Plasma MVP is planning to integrate the Plasma MVP smart contracts from Fourth State once they have completed an audit by Authio. They also plan to start work on language SDKs in 2019, making it easier and more secure to integrate into your Dapps. Keep an eye on progress in the Plasma MVP GitHub repository.

Created with Sketch.Content is"CC-BY-SA 4.0" licensed
Article On-chain
Article Author

Chris Ward

Technical Content Lead

64

11

5

0 Comments
Related Articles
Plasma Group’s Plasma Spec

TLDR: We created a spec for a Plasma Cash variant and implemented it in Node.js and Vyper. This document covers the design specification, providing references to the implementation along the way. Our code supports deploying a new chain to testnet, an on-chain registry of other plasma chains and their block explorers, and transacting via a command-line wallet. Introduction The vision of a network of blockchains as a scalability solution has been spreading rapidly. A multi-chain approach for paral

Plasma Group

22 Apr 19

Plasma Roundup: From MVP to Mainnet

Ethereum second layer scaling technology has come a long way in a short period of time. Second layer solutions, innovations beyond the layer one protocol level, include State Channels, Side Chains, and Plasma. Taken together, layer two technologies present a wide scope of possibility for scaling the Ethereum blockchain. In August 2017, Plasma creators Joseph Poon and Vitalik Buterin proposed this framework for scaling Ethereum transaction throughput to a significant amount of state updates per s

chrisspannos
Chris Spannos

09 Apr 19