Inference from Radix and StarkWare technologies: What kind of underlying network does DeFi need?

avatar
白计划
4 years ago
This article is approximately 1956 words,and reading the entire article takes about 3 minutes
Some DeFi are suitable for layer1 expansion.

Inference from Radix and StarkWare technologies: What kind of underlying network does DeFi need?

If we go deep into the technical logic of layer2 and layer1, we may find:

Some DeFi are suitable for layer 1 expansion, choose Radix and Near, which are known for their sharding technology, while some DeFi are suitable for building high-frequency transaction areas in layer 2, such as StarkWares StarkEx system.

Text|Li
DeFi has become an integral part of the cryptocurrency world.
image description

Inference from Radix and StarkWare technologies: What kind of underlying network does DeFi need?

The picture above shows the changes in DeFi locked-up assets displayed by DeBank

This huge number is formed based on Ethereum. Today, Ethereum has assumed the liquid value of BTC, ETH, DAI and other assets on the chain. However, according to the operating logic of Ethereum, behind this huge number is a huge LF.
By checking the gas consumption of Ethereum, it can be seen that today, with the rising price of ETH and the increasing number of DeFi applications, the peak income of miners in a single day of Ethereum has exceeded 27 million US dollars. In addition to regular block rewards, a large portion of this figure is generated by DeFi users calling smart contracts.
Excessive gas fees not only increase the threshold for users to use cryptocurrencies, but from a higher perspective, this hinders the original intention of cryptocurrencies: inclusive finance.
Therefore, cryptocurrencies need to solve the cost problem in transactions to achieve lower-cost DeFi transactions. At present, many public chain projects already have a clear development roadmap. Ethereum has the most DeFi, so its current expansion plan is the most representative. There are three plans: switch to PoS, sharding, and layer2.

secondary title

Layer2 is currently the easiest expansion solution

Ethereum and other public chains are trying to use the multi-chain structure to expand capacity, such as the possible homogeneous sharding of Ethereum 2.0, the heterogeneous sharding that Polkadot is implementing, and the cross-chain structure of COSMOS. The newly emerging networks such as the Avalanche Protocol have more detailed definitions of functional layering and functional modularization in the multi-chain structure to achieve expansion.
These are huge and long-term designs. For example, Polkadot needs to go through slot auctions in the future, COSMOS needs to build a better ecology, and the technological progress and ecological construction of the rest of the chains are still in their infancy.
For other projects that focus more on expansion, they will focus more on a single network structure, such as implementing fragmentation in layer1, and the representative projects are Radix and Near. In the long run, the expansion of layer1 (such as sharding) is inevitable. After these networks are compatible with EVM, Defi can be quickly migrated to the network. If the problem of asset transfer is solved, these networks will become the extended network of Ethereum.
However, for the bull market with strong demand for DeFi, the expansion of layer 2 is necessary.

secondary title

Briefly analyze the principle of Layer2

Lets take a look at the principle of Layer2.
Still taking Ethereum as an example, its layer2 solution is to establish an off-chain structure or sidechain structure on Ethereum, map the address balance on Ethereum to layer2, and then complete transactions between accounts and Other operations, and then feed the settlement result back to the chain to confirm the data change of the final address.
In this way, for DeFi applications running on layer 2, only when layer 2 is started and the final settlement is just started, layer 2 interacts with the chain, and other transaction processes take place in layer 2, which will not occupy resources on the chain and can achieve fast processing transactions and effectively reduce gas consumption.
But this approach still has two associated concerns:
1. If the performance of the main chain is not good, when there is congestion on the chain, the settlement between layer2 and the account may still require a high gas fee and a long confirmation time.
2. It may not be possible to interact with other assets and contracts on the chain at layer 2. If it can interact, it still needs to call resources on the chain multiple times, which will cause a problem of 1.
Because in addition to the transaction being packaged to form a block and stored on the chain, all smart contracts are also uploaded to the chain. The normal state of DeFi is that asset contracts, loans, and transaction contracts call each other, so when calls occur between contracts , which is when resources on the chain are occupied.
This means one: the process of paying gas fees is unavoidable, and the other: DeFi requires rich composability.
So the root of solving the problem is to solve the gas problem brought by the Ethereum PoW chain and maintain the composability between DeFi. This brings the answer: if the performance of layer1 is fast enough, there is no need for layer2 to expand the capacity. If it is not suitable for layer2 business, try to use layer1 expansion technology, because layer2 will affect the combination of smart contracts.
3. Example of layer2 design of StarkWare
However, in the hot demand of the bull market, layer2 is the choice for many projects to seek development. For example, dYdX will use StarkWare technology to build the StarkEx system for perpetual contract transactions. Lets look at the technical logic of StarkWare.
image description

Inference from Radix and StarkWare technologies: What kind of underlying network does DeFi need?

The layer2 network structure that StarkWare will form in the future

For example, dYdX is a DEX in the form of an order book. Before layer 2 was applied, the order book matching of dYdX worked off-chain, and the settlement data would be synchronized with on-chain interaction. This process would generate high gas fees. After applying layer 2 , the StarkEx system will complete the settlement process at layer2, which will significantly reduce the gas fee consumption in this process.
But this will bring about some associated impacts, such as the steps used will be slightly complicated, it may not be applicable on the mobile terminal, and layer2 account opening costs may be incurred. In addition, the biggest problem is that if dYdX wants to open combined applications with other DeFi protocols, other DeFi applications need to be deployed on this network.
From the perspective of the original intention of cryptocurrency, this is not the practice of financial inclusion, and its application may end up being the domain of power users and professional users.
Therefore, compared to layer2, which allows some DeFi (requiring frequent transactions) to run faster, some DeFi are more suitable for using layer1 expansion solutions or higher-performance networks.
secondary title

Layer 1 expansion ideas that are more in line with DeFi characteristics

So how to confirm what kind of layer1 DeFi needs? Radix has given some ideas in its network design:
1. Solve the performance bottleneck caused by the consensus problem.
2. Do your best to create composability.
So Radix took something a little different.
In the homogeneous sharding and heterogeneous sharding we mentioned above, the distributed shards are chains composed of some nodes. It can be understood as dividing some nodes into a partition, which exists independently of other partitions and processes tasks separately.
For example, in Ethereum 2.0, if the original sharding roadmap is still followed, 64 shards may be established in the initial stage, and these shards will eventually be verified by the beacon chain. The communication between the shards is called cross-linking. , if one of the shards needs to verify other shards, the inter-shard communication will only take place. And because of the existence of shards, DApp developers need to choose a shard as the main processing area when developing DApps on Ethereum.
This means that if the DApp needs to obtain data from other shards, there will be some complicated steps. The structure implemented in Polkadot and COSMOS is also the same. Polkadots parachains are fragments in the heterogeneous sharding structure. The interaction between parachains is carried out through the relay chain, but the interaction process is more complicated and requires to be defined separately. The same is true for COSMOS.
Such sharding is a demarcated design. Each shard chain will form a certain island effect, and some follow-up problems will naturally arise.
But if you change your thinking, some new technical ideas may emerge.
image description

Inference from Radix and StarkWare technologies: What kind of underlying network does DeFi need?

Schematic diagram of Radix fragmentation deployment

This kind of sharding is different from the above-mentioned definition of some nodes as sharding chains. Instead, all computing resources that join the network are first divided into different shards. Sharding is not divided by chains, but by random commands. They are randomly assigned to the determined shard positions, and these shards separated by commands form large partitions one by one.
This method of pre-setting the location of shards and then dynamically assigning commands to each location to form shards requires a consensus to confirm the final state. Radix’s Cerberus consensus implements this process. Just like the beacon chain’s ghost algorithm to achieve finality, the Cerberus consensus can determine the ordering of transactions and form the final data set for verification by the verifier.
The best way to do this is to achieve greater parallelism and mobilize all resources to use, rather than some boundary problems caused by fixed partitions.
Second, an important issue is compositionality.
Compared with Ethereum, the combination on the chain is the mutual interaction between smart contracts. For example, cToken borrowed through Compound can be mined and swapped in other DeFi. This means that the DeFi contract needs to call the Compound contract to confirm the cToken. The call between the contracts is the embodiment of composition.
If the two are not deployed in the same network or shard, it is difficult to combine them together, requiring gateway processing or the existence of a mapped smart contract.
In order to solve this problem, Radixs idea is to reduce the programming complexity of the smart contract, because the smart contract will definitely record the account book to output the final result, but if it is implemented in layer1, the smart contract can be replaced with a more For the execution process of small units, Radix calls this execution unit a component, which defines the functions of components in advance. The execution of these components is very simple and direct, so that multiple components can be combined to quickly execute DeFi business.
For example, when a smart contract is a transfer, the smart contract needs to edit the accounts of the two parties, that is, to form a small ledger, which is destroyed at the transfer party and added at the receiver. However, if Radix’s component design is used, it is enough to design the component as a’s transfer token belonging to b, which is very fast and does not require more proofs.
image description

Inference from Radix and StarkWare technologies: What kind of underlying network does DeFi need?

Radix component example

According to the official technical documentation, the current components established by the Radix Foundation will include some standard functions of DeFi applications. It will include (as shown in the figure): assets (substitutable or non-substitutable tokens), accounts (including multi-sig control), liquidity pools, exchange systems, purchasable assets, data oracles, etc.
These components can all be instantiated directly, for example via API calls to create a custom token supply or modularly combined in various ways to create more complex functionality.
5. Can DeFi applications be expected on the new network?
Just like Compound once revealed that it is considering a new public chain, for the current smash hit DeFi, choosing a new network is a challenge.
Whether it is feasible to migrate to another public chain is not only a performance consideration, but also has a huge relationship with the asset compatibility of this chain with Ethereum, Bitcoin and other networks, and the value of the basic currency on the chain.
So for the time being, no DeFi can escape from Ethereum, but there are many new attempts. On February 11th, Chainlink, Aave, mStable, Messari, and Radix announced the joint launch of a new DeFi alliance, GoodFi. This alliance aims to promote education, research and practical development in the DeFi industry. This gives us hope.
Looking forward to the early emergence of DeFi with low cost and good experience.

Original article, author:白计划。Reprint/Content Collaboration/For Reporting, Please Contact report@odaily.email;Illegal reprinting must be punished by law.

ODAILY reminds readers to establish correct monetary and investment concepts, rationally view blockchain, and effectively improve risk awareness; We can actively report and report any illegal or criminal clues discovered to relevant departments.

Recommended Reading
Editor’s Picks