When DeFi meets Rollup
Editor's Note: This article comes fromCrypto Valley Live (ID: cryptovalley)Editor's Note: This article comes from
Crypto Valley Live (ID: cryptovalley)"DeFi "Crypto Valley Live (ID: cryptovalley)
, Author: Ryan Sean Adams, translation: Ziming, reprinted by Odaily with authorization.
This year (2020), with the recent continued development of the DeFi ecosystem and the continuous impact of Rollups on the mainnet, a natural question arises: how will the two meet?
overview
Can we use Rollups to expand the scale of the DeFi ecosystem? What challenges do we face?"first level title"overview
Optimistic Rollups is a layer 2 architecture designed to reduce the burden on the Ethereum main chain. The basic idea is that the main chain does not verify all transactions on the Rollup side chain, but simply publishes them, and
The core benefit of using Rollups is that it reduces the user's gas cost, which means more transactions per second (at least several hundred TPS) for the entire network. It also means that certain gas-intensive applications (such as privacy solutions using complex cryptography) will become feasible. Therefore, while Rollup itself does not have the inherent advantages of privacy protection, it is a suitable foundation on which to build privacy-preserving technology. Again, Rollup itself does not reduce transaction latency, but it provides a good environment on which we can build a channel that can provide almost instant transactions.
user perspective
The way Optimistic Rollups handles data can simplify application construction, especially compared to other layer 2 protocols. The important thing is that this brings the end user almost the same user experience as using a layer 1 protocol. Likewise for developers and protocol designers, the tools and mindsets they are used to can still be used (although as we will see, solving some of the challenges around composability may require some extra work) .
first level title
user perspective"From a user perspective, interacting with DeFi apps or otherwise on Rollup feels almost the same as using DeFi on layer 1. It can support popular wallets like Metamask and Burner, as well as block explorers to monitor Rollup activity."The basic life cycle of DApp using Rollup is as follows:
First, the user deposits some funds (the
It can be ETH, ERC20s, ERC721s, etc.) into Rollup; this first step is the same as the user experience of many first-tier DApp users, that is, users must transfer funds into the contract before using it. At this point, users can post transactions on the app as they normally would; if Rollup is designed to prioritize censorship resistance, getting one's transactions included on Rollup doesn't need to rely on more trust, reputation, or business. reputation, and face no more potential scrutiny than posting a layer 1 transaction.
T-word
When users want to bring assets back to layer 1, they issue a special withdrawal transaction. At this point we observe a potential difference: Recall that Optimistic Rollup's security model depends on the ability of all parties to issue challenges; thus the process of detecting and proving fraudulent behavior takes a while. This means that once a withdrawal is requested, the user must wait before being able to obtain funds again on layer 1; the economic security provided by this mechanism is actually a function of the amount of stake required for the block and the length of the waiting period mentioned above (Ed Felten I think 3 hours is actually enough).
Having said that, what we would like to see is for users not to go through such a waiting period. For example, a third party can send you an equivalent amount of funds at layer 1 and subtract some related fees so that you can obtain ownership of the funds without waiting. Therefore, as long as we have such a liquidity provider and an interactive interface that simplifies complex things, even the withdrawal at layer 2 will not be much different from the user experience at layer 1.
secondary title"Well, but is Optimistic Rollup really trustless? certainly."To eliminate any trust hazards, anyone (user or otherwise) can become a validator, allowing them to verify for themselves that no one will cheat in it, and that they will be stopped in time if they try to cheat. This is equivalent to running some
check once
additional programs. For users who do not run validators, fraudulent transactions (such as stealing funds) are only possible if all validators are involved in illegal activities and collude with each other. In other words, as long as there is an honest validator out there, be it another user, an exchange, an app developer, a block explorer, a wallet provider, or an anonymous teenager in their basement; All parties involved are malicious, but as long as they do not collude, that is, they do not lie collectively in unison, the entire Rollup will not involve any wrongdoing. Once fraudulent behavior is proven, bad actors are deducted from deposits, some of which are given to fraudulent validators; this incentivizes these honesty validations and allows bad actors to give other validators the wrongdoing Pay the price for the inconvenience.
developer perspective
Next, let's move to the perspective of application developers. We are very happy to find that in the process of building and deploying Rollup DApps, many developers are also familiar with it; developer tools and libraries, such as truffle, web3 and ethers.js , can be re-applied to development in a Rollup environment. Additionally, contracts deployed to Rollup can still be written in Solidity, with some limitations.
secondary title"free"On Composability Challenges
One of the more famous (and occasionally shocking) features of DeFi applications is their ability to collaborate with each other to directly and permissionlessly integrate other financial services. This seemingly radical interoperability actually provides Ethereum contracts at layer 1
free
Services, of course, its disadvantage is that its application scaling (scaling) will encounter bottlenecks. Interoperability between different layer 2 chains, while not lost, becomes more difficult when we split activities into independent layer 2 environments.
Take PoolTogether as an example. PoolTogether is a no-loss lottery DeFi application. PoolTogether's contract governs random lottery winner selection and distribution of funds; funds consist of interest generated by Compound (which is a separate (and pre-existing) application); and its funds form (for one of its pools ) is Dai (issued by a separate contract). This interoperability is no different from the interoperability shown by the three in layer 1."renew"But what if all three contracts are on a separate Rollup?
Migrating assets like DAI from one Rollup to another is not a difficult task, and even looks very similar to asset migration between ordinary layer 1 contracts. However, buying PoolTogether games requires first using PoolTogether to deposit assets into Compound, but if PoolTogether and Compound are on different chains, it is impossible to pass a simple transaction. PoolTogether Rollup needed a new strategy to access and keep up with news about Compound Rollup updates. In some other cases, we can imagine that both contracts might want to have the power to interact bidirectionally with the other contract to obtain these update schedules in a timely manner; of
renew
announcement of.
The Rollup communication tool set here is similar to the communication method between layer 1 blockchains, such as the communication arrangement between different shards (shards) in the context of a system like Ethereum 2.0. In short, we have many different approaches to suit different uses, each with their own technical complexity and/or user experience trade-offs, depending on the specific needs. This article won't get into the technical details, but UX tradeoffs often involve things like asking users to wait longer for their transactions to be confirmed and/or posting multiple transactions to complete their desired operation.
Let's make that analogy a little more exaggerated: Do friends who already live in the same space need to move to different houses and communicate with each other by yelling out the window? Or communicate through some intermediate location or shared room? Or just chat digitally (fast, but requires more advanced phone technology)?
While the possibilities are many, in short Rollup communication will never be as simple as "chatting face to face".
We can imagine such an extreme situation: we put a large number of applications (such as all DeFi) on a huge Rollup. At this point the complexity of cross-Rollup interoperability disappears; Compound and PoolTogether can interact freely on layer 2 as they do on layer 1.
But the only problem with this vision is that it destroys the gains in scalability that we were chasing when we started. Layer 2 scalability comes largely from partitioning and localizing work that would otherwise have to be done globally; a single, busy Rollup would be harder to verify, and It will make us even more confronted with the problems we were trying to avoid in the first place. In other words, we don't want to move out of an already overcrowded house into a new one.
Then perhaps the ideal implementation operates in a position of compromise: those applications that benefit from (or need) mutual composability can choose to run on a common Rollup, while interacting with other rollups in appropriate ways as needed. chain for communication.
image description


