Sending value through cryptocurrency has many advantages. It is quite secure, permissionless, decentralized, etc. Despite these many advantages, sending cryptocurrency transactions can also be somewhat costly and time-consuming depending on the specific blockchain network. For example, it takes about 10 minutes to send a Bitcoin transaction, and the fee for a simple ERC-20 token transfer can cost several dollars depending on network congestion. In this video, I’ll discuss how “Second Layer Solutions” (sometimes called off-chain settlement) bring greater speed and lower-cost to blockchain transactions.
The most basic method of cryptocurrency exchange is an on-chain transfer. When an on-chain transfer is conducted, the transaction must be broadcast to the network, picked up by miners, processed, and recorded into the distributed public ledger. Although this method is very secure and trustworthy, it also requires immense amounts of computational power, wastes energy, incurs high transaction fees, and can have long wait times (depending on the network).
Off-Chain Solutions (AKA Layer 2)
“Off-chain” or “second layer solutions” are a way of removing transactions from the blockchain itself, which allows these off-chain transfers to be processed quicker and more efficiently.
One of the best use cases for off-chain or second layer solutions is cryptocurrency trading. When a trader swaps one cryptocurrency for another, they must make a transaction that can incur several dollars worth of fees. Especially if they are trading in and out of positions they can quickly incur a large amount of fees that will eat into their profits.
Instead of conducting each cryptocurrency trade on-chain, traders can move their cryptocurrency into an off-chain platform and conduct trades there. Any trades that happen within this separate ecosystem will not incur main net transaction fees or be recorded in the public ledger of the underlying blockchain. Rather, these off-chain transactions will be recorded in a separate database. Because this external off-chain database does not have to be mined and validated in the same way as the underlying blockchain, off-chain transactions can be processed much more quickly and also with significantly lower fees. Periodically, the end state of these various cryptocurrency transactions will then be broadcast to the underlying blockchain to be finalized.
At first, this can sound a little bit counterintuitive. If the purpose of blockchain is to record a transaction, then why would we want to deliberately move something off-chain to where we can't see intermediate transactions. However, once we look at it in more detail it begins to make sense. If I trade from BAT → ETH → USDC → Dai on the main net, I will pay transaction fees three separate times. If I conduct this transaction off-chain, I will pay much lower fees and the ending result will show that BAT has left my on chain address an Dai has been deposited. Although I pay three separate transaction fees with an on chain transfer; the end result is the same. I have converted all of my BAT to Dai. Although "off-chain" solutions prevent intermediate transactions from being written to the blockchain, the end states of all transactions remain in agreement.
To show the dramatic difference between on-chain and "off-chain" fees/processing time consider that the current lowest transaction fee paid on the Ethereum network is about $0.44. Although ETH’s block time is 15 seconds, transactions typically take much longer than this and can range from several minutes to hours depending on the amount of gas used. Just as a point of comparison, transactions on Loopring (a layer 2/off chain solution) can process trades in a fraction of a second for less than a fraction of a cent.
In summary, off-chain solutions go by many names and have slightly different implementations depending on the network, but I have intended to provide a general overview that will help beginners understand the general concept behind them. The main takeaway is that layer 2 solutions deliver increased transaction speed and lower fees compared to on-chain transfers.
Thanks for reading!
Image Credits
References