5. Safety mechanism

Security is the primary issue addressed by DeCredit oracles, including the design of DeCredit oracles for confidentiality, integrity, and availability. If the credit data is not encrypted, the risk of leakage is very high; if the price of the oracle machine is wrong or the real-time performance is not high, it will lead to wrong DEFI liquidation; if the GPS data of the trade finance smart contract is tampered with during the transmission process, then it is possible to pre-pay rashly before delivery.

Under a distributed environment, DeCredit security focuses on:

In order to deal with a single data source Src risk vulnerability, it is modified to obtain data from multiple data sources, that is, the distributed data source mode is adopted. The trusted ORACLE may request data from the Src1, Src2,...,Srck data source sets to obtain a1, a2,...ak result sets, and aggregate them into a single data A=agg(a1 ,a2,...,ak). The agg function returns the result a if most of the data sources return the same value a; otherwise it returns false. In this way, if most of the data sources (i.e. greater than k/2) are functioning properly, the ORACLE will always return the correct value of a.

Regarding quotations, in addition to taking the average, there are more quotation stability solutions

Deviation of quotation:

The quotation is updated according to the deviation and time, and the quotation deviation threshold and interval time are set. Generally, the deviation threshold is within 5% and 10%, or the time exceeds 10800 seconds.

Quotation node:

5≤number of quotation nodes ≤30

If the quotation node is less than 5, it returns false, and if the quotation node is greater than 30, the best price will be obtained according to the quotation algorithm.

Security guarantee:

Node credit value: The higher the credit, the higher the security. Mortgage token: The larger the mortgage token and the longer the time, the higher the security. Deviation: The price deviation is safe within 10%, there will be a warning when it’s between 10% and 20% is a warning, and if it’s more than 20%, it is regarded as unsafe.

Quotation Mode:

Average price: Take the average price of all nodes.

Optimal price: Take the average price of the middle price node, set the number of nodes to be N, then remove the highest price and the lowest price, take the average price of the middle node

Time-Weighted Average Price (TWAP): Take the weight of each node and accumulate. When all the weights are the same, it takes the average price formula.

Credit price: set a certain limited credit price, take the credit value K a percentage between 0 and 1, where K1 is the lowest credit, K2 is the highest credit, and the background parameters can be used to adjust K1 and K2.

Quartile price: The quartile price of the node market maker model arranges the price of the oracle data source from low to high, forming a price sequence a1,a2,a3,... Then three quartiles Q1, Q2, Q3 are obtained.

最后更新于