aelf Oracle Episode 1: What is an oracle? How does it work?

Oracle may not be a common concept to the general, however, it is something of great importance to those who are deeply engaged with DeFi — oracle helps retrieve live token prices for the protocols.

So how this happens? There will be an oracle organization with around 10–20 nodes. The organization retrieves the token price on a certain exchange to its serving chain via a transaction. The transaction will be executed every an hour or two; or in some cases where the service fee is cheaper on certain chains, it can even be shortened to ten or twenty minutes. In this way, the DeFi contract can receive the price of certain trading pairs in exchanges.

Oracle can do more than this. In addition to currency price pairs, oracles play a key role in reserving proofs, generating random numbers, on-chain gaming, insurance, and many more. Intrinsically, it is a mechanism that transfers data in a reliable way. The reliability lies in the oracle organization.

All members in the oracle organization are obligated to have correct data. The mechanism is set in certain ways. Some nodes may have staked a large amount of token when joining the organization; some will lose money if making mistakes; some are managed under certain decentralized structure so that no one can falsify data; or to considerate it from a sustainable perspective, nodes will not give up their reputation for an immediate benefit.

The aelf mainnet officially deployed a series of contracts related to the oracle mechanism two weeks before the mainnet token swap. Two of the contracts are at the core, one static, and one moving. The Regiment contract is responsible for maintaining the oracle organization. The Oracle contract can trigger the entire process of the oracle mechanism itself.

Regiment Contract

Management of oracle organization is like the ...

-----
To keep reading, please go to the original article at:
Stories by ælf on Medium

Comments (No)

Leave a Reply