<blockquote>
<p><strong>if different people have the same transaction but with different output1 and output1 amount, would there be any conflicts?</strong></p>
</blockquote>
<p>Those transactions would all have the same inputs.</p>
<p>A transaction always consumes and destroys all its inputs.</p>
<p>Therefore the first transaction to be broadcast and confirmed would invalidate all the others.</p>

CC BY-SA 4.0
2024-03-19T10:35:04.440Z
Thank you so much for your answer. It makes sense, I know, but if SIGHASH_SINGLE is signed this doesn't mean that the signature is valid for ANY input, and just a certain output? I mean, regardless a previous transaction consumes and destroys certain inputs, if the address has more unspent inputs the transaction can be used for those?
skydanc3r
CC BY-SA 4.0
2024-03-19T12:41:37.457Z
Transactions don't reference addresses. Specifically, inputs and outputs never contain addresses as such. They reference specific UTXOs.  Therefore any reasoning involving addresses can't apply to the processing of transaction inputs.
RedGrittyBrick
CC BY-SA 4.0
2024-03-19T09:23:39.030Z
2024-03-19T09:23:39.030Z
RedGrittyBrick
<p>I am trying to achieve a more complex task, as an use-case where a company holds a very popular bitcoin address that has many hundreds of inputs (UTXOs) in related to stocks it issued.</p>
<p>Now, the intention is to build a transaction that all the stock owners can broadcast if and when they decide to. But they should not be able to spend more than their rightful amount. Can <code>SIGHASH_SINGLE</code> be used in this case?</p>
<p>Example:
input0, input1, input2, input3, input4 total = 5.001 btc
output0 = 4 btc, output1 = 1 btc, fee = 0.001 btc</p>
<p>where <em>output0</em> is the entire amount going back to the same address
<em>fee</em> is the fee
and <em>output1</em> is the address of the holder that is entitled to withdraw no more than 1 btc.</p>
<p>The goal is to have a transaction that someone can use to withdraw no more than a certain amount and be valid for any inputs of a given address. Also, if different people have the same transaction but with different output1 and output1 amount, would there be any conflicts?</p>

<script><sighash>
How to build a transaction that is valid for ANY input of an address but with a specific output
skydanc3r
# How to build a transaction that is valid for ANY input of an address but with a specific output

(Asked by: username_0 on 2024-03-17)

I am trying to achieve a more complex task, as an use-case where a company holds a very popular bitcoin address that has many hundreds of inputs (UTXOs) in related to stocks it issued.

Now, the intention is to build a transaction that all the stock owners can broadcast if and when they decide to. But they should not be able to spend more than their rightful amount. Can `SIGHASH_SINGLE` be used in this case?

Example:
input0, input1, input2, input3, input4 total = 5.001 btc
output0 = 4 btc, output1 = 1 btc, fee = 0.001 btc

where *output0* is the entire amount going back to the same address
*fee* is the fee
and *output1* is the address of the holder that is entitled to withdraw no more than 1 btc.

The goal is to have a transaction that someone can use to withdraw no more than a certain amount and be valid for any inputs of a given address. Also, if different people have the same transaction but with different output1 and output1 amount, would there be any conflicts?

**Tags:** script, sighash


---

## 1 answers

### Answer by username_1 on 2024-03-19. Score: 0

> **if different people have the same transaction but with different output1 and output1 amount, would there be any conflicts?**

Those transactions would all have the same inputs.

A transaction always consumes and destroys all its inputs.

Therefore the first transaction to be broadcast and confirmed would invalidate all the others.

> **Comments:**
> **username_0**: Thank you so much for your answer. It makes sense, I know, but if SIGHASH_SINGLE is signed this doesn't mean that the signature is valid for ANY input, and just a certain output? I mean, regardless a previous transaction consumes and destroys certain inputs, if the address has more unspent inputs the transaction can be used for those?  
> **username_1**: Transactions don't reference addresses. Specifically, inputs and outputs never contain addresses as such. They reference specific UTXOs.  Therefore any reasoning involving addresses can't apply to the processing of transaction inputs.  

---

