Partially Signed Bitcoin Transactions (PSBTs) are the standard coordination mechanism for trustless Ordinals and Runes trades, allowing a buyer and seller to collaboratively construct a transaction without exposing private keys to a marketplace. However, the asynchronous nature of PSBT signing creates a critical race condition window: after a counterparty signs but before the transaction is broadcast and confirmed, a malicious actor can manipulate the transaction's inputs, outputs, or fee structure to alter the agreed-upon trade terms. This class of exploit has been a recurring source of financial loss across Ordinals marketplaces, with attackers using techniques ranging from simple front-running to sophisticated replacement cycling.

PSBT Race Condition Exploits in Ordinals Marketplaces
Introduction
A persistent class of attacks exploiting the time gap between PSBT signing and transaction finalization to manipulate trade terms in Ordinals marketplaces.
The core vulnerability lies in the PSBT workflow itself. A typical marketplace trade involves a seller signing a PSBT to list an inscription, a buyer signing to purchase it, and a marketplace or third-party relayer finalizing and broadcasting the transaction. At each step, an unsigned or partially signed transaction exists in a malleable state. Attackers exploit this by monitoring the mempool for partially signed trades, then constructing competing transactions with higher fees, altered outputs, or additional inputs that divert the inscription or Runes UTXO to their own address. The introduction of time-locked PSBTs and anti-exfiltration commitments has mitigated some vectors, but the fundamental tension between collaborative signing and atomic finality remains unresolved.
Marketplace security teams must treat PSBT construction as a security-critical component, not a simple serialization format. Effective countermeasures require a layered defense: enforcing strict input and output validation before signing, implementing time-locked refund paths to limit exposure, using anti-exfiltration protocols to prevent nonce reuse, and monitoring the mempool for competing transactions that target pending trades. Wallet developers face the parallel challenge of presenting PSBT contents to users in a human-readable format that enables informed signing decisions. Chainscore Labs provides integration review services that assess a marketplace's entire PSBT lifecycle—from construction and signing to broadcast and confirmation—against known race condition attack patterns and emerging exploit techniques.
Quick Facts
A reference table for marketplace operators and wallet developers to identify the key failure modes, affected actors, and required actions for PSBT-based trade vulnerabilities.
| Area | What changes | Who is affected | Action |
|---|---|---|---|
PSBT Finalization | A malicious seller broadcasts a finalized PSBT after the buyer signs, but before the trade is canceled, front-running the agreed-upon terms. | Marketplace operators, buyers | Implement server-side PSBT finalization and broadcast; do not rely on the counterparty to finalize. |
Anti-Exfiltration | Non-standard PSBT fields can be used to leak the buyer's signature to the seller before the transaction is complete, enabling off-chain theft. | Wallet developers, signing devices | Verify that wallet signing logic strictly validates PSBT output scripts and does not sign non-standard fields. |
Time-Locked PSBTs | A PSBT without an absolute or relative timelock can be held and broadcast at a disadvantageous time, invalidating the trade's price assumption. | Marketplace operators, traders | Incorporate |
Fee Sniping | An attacker uses Replace-By-Fee (RBF) to replace a pending trade transaction with one that pays the attacker, stealing the asset. | Marketplace operators, node operators | Monitor the mempool for conflicting transactions and implement fee bumping strategies for time-sensitive trades. |
Input Overlap | A single UTXO is signed into two different PSBTs by the same wallet, allowing a double-spend across two pending trades. | Wallet developers, indexer operators | Implement UTXO locking in wallet software to prevent the same input from being signed into multiple concurrent PSBTs. |
Indexer Lag | A PSBT is constructed based on stale indexer data, referencing an already-spent UTXO, causing the trade to fail after signing. | Marketplace backends, indexer operators | Use a combination of mempool and confirmed UTXO state to validate inputs before presenting a PSBT for signing. |
Coordinated Disclosure | A new PSBT vulnerability is discovered but not yet publicly disclosed, leaving unprepared platforms exposed to zero-day exploits. | All platform operators | Establish a security contact and monitor channels like the Bitcoin-Dev mailing list for pre-disclosure coordination. |
Technical Mechanism of the Exploit
How attackers manipulate the time gap between PSBT signing and transaction broadcast to alter trade terms, front-run counterparties, or cancel transactions after commitment.
PSBT race condition exploits in Ordinals and Runes marketplaces exploit the asynchronous nature of Partially Signed Bitcoin Transactions. In a typical marketplace flow, a seller constructs a PSBT listing an inscription or Runes UTXO for sale, signs their input, and passes the incomplete transaction to a buyer. The buyer then adds their own inputs and outputs—including the payment and any marketplace fees—signs their portion, and broadcasts the final transaction. The vulnerability exists because the seller's signature is committed to a specific transaction structure before the buyer's actions are finalized, but the transaction is not broadcast until the buyer completes their side. An attacker acting as a buyer can leverage this window to alter the transaction's fee rate, change the destination of the payment output, or broadcast a conflicting transaction that spends the same UTXO under different terms.
The core exploit pattern often involves transaction replacement or fee manipulation. After receiving a signed PSBT from a seller, a malicious buyer can extract the seller's signature and construct a new, conflicting transaction that spends the same Ordinal or Runes UTXO—but to a different address or with a minimal fee. By broadcasting this alternative transaction with a higher fee using Replace-By-Fee (RBF), the attacker can have their version confirmed, effectively stealing the asset while the seller's original PSBT becomes invalid. A related variant exploits the lack of time-locks: a seller signs a PSBT without an expiration, and the attacker simply delays broadcasting until market conditions shift unfavorably for the seller, then either abandons the trade or demands renegotiation. In both cases, the seller's pre-signed commitment is weaponized against them because the PSBT lacked constraints on when and under what fee conditions the transaction could be finalized.
Countermeasures have evolved to include seller-imposed time-locks via nLockTime or OP_CHECKLOCKTIMEVERIFY, which make the signed transaction invalid after a specified block height, preventing indefinite holding attacks. Anti-exfiltration techniques, such as requiring the buyer to commit to their inputs and outputs before the seller signs, reduce the malleability surface. Some marketplace architectures have moved toward a dual-PSBT model where the seller signs only a cancelable offer, and a separate, co-signed transaction is constructed atomically only when a buyer locks in their terms. Despite these improvements, the underlying trust model remains fragile: the seller must still sign first in most non-custodial designs, and the security of the trade depends on the completeness of the PSBT validation logic in both the marketplace frontend and the user's wallet. Marketplace security teams and wallet developers should conduct an integration review to verify that their PSBT construction enforces strict time-locks, validates all output scripts before signing, and detects conflicting mempool transactions before presenting a PSBT for user approval.
Affected Systems and Actors
Marketplace Operators
Marketplace backends that construct and relay PSBTs are the primary attack surface. The core vulnerability lies in the time gap between a seller signing their input and the buyer completing the transaction. An attacker can exploit this window to front-run, cancel, or alter trade terms.
Action Items:
- Implement server-side nonce challenges to bind a seller's signature to a specific PSBT structure.
- Adopt anti-exfiltration signing protocols to prevent signature reuse across conflicting transactions.
- Integrate time-locked refund paths directly into the PSBT to limit the window of exploitability.
- Monitor the mempool for conflicting transactions that spend the same UTXOs immediately after a PSBT is partially signed.
Chainscore Labs can review your PSBT construction and order-matching pipeline to identify race-condition vulnerabilities before they are exploited.
Countermeasures and Secure Implementation Patterns
Actionable controls and architectural patterns to eliminate PSBT race conditions in Ordinals marketplace infrastructure.
Time-Locked PSBTs with Absolute Expiry
Implement PSBTs with absolute timelocks (nLockTime) that expire the trade if not confirmed within a short window. The seller's signed PSBT should become invalid after a few blocks, preventing an attacker from holding a signed transaction and broadcasting it later under changed market conditions. Marketplaces must enforce this at the protocol level, not rely on off-chain order expiry. Combine with a strict nSequence check to prevent replacement cycling.
Anti-Exfiltration Commitment Schemes
Adopt anti-exfiltration protocols where the buyer commits to their transaction intent before seeing the seller's fully signed PSBT. This prevents the attacker from extracting a valid seller signature and then using it in a different transaction context. Techniques include requiring the buyer to broadcast a commitment transaction first, or using adaptor signatures that reveal the seller's signature only when the buyer publishes their side of the trade.
Server-Side PSBT Finalization and Broadcast
Never expose partially signed PSBTs to the client-side where they can be manipulated. The marketplace backend should act as a trusted coordinator that receives unsigned inputs from both parties, assembles the complete transaction, and broadcasts it atomically. This eliminates the client-side race window entirely. If a decentralized model is required, use a non-custodial coordinator with a strict timeout and single-use session keys.
Mempool Monitoring and RBF Detection
Deploy real-time mempool monitoring to detect when a counterparty broadcasts a conflicting transaction that spends the same UTXOs as a pending PSBT. Integrate alerts for unexpected RBF fee bumps or replacement transactions targeting trade inputs. If a conflict is detected before the legitimate trade confirms, the system should automatically attempt to accelerate the honest transaction via CPFP or alert the user to take manual action.
UTXO Reservation and Locking Protocol
Implement a UTXO reservation system where the marketplace temporarily locks the seller's UTXO from being used in any other trade or listing while a PSBT is pending. This prevents the double-spend vector where a seller signs multiple PSBTs for the same asset. The lock should be enforced by the marketplace's order-matching engine and released only upon trade confirmation, cancellation, or timeout. Combine with indexer-level checks for on-chain UTXO state.
Risk and Compatibility Matrix
A structured breakdown of the specific attack vectors, affected components, and required actions for marketplace operators and wallet developers to mitigate PSBT race condition exploits in Ordinals trading.
| Attack Vector | Failure Mode | Affected Systems | Severity | Mitigation |
|---|---|---|---|---|
Pre-signature front-running | Attacker monitors the mempool for a buyer-signed PSBT, constructs a conflicting transaction with a higher fee, and replaces the original trade before it confirms, stealing the listed asset. | Marketplace order-matching engines, buyer wallets, mempool monitoring services | Critical | Implement time-locked PSBTs with short expiration windows. Marketplaces should broadcast seller transactions immediately and monitor for conflicting spends. |
Post-signature cancellation | Seller signs a PSBT to sell an inscription, then double-spends the UTXO in a separate transaction before the buyer's signature is broadcast, invalidating the trade. | Marketplace escrow logic, seller wallets, indexer APIs | High | Require seller PSBTs to include a relative timelock (OP_CSV) that prevents spending the UTXO elsewhere for a defined window. Verify UTXO status against a reliable indexer before finalizing. |
Fee sniping via Replace-By-Fee (RBF) | Attacker flags a pending trade transaction with RBF, then replaces it with a version that redirects the inscription to their own address, outbidding the original fee. | Buyer wallets, marketplace transaction finalizers, Bitcoin node mempool policy | High | Disable RBF signaling on finalized trade transactions. Use full-RBF-aware mempool monitoring to detect replacement attempts before confirmation. |
Child-Pays-For-Parent (CPFP) cycling | Attacker attaches a high-fee child transaction to an unconfirmed trade, accelerating confirmation of a malicious parent that steals the asset before the legitimate trade confirms. | Marketplace fee estimation, buyer transaction construction, mining pool behavior | Medium | Monitor for unexpected CPFP chains attached to pending trade transactions. Use package-relay-aware fee bumping to outbid malicious children if detected. |
PSBT role confusion in multi-party trades | In a trade involving a buyer, seller, and marketplace fee address, the PSBT output structure is manipulated so that the marketplace fee is redirected to the attacker, or the inscription output is duplicated. | Marketplace PSBT construction libraries, multi-output trade logic, fee address management | High | Strictly validate PSBT output scripts and amounts against the agreed trade terms before signing. Use distinct output descriptors for each role to prevent substitution. |
Indexer lag exploitation | Attacker exploits the delay between an on-chain event and its reflection in the marketplace's indexer to list an already-spent inscription, tricking a buyer into signing a PSBT for an unavailable asset. | Marketplace indexer integration, listing availability checks, order-book state management | Critical | Implement a mandatory confirmation requirement before listing. Use multiple independent indexers for availability checks and reject trades where indexers disagree on UTXO status. |
Anti-exfiltration nonce reuse | A flawed PSBT signing implementation reuses anti-exfiltration nonces, allowing an attacker who observes multiple partial signatures to derive the private key and steal funds. | Hardware wallets, mobile wallet SDKs, custom signing implementations | Critical | Audit PSBT signing code for RFC6979 deterministic nonce compliance or proper anti-exfiltration nonce generation. Use well-audited libraries like rust-bitcoin or bdk. |
Malleated witness data in unconfirmed trades | Attacker alters the witness data of an unconfirmed PSBT trade to change inscription metadata or content hash, causing the buyer to receive a different inscription than expected. | Marketplace transaction monitoring, buyer wallet verification, inscription content indexing | Medium | Verify inscription content hash against the expected value after confirmation, not just before signing. Alert users if the final inscription differs from the listing. |
Remediation and Integration Review Checklist
A technical checklist for marketplace operators, wallet developers, and custody providers to verify that their PSBT implementation is resistant to the class of race condition exploits that have historically affected Ordinals marketplaces. Each item identifies a specific vulnerability pattern, explains the risk, and defines the signal that confirms remediation.
What to check: Confirm that your marketplace or wallet has moved from standard PSBTs to an anti-exfiltration signing protocol where the receiver commits to their output and a nonce before the sender signs.
Why it matters: In a classic PSBT race condition, a malicious seller broadcasts a different transaction after the buyer signs, stealing the buyer's funds without delivering the asset. Anti-exfil protocols prevent this by binding both parties to the final transaction shape before any signatures are exchanged.
Readiness signal: The signing flow includes a step where the buyer's wallet presents a PSBT_OUT_PROPRIETARY record containing a commitment to the seller's output and a nonce. The seller's wallet verifies this commitment and countersigns with their own nonce commitment. Only after both commitments are exchanged are final signatures applied. If your flow allows the seller to receive a fully signed buyer input before the seller has committed to their output, you are vulnerable.
Source Resources
Use these sources to audit PSBT construction, signature scope, mempool handling, and Ordinals asset interpretation. Marketplace teams should test their exact order flow against current Bitcoin Core and ord behavior rather than treating a signed PSBT as proof that a trade remains executable.
PSBT Order-Flow Security Review
Translate the specifications into an executable abuse-case suite for each supported wallet and listing format. Verify exact outpoint binding, expected inscription location, output value and ordering, seller proceeds, fee bounds, locktime and sequence policy, and all signature hash flags—especially designs using SIGHASH_SINGLE or ANYONECANPAY. Add mempool conflict monitoring and atomic order invalidation before rebroadcast. Chainscore Labs can review the PSBT state machine, wallet signing boundary, indexer dependency, and replacement-handling controls without assuming that specification compliance alone prevents marketplace races.
Looking to build on a specific blockchain?
We build smart contracts, DeFi applications, wallets, tokenization platforms, and blockchain infrastructure across the major ecosystems teams choose today. That includes Ethereum, Arbitrum, Optimism, Polygon, Avalanche, Solana, Sui, Aptos, Hedera, Stellar, and NEAR, with support for additional EVM and non-EVM networks based on your product requirements.
EVM ecosystems
- Ethereum
- Arbitrum
- Optimism
- Polygon
- Avalanche
- Cronos

