Decentralized finance (DeFi) promises a new kind of financial system, one that blasts open the old barriers to entry. The idea is to leverage the benefits of blockchain to enable anyone to access loans, trade assets, and participate in markets-all without having to rely on traditional banks and third-party intermediaries. In the world of DeFi, you control your assets, not the bank.
Ethereum has emerged as the blockchain hub for DeFi dApps, partially because it was the first blockchain for general-purpose applications, but also for its strong security and decentralization. The challenge at hand is how to vastly expand Ethereum’s capacity for fast and low-cost transactions without damaging its decentralization.
Here, we’ll explore the limits of blockchain scalability and their potential solutions, ultimately revealing how they will shape the future of DeFi.
DeFi’s scalability bottleneck
Transacting on Ethereum isn’t always costly and slow. During times of peak activity, however, the network becomes congested. The result is much slower and more costly transactions.
How much more costly?
On February 9, 2024, Ethereum gas prices (transaction fees) reached an average peak of 70 gwei-that’s about $60 for a standard transaction-with peak gas costs surging as high as 377 gwei. That was an eight-month high, but certainly not an all-time high for Ethereum.
Think about that for a moment. Sixty dollars for a standard transaction. Even half of that, a quarter of that, or a single dollar is too much when we’re talking about DeFi use cases such as high-speed trading, staking, or even basic token transfers.
That’s where Layer 2 (L2) networks come into play. Layer 2 networks boost Ethereum’s scalability by offloading the heavy computation associated with transaction execution from L1. They execute transactions on L2-where computation is cheaper-and then bundle them together. They then submit either a proof and a state difference (validity rollups) or a compressed version of the transactions (optimistic rollups) to L1 for verification.
Because the transactions are executed on L2, where it’s cheaper, and batched together into a single unit before being processed by Ethereum, the L1 cost is spread among many transactions. The result is transactions that are much faster and much cheaper, even during times of peak activity.
Benefits of Layer 2 for DeFi
Layer 2 enables DeFi applications to scale by:
- Offloading transaction execution: L2 moves the heavy computation associated with transaction execution from the congested and more expensive base layer (the L1). This frees up space on L1 for essential functions like security and settlement.
- Parallel processing: Some L2 solutions utilize sidechains or rollup technology to process transactions in parallel with the main chain. This significantly increases the overall transaction throughput of the system.
- Bundling transactions: L2s bundle many transactions into either a compressed format (optimistic rollups) or a proof attesting to their validity (validity rollups) for submission to the L1. This reduces the number of individual transactions competing for block space, effectively lowering fees.
Practically, these techniques work together to enable DeFi applications to efficiently handle a much higher volume of transactions without compromising on performance, leading to:
- Reduced transaction costs: L2 solutions can minimize gas fees by processing transactions off the base layer blockchain before settling them there. By doing so, users can execute trades at a fraction of the typical cost, making DeFi more accessible.
- Faster transaction speeds: L2 scaling solutions can make transaction speed nearly instantaneous, compared to several minutes on Ethereum. This speed is essential for applications that require quick transaction finality, such as decentralized exchanges.
- Potential for better UX: Faster and cheaper transactions lead to a smoother user experience. This improved experience can drive higher adoption rates, as users find the platforms more efficient and user-friendly.
StarkWare pioneers faster, cheaper DeFi
StarkWare hypercharged Ethereum scaling by introducing the STARK proof system, which is now becoming the gold standard of L2 validity rollup technology. StarkWare’s scaling engine, StarkEx, leverages STARK proofs to power top DeFi derivatives trading platforms, such as dYdX and ApeEx.
StarkWare also helped pioneer the permissionless L2 validity rollup Starknet, which is already transforming L2 scaling for DeFi with its faster and cheaper transactions. Transactions on Starknet have recently been as low as $.002 (!!!), making DeFi more accessible than ever.
As a validity rollup, Starknet is also much more secure than optimistic rollups because it submits a proof to L1 along with every batch of transactions, attesting to the validity of each transaction in the batch with math. Optimistic rollups, on the other hand, assume transactions are valid and rely on incentivizing network participants to challenge fraudulent transactions. Of course, when it comes to security, math > incentives.
1-click DeFi on Starknet
Beyond making transactions faster and cheaper, Starknet drastically improves DeFi user experience with native account abstraction. Account abstraction enables dApp builders to offer a Web2-like experience, and on Starknet, account abstraction is built into the network.
On Starknet, wallets can offer users familiar Web2 security methods, such as two-factor authentication, three-factor authentication, and spending limits, as well as multi-sig approvals. There’s also the advantage of simplifying transactions-fewer complicated private keys, and much more face ID and fingerprint ID to sign transactions.
Native account abstraction on Starknet also enables DeFi-specific improvements to UX, such as making it possible to complete DeFi transactions in a single click as opposed to having to sign multiple transactions. For example, to provide liquidity for a STRK/USDT pair on a platform without account abstraction, you’d have to perform the following steps as three separate transactions:
- Approve STRK
- Approve USDT
- Provide liquidity
On Starknet, all three can be done in one transaction, in one click. Finally, with Starknet’s Paymaster, currently in use by the DEX aggregator AVNU and coming soon at the protocol level, users can pay gas fees not only in ETH and STRK, but also in USDC and USDT. This flexibility makes trading simple and efficient, offering traders more options for fee payment. Here’s how it works:
- Users choose their preferred token for gas fees, which AVNU then covers in ETH or STRK.
- If a user opts to pay with USDC and the gas fee is $0.01, AVNU collects $0.01 in USDC and buys back the equivalent amount of ETH it advanced to the user.
Starknet users currently can pay network fees in STRK and ETH (and, on AVNU, in USDC and USDT). In the future, other tokens will be available for fee payments as well. Eventually, thanks to Paymaster and Starknet’s ultra-low fees, protocols on Starknet could directly pay fees for users.
The road ahead for blockchain scalability and DeFi
Achieving blockchain scalability is vital to enabling faster and cheaper transactions, improved security, and better user experience. These improvements will make DeFi applications-ranging from trading to staking to swapping at scale-economically feasible, and therefore pave the way for mass adoption.
Be sure to stay informed on L2 and DeFi developments. We invite you to dive deeper into the vibrant Starknet DeFi ecosystem to see how Starknet can revolutionize your DeFi experience.