0

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?

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 or OP_CHECKLOCKTIMEVERIFY for the time restriction, and you can use Lightning Network style 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.

  • 1
    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 Jul 21 '16 at 13:57
  • 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 Jul 21 '16 at 14:26
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.

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.