<p>What you are looking for is a type of smart contract.  But be aware, that smart contracts in Bitcoin are generally comprised of <em>multiple</em> transactions, rather than a single transaction confirmed in a block.  You would need this initial transaction to "fund" the contract, and then further transactions that spend the outputs of the funding transaction, based on your conditions.</p>

<p>For example, your initial transaction can be written as to say:</p>

<p>"This money can be claimed by the recipient after a certain amount of time OR it can be reclaimed by me right now if I have some piece of provided information."</p>

<p>Now if the time period expires, it can be assumed that the recipient will create a transaction spending the outputs of the first, thus claiming the money.  However, if the sender has this special information you speak of, he can spend the outputs immediately before the recipient gets a chance.</p>

<p>You can use either <a href="https://en.bitcoin.it/wiki/NLockTime" rel="nofollow"><code>nLocktime</code></a> or <a href="https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki" rel="nofollow"><code>OP_CHECKLOCKTIMEVERIFY</code></a> for the time restriction, and you can use <a href="https://en.bitcoin.it/wiki/Lightning_Network" rel="nofollow">Lightning Network</a> style <a href="https://en.bitcoin.it/wiki/Lightning_Network#Hash_locks" rel="nofollow">hash locks</a> for "when this information is provided".  Keep in mind this is just a simple example of what a potential smart contract solution would look like for you.  You would certainly need to design your own to meet your own requirements.</p>

CC BY-SA 3.0
2016-07-21T13:57:44.460Z
Perhaps worth noting that many contracts involve transactions that are signed ahead of time but not broadcast, specifically to obtain the possibility of them being "reverted" (by never broadcasting them and replacing them with updated versions).
Pieter Wuille
CC BY-SA 3.0
2016-07-21T14:26:47.297Z
Right.  I think most people's confusion with smart contracts comes from the assumption that everything happens on the blockchain.  This is not true.  To use a metaphor of the existing legal system, the blockchain is like the courts.  You generally don't go to court unless something goes wrong.
Jestin
CC BY-SA 3.0
2016-07-21T13:50:09.293Z
2016-07-21T13:50:09.293Z
Jestin
<p>There is no "beneficiary address field" in a blockchain transaction, only the locking script. Since most of the transactions are not strange, the beneficiary address is usually derivated from it. If you have a locking script, by which the sender's signature unlocks it, it will be no different than a transaction sender to sender himself. It looks like it, quacks like it, and shows on sender's balance like it.</p>

<p>To answer the second half of the question, the wallet software will not display an incoming strange transaction, since its strangeness will prevent the wallet to derive its beneficiary address, and wallet only displays transactions sent to its addresses.</p>

CC BY-SA 3.0
2016-07-22T05:57:04.347Z
2016-07-22T05:57:04.347Z
Tankman六四
<p>I am aware that a normal bitcoin transaction cannot be reversed once broadcast and confirmed on the network. My question is whether it is possible to create a strange transaction with an unusual redeem script which would allow the sender to reverse the transaction when this information is provided. </p>

<p>The wallet software might not accept this transaction as spendable but this does not matter as it is supposed to be an unusual transaction. Ultimately my question is whether such a transaction is possible at all but if not, how would I go about creating it?</p>

CC BY-SA 3.0
2016-07-21T11:26:31.987Z
this link may be useful for you: https://www.khanacademy.org/economics-finance-domain/core-finance/money-and-banking/bitcoin/v/bitcoin-security-of-transaction-block-chains
dot.Py
<transactions>
Bitcoin reversible strange transactions
Jim
# Bitcoin reversible strange transactions

(Asked by: username_0 on 2016-07-21)

I am aware that a normal bitcoin transaction cannot be reversed once broadcast and confirmed on the network. My question is whether it is possible to create a strange transaction with an unusual redeem script which would allow the sender to reverse the transaction when this information is provided.

The wallet software might not accept this transaction as spendable but this does not matter as it is supposed to be an unusual transaction. Ultimately my question is whether such a transaction is possible at all but if not, how would I go about creating it?

**Tags:** transactions

> **Comments:**
> **username_1**: this link may be useful for you: https://www.khanacademy.org/economics-finance-domain/core-finance/money-and-banking/bitcoin/v/bitcoin-security-of-transaction-block-chains  

---

## 2 answers

### Answer by username_2 on 2016-07-21. Score: 2

What you are looking for is a type of smart contract. But be aware, that smart contracts in Bitcoin are generally comprised of *multiple* transactions, rather than a single transaction confirmed in a block. You would need this initial transaction to "fund" the contract, and then further transactions that spend the outputs of the funding transaction, based on your conditions.

For example, your initial transaction can be written as to say:

"This money can be claimed by the recipient after a certain amount of time OR it can be reclaimed by me right now if I have some piece of provided information."

Now if the time period expires, it can be assumed that the recipient will create a transaction spending the outputs of the first, thus claiming the money. However, if the sender has this special information you speak of, he can spend the outputs immediately before the recipient gets a chance.

You can use either [`nLocktime`](https://en.bitcoin.it/wiki/NLockTime) or [`OP_CHECKLOCKTIMEVERIFY`](https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki) for the time restriction, and you can use [Lightning Network](https://en.bitcoin.it/wiki/Lightning_Network) style [hash locks](https://en.bitcoin.it/wiki/Lightning_Network#Hash_locks) for "when this information is provided". Keep in mind this is just a simple example of what a potential smart contract solution would look like for you. You would certainly need to design your own to meet your own requirements.

> **Comments:**
> **username_3**: Perhaps worth noting that many contracts involve transactions that are signed ahead of time but not broadcast, specifically to obtain the possibility of them being "reverted" (by never broadcasting them and replacing them with updated versions).  
> **username_2**: Right.  I think most people's confusion with smart contracts comes from the assumption that everything happens on the blockchain.  This is not true.  To use a metaphor of the existing legal system, the blockchain is like the courts.  You generally don't go to court unless something goes wrong.  

---

### Answer by username_4 on 2016-07-22. Score: 1

There is no "beneficiary address field" in a blockchain transaction, only the locking script. Since most of the transactions are not strange, the beneficiary address is usually derivated from it. If you have a locking script, by which the sender's signature unlocks it, it will be no different than a transaction sender to sender himself. It looks like it, quacks like it, and shows on sender's balance like it.

To answer the second half of the question, the wallet software will not display an incoming strange transaction, since its strangeness will prevent the wallet to derive its beneficiary address, and wallet only displays transactions sent to its addresses.


---

