Ethereum Scaling Solutions

Vassil Guenov
NewCryptoBlock
Published in
12 min readMay 28, 2019

Ethereum blockchain is a public, permissionless, open-source, distributed platform which integrates execution of programmable units called smart contracts. In essence, this is a huge database (ledger — transaction list), stored in parallel on hundreds of thousands of computers called nodes. Every node keeps the same copy of this ledger. Hence — there is no single point of failure of the database.

The database consists of blocks ordered one after the other and time stamped, so that it is clearly identifiable which block comes first, second, third and so on … The blocks integrate a number of transactions. The order in which the transactions are grouped in blocks and blocks are added in the Blockchain is identified through the consensus mechanism protocol behind the Ethereum network — called Proof of Work (POW).

And this is where the challenge comes — by keeping the network safe (all nodes agree on validity of the transactions in the blocks), the throughput is as low as 5 to 20 transactions per second. In order to get enterprise adoption Ethereum needs to be able to handle 100k transactions per second.

There are a number of directions into which the R&D teams are working. And we will talk about the current trends and expectations for the near and mid term future.

But let’s make a step 2 years ago — late 2016–2017 year — the ICO year. Teams have been raising millions if $$ by only sketching their ideas, with no single line of code. And then the expectations of their investors for bringing the value of the digital tokens up, rocketed up. However, the technology could not meet the high demands. Throughput was so low, that only one mid-intense application (Crypto Kitties) brought the network down.

At the beginning of the year 2018, the price of Bitcoin and Ethereum started to go down and that is exactly the period coinciding with the time of the first products. And many people started to ask questions about the sustainability of the crypto currencies, not at all thinking about Blockchain as a core technology in general.

An example form the past:

Johannes Gutenberg was a German printer and publisher, among others, who introduced printing in Europe with the printing press in the 15th century. At that time:

- Only 6% of the population could read

- There were no bookstores

- There were only a few real use cases (the bible).

- There were no reading glasses.

Thanks God, he did not care!

In January 2018 Vitalik Buterin gave the answers, or at least opened up the door for the next big things coming out. He emphasized on the scalability and more precisely proof-of-stake (POC) and Plasma design pattern.

On-Chain vs. Off-Chain solutions

Currently (Feb 2019), there are 2 main types of solutions — on-chain and off-chain solutions:

On-Chain vs Off-Chain Solutions

On-Chain Scaling solutions, referred to as Layer 1 scaling solutions might be:

- Increasing of the Block Size in order to increase the troughput rate (TPS)

- change of the consensus mechanism (from POW to POS — to be done in Ethereum)

- Sharding — Horizontal Partition of the Blockchain

Known Off-chain scaling solution also known as Layer 2 (or any layer above the core Blcokchain) are state channels and side-chains. We will talk about these shortly.

Let’s go through some of the solutions.

SHARDING

SHARDING is a term that comes with the traditional databases. Google, Oracle and many more SQL and No-SQL databses implement sharding in order to optimize data access.

A shard is is a horizontal database split unit saved on a different server in order to provide scalability.

Vitalik Buterin was the one to introduce sharding concept in Ethereum like that:

Imagine that Ethereum has been split into thousands of islands. Each island can do its own thing. Each of the island has its own unique features and everyone belonging on that island i.e. the accounts, can interact with each other AND they can freely indulge in all its features. If they want to contact with other islands, they will have to use some sort of protocol.

Blockchain sharding is the process of separating the overall state into different shards.

Sharded Blockchain

A shard looks like this:

A shard

Sharding Blockchain looks like a normal Blockchain. But each block contains:

• State Root — The entire Blockchain state, containing all shards

• Txgroup root — The root of all transaction groups inside a particular block

Every transaction in a shard will do 2 things: change the state of the shard it belongs to and generate a receipt. This is called “receipt paradigm for cross-shard communication”. These receipts are stored in a distributed shared memory and can be seen by other shards but not modified.

Sharding is still an experimental scaling solution. The first proof-of-concept of has been coded up, according to Vlad Zamfir, one of the Blockchain researchers. It is expected to have Sharding integrated as part of the so called Ethereum 2.0 — switch from POW to POS. This will not happen before 2021.

Off-Chain Scaling solutions.

Off-Chain scaling solutions are known as well as Layer 2 (or any layer above 2) scaling solutions. Layer 2 solutions present Blockchains that are hooked up to the root chain (or previous layer in a more complex structure). By adding new levels of Blockchains, we can exponentially grow the scalability of the network.

In essence the root chain economic consensus provides a core kernel of certainty. Layer 2 solutions are anchored to this certainty in the root chain. The solutions have to be are transparently implemented on top of the root chain and on words, so that any user can exit his digital assets from the Layer 2 Blockchain to the root chain and securely keep it.

We will talk a bit about 2 different implementations of off chain solutions: State channels (Raiden Network) and Plasma design pattern.

