More than one organization has been working on solving a major blockchain conundrum: how to improve sluggish transaction performance.
Blockchain distributed ledgers work by linking together a chain of electronic records, each inextricably tied to the one before it; each new set of entries or "blocks" is completed and time-stamped with a hashtag only after passing through a consensus process on a peer-to-peer (P2P) network.
Due to its chain nature, each new record inserted into a blockchain has to be serialized, which means – as the blockchain grows – the rate of updates is slower than traditional databases that can update data in parallel.
Today, the world's most popular cryptocurrency ledgers – bitcoin and Ethereum – use a proof of work (PoW) consensus model that requires nodes (servers) to complete a complicated mathematical problem as a way of authenticating new blocks (similar to how CAPTCHA acts as a challenge/response mechanism for websites confirming human users).
PoW mechanisms are slow by design. Bitcoin, for example, needs around 10 minutes to add a new record or block to the ledger, even with only 1MB of data allowed per entry. While there's no such limit on block size in Ethereum – it's been adjusted dynamically over time – it can only process about 20 transactions a second. By comparison, Visa's financial network processes about 10,000 transactions per second at peak load.
Complicating matters: neither bitcoin nor Ethereum P2P networks were designed to store large amounts of data; they simply do it by default. Because of that, as the electronic ledgers grow organically, so, too, does the compute and electrical power required to support them.
Various solutions have been proposed for addressing storage issues and speeding up the transaction process – from increasing block sizes to changing the consensus mechanism from PoW to proof of stake (PoS); the latter creates "bonded validators," or users, who must place a security deposit down before they can serve as part of the blockchain consensus or voting community. As long as bonded validators act honestly on the blockchain, they remain in the consensus community; if they attempt to cheat the system, they lose their stake (their money).
Casting about for the right answer
Last year, Ethereum introduced a PoS mechanism on a testnet called "Casper" (as in Casper the friendly ghost).
A graphic describing Ethereum blockchain as part of UC Berkeley's course cirriculum.
"Proof of Stake algorithms definitely have the potential to overtake Proof of Work," said Vipul Goyal, an associate professor in the Computer Science Department at Carnegie Mellon University (CMU). "However, there are still some significant research challenges that need to be overcome before that happens."
(There are also hybrid models that combine PoW with PoS mechanisms – giving deference to those with a vested interest while still allowing some degree of transaction validation from all users on the electronic ledger.)
Earlier this year, the Ethereum Foundation reached out to outside developers to help solve its inability to sufficiently scale.
The foundation has explored two possible fixes. The first, known as layer 2, offloads the cumbersome back-and-forth processes between network participants to a separate blockchain or database. But it still allows the primary or layer 1 blockchain to record the final transaction result, i.e. you have purchased one Ether or bitcoin. Also known as "state channels," layer 2 would vastly increase efficiency by moving the most mundane processes off-chain while maintaining blockchain's innate trustworthiness.
Another possibility: 'Sharding'
The second potential fix involves moving to PoS and adding "sharding," which divides nodes on the network into partitions, each of which would be responsible for processing a small piece of each transaction, allowing many more transactions to be processed in parallel at the same time; sharding also isn't expected to diminish the native security of a blockchain because it maintains "most of the desired decentralization and security properties of a blockchain," Ethereum co-creator Vitalik Buterin wrote in a blog.
But, sharding is complex and it will take time to create a workable scheme, according to Ethereum's other co-founder, Joseph Lubin.
"We're not going to get to scalability instantly via proof of stake and sharding, so that's going to happen as phase three in our ecosystem," he said. "And I think that's going to be pretty profound. But the layer 2 solutions are a very powerful stepping stone."
Bitcoin and Ethereum developers have both proposed offloading transactional data to a secondary database or blockchain, which would allow funds to be transferred "off chain," keeping only the funds validation process on chain. Earlier this year, Bitcoin developers proposed the Lightning Network as a "second layer" payment protocol that could allow transactions and microtransactions to take place almost instantly on a separate P2P network.
While speaking at last month's Rise conference in Hong Kong, Lubin mentioned Plasma, a second-layer scaling fix for Ethereum, which would add tertiary blockchains for processing to a main, or layer 1, blockchain. Plasma was first introduced in 2017 by Buterin and Joseph Poon, who also created bitcoin's proposed Lightning Network.
"We're moving into a space where Ethereum can serve as the layer 1 trust system, and built into Ethereum we'll have hundreds of thousands of transactions in the layer 2 systems and we're going to see that ramified this year," Lubin said during a panel discussion.
In an interview with Computerworld, Lubin confirmed the trajectory for a layer 2 protocol in Ethereum: it could be constructed using Plasma for the purpose of gaming or a cryptocurrency exchange, which would then link back to a layer 1 Ethereum blockchain via a smart contract. (Smart contracts are business automation scripts that execute based on pre-determined rules).
The smart contract would be responsible for moving transactions between the root or layer 1 blockchain and the layer 2 blockchain; smart contracts would also maintain rules, such as not allowing a digital token, represented by a hash record, to be spent more than once. The layer 2 blockchain could also use other consensus mechanisms, such as PoS or even Proof of Authority, to validate transactions moving from a primary to a secondary blockchain.
"If something goes wrong on that system, the Plasma technology enables people to potentially pull their tokens out of that system based on the last checkpoint of recovered value, and there's nothing the managers of that layer 2 system can do to thwart people's ability to rescue their value," Lubin said.
And if you lose your cryptographic key?
Recovering cryptocurrencies when a system is hacked or a user loses their private cryptographic key has been an issue for as long as the distributed electronic ledgers have existed. If you lose your private key, you lose the ability to access your cryptocurrency.
One example of a layer 2 Ethereum blockchain could be an application enabling the purchase of Wi-Fi access at a coffee shop, say for a penny a minute. A customer would walk into the café and use the Ethereum-enabled application to sign in for Wi-Fi service. The application would allow the customer to set aside a certain amount of money in his or her account via an Ethereum smart contract. With each passing minute, the smart contract on the layer 2 blockchain would automatically record or validate another penny toward the Wi-Fi service charge. When the customer leaves, the final amount to be transferred would be recorded on the primary Ethereum blockchain. The café owner has the last transaction automatically signed by the smart contract when the service ends, which entitles him to the money owed.
Blockchain has also become a popular platform for gaming. For example, one of the earliest and most popular blockchain-based games is CryptoKitties, where players collect, breed and trade virtual cats. Each cat represents a non-fungible digital token. Trading card games, such as Spells of Genesis and Force of Will, are also based on blockchain.
Plasma networks would also allow users to move between two different blockchain-based games.
"Let's say there are two different games on two different Plasma-based networks. If I have a digitally-scarce sword that I'm using in one game, I might want to move it back to Ethereum, maybe to trade it to somebody or to move it to some other... game," Lubin said.
The most prominent layer 2 Ethereum project to date is Loom Network, an SDK kit that went live earlier this year and enables the creation of highly-scalable games and user-facing DApps. The layer 2 technology uses a PoS consensus mechanism for authenticating new blocks.
Still time to experiment
At this point, there's no rush to bring a layer 2 protocol to Ethereum, Lubin claimed, saying there are there are other "pruning mechanisms" available using the current architecture that would enable more efficiency.
"So, we're not in real danger and the system can grow significantly for quite a while," he said. "I think we can squeeze two to three times the amount of performance out of it despite...deficiencies."
For example, in the next iteration of Ethereum, the block size may increase by 50% or 70%, allowing more data to be stored on chain. "That's in play right now," Lubin said.