Non-EVM ecosystems
- Solana
- Sui
- Aptos
- Hedera
- Stellar
- NEAR
Additional ecosystems
- Polkadot
- Cosmos
- TON
- Cardano
- Algorand
- Tempo
Also available for Base, appchains, custom EVM networks, and cross-chain product architecture.
Frequently Asked Questions
Common questions from marketplace operators, wallet developers, and security teams investigating Partially Signed Bitcoin Transaction (PSBT) race condition exploits in Ordinals and Runes trading infrastructure.
A PSBT race condition exploit occurs when a malicious actor manipulates the time gap between a seller signing a Partially Signed Bitcoin Transaction and the transaction's broadcast to the mempool. The attacker intercepts, modifies, or replaces the PSBT to alter the trade terms—typically by changing the recipient address, reducing the payment amount, or canceling the sale after the counterparty has committed their signature. In Ordinals marketplaces, this is especially dangerous because the signed PSBT often authorizes the transfer of a specific inscribed satoshi or Runes UTXO. If the attacker can front-run the honest broadcast with a conflicting transaction that spends the same UTXO, the victim's signed PSBT becomes invalid while the attacker walks away with the asset.
Delivering blockchain solutions for 5+ years.
We have partnered with 50+ leading DeFi protocols, NFT ecosystems, and fintech innovators to build secure, scalable, and capital-efficient blockchain products.
Selected Partners & Clients
“I've been working with Chainscore Labs for last 3+ years, they've consistently delivered with strong ownership across multiple projects. The team is reliable and detail-oriented.”
How to get started?
If you're looking for blockchain integration, ChainScore Labs has 5+ years of experience helping teams build and integrate exchanges, wallets, smart contracts, tokenization solutions, and protocol-connected products, we can help you choose the right path, integrate securely, and get to production faster. Our team consists of experienced blockchain developers and architects who can help you with your blockchain integration needs.
Exploration & Strategy
Define your product goals and choose the right blockchain architecture for your use case.
Architecture & Design
Design the smart contracts, tokenomics, and security parameters of your system.
Development & Integration
Build and integrate with wallets, oracles, and front-end dApps for a seamless experience.
Security & Launch
Comprehensive audits followed by a risk-managed mainnet deployment to protect your users.
Discover our
blockchain development services.
We build production-grade blockchain solutions for top-tier projects across DeFi and Web3.
Need a blockchain engineering team?
Send the project context and we will respond with next steps, scope questions, and a practical path to delivery.