State Channels

State channels enhance blockchain performance by taking state-modifying operations off of a blockchain and executing them directly between defined sets of participants.

Counterfactual WP

State channels enable nearly-instant, low-fee and scalable transactions (payments). It is the Ethereum version of Lightning Network.

Let’s take for an example one simple game, played between two persons:

  • Allice and Bob deposit ethers in the smart contract.

• They start the game off-chain.

• Because it is only the 2 of them, they can easily agree on each others moves. And the moves are registered instantly.

• Once Alice makes a move, she signs the transaction and sends it to Bob who sings as well.

• When the game finishes, Alice sends the last signed state to the smart contract.

Imagine that Alice and Bob have not been using state channels. Then every transaction needs to be confirmed by the whole Ethereum network. This will affect the usability (time for transaction is not small) and the efficiency (every move will be at the expense for the transaction).

Participants in the state channels only pay the transaction cost of entering the deposit in the smart contract and at the exit state. What happens within the state channel is free (or almost free) and instatntenious.

To recap: the term “state channels”refers to the process of exchange of value within a channel between all participants, resulting in a change of the global on-chain balance after closing the channel.

Raiden Network

Raiden Network is an off-chain scaling solution. It is Ethereum’s version of Bitcoin’s Lightning Network. Raiden enables near instant, low-fee, scalable and privacy-preserving payments without the need for global consensus. Transfers (balance proofs) are digitally signed hash-locked, fully collateralized by on-chain deposits.

Two way Raiden Channel

By opening a Raiden channel between two participants, the following processes take place:

• Both participants are locking a deposit as a security on the mainchain smart contract

• Every participant keeps a copy of the balance proof of the other participants

• On every transaction the participant initiating it, sends his/her balance proof. So, both are in agreement of the current status. Every iteration has an assigned consecutive order number — nonce.

• Every participant can initiate to settle the balance and close the channel, by providing his/her balance proof.

• After both parties have submitted their balance proofs, they can withdraw their balances.

As mentioned above, everytime a Raiden (payment) channel is opened, the user needs to pay to do so. It could be inefficient in cases when one participants enters more frequently in payment channels. This is why Raiden team has come up with an idea for a Raiden network in which any participant, once entered into the network, transitively connects with the rest of the participants.

In this case, the network needs to provide routes between 2 different points.

The establishment of these multihop payment channels is happening by having some of the nodes lending their channels. Each node cooperates in order to funnel the payment through his channels. Once that channel is established, the nodes are incentivised.

It is believed that these incentives are going to be very small as the nodes in the network will be in direct competition to provide their services and the transaction costs within Raiden networks will be rather low (micropayments).

By being incentivised, the nodes will be able to redeem immediately on chain their rewards, but what actually is happening is that these rewards are being consolidated over time, before redeemed on chain.

Rainden protocol provides privacy for the off-chain transactions, as channel balances are hidden from the public until redeemed on-chain. There are even services providing rebalancing or obfuscation of the channels for even bigger security.

Examples for State Channels solutions:

Counterfactual — L4 are building a framework for generalized state channels of Ethereum.

Funfair — decentralized gambling platform (they call their state channels “Fate Channels”)

Spunkchain — One way payment channel for adult performers.

Horizon games are using state channels for their first Ethereum game.

Here is in short the main characteristics for the state channels. State channels rely on availability. There is an initial cost associated with the process of creating a payment channel. That is why they are useful in cases where there are going to be executed many states updates over a longer period. State channels are to be best used in applications with a defined number of participants. Only opening and closing transactions are public, all other interactions between participants happen in the state channel. That is why state channels have strong privacy. Instant finality.

Plasma

Plasma is a design pattern that adds a layer of Smart Contracts, which interacts with the child-chain and allows off-chain messages to dictate the transfer of on-chain assets.

If we make a parallel with the State Channels, Plasma is an off-chain scalability solution. However, State channels form a closed system between a defined set of participants and no “come or go” option is available within one State Channel. As opposed to that, Plasma design pattern adds a new Blockchain on top of the core Ethereum Blockchain.

Plasma Cash

Plasma Cash is a Plasma construction based around the use of unique identifiers for each token on the Plasma chain. Similar to cash in your pocket, tokens on the network are given unique serial numbers.

There are 2 main implementations based on Plasma Cash: Loom Network and OmiseGo. We will have a walk through Loom solution.

Root Chain, Plasma chain and Client application are the three architectural components. There are 2 smart contracts hosted by the root chain. ERC 721 is the first smart contract, which manages the generation of the ERC 721 coins. The team works now to adapt Loomis for ERC 20 as well.

Plasma contract goal is to handle deposit events and exit events to and from Plasma chain.

Plasma chain is an hosted and operated by an Operator. This means that the transactions are in Plasma Cash chain are validated by the Operator (POA — Proof of Authority). POA is an algorithm that delivers very fast transactions throughput.

