How can I include real world data in a smart contract?

307 views Asked by At

Lets say that I want to write a simple contract to bet on the weather 10 days from now, or the outcome of a sporting event.

How could I connect to a third party application that hosts data and use that to write my smart contract?

1

There are 1 answers

0
Lucas Hendren On BEST ANSWER

What you are looking for is an oracle.

Ethereum and other blockchains are unable to access data outside of their network(The way to think about it is imagine if the entire Ethereum network tried to access the weather api you mentioned at the same time...) which is where Oracles come in. Oracles are third party services designed for use with smart contracts that provide and push external data to the chain including weather for example.

There are many different ways to set this up and different services you can use for your own oracle

I included a link to Gnosis' white paper so you can see how they handle Oracles. https://gnosis.pm/ And I included a link to further general explanation on Oracles https://blockchainhub.net/blockchain-oracles/