<p>Your question is about what happens when a transaction gets broadcast which tries to spend outputs that are already spent. It is unrelated to PSBT; PSBT is just one technology that helps wallets cooperate in constructing a transaction together, but how that transaction comes to be here is irrelevant here.</p>
<p>The answer is that Bitcoin nodes will not let you spend outputs which are already spent in a confirmed block. The transaction will be ignored.</p>
<p>If a transaction has already been broadcast, but not confirmed, which spends the same outputs, nodes may or may not accept the transaction, based on whether the new transaction pays a higher feerate, whether the old one opted into the <a href="https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki" rel="nofollow noreferrer">BIP125</a> (signalling replaceability), and on the local policies of the node involved. There is no guarantee that all nodes behave the same way.</p>

CC BY-SA 4.0
2024-06-28T10:31:41.540Z
how blockchain knows that certain utxo is locked for psbt as it isnt on chain data ?
Nerses Asaturyan
CC BY-SA 4.0
2024-06-28T11:49:42.267Z
@NersesAsaturyan It does not. It's a feature of the wallet.
Pieter Wuille
CC BY-SA 4.0
2024-06-27T18:15:41.393Z
2024-06-27T18:15:41.393Z
Pieter Wuille
<p>I'm working with Partially Signed Bitcoin Transactions (PSBTs) and have a question about the behavior of transactions when the same UTXOs are involved in multiple transactions. Suppose I have a transaction created as a PSBT that requires multiple signatures. I sign it first, and before the second signer completes their part, I attempt to spend the same UTXOs in a different transaction.</p>
<p>PSBT Completion: What happens if I broadcast a new transaction using the same UTXOs before the PSBT is fully signed and broadcast? Can the new transaction be confirmed before the PSBT, making the PSBT invalid?</p>
<p>Double-Spend Protection: How does the Bitcoin network handle this scenario? Is the first transaction that gets confirmed the only one recognized, thus invalidating the other?</p>
<p>Wallet Behavior: What role do wallets play in managing UTXOs to prevent potential double-spends in such scenarios? Do they typically prevent the creation of a second transaction that would use the same UTXOs already allocated in a partially signed PSBT?</p>
<p>Any insights on how the Bitcoin protocol and network handle these situations would be very helpful.</p>

<transactions><multi-signature><doublespend><bip174-psbt><utxo-committments>
Handling UTXOs in Partially Signed Bitcoin Transactions (PSBTs) and Potential Double-Spend Scenario
Nerses Asaturyan
# Handling UTXOs in Partially Signed Bitcoin Transactions (PSBTs) and Potential Double-Spend Scenario

(Asked by: username_0 on 2024-06-27)

I'm working with Partially Signed Bitcoin Transactions (PSBTs) and have a question about the behavior of transactions when the same UTXOs are involved in multiple transactions. Suppose I have a transaction created as a PSBT that requires multiple signatures. I sign it first, and before the second signer completes their part, I attempt to spend the same UTXOs in a different transaction.

PSBT Completion: What happens if I broadcast a new transaction using the same UTXOs before the PSBT is fully signed and broadcast? Can the new transaction be confirmed before the PSBT, making the PSBT invalid?

Double-Spend Protection: How does the Bitcoin network handle this scenario? Is the first transaction that gets confirmed the only one recognized, thus invalidating the other?

Wallet Behavior: What role do wallets play in managing UTXOs to prevent potential double-spends in such scenarios? Do they typically prevent the creation of a second transaction that would use the same UTXOs already allocated in a partially signed PSBT?

Any insights on how the Bitcoin protocol and network handle these situations would be very helpful.

**Tags:** transactions, multi-signature, doublespend, bip174-psbt, utxo-committments


---

## 1 answers

### Answer by username_1 on 2024-06-27. Score: 1 | Accepted answer

Your question is about what happens when a transaction gets broadcast which tries to spend outputs that are already spent. It is unrelated to PSBT; PSBT is just one technology that helps wallets cooperate in constructing a transaction together, but how that transaction comes to be here is irrelevant here.

The answer is that Bitcoin nodes will not let you spend outputs which are already spent in a confirmed block. The transaction will be ignored.

If a transaction has already been broadcast, but not confirmed, which spends the same outputs, nodes may or may not accept the transaction, based on whether the new transaction pays a higher feerate, whether the old one opted into the [BIP125](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki) (signalling replaceability), and on the local policies of the node involved. There is no guarantee that all nodes behave the same way.

> **Comments:**
> **username_0**: how blockchain knows that certain utxo is locked for psbt as it isnt on chain data ?  
> **username_1**: @NersesAsaturyan It does not. It's a feature of the wallet.  

---

