Transaction Pinning Attack
A pinning attack exploits mempool policy to prevent a transaction from confirming. Attackers use this method to delay or block transactions from being processed by miners.
Explanation with Example
Let's take Alice, Bob, and Carol to explain the concept:
- Alice creates a parent transaction (Tx1)
- Tx1 has two outputs: one for Bob and one for Carol.
- Tx1 is sent with a very low fee, making it less attractive to miners.
- Tx1 gets stuck in the mempool.
- Since miners prefer transactions with higher fees, Tx1 remains unconfirmed.
- Carol (the attacker) creates a child transaction (Tx2)
- Tx2 spends Carol's output from Tx1.
- Tx2 has a very low fee and a large size.
Mempool Rule Exploitation
- Bitcoin’s mempool policy limits the total package size (parent + child transactions) to 101KB.
- Carol intentionally makes Tx2 close to this limit.
Consequence for Bob
- When Bob tries to create Tx3 (spending from Tx1), it gets rejected.
- Even if Bob includes a higher fee, the mempool won't accept it because it would exceed the 101KB limit.
Why is it Called "Pinning"?
Since Tx1 is stuck due to Carol’s actions, it is effectively “pinned”, preventing Bob from spending his funds.
Find a complete tutorial series of bitcoin technical concepts at https://bitcoindevs.xyz/decoding/welcome