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.
One-to-One Live Blockchain Classes
Coding Bootcamps school offers One-to-One Live Blockchain Classes for Beginners.
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:
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:
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:
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:
- Hyperledger Fabric for system admin versus developers
- How to harness blockchain for environmental and corporate sustainability
- Review of Initial Coin Offering, Security Token Offering and asset tokenization use cases and best practices
- Hyperledger Fabric Deployment on Cloud
- Hyperledger Fabric for entrepreneurship- 21 blockchain business use cases
Free Courses
Here is the list of our 10 free self-paced courses that are highly recommended:
- IT Career Roadmap Explained
- Web Design with Bootstrap
- User Experience Best Practices
- Intro to Search Engine Optimization
- Web Design with WordPress
- Introduction to Drupal CMS
- Intro to Joomla CMS
- Intro to Cybersecurity
- Introduction to Cloud Technology
- Recorded Live Webinars and Classes
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:
- Intro to Blockchain Technology
- Blockchain Management in Hyperledger for System Admins
- Hyperledger Fabric for Developers
- Intro to Blockchain Cybersecurity
- Learn Solidity Programming by Examples
- Introduction to Ethereum Blockchain Development
- Learn Blockchain Dev with Corda R3
- 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:
- Live and self-paced blockchain development with Ethereum
- Live and self-paced blockchain development with Hyperledger Fabric
- Live and self-paced blockchain development with Corda
- Immersive Blockchain Bootcamp with live and self-paced courses
- Live crash course for learning Ethereum with Solidity
- Live crash course for building DApps with Hyperledger Fabric
- Live crash course for building DApps with Corda
- Live full-stack blockchain development in Hyperledger and Ethereum
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:
- History and Evolution of Blockchain Technology from Bitcoin
- Overview of Blockchain evolution and phases from Ethereum to Hyperledger
- Comprehensive overview and analysis of blockchain use cases in many industries
- Blockchain Crowdfunding Security Token or Initial Coin Offerings
- A beginner Guide to Blockchain Technology
- How Decentralized Peer-To-Peer Network Works
- How blocks are added to the blockchain
- How Public and Private Keys of Cryptography Work
- What Is A Cryptographic Hash Function
- How Digital Signature Works In Blockchain
- The role and types of consensus mechanism in blockchain
- How Proof-of-Work Consensus Works in Blockchain
- How Proof of Stake Consensus works in Blockchain
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:
- Review of Architecture and Components of Ethereum
- Comprehensive Blockchain Ethereum Developer Guide from Beginner to Advance Level
- How to Write Ethereum Smart Contracts with Solidity in 1 hour
- Review of Architecture and Components of Ethereum
- How Ethereum Manages Accounts
- How Ethereum Manages Transactions
- How Smart Contracts Work in Ethereum
- How Ether and Gas Work in Ethereum
- How Ethereum Virtual Machine works
- How address and wallet work in Ethereum
- How mining works in Ethereum
- List of Tools and Technologies in Ethereum Ecosystem
- Review of challenges in distributed systems
- Review of Cap Theorem in Distributed Systems
- Horizontal Scaling versus Vertical Scaling in Distributed Systems
- How to Scale up Ethereum Blockchain Applications
- Review of scaling solutions for Ethereum
- How to Manage Ethereum State Channel with Raiden
- How Plasma Chains Work in Ethereum
- How Sharding and Gasper work in Ethereum
- How Proof-of-Stack Consensus Works in Ethereum
- A roadmap for Implementing Ethereum 2.0
- How to work with Decentralized Data and Content Storage in Ethereum
- How Decentralized Messaging with Whisper Works in Ethereum
- Review of Infura for Ethereum Development
- Review of Infura Ethereum API
- How to Use Remix with Infura for Ethereum Development
- How Ethereum Client API Works
- How Ethereum IPFS Storage Works
- How to Install and Start Ethereum IPFS Storage
- How to Run Ethereum IPFS Storage
- How to Work with Ethereum Swarm Storage
- How to Install Ethereum Swarm Storage
- How to Handle Ethereum Messages with Whisper
- Review of Popular Ethereum Smart Contract Libraries
- Review of Private and Permissioned blockchain
- How to Set up a Local Private Ethereum Blockchain
- How to Run Geth on a Local Private Ethereum Blockchain
- How to Build a Local Private Ethereum Blockchain with Mining
- How to Run Geth on a Local Private Ethereum Blockchain with Mining
- How to Create an Account on a Local Private Ethereum Blockchain
- How to Use Ethereum Optional Flags with New Chains
- Review of Ethereum Options for Development and Testing
- Review of Ethereum Developer Chain Options
- Review of Ethereum API and Console Options
- Review of Ethereum Networking Options
- Review of Ethereum Transaction Pool Options
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:
- Introduction to Hyperledger Architecture, Projects, Tools and Libraries
- Complete Review of Hyperledger Fabric Architecture and Components
- Hyperledger Fabric for System Administers versus Developers
- How to use Prometheus and Grafana to monitor Hyperledger Fabric
- Blockchain Developer Guide- How to Install Hyperledger Fabric on AWS
- Blockchain Developer Guide- How to Install and work with Hyperledger Sawtooth
- Blockchain Developer Guide- How to Install Hyperledger Burrow on AWS
- Blockchain Developer Guide- How to Install Hyperledger Iroha on AWS
- Blockchain Developer Guide- How to Install Hyperledger Indy and Indy CLI on AWS
- Blockchain Developer Guide- How to Install Hyperledger Seth and Docker on AWS
- Blockchain Developer Guide- How to Configure Hyperledger Sawtooth Validator and REST API on AWS
- Blockchain Developer Guide- How to Build Transaction Processor as a Service and Python Egg for Hyperledger Sawtooth
- Blockchain Developer Guide- How to Deploy Ethereum Smart Contracts with Hyperledger Burrow
- Blockchain Developer Guide- How to Create Cryptocurrency Using Hyperledger Iroha CLI
- Blockchain Developer Guide- How to Explore Hyperledger Indy Command Line Interface
- Blockchain Developer Guide- Comprehensive Blockchain Hyperledger Developer Guide from Beginner to Advance Level
- Introduction to Hyperledger Sawtooth Blockchain Development
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: