<p>Locking UTXOs is a feature of certain wallets, to prevent their UTXOs from being reused while the building of a transaction using them is in progress.</p>
<p>Whether or not a UTXO is locked is only known only locally to the wallet itself. It is not stored on chain, so it is not known to other wallets.</p>

CC BY-SA 4.0
2024-06-28T12:06:13.720Z
so it can be used as commitement for doing transaction,am I right ?
Nerses Asaturyan
CC BY-SA 4.0
2024-06-28T12:10:37.547Z
What do you mean by "commitment"?
Pieter Wuille
CC BY-SA 4.0
2024-06-28T12:13:03.647Z
if i want to do swap of assets second side should be insured that first side want to do swap and locked the funds so doing himself. In case I undertsood correctly psbt cant be used as after signing psbt later utxos can be send if psbt isnt broadcasted
Nerses Asaturyan
CC BY-SA 4.0
2024-06-28T13:07:55.707Z
You cannot rely on locking as a means to guarantee that the other side will not double-spend the assets. You need to use an atomic swap protocol.
Pieter Wuille
CC BY-SA 4.0
2024-06-28T13:10:58.453Z
for example what protocols can be used in such case ?
Nerses Asaturyan
CC BY-SA 4.0
2024-06-28T14:12:18.327Z
@Nerses: *"What protocols can be used for atomic swaps"* is a different question and deserves to be asked as a new question using the [Ask Question](https://bitcoin.stackexchange.com/questions/ask) button.
RedGrittyBrick
CC BY-SA 4.0
2024-06-28T15:29:03.467Z
Hey @NersesAsaturyan, we have tens of thousands of questions with answers on this site. Please check out the [tag:atomic-swap] tag to find topics such as https://bitcoin.stackexchange.com/q/54120/5406
Murch
CC BY-SA 4.0
2024-06-28T11:55:40.470Z
2024-06-28T11:55:40.470Z
Pieter Wuille
<p>I'm currently exploring the use of Partially Signed Bitcoin Transactions (PSBTs) and have a question about the locking mechanism of UTXOs during the signing process. I understand that as a first signer, I lock UTXOs to ensure they are not used in another transaction before the PSBT is finalized. However, since the PSBT itself is not stored on the blockchain until it's fully signed and broadcast as a complete transaction, how does the blockchain or the network recognize that these UTXOs are locked? Does the lock actually reflect on the blockchain, or is it managed some other way?</p>
<p>I am looking for clarification on:</p>
<p>The mechanism that prevents other parties from using the locked UTXOs while the PSBT is in progress.
Any documentation or technical details that explain how these locks are recognized and respected by the network.
Any insights or technical explanations would be greatly appreciated!</p>

<transactions><utxo><doublespend><bip174-psbt><block-validity>
How Does the Blockchain Recognize Locked UTXOs in a PSBT if the PSBT Isn't Stored On-Chain?
Nerses Asaturyan
# How Does the Blockchain Recognize Locked UTXOs in a PSBT if the PSBT Isn't Stored On-Chain?

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

I'm currently exploring the use of Partially Signed Bitcoin Transactions (PSBTs) and have a question about the locking mechanism of UTXOs during the signing process. I understand that as a first signer, I lock UTXOs to ensure they are not used in another transaction before the PSBT is finalized. However, since the PSBT itself is not stored on the blockchain until it's fully signed and broadcast as a complete transaction, how does the blockchain or the network recognize that these UTXOs are locked? Does the lock actually reflect on the blockchain, or is it managed some other way?

I am looking for clarification on:

The mechanism that prevents other parties from using the locked UTXOs while the PSBT is in progress.
Any documentation or technical details that explain how these locks are recognized and respected by the network.
Any insights or technical explanations would be greatly appreciated!

**Tags:** transactions, utxo, doublespend, bip174-psbt, block-validity


---

## 1 answers

### Answer by username_1 on 2024-06-28. Score: 2 | Accepted answer

Locking UTXOs is a feature of certain wallets, to prevent their UTXOs from being reused while the building of a transaction using them is in progress.

Whether or not a UTXO is locked is only known only locally to the wallet itself. It is not stored on chain, so it is not known to other wallets.

> **Comments:**
> **username_0**: so it can be used as commitement for doing transaction,am I right ?  
> **username_1**: What do you mean by "commitment"?  
> **username_0**: if i want to do swap of assets second side should be insured that first side want to do swap and locked the funds so doing himself. In case I undertsood correctly psbt cant be used as after signing psbt later utxos can be send if psbt isnt broadcasted  
> **username_1**: You cannot rely on locking as a means to guarantee that the other side will not double-spend the assets. You need to use an atomic swap protocol.  
> **username_0**: for example what protocols can be used in such case ?  
> **username_2**: @username_0: *"What protocols can be used for atomic swaps"* is a different question and deserves to be asked as a new question using the [Ask Question](https://bitcoin.stackexchange.com/questions/ask) button.  
> **username_3**: Hey @username_0, we have tens of thousands of questions with answers on this site. Please check out the [tag:atomic-swap] tag to find topics such as https://bitcoin.stackexchange.com/q/54120/5406  

---

