public key – How can I generate expiring transactions?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
I want to generate a transaction that spends funds to a wallet controlled by a third party, but for this transaction to only remain valid for a certain window of time. This could mean a transaction that excecutes successfully if it is accepted within the next three blocks but fails if it is executed after the next three blocks. Let’s assume that information such as block height information is known.
I understand that the default response is to say “Bitcoin transactions do not expire […] so you should just give up.” Any creative solution would be appreciated, consider this a challenge if need be.
A few things that come to my mind that may help you deliver a solution:
- Spending funds to a wallet that a third party controls is not the same thing as spending to an address that a third-party provides.
- You could potentially make use of the public key to generate an address with weirdness or make use of bitcoin script.
- You could potentially make use of two-way communication between the sender and reciever here.
It is not possible to make a transaction which is valid in the past invalid in the future (except in specific cases around soft fork activation). The best you can do is to make it more likely that a conflicting transaction is accepted.
What you could do is making a double spending transaction that has a timelock (so it can’t be confirmed until the “expiration”) and pays a higher transaction fee rate. So once the timelock is passed, the transaction becomes a RBF transaction for the original, making it much more likely to become confirmed. Once confirmed, it would cause the original to become invalid and thus “expired”.