This series of articles will focus on ethereum’s two-layer expansion framework, introducing its basic operating principles, specific operation details, security discussions and future research directions, etc. The main goal of this article is to understand the Plasma framework.
Plasma is a layer 2 expansion framework for Ethereum. Since it was proposed by Joseph Poon (founder of Lightning Network) and Vitalik Buterin (founder of Ethereum) in 2017 [1], Has been the focus of attention of blockchain practitioners [2]. To be clear, Plasma is essentially a framework, not a single project, and it provides off-chain solutions for a variety of projects. This is one of the main reasons why Plasma is confusing to a lot of people, because it’s hard to explain Plasma in the absence of real-world scenarios. So understanding Plasma as a framework is key to understanding Plasma.
1
Start with blockchain expansion
Before we get to Plasma, we have to introduce blockchain capacity expansion. As we all know, the biggest problem facing Bitcoin and Ethereum, the most widely used blockchain platforms, is Scalability. It is important to note that the scalability issue in blockchain is not a single issue, but rather a set of challenges that blockchain needs to overcome in order to realize the vision of Web3.0[3] and provide decentralized services to hundreds of millions of users. Ethereum claims to be the “world computer,” but the “computer” is single-threaded and can only handle about 15 transactions per second, dwarfed by the tens of thousands of transactions that Visa and MasterCard can handle per second. Therefore, how to improve the scalability while ensuring the security of blockchain is one of the urgent problems to be solved in the development of blockchain.
At present, there are no more than two solutions for blockchain capacity expansion: Layer 1 capacity expansion and Layer 2 capacity expansion [4]. Layer capacity expansion is also known as on-chain capacity expansion, and as the name implies, this type of capacity expansion requires changes to the underlying protocol of the blockchain. But it also means hard forking the blockchain. This kind of expansion solution is like changing the original single-core CPU to multi-core CPU, which can multithread computing tasks and improve the throughput of the entire network.
Currently, the most typical one-tier expansion is what Vitalik and his research team propose as “Sharding,” which means dividing the blockchain into different parts (Shards), each of which processes transactions independently. For more information on Sharding, please refer to the official Ethereum Wiki[5].
Layer-2 capacity expansion, also known as off-chain capacity expansion, is also very easy to understand. Such capacity expansion solution does not need to modify the underlying protocol of blockchain, but to complete a large number of frequent computing work to the “off-chain”, and periodically or when needed to submit the results of the off-chain calculation to the “on-chain” to ensure its finality. The core idea of layer 2 capacity expansion is to take the underlying blockchain as the consensus basis, and use smart contracts or other means as the bridge of communication between the chain and the chain, so that users can still return to a certain state on the chain in case of fraud. While moving computing down the chain will lose finality for a while, the trade-off is worth it because it not only dramatically increases the flexibility and scalability of the blockchain, but also dramatically reduces the cost to users of transactions. Moving computing down the chain does not mean giving up security completely, because the final security is guaranteed by the blockchain that the bottom layer relies on. Therefore, the main concern of layer 2 expansion is how to ensure the security of the on-chain switching process. This idea was first used in the Lightning Network as one of the expansion schemes of bitcoin, and has achieved good results.
Plasma, as introduced in this article, is an Ethereum-based layer 2 expansion solution. Similar solutions include State Channels and Trubit. Although these schemes face different problems, the basic idea is to transfer complex calculations down the chain. So, let’s go into Plasma and see what’s going on!
2
Understanding of Plasma
We have already seen that Plasma is a layer 2 capacity expansion framework. How can we further understand what Plasma is? What distinguishes it from other tier 2 expansion solutions?
Plasma is also known as “blockchains in Blockchains”. Anyone can create different Plasma on top of the underlying blockchain to support different business needs, such as distributed exchanges, social networks, gaming and so on.
So here’s an example to think about Plasma. Let’s say Penguin creates a Plasma Chain called Game Chain. Users send some Ether to Game Chain in exchange for tokens, which are used to buy in-game value-added goods such as skins. Joining Game Chain takes place on the Chain, and the Ethereum blockchain locks up the assets and transfers them to Game Chain. And then every time we buy a virtual good, it moves down the chain, and Penguin books it. This approach is almost identical to what we experience in real life in-game purchases, with quick settlement and low fees (compared to the fees paid to miners on Ethereum). So the question is, what if Penguin gets in the way, changes the books, and takes possession of our assets? At this point, we can submit the voucher of each previous transaction to the Ethereum blockchain. If it is true that Penguin maliciously tampered the books, we can not only successfully retrieve our assets, but also get some or all of the deposit deposited by Penguin before the establishment of Game Chain.
Does this give you an idea of how Plasma works? However, the above example is still too simple and only involves the users themselves and Penguin. Let’s parse the above example using the language of blockchain.
First, Penguin created a series of smart contracts on top of the Ethereum main Chain as a medium for communication between the main Chain and sub-chain Game Chain. These smart contracts not only specify some basic state transition rules in the subchain (such as how to punish evil nodes), but also record the states in the subchain (the hash values of the blocks in the subchain). Penguin could then build its own sub-chain (a private chain could be built using Ethereum). The sub-chain is actually a completely independent blockchain that can have dedicated miners, using consensus algorithms different from the main chain, such as PoS (Proof of Stake), etc.
When the sub-chain is created, Penguin can use the ERC721 contract to create tokens as in-game goods (just like Cryptokitty). The important thing to note here is that all digital assets must be created on the Ethereum main chain and transferred to the subchain via Plasma’s smart contract. Users also need to purchase digital assets on the main chain and then transfer them to sub-chains. In the example above, Game Chain’s smart contract locks in assets on the main Chain and then generates equivalent assets on the sub-chain. Users can then move off the main chain entirely and trade on sub-chains. Penguin plays the role of operator on the subchain, and if all goes well, the miners in the subchain will pack up the block normally, and the operator will submit the hash value of the block to the main chain as proof of the status update of the subchain if needed. In this process, the user does not need to interact with the main chain at all.
As we can see, moving complex computing operations down the chain really simplifies the whole transaction process. But without a strong consensus algorithm and a large number of participants, assets in the sub-chain are very insecure. Plasma gives us a hedging mechanism, so if the operator does something bad, we can get our assets back. The figure below (from [1]) illustrates this process briefly. In the figure, the transaction in block 4 is tampered with. Since Alice keeps all the block data in the Plasma Chain locally, she can submit a transaction containing “Fraud Proof” to the main Chain. If the proof is valid, then the main chain rolls back the state from block 4 to block 3 and everything returns to normal. Participants in the Plasmas Chain can also return to the main Chain at any time by submitting proof of assets.
So far we’ve seen that Plasma’s job is not to secure the subchain, but to ensure that users can safely retrieve their assets and return to the main chain in the event of a security incident. And use a range of financial incentives to reduce the incidence of wrongdoing.
The details of how Plasma works will be dissected in the next article.
3
The related resources
The related resources
-
plasma.io/
-
ethresear.ch/c/plasma
-
Medium.com/l4-media/ma…
-
Blog.ethereum.org/2018/01/02/…
-
Github.com/ethereum/wi…
-
Medium.com/l4-media/ma…
-
medium.com/@argongroup…
Content source: Zhihu original author: Gai Gai
Shanghai block chain marathon | Blockathon (2018)You’re invited to the roadshow
Time: 15:00 — 17:00, October 21, 2018
Venue: 2nd Floor, No.1 Liuquan Lane, Huangpu District, Shanghai (P2· Lu Xiang Yuan)
It’s free and there are gifts
How to register: identify the qr code below or click “Read the original” to register.
Beijing Blockathon Review:
Blockathon (Beijing) : 48 hours geek development, block Pine 11 on-site delivery project ideas open
Chengdu Blockathon Review:
The closing of Blockathon2018 (chengdu) competition leaves us thinking about blockchain applications