<blockquote>
<p>I want to know if I can prevent a transaction from being spent at all?</p>
</blockquote>
<p>You can secretly burn money - send it to a randomly chosen address that has not been generated from a private-key.</p>
<p>You can also provably burn money by sending it to a <a href="https://bitcoin.stackexchange.com/q/1851/13866">burn address</a></p>
<p>In either case, the money can never be spent and can never be recovered.</p>
<hr />
<blockquote>
<p>TransactionError::MAX_FEE_EXCEEDED</p>
</blockquote>
<p>Perhaps you spent an input but forgot to return <a href="https://bitcoin.stackexchange.com/q/29953/13866">change</a> which would mean the whole input amount is given to the miner as a transaction fee. Wallets usually have fee limits to catch this kind of mistake.</p>
<p>But see also <a href="https://bitcoin.stackexchange.com/q/10986/13866">dust limit</a></p>

CC BY-SA 4.0
2023-01-16T16:05:59.663Z
Can I return all the money to the coinbase address that started the chain? The reason I got the `MAX_FEE_EXCEEDED` is because I didn't specify an address in order to make the transaction unspendable.
liorko
CC BY-SA 4.0
2023-01-16T16:16:13.750Z
If the transaction was not mined (is unconfirmed), no money has been spent, there is nothing to return. If the transaction is mined (is confirmed), no money can be returned (other than by the recipient creating a new transaction). There is no functional distinction between coinbase addresses and non-coinbase addresses. Anyway addresses don't exist in the bitcoin network.
RedGrittyBrick
CC BY-SA 4.0
2023-01-16T14:43:21.697Z
2023-01-16T14:48:45.480Z
2023-01-16T14:48:45.480Z
RedGrittyBrick
<p>For an academic article I want to know if I can prevent a transaction from being spent at all?</p>
<p>I tried to send a transaction with only one output that contains only data (no output address provided) but it got rejected by the server (mempool) with error message <code>TransactionError::MAX_FEE_EXCEEDED</code>.</p>
<p>---UPDATE---</p>
<p>My intention was that I have an UTXO with OP_RETURN script that I want to be not spendable. I set it's value to be 0.00 BTC and therefore all the inputs values go to fee.</p>
<p>The issue with that that My transaction weight is very small (154 vBytes) and the sum of the input is much higher.</p>

CC BY-SA 4.0
2023-01-17T07:32:42.950Z
The title question is formulated somewhat incorrectly, you want the UTXO (the output of the transaction) to be not spendable, not the transaction.
OptOut
CC BY-SA 4.0
2023-01-17T07:35:56.147Z
Can you elaborate on 'output that contains only data, no output address'. Is it an OP_RETURN script?
OptOut
CC BY-SA 4.0
2023-01-17T07:37:21.423Z
Have you set the value on the output? If not, all input value goes to fee.
OptOut
CC BY-SA 4.0
2023-01-17T14:59:30.157Z
It's not clear to me what you were exactly trying to achieve. Could you perhaps clarify your question now that RedGrittyBrick seems to have given a satisfactory answer?
Murch
CC BY-SA 4.0
2023-01-17T17:05:37.547Z
I updated the question, thank you for your comments.
liorko
<transaction-fees><op-return>
How can I prevent a transaction from being spent
liorko
# How can I prevent a transaction from being spent

(Asked by: username_0 on 2023-01-16)

For an academic article I want to know if I can prevent a transaction from being spent at all?

I tried to send a transaction with only one output that contains only data (no output address provided) but it got rejected by the server (mempool) with error message `TransactionError::MAX_FEE_EXCEEDED`.

---UPDATE---

My intention was that I have an UTXO with OP\_RETURN script that I want to be not spendable. I set it's value to be 0.00 BTC and therefore all the inputs values go to fee.

The issue with that that My transaction weight is very small (154 vBytes) and the sum of the input is much higher.

**Tags:** transaction-fees, op-return

> **Comments:**
> **username_1**: The title question is formulated somewhat incorrectly, you want the UTXO (the output of the transaction) to be not spendable, not the transaction.  
> **username_1**: Can you elaborate on 'output that contains only data, no output address'. Is it an OP_RETURN script?  
> **username_1**: Have you set the value on the output? If not, all input value goes to fee.  
> **username_2**: It's not clear to me what you were exactly trying to achieve. Could you perhaps clarify your question now that username_3 seems to have given a satisfactory answer?  
> **username_0**: I updated the question, thank you for your comments.  

---

## 1 answers

### Answer by username_3 on 2023-01-16. Score: 0 | Accepted answer

> I want to know if I can prevent a transaction from being spent at all?

You can secretly burn money - send it to a randomly chosen address that has not been generated from a private-key.

You can also provably burn money by sending it to a [burn address](https://bitcoin.stackexchange.com/q/1851/13866)

In either case, the money can never be spent and can never be recovered.

---

> TransactionError::MAX\_FEE\_EXCEEDED

Perhaps you spent an input but forgot to return [change](https://bitcoin.stackexchange.com/q/29953/13866) which would mean the whole input amount is given to the miner as a transaction fee. Wallets usually have fee limits to catch this kind of mistake.

But see also [dust limit](https://bitcoin.stackexchange.com/q/10986/13866)

> **Comments:**
> **username_0**: Can I return all the money to the coinbase address that started the chain? The reason I got the `MAX_FEE_EXCEEDED` is because I didn't specify an address in order to make the transaction unspendable.  
> **username_3**: If the transaction was not mined (is unconfirmed), no money has been spent, there is nothing to return. If the transaction is mined (is confirmed), no money can be returned (other than by the recipient creating a new transaction). There is no functional distinction between coinbase addresses and non-coinbase addresses. Anyway addresses don't exist in the bitcoin network.  

---

