4.2 Off-chain structure

The off-chain part provides the data source interface, and the core software responsible for the node is responsible for interacting with the blockchain, scheduling tasks, and balancing the workload of various external services.

Work Packages and Work Cores

The work completed by the DeCredit nodes is carried out in a streamline similar to the CPU, which is called a work package. Each work package can be divided into smaller units, that is, a work core. Each work core has specific responsibilities. After the previous work core completes the work, the result will be passed to the next working core, and the final result will be calculated, including HTTP request, JSON parsing and conversion into different blockchain formats, perform integrity verification, and mark the results.

External data source API

The access to external data sources is carried out in the form of external APIs. Currently, the following APIs have been developed:

·Currency Pair API

·Credit Points API

·Random Number API

With the continuous enrichment of applications, we will provide more external APIs, which provide simple parameterized configuration, and programs developed in any programming language can be easily implemented by adding an intermediate API. Likewise, API interaction can be simplified by multiple parameterized work cores.

Off-chain aggregation

The DeCredit oracle supports both on-chain and off-chain aggregation modes. On-chain aggregation: The node submits data to the on-chain contract and aggregates the data within the contract to obtain the best data.

Off-chain aggregation: Trusted data is aggregated off-chain, and the best data is gained and then uploaded to the chain. According to experiments, the reliability and stability of DeCredit off-chain aggregation are improved by more than 30% compared to on-chain aggregation. Since only one transaction is submitted per round, the following benefits can be gained:

·Significant reduction in overall network congestion for oracle networks

·A single node operator spends much less on gas costs

·Node network is more scalable as the data feed can contain more nodes

·Data feeds can be updated in a more timely manner as there is no need to wait for multiple transactions to be confirmed per round before prices are confirmed on-chain

最后更新于