So, here is how it works. Once an user wants to interact with the plasma chain, he needs to send ethers to the ERC721 contract. The contract generate ERC721 Plasma coin, which has its specific Id. This coin is transferred to the Plasma smart contract.

Plasma contract emits Deposit event. On the other side Plasma Chain listens for such events and once such event is caught, Plasma chain generates a transaction.

There are 2 types of transactions:

- Deposit Blcok — includes only one transaction — Deposit transaction.

- Plasma Block — includes Plasma Chain specific application transactions.

Spending Plasma Coin is the actual act of working with the coins within the user specific application. Let me remind you that being run and validated by an Operator, the transactions approval is almost instant. This what makes the difference from user perspective.

Getting back to the spending of the coin, we have to say, that there are some specifics and differences coming from the fact that Plasma coins have their own IDs, unique elements. So, on top of the transaction details, the sender shares the history of the coin. These are called inclusion and exclusion proofs.

Inclusion proof validates that token has at least one transaction associated with it from block with deposit transaction onwards and exclusion proof that there is no transaction related to token in question for block number that is bigger than block with deposit transaction.

And last we will talk about the exit in Plasma chain. It is equally, not to say even more important than spending the coins, to talk about how one can exit Plasma coins to the root chain.

User has to be allowed to exit at any point in time, regardless of the reason he wants to do so. In case that this is because of fraud within the application or by the Operator, the operation is even more critical.

In order to exit Plasma chain, the user needs to submit a proof that the coin belongs to him. This process is the opposite to the deposit event. In this case StartedExit even is emitted. And it runs for seven days within which any fraudulent behaviour should ne detected or reported.

That specific implementation has to be applied on application level, so that by identifying exit event, Plasma chain app, has to be in a position to run processes of double checking validity of the exit coins. In case of problems, user or the application can challenge it.

There are three types of fraudulent behaviour, hence challenges: Exit Spent Coin Challenge, Exit Double Spent Challenge and Exit with Invalid History Challenge. These events have to be handled properly on application level, so that in cases of fraudulent behaviour from any other participant, the operator or a combination of both, the user can easily exit Plasma chain.

For more detailed technical overview of Plasma Cash read the following article: https://medium.com/newcryptoblock/how-plasma-cash-is-going-to-help-ethereum-to-scale-1f0cad1c7d14 .

Conclusions

Blockchain is the technology expected to transform the digital relationships in B2C and B2B relations. Peer to peer being the core of Blockchain, facilitates as well how individuals interact between each other, without any mediation what so ever. However, the technology still has to mature and to overcome the flaws of the early adoption.

This is why it is important that businesses should not stop innovating, as they are the ones pushing R&D teams to strive for perfection in a constantly changing and demanding tech world.

Today we are a few years, or even months away from Ethereum 2.0. As long as we will see answers to our nowadays questions of scalability, I expect new questions to pop up.

While we wait for that to happen, companies will build their business processes on top of solutions like Raiden Network(State Channel), Plasma (many variation) design pattern or others.

References:

https://medium.com/loom-network/plasma-cash-initial-release-plasma-backed-nfts-now-available-on-loom-network-sidechains-37976d0cfccd

https://medium.com/coinmonks/scaling-solutions-on-ethereum-explained-d970b66e28e5

https://medium.com/novamining/plasma-cash-new-scalability-solution-for-the-ethereum-network-f7c0b889db7d

https://medium.com/crypto-economics/what-is-plasma-plasma-cash-6fbbef784a

https://karl.tech/plasma-cash-simple-spec/

https://medium.com/loom-network/practical-plasma-volume-i-gaming-9cfd3f971734

https://hackernoon.com/blockchains-dont-scale-not-today-at-least-but-there-s-hope-2cb43946551a

https://blockgeeks.com/guides/what-are-ethereum-nodes-and-sharding/

https://medium.com/@icebearhww/ethereum-sharding-and-finality-65248951f649

https://medium.com/edchain/what-is-sharding-in-blockchain-8afd9ed4cff0

https://www.coindesk.com/ethereums-vlad-zamfir-claims-breakthrough-in-blockchain-sharding

https://medium.com/blockchannel/counterfactual-for-dummies-part-1-8ff164f78540

https://medium.com/blockchannel/state-channel-for-dummies-part-2-2ffef52220eb

https://medium.com/@eolszewski/idealism-and-how-to-scale-ethereum-now-e5545cae7db0

https://blockgeeks.com/guides/what-are-ethereum-nodes-and-sharding/

_________________________________________________________________

NewCryptoBlock consists of a team of engineers with extensive technology and business backgrounds, united by a passion for innovation, professional development and building high-quality software products. Innovative technologies have the capacity of bringing to life revolutionary ideas that can change and better the world compared to the way we know it.

info@newcryptoblock.io

--

--