Note

If you are new to the blockchain technology, taking our Introduction to Blockchain Technology self-paced course is highly recommended. Also, for a comprehensive coverage of blockchain development in Ethereum or mastering Solidity programming, taking our below self paced courses is highly recommended:

Recap

In our previous article (How to Manage Ethereum State Channel with Raiden), we covered how to manage Ethereum state channel with Raiden.

In this article we learn how Plasma Chains work in Ethereum.

Ethereum side chain with Plasma

As we discussed earlier, one intuitive solution to improve scalability and throughput is to create many small chains. This may sound like a plausible solution, since it may suit business and social needs. Take ourselves for example, as customers or citizens, we buy fruit and vegetables from our local grocery, which might leverage one blockchain to ensure traceability and food safety through the entire supply chain of fresh produce.

At the end of your shopping, you may pay the grocery directly through a P2P payment blockchain. When you apply your mortgage or business loan, you might be able to get your mortgage and loan approved through the mortgage blockchain, and so on. We are more likely to meet all these vertical chains or private chains before we see a gigantic global chain.
However, it creates cross-chain integration and security enforcement issues. This is what Plasma tries to address. It was first proposed in August 2017 by Joseph Poon and Vitalik Buterin. The design idea is to offload transactions to many faster and less crowded side chains, also called Plasma chains. Similar to the state channel approach, a Plasma chain will periodically commit its transactions to the Ethereum root chain.

Security and integrity will be enforced through the root chain. If any suspicion of fraud is detected in the plasma chains, the transactions will be rolled back and Plasma users can exit the plasma chain and move out to the root chain.
The following diagram shows what a Plasma network may look like:

Ethereum blockchain development

Each plasma chain is a blockchain on its own. They are bonded with an Ethereum root chain through a smart contract. The smart contract essentially connects an entire child chain to the root chain, acting as a bridge. Anyone can create a plasma chain, and write a smart contract binding the plasma chain to the root chain.

As the following diagram shows, at each period, the block headers of each block of the plasma chains are submitted to the root chain and recorded in the blocks of the root chain. Transactions in the plasma chains will stay at each plasma chain. The Merkle proof in the block headers will then be used to verify data on the child chain. This allows for tens and thousands of transactions to be processed in many plasma chains in parallel, and also leaves minimal and enough Merkle header information on the root chain to enforce security:

Ethereum blockchain development

 

The root chain will play an arbitrator role, somewhat similar to the federal court system in the United States, where the root chain is the supreme court and the plasma chains are the circuit courts, or the district courts. In the federal court system, once the federal district court has decided a case, the case can be appealed to the circuit court or supreme court for an arbitration.
When a fraud occurs in a plasma chain, whether it is a double spend across the chains or you cash out more than you have in all accounts, anyone can provide a fraud proof to prove the transaction is invalid. If proven to the fraud transactions, the transaction will be rolled back.

Plasma users can exit the child plasma chain and transfer ethers back to the main chain. The original proposals introduce a single validator concept, as the operator for the plasma blockchain, to validate and add transactions to the blocks, and manage the state of the child blockchain.

The idea behind this approach is that security and integrity of the blockchain at the global level is enforced by the root chain, using either PoW or, most likely, a hybrid PoW and PoS  consensus protocol. In the case where the validator of the plasma chain may hold the fund and commit fraudulent activities, anyone can provide a fraud proof against the validator to the root chain.

Once proven to be fraudulent from the validator, the root chain will allow all accounts at the impacted plasma chain to move out to the root chain. This is called a mass exit scenario. In this case, individual accounts will be migrated to the root chain one by one, the invalid transaction will be rolled back, and the validator of the plasma chain will be penalized with the stake it puts in the smart contract. Depending on how many accounts need to be migrated, it may take a while to complete the mass exit.

Although it has been one of the most interesting and active topics in the Ethereum research community, there is no public release of a plasma implementation yet. Instead, a scaled down version of the original proposal, also called a minimal viable plasma, or MVP, was proposed for a simple implementation, which includes a simplified security model and basic operations for exiting plasma chains.

One very interesting aspect of an MVP is the reintroduction of a UTXO model. As we discussed in the last two chapters, one key difference in Ethereum is to move away from Bitcoin’s UTXO model to a more defined account model, where account balance is the state object maintained at the world state.

The Ethereum account model makes transaction verifications and money transfer simple, with the sacrifice of parallelism. This may not be a significant drawback, since all transactions need to be verified by all nodes. But with Plasma, as the root chain moves away from transaction processing to security enforcement and arbitration, it becomes important to be able to verify invalid transactions in parallel.

A tree structure of blockchains, hence the tree of UTXOs from all child chains, makes it easy to apply distributed parallel algorithms to verify fraud proofs and enforce security across all plasma chains.

The following diagram shows what the potential Plasma may be able to bring into the Ethereum blockchain network when a tree of Ethereum plasma child chains are bonded with the parent plasma chain, and are ultimately connected to, and secured through, the Ethereum root chain:

Ethereum blockchain development

Massive scalability will be achieved through offloading expensive computations to the child chains, and allow the root chain to provide the shared security and arbitration services to the blockchain at a global level. There are a few similar cross chain interoperability solutions, like Cosmos network. Claimed to be the internet of blockchains, Cosmos network provides a hub-spoke integration architecture. Independent blockchains, as the zones or spokes, are attached to the main blockchain as the hub. Its purpose is to facilitate blockchain integration through the IBC (inter-blockchain communications) protocol.

 

Next Article

In our next article (How Sharding and Gasper work in Ethereum), we discuss how Sharding and Gasper work in Ethereum.

This article is written in collaboration with Brian Wu who is a leading author of “Learn Ethereum: Build your own decentralized applications with Ethereum and smart contracts” book. He has written 7 books on blockchain development.

Resources

Free Webinars on Blockchain

Here is the list of our free webinars that are highly recommended:

 

Free Courses

Here is the list of our 10 free self-paced courses that are highly recommended:

 

Self-Paced Blockchain Courses

If you like to learn more about Hyperledger Fabric, Hyperledger Sawtooth, Ethereum or Corda, taking the following self-paced classes is highly recommended:

  1. Intro to Blockchain Technology
  2. Blockchain Management in Hyperledger for System Admins
  3. Hyperledger Fabric for Developers
  4. Intro to Blockchain Cybersecurity
  5. Learn Solidity Programming by Examples
  6. Introduction to Ethereum Blockchain Development
  7. Learn Blockchain Dev with Corda R3
  8. Intro to Hyperledger Sawtooth for System Admins

 

Live Blockchain Courses

If you want to master Hyperledger Fabric, Ethereum or Corda, taking the following live classes is highly recommended:

 

Articles and Tutorials on Blockchain Technology

If you like to learn more about blockchain technology and how it works, reading the following articles is highly recommended:

 

Articles and Tutorials on Ethereum and Solidity

If you like to learn more about blockchain development in Ethereum with Solidity, reading the following articles and tutorials is highly recommended:

 

Articles and Tutorials on Hyperledger Family

If you like to learn more about blockchain development with Hyperledger, reading the following articles and tutorials is highly recommended:

 

Articles and Tutorials on R3 Corda

If you like to learn more about blockchain development on Corda , reading the following articles and tutorials is highly recommended:

 

Articles and Tutorials on Other Blockchain Platforms

If you like to learn more about blockchain development in other platforms, reading the following articles and tutorials is highly recommended: