Oracles
To enable smart contracts to connect with the outside world (such as price feeds or randomness) and access off-chain data, Humans.ai supports a number of oracle providers. The centralized, conventional internet and the decentralized, trustless environment of blockchain are connected via these oracles.
A piece of software called an oracle collects information from outside sources and feeds it to blockchain-based smart contracts. As a result, smart contracts are able to react to events that happen in the real world, start automatic processes, and carry out their intended purposes.
How do Oracles work?
+------------+ +------------+ +-------------+
| External | | Oracle | | Smart |
| Data Source| | Service | | Contract |
+------------+ +------------+ +-------------+
| | |
| API Call | |
|---------------------> | |
| | Retrieve External |
| | Data via API Call |
| |---------------------->|
| | |
| | Use External Data |
| | in Smart Contract |
| |<----------------------|
| | |
| | Return Result to |
| | Smart Contract |
| |<----------------------|
| | |
- External Data Source: A data source external to the blockchain network, such as a stock market, weather service, or external API, that provides data to be used by a smart contract.
- Oracle Service: A third-party service that acts as an intermediary between the external data source and the smart contract, retrieving data from the external source and supplying it to the smart contract.
- Smart Contract: A self-executing contract deployed on the blockchain network that utilizes data provided by the oracle service to perform specific actions, such as releasing funds or triggering events.
- API Call: A request made by the smart contract to the oracle service for the required external data.
- Retrieve External Data: The process of retrieving the requested data from the external data source through the API call.
- Use External Data: The process of utilizing the retrieved data in the smart contract to perform actions, such as condition checking and state changes.
- Return Result: The process of returning the result of the action performed in the smart contract back to the oracle.