2

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?

  • 2
    Hi there. You mean how does a smart contract get information from an external source? And what is this source? (Ans: an oracle.) – Richard Horrocks Apr 26 '18 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. – Thorkil Værge Apr 26 '18 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! – Patrick Conway Apr 26 '18 at 20:55
  • Thank you, @ThorkilVærge! You've answered the question I didn't know I was trying to ask. – Patrick Conway Apr 27 '18 at 0:52
  • You're very welcome :) – Thorkil Værge Apr 27 '18 at 10:13
3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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