GithubHelp home page GithubHelp logo

oracle-ethereum's Introduction

ORACLE ETHEREUM

What is an Oracle?

According to "ethereum.org", they define: "An oracle is a bridge between the blockchain and the real world. They act as on-chain APIs you can query to get information into your smart contracts. This could be anything from price information to weather reports. Oracles can also bi-directional, used to 'send' data out to the real world".

Smart contracts are deployed to the Ethereum blockchain network to allow users to engage with them by submitting transactions that perform a function described in the smart contracts. Because smart contracts are public, they may be viewed of as open APIs that may be used by other smart contracts. The Ethereum blockchain network is a cluster of nodes executing smart contracts. To provide a consistent result, all nodes in the network must have access to the same set of inputs, which is known as the "determinism" property. This property will be used by the Ethereum to validate the smart contract's output - all the validators must produce the same result while the code is executing. To maintain this property, Ethereum must limit access to off-chain information from smart contracts. The reason for this is because if smart contracts are permitted to get data from external sources, even a little difference in time might result in a distinct set of inputs, then resulting in distinct smart contract outputs. Oracle Ethereum appears to be a viable answer to this issue. Oracle is a smart contract that gathers off-chain data and pushed it into the blockchain so that other smart contracts can use it.

2. How to allow a smart contract to retrieve off-chain data automatically?

The Oracle will be made up of two parts: a smart contract on the blockchain (the on-chain oracle) and an off-chain service.

The on-chain oracle provides public functions to emit events that cause the oracle service to be triggered outside of the blockchain.

The off-chain oracle is made up of a number of services that will query the API and deliver the results to the contract.

When smart contracts access the on-chain oracle and call one of the oracle's functions, the oracle emits an event that causes the off-chain oracle to initiate a service. It will then use the API to obtain the valid data that the blockchain requires. The data is then updated in the on-chain oracle by running a function of the oracle smart contract, and the data is returned to smart contracts that have access to the oracle.

A smart contract can use this protocol to obtain off-chain data automatically.

Reference

"https://ethereum.org/en/developers/docs/oracles/"

oracle-ethereum's People

Contributors

minhtc176825 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.