Skip to content

Oracle service

Milen Radkov edited this page Nov 12, 2019 · 2 revisions

Waellet Oracle Service

This service is used for firing up and maintaining oracle services used in the waellet browser.

Oracles

How oracles operate:

  • An oracle is an entity on the blockchain and lives in the oracle state tree in a full node.
  • An oracle is operated by an oracle operator.
  • The oracle operator creates an oracle through posting a oracle register transaction on the chain.
  • The oracle register transaction register an account as an oracle. (One account - one oracle)
  • Any user can query an oracle by posting an oracle query transaction on the chain.
  • The oracle query transaction creates an oracle query object in the oracle state tree.
  • The oracle operator scans the transactions on the blockchain for the oracle query transaction through whatever means. Probably on the operator's own node.
  • The oracle operator responds to the oracle query by posting an oracle response transaction on the chain.
  • The oracle response transaction modifies the oracle query object by adding the response.
  • After the response have been added, the oracle query object is closed, and is now immutable.

More info here: https://github.com/aeternity/protocol/blob/master/oracles/oracles.md

Oracles in the waellet

Oracles are needed in waellet for providing data to waellet's smart contracts from an outside environment. One of the functionalities in the waellet e.g. the tipping functionality is relying on such service in order to work in a decentralized manner.

Oracles are used to verify the ownership of a certain domain name. The smart contracts generate a TXT record that one will need to add to the claimed domain's DNS records in order for them to prove its ownership.

How the tipping works

It works in a decentralized way via smart contracts, allowing visitors to tip a website with only few simple clicks in the waellet extension.

Meanwhile the tipping functionality works out of the box and one can tip a website even if it is not yet confirmed by its owner.

The smart contract will act as a jar and store the tips until the rightful owner claims the possesion of the domain.

Tipping smart contract: https://github.com/waellet/waellet-contracts/blob/master/contracts/waellet-tip.aes

Scheme

          +------------------------------------------------------+
          |                                                      |
          |   tip a website                                      |
          |                                                      |
          |   +----------------+     verify     +------------+   |
          |   |                |                |            |   |
          |   |  tip contract  +--------------->+   oracle   |   |
          |   |                |                |            |   |
          |   |     websites   |                |            |   |
          |   |       tips     |                |            |   |
          |   |       owners   |    response    |            |   |
          |   |                +<---------------+            |   |
          |   |                |                |            |   |
          |   |                |                |            |   |
          |   +----------------+                +------------+   |
          |                                                      |
          |                                                      |
          +------------------------------------------------------+
Clone this wiki locally