3

How do smart contracts probe information about the real world?

A smart contract's execution can be contingent on real world events such as who will win a football match (this is a betting contract) or what the price of oil is in 90 days (a financial contract). How do smart contracts get this information?

5
  • 2
    Hi there. You mean how does a smart contract get information from an external source? And what is this source? (Ans: an oracle.) Commented Apr 26, 2018 at 19:57
  • Patric Conway: If you illuminate your question with some more words or perhaps an example of what you find unclear, we might get a better understanding of your question and how to answer it. Commented Apr 26, 2018 at 20:28
  • @ThorkilVærge Thank you for the response! Say I were to be writing a contract in which I was purchasing a car. I wanted to validate that the car met certain quality conditions before the transaction was completed. Is this contract possible to be executed on through a smart contract? The only want to verify that these conditions could be met is by physically looking at the car and its current state. Is this only possible through smart contracts if the quality information of the car is already present on the blockchain? Sorry if the question is still unclear - I'm new to this! Commented Apr 26, 2018 at 20:55
  • Thank you, @ThorkilVærge! You've answered the question I didn't know I was trying to ask. Commented Apr 27, 2018 at 0:52
  • You're very welcome :) Commented Apr 27, 2018 at 10:13

1 Answer 1

4

Blockchains are in themselves not capable of revealing truth or facts about the world outside of the blockchain. But if you somehow can get that information onto the blockchain in a reliable manner, you can design contracts whose execution depends on what happens in the "real world".

Let's say we make a contract that depends on the price of oil in 90 days. After 90 days, we execute the contract and it asks another contract (an oracle) for the price of oil. If one person decides what the oracle returns, he can cheat to benefit himself or his friends. But if several people can vote on what the price of oil is, we can use economic game theory to make it more likely that the oracle contract will tell the truth.

The idea is to let people vote on what the price is and reward those whose guess is closest to the median value of all the guesses and punish those whose guess is further from the median. Then no single entity would be able to set a false value in the oracle and the more people you have participating in this process, the less likely a conspiracy to set a false value becomes.

For more information on how oracle's values can be set, have a look at this article.

2
  • Thank you ! Are such oracles a reality today or is this just some concept ?
    – Maxx
    Commented Mar 22, 2021 at 11:05
  • Another question : in your answer, it is about an event that many people have interest for. What about this : I want to sell you an object, and we make a smart contract : you have 14 days to return the product and, if so, you are reimbursed. How to know that the product has indeed been sent, or returned ? My guess is you have to wait until the post office uses smart contracts too..
    – Maxx
    Commented Mar 22, 2021 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.