<p>No. You can't impose restrictions on where a current UTXO moves (without covenant functionality that isn't enabled on Bitcoin today) let alone impose restrictions on where a future UTXO moves.</p>

CC BY-SA 4.0
2022-09-05T12:05:32.067Z
Thanks, slightly updated q (input rather than output). Another way of asking - is tx input amount able to be referred to by the script?
Lee
CC BY-SA 4.0
2022-09-05T12:08:25.163Z
.. and perhaps that would only work if `OP_DIV` or `OP_MUL` enabled
Lee
CC BY-SA 4.0
2022-09-05T12:25:50.203Z
Apologies, updated again, removed UTXO ref, I now get that UTXOs are referenced by hash and so you can't "send to an input".. answer still no I think.
Lee
CC BY-SA 4.0
2022-09-05T12:35:06.377Z
No there's no opcode that refers to the amount in the UTXO. You could create a transaction spending to the three recipients with the three stated proportions, not broadcast it and then delete the private keys so no other transaction can be constructed that spends that UTXO. At the moment that's the only way of doing something like this.
Michael Folkson
CC BY-SA 4.0
2022-09-05T12:37:06.560Z
I see, you broadcast the tx after deleting keys else would burn the coins?
Lee
CC BY-SA 4.0
2022-09-05T12:40:57.353Z
Only if you lost the transaction that you were meant to broadcast at some later point. As long as you store it safely you can broadcast it later at the time of your choosing.
Michael Folkson
CC BY-SA 4.0
2022-09-05T11:58:22.430Z
2022-09-05T11:58:22.430Z
Michael Folkson
<p>As Michael already explained, it is not possible to make a transaction that spends unknown UTXOs since a transaction must state which outputs it consumes. Such a functionality could be partially enabled by e.g. sighash_anyprevout (BIP118) which identifies the spent input by the <code>scriptPubKey</code> rather than identifying a specific UTXO, but even then you'd need to know the expected value of the UTXO in advance, as the output amounts are predetermined.</p>
<p>A practical solution might be to run an automated process which regularly checks if there is a balance on the online service's wallet and then creates a transaction which splits the funds in the pre-defined proportions to the receivers. The receivers would then trust this service for the duration until the wallet is swept not to steal or compromise the funds.</p>

CC BY-SA 4.0
2022-09-07T19:23:20.683Z
2022-09-07T19:23:20.683Z
Murch
<p><strong>Is there a way to divide an unknown future input amount received by a given address amongst three recipients with proportions of, for example 0.2 , 0.3, 0.5?</strong></p>
<p>This would need to be done in such a way that one could send an amount and be sure that it will be divided in this way.</p>
<p>It would not matter if the transaction was &quot;blank cheque&quot;/repeatable <a href="https://bitcoin.stackexchange.com/a/13465/34190">as described here</a>.</p>

<transactions><script><covenants>
Divide unknown future input amount sent to a given address amongst known recipients in known proportions?
Lee
# Divide unknown future input amount sent to a given address amongst known recipients in known proportions?

(Asked by: username_0 on 2022-09-05)

**Is there a way to divide an unknown future input amount received by a given address amongst three recipients with proportions of, for example 0.2 , 0.3, 0.5?**

This would need to be done in such a way that one could send an amount and be sure that it will be divided in this way.

It would not matter if the transaction was "blank cheque"/repeatable [as described here](https://bitcoin.stackexchange.com/a/13465/34190).

**Tags:** transactions, script, covenants


---

## 2 answers

### Answer by username_1 on 2022-09-05. Score: 2 | Accepted answer

No. You can't impose restrictions on where a current UTXO moves (without covenant functionality that isn't enabled on Bitcoin today) let alone impose restrictions on where a future UTXO moves.

> **Comments:**
> **username_0**: Thanks, slightly updated q (input rather than output). Another way of asking - is tx input amount able to be referred to by the script?  
> **username_0**: .. and perhaps that would only work if `OP_DIV` or `OP_MUL` enabled  
> **username_0**: Apologies, updated again, removed UTXO ref, I now get that UTXOs are referenced by hash and so you can't "send to an input".. answer still no I think.  
> **username_1**: No there's no opcode that refers to the amount in the UTXO. You could create a transaction spending to the three recipients with the three stated proportions, not broadcast it and then delete the private keys so no other transaction can be constructed that spends that UTXO. At the moment that's the only way of doing something like this.  
> **username_0**: I see, you broadcast the tx after deleting keys else would burn the coins?  
> **username_1**: Only if you lost the transaction that you were meant to broadcast at some later point. As long as you store it safely you can broadcast it later at the time of your choosing.  

---

### Answer by username_2 on 2022-09-07. Score: 2

As username_1 already explained, it is not possible to make a transaction that spends unknown UTXOs since a transaction must state which outputs it consumes. Such a functionality could be partially enabled by e.g. sighash\_anyprevout (BIP118) which identifies the spent input by the `scriptPubKey` rather than identifying a specific UTXO, but even then you'd need to know the expected value of the UTXO in advance, as the output amounts are predetermined.

A practical solution might be to run an automated process which regularly checks if there is a balance on the online service's wallet and then creates a transaction which splits the funds in the pre-defined proportions to the receivers. The receivers would then trust this service for the duration until the wallet is swept not to steal or compromise the funds.


---

