How to manipulate oracle prices through flash loans?

avatar
NEST爱好者
3 years ago
This article is approximately 1185 words,and reading the entire article takes about 2 minutes
DeFi solves the problem of oracle machines and improves the anti-attack performance is the root of resisting the malicious attacks of flash loans, so as to enter the mainstream financial world.

Author: Zhiyu | NestFans Forum 

text: 

text:

secondary title

What is a flash loan?

secondary title

Why are there flash loans?

In the early days of DeFi lending, it was necessary to over pledge to borrow a sum of money, and the utilization rate of funds was very low. With the prosperity of the DeFi ecosystem, smart contracts can support and call each other, and flash loans are born. The earliest discussion on flash loans was the Aave protocol, and the first flash loans also came from the Aave protocol.

Its original intention is to improve the utilization rate of funds and ensure that users do not need mortgages to achieve rapid borrowing. Although flash loans have greatly improved the utilization rate of encrypted funds, they have also buried some security risks.

secondary title

Flash loans should be viewed from the perspective of blockchain

When we discuss the issue of flash loans, we need to discuss it from the essence, from the essence of the blockchain. In the world of blockchain, it is assumed that everyone is a perpetrator, just like Satoshi Nakamoto created the Bitcoin network, and even himself is assumed to be a perpetrator, in order to ensure the security and decentralization of the system. Therefore, in a sense, flash loans allow everyone to have the opportunity to become a super perpetrator, which is necessary. If these super perpetrators succeed in doing evil, it directly proves the vulnerability of the DeFi protocol. DeFi is not established and needs to be innovated and improved. Because this kind of success also indirectly proves that a real giant whale can complete such an attack. If the DeFi ecology cant even pass this level, how can we talk about system security and how to carry a trillion-dollar market value? What about the encrypted market? So in the face of flash loans, the real question that DeFi scientists need to solve is: what exactly is flash loan attacking? Is it a technical problem or a mechanism problem?

secondary title

Discussion on oracles

The DeFi ecology now needs to recognize a reality, the price oracle is the most important underlying infrastructure of the DeFi ecology! If the oracle problem cannot be solved, no matter how good the code quality is, the DeFi protocol is just a castle in the air.

If you want to form a huge DeFi market on the chain, the first step is to generate prices on the chain. However, the blockchain cannot automatically generate price information on the chain, and needs to rely on external facilities to write price information. Therefore, the action of writing is very important. How to make price information directly on the blockchain in a decentralized manner Generated is what the oracle machine will do.

secondary title

Lets take a look at the NEST oracle solution

The NEST oracle machine solution adopts a new idea of ​​reverse verification. Quotation miners have to use real money to participate in the quotation, not just upload the price data to the contract on the chain. In the case of taking risks and paying quotation fees, there is a cost The price output is worth considering and needs to be verified by the market block. Regarding the specific operating mechanism of the NEST oracle machine, we will use the ETH/USDT price as an example to illustrate:

1. Any participant can pass the price he or she recognizes into the quotation contract, such as 1 ETH = 400 USDT, and then put these two assets into the quotation contract according to the price ratio. The initial scale is 30ETH, and ETH will be charged 0.3% of the scale is used as a handling fee for mining to obtain NEST incentives;

2. After typing in, wait for T0 time (currently 25 blocks, about 5 minutes), within this time period, anyone can buy ETH or USDT at the bidders price, if no one trades within T0, then the If the quotation is accepted by the system, if someone makes a transaction, the price will be invalid. After this time, the assets can be recovered;

3. If someone is willing to make a deal with the bidder, he must quote a new price according to the above standard at the same time of the deal, so that a p1, p2... price chain will be formed after the initial quotation P0.

4. The bid size of the trader is an integer multiple of beta of his trade size, where beta > 1, which means that the price chain will eventually terminate (stop) as the scale expands, and the cost of the perpetrator will increase geometrically. against aggressive behavior.

5. NEST value: Mining fees and the use of oracle machines need to pay a certain ETH fee, which is unified into the dividend contract and distributed to all circulating NEST holders.

The performance of such a NEST distributed price fact oracle program in terms of specific results: its data is accurate, sensitive, and resistant to attacks, and it can directly verify the data, and the verifier can be any third party without threshold In addition, the NEST oracle machine network system is highly distributed, and anyone can become a quote miner, participate in quote mining, and freely enter or exit. In the NEST quotation mechanism, the price you write with real money has to be verified by the whole market. Only the price data that has survived 25 blocks will be entered by the NEST oracle system. Only this point, the flash loan attack It cannot be realized, because the flash loan must be repaid in time within one block, and it is almost impossible to control the NEST oracle machine.

Finally, we make a summary of the current status and development trends of oracles:

1. The centralized oracle machine solution must have a centralized system risk, and it is impossible to get rid of it.

2. The essence of uploading price data to the chain is not to upload data information on the chain, but to form (generate) price facts on the chain; whether it is to upload price information in a centralized manner or in a decentralized way, all It means that the off-chain price fact is generated before the on-chain. And the real oracle system should realize that the off-chain price fact is synchronously generated on the chain.

3. The NEST distributed price fact oracle machine provides a pioneering oracle machine solution, which is unique in that it directly forms a price fact on the chain, while other indirect oracle systems only upload a price fact to the chain , this is the essential difference!

4. In addition, the cost and credit scale of the price formation of the oracle machine must be able to support DeFi far beyond this scale, which is the correct oracle machine; every piece of data generated by the NEST distributed price fact oracle machine is real gold and silver for miners Unverified, and its chain structure is highly resistant to attacks.

It is hoped that more DeFi eco-scientists will face up to the problem of oracles, and jointly participate in the construction of oracle infrastructure, maintain the network security of the infrastructure, promote the prosperity and development of the DeFi ecosystem, and make it possible to carry a trillion-dollar market.

Original article, author:NEST爱好者。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