Scaling Solomon

Solomondefi
Solomon Defi
Published in
7 min readMar 15, 2022

--

Layer 2 solutions for scaling Ethereum dApps

At its core, the intent of the Solomon project is to increase security, and decrease friction for e-commerce cryptocurrency payments, high value escrow contracts, and crowdfunding projects. In order to realize this goal, there are several requirements that must hold for the core technology (e.g. smart contracts):

  1. Reasonable transaction price
  • A $5 USD transaction should incur no more than $0.40 in fees
  • A $1000 USD transaction should incur no more than $10 in fees

2. Fast transactions

  • Less than one minute on average

3. Accessible transactions

  • Buyers should not have to jump through extra hoops, compared to normal Ethereum transactions.

Anyone who has made transactions on the Ethereum network can attest to the fact that they are expensive, and can take a long time to complete. The price and duration are also very unpredictable, since they are related to network congestion. High transaction costs and low transaction speeds are a considerable problem to both users and projects on the Ethereum network, causing many to seek out faster and cheaper alternatives. However, even with these problems, the Ethereum network is still the market leader in terms of dapps, whether it be for DeFi or NFTs and the like. A reason for this is the security that it offers and the extensive developer community and tools that have built around the network, which allows it to continue to attract a large user base.

Ethereum upgrades that aim to make the network faster, cheaper and more secure have continually been delayed, so scalability issues worsen as transactions increase and put pressure on the network. Various projects and the Ethereum community have spent several years finding different ways to make improvements on the network to accommodate the increasing quantity of transactions. Numerous projects (such as Avalanche, Solana, Cardano, EOS, Tron, etc…) have been introduced claiming to be cheaper, faster or more secure alternatives to Ethereum. Although many of these projects are quite promising and deploy creative solutions to tackle the blockchain trilemma, many still prefer to remain on Ethereum.

Layer 2 scaling solutions have been the talk of the town recently — they aim to build on top of the Ethereum network to help it scale better while still enjoying the popularity and network benefits of Ethereum. As the name implies, Layer 2 solutions involve a second layer built on top of Ethereum to provide a way for users to transact quickly and easily without putting pressure on the main network. An analogy would be creating a highway above a congested main road to divert traffic and still allow people to move along on the same path. Layer 2 solutions mainly consist of side chains, channels, and rollups. We at Solomon feel the need to explore and better understand these Layer 2 solutions to provide the greatest cost-savings to users while still being able to maintain a high level of speed and security.

Side Chains

A side chain, though technically not considered a Layer 2 solution, is essentially another chain that runs parallel to the main Ethereum chain. It moves transactions off the main chain and onto its own separate blockchain while allowing users to transfer information back and forth between the two via bridges. Side chains often have their own consensus model and do not rely on the main Ethereum network for security. This means there is a separate set of validators for the side chain, making it less secure than the more decentralized Ethereum main chain. Since side chains are often EVM-compatible, it is very easy for developers to deploy their dapps onto side chains directly.

Plasma chains are often discussed alongside side chains, however they are direct copies of the Ethereum chain that run in parallel with the main chain. They provide many of the same benefits as side chains since they are basically smaller Ethereum chains that operate alongside the main network. The only difference is that plasma chains rely on the security of the main network through the use of fraud proofs and allow for a period of time for transactions to be validated and contested if fraud is suspected. Withdrawals from the child plasma chains back to the mainnet can take much longer (usually around a week) because of the time allowed for these fraud proofs to occur before transactions are finalized and sent back to the main chain.

Projects include: Polygon, OMG/Boba, Skale

Channels

Channels consist of two types: payment channels and state channels. Channels are smart contracts that allow for multiple transactions to occur off-chain during a set period of time. The only records that are processed on chain are one to open the channel and lock the state, and another to close the channel which unlocks and updates the state on the main network. Payment channels are simple channels that facilitate multiple payments between parties. They work to process multiple transfers off-chain and process the final net results onto the main chain. State channels are a more general implementation that allow users to process multiple transactions relating to anything off-chain, and then record the result and final state of the transactions on-chain.

Popular use cases for state channels are streaming, P2P file-sharing, and games like chess, tic-tac-toe or even rock-paper-scissors which process moves between the players off-chain and record the results of matches on-chain. In the example of a game of chess, state channels allow users to make moves instantly without needing to process each one as a transaction on the main chain. This greatly increases the speed of transactions and reduces the transaction fees since only one transaction is processed on-chain to record the result of the match, no matter how many transactions occurred within the channel during the duration of the game.

Channels often require parties to be predetermined before the channels are open and require them to remain online and active throughout the duration of the channel. This typically will not be useful for situations where arbitrary users are involved for infrequent transactions or if users are not always online and active. Funds will be locked up in a channel and, once closed, will allow for instantaneous settlement of funds. However, this requires that parties cooperate and agree on the result to close the channel in a timely manner, otherwise it might take longer to settle the final state of the channel.

Projects include: StateChannels.org, Celer

Rollups

Rollups seem to be the most promising of the Layer 2 solution at the moment, since they can be applied to a wide range of use cases and allow for greater scaling to occur while still relying on the decentralized security of the mainnet. They “roll up” transactions to execute on Layer 2 while the updated state data is recorded on Layer 1.

Optimistic rollups lump transactions together and pass them back to the Ethereum mainnet without validating the transactions, assuming that all transactions that occurred in the rolled up transaction are valid. The off-chain transaction data are passed back to the main chain as calldata, helping in the reduction of transaction fees. Like with plasma chains, a period of time is allowed for parties to challenge the validity of transactions and execute fraud proofs to run through the transaction computations. Senders of transactions usually have to post a bond in the form of ETH to process the transaction and in the case that fraudulent transactions occur, their bond will be slashed and on top of that, the fees used to process the fraud proof will also be deducted from the posted bond. Optimistic rollups tend to be EVM-compatible so developers can deploy their projects onto Layer 2 with little to no modifications to their code.

ZK-rollups, or Zero-knowledge rollups, make use of validity proofs to ensure that transactions are valid before posting them on the main chain. Unlike optimistic rollups, there is no delay in the transfer of funds between Layer 1 and 2 since the transactions have already been verified and there is no need to contest the transactions that have occurred. This also helps to increase transaction speeds and reduce costs further since much less data is being sent back to the main chain and the state is instantly verified. Due to the complexity of the computations required to produce validity proofs, many ZK-rollup solutions are not yet EVM compatible. This limits the application of ZK-rollups to more application specific solutions and are currently mainly used for payment solutions. As the technology matures and allows for more general application, ZK-rollups seem to be the most promising Layer 2 solution for future applications.

Projects include: Arbitrum, Optimism, ZK-Sync, Immutable X, Loopring

Validium

Validium also uses validity proofs, but does not send that data back to the Layer 1 network. This allows for even faster transactions and greater scalability for Ethereum.

Projects include: Starkware

Further reading

https://ethereum.org/en/developers/docs/scaling/

https://medium.com/coinmonks/ethereum-layer-2-scaling-solutions-demystified-991eeffb93bd

https://www.buildblockchain.tech/newsletter/issues/no-99-validium-and-the-layer-2-two-by-two

--

--

Solomondefi
Solomon Defi

Decentralized Ecommerce (DeCom) for the DeFi Era.