<p>Bitcoin can't directly check the outcome of real-life events. However, it is possible to make conditional transactions with the help of third parties. This can be achieved with multisignature addresses. A multisignature address is an address which is controlled by several different people. To spend the money from such address, signatures from specific number of those people is required. For example, to spend from a 2-of-3 multisignature address, at least two of the three owners must agree on a transaction.</p>

<p>How can this be used to make conditional payments? Well, there are three parties: the sender, the recipient and the party which determines the outcome of the event, which we will call the oracle. The oracle provides a public key which corresponds to the event which is the condition of the payment. If the event happens, the oracle would reveal the corresponding private key, so anyone would be able to use it to make signatures.</p>

<p>Now, suppose that the sender sends his money to a 2-of-3 multisignature address with the owners being himself, the recipient and the public key provided by the oracle. Until the oracle reveals his private key, the recipient can only spend the money with the assistance of the sender. Afterward, the recipient can use the key revealed by oracle to spend the money as he wishes.</p>

<p>This scheme, however, has a few problems. Firstly, if the event doesn't happen, the sender can only take his money back with the assistance of the recipient. Secondly, if the event does happen, the sender can take his money back if the recipient is not fast enough to move it first. The first problem can be solved by having the recipient sign a transaction returning money back to the sender before the sender broadcasts the first transaction. <a href="https://en.bitcoin.it/wiki/Contracts#Example_1:_Providing_a_deposit" rel="nofollow">Here</a> is an example of how this feature can be used. The second problem can be solved by using more complex script than 2-of-3. For example, it is possible to make a script which lets the money to be spent by sender+recipient and recipient+oracle, but not sender+oracle.</p>

<p>By the way, when doing research on this question, I found an actual <a href="https://www.realitykeys.com/" rel="nofollow">website</a> which offers to reveal private keys based on the outcome of real-life events.</p>

CC BY-SA 3.0
2014-09-29T08:47:12.557Z
2014-09-29T08:47:12.557Z
abacabadabacaba
<p>Just starting to learn bitcoin scripting. Can someone explain how to pay out based on some real-life event?<br>
I currently test from the command line with bitcoind -regtest</p>

CC BY-SA 3.0
2014-09-02T20:09:35.403Z
Could you clarify what you mean by conditional? When I use a normal [transaction script](https://en.bitcoin.it/wiki/Transactions), it includes two conditional statements: `OP_EQUALVERIFY` and `OP_CHECKSIG`.
Nick ODell
CC BY-SA 3.0
2014-09-02T20:23:58.997Z
In most simplest form, if a condition is met by checking an outside "oracle", then pay out, if not then do not pay and continue to check until condition is met.
Patrick Francis
CC BY-SA 3.0
2014-09-02T20:30:47.990Z
There isn't one - that's intentional. If it allowed an outside oracle, that oracle might tell one part of the network that the transaction is valid, and tell another that the transaction is invalid.
Nick ODell
CC BY-SA 3.0
2014-09-02T23:21:45.217Z
So how would one go about a conditional script which relies on a real life event to trigger a payout?
Patrick Francis
CC BY-SA 3.0
2014-09-03T01:37:26.867Z
Have a trusted server monitor the real-life event, then make it send the payment when it happens.
Nick ODell
CC BY-SA 3.0
2014-09-03T07:44:33.030Z
@NickODell That seems to be a good start for an answer. :)
Murch
CC BY-SA 3.0
2014-09-03T18:48:52.327Z
I am awaiting the Murphy answer like a school girl
TheGenesisBloke
CC BY-SA 3.0
2014-09-04T22:45:42.700Z
You could use a service such as ifttt or tasker to tie in BitCoin API with a real-life event monitoring service.
Sun
<transactions><bitcoind><bitcoin-core><script>
Bitcoin payout based on real-life event
Patrick Francis
# Bitcoin payout based on real-life event

(Asked by: username_0 on 2014-09-02)

Just starting to learn bitcoin scripting. Can someone explain how to pay out based on some real-life event?  
I currently test from the command line with bitcoind -regtest

**Tags:** transactions, bitcoind, bitcoin-core, script

> **Comments:**
> **username_1**: Could you clarify what you mean by conditional? When I use a normal [transaction script](https://en.bitcoin.it/wiki/Transactions), it includes two conditional statements: `OP_EQUALVERIFY` and `OP_CHECKSIG`.  
> **username_0**: In most simplest form, if a condition is met by checking an outside "oracle", then pay out, if not then do not pay and continue to check until condition is met.  
> **username_1**: There isn't one - that's intentional. If it allowed an outside oracle, that oracle might tell one part of the network that the transaction is valid, and tell another that the transaction is invalid.  
> **username_0**: So how would one go about a conditional script which relies on a real life event to trigger a payout?  
> **username_1**: Have a trusted server monitor the real-life event, then make it send the payment when it happens.  
> **username_2**: @username_1 That seems to be a good start for an answer. :)  
> **username_3**: I am awaiting the Murphy answer like a school girl  
> **username_4**: You could use a service such as ifttt or tasker to tie in BitCoin API with a real-life event monitoring service.  

---

## 1 answers

### Answer by username_5 on 2014-09-29. Score: 1

Bitcoin can't directly check the outcome of real-life events. However, it is possible to make conditional transactions with the help of third parties. This can be achieved with multisignature addresses. A multisignature address is an address which is controlled by several different people. To spend the money from such address, signatures from specific number of those people is required. For example, to spend from a 2-of-3 multisignature address, at least two of the three owners must agree on a transaction.

How can this be used to make conditional payments? Well, there are three parties: the sender, the recipient and the party which determines the outcome of the event, which we will call the oracle. The oracle provides a public key which corresponds to the event which is the condition of the payment. If the event happens, the oracle would reveal the corresponding private key, so anyone would be able to use it to make signatures.

Now, suppose that the sender sends his money to a 2-of-3 multisignature address with the owners being himself, the recipient and the public key provided by the oracle. Until the oracle reveals his private key, the recipient can only spend the money with the assistance of the sender. Afterward, the recipient can use the key revealed by oracle to spend the money as he wishes.

This scheme, however, has a few problems. Firstly, if the event doesn't happen, the sender can only take his money back with the assistance of the recipient. Secondly, if the event does happen, the sender can take his money back if the recipient is not fast enough to move it first. The first problem can be solved by having the recipient sign a transaction returning money back to the sender before the sender broadcasts the first transaction. [Here](https://en.bitcoin.it/wiki/Contracts#Example_1:_Providing_a_deposit) is an example of how this feature can be used. The second problem can be solved by using more complex script than 2-of-3. For example, it is possible to make a script which lets the money to be spent by sender+recipient and recipient+oracle, but not sender+oracle.

By the way, when doing research on this question, I found an actual [website](https://www.realitykeys.com/) which offers to reveal private keys based on the outcome of real-life events.


---

