<p>You could compile Bitcoin Core with <em>tracing</em> enabled and listen to the <a href="https://github.com/bitcoin/bitcoin/blob/master/doc/tracing.md#tracepoint-mempoolreplaced" rel="nofollow noreferrer"><code>mempool:replaced</code> tracepoint</a>.</p>
<p>If I remember right, User-space, Statically Defined Tracing (USDT) only works on Linux, and you will need to install the corresponding packages <a href="https://github.com/iovisor/bpftrace/blob/master/INSTALL.md" rel="nofollow noreferrer">bpftrace</a> and <a href="https://github.com/iovisor/bcc/blob/master/INSTALL.md" rel="nofollow noreferrer">BCC</a>.</p>
<p>Also see:</p>
<ul>
<li><a href="https://github.com/bitcoin/bitcoin/blob/master/doc/tracing.md" rel="nofollow noreferrer">USDT documentation in Bitcoin Core</a></li>
<li><a href="https://github.com/bitcoin/bitcoin/blob/ae69fc37e4fff237a119225061d68f69e6cd61d7/contrib/tracing/README.md" rel="nofollow noreferrer">USDT readme</a></li>
</ul>

CC BY-SA 4.0
2024-12-04T15:12:54.557Z
2024-12-04T15:12:54.557Z
Murch
<p>I am trying to track transactions in the mempool that utilize Replace-By-Fee (RBF). My approach involves saving the current transactions in the mempool and comparing them to newly added transactions. If a new transaction shares inputs with a previously saved transaction, I infer that it replaced the original transaction via RBF. In such cases, I save both the original and the replacement transactions for further analysis.</p>
<p>My question is, if instead of doing all this, is there any method in which the Bitcoin core to tell me when a transaction has used RBF.</p>

<bitcoin-core><mempool><replace-by-fee>
Is there a Bitcoin Core method that identify when a transaction in the mempool uses Replace-By-Fee (RBF)?
Biel Castellarnau
# Is there a Bitcoin Core method that identify when a transaction in the mempool uses Replace-By-Fee (RBF)?

(Asked by: username_0 on 2024-12-04)

I am trying to track transactions in the mempool that utilize Replace-By-Fee (RBF). My approach involves saving the current transactions in the mempool and comparing them to newly added transactions. If a new transaction shares inputs with a previously saved transaction, I infer that it replaced the original transaction via RBF. In such cases, I save both the original and the replacement transactions for further analysis.

My question is, if instead of doing all this, is there any method in which the Bitcoin core to tell me when a transaction has used RBF.

**Tags:** bitcoin-core, mempool, replace-by-fee


---

## 1 answers

### Answer by username_1 on 2024-12-04. Score: 0

You could compile Bitcoin Core with *tracing* enabled and listen to the [`mempool:replaced` tracepoint](https://github.com/bitcoin/bitcoin/blob/master/doc/tracing.md#tracepoint-mempoolreplaced).

If I remember right, User-space, Statically Defined Tracing (USDT) only works on Linux, and you will need to install the corresponding packages [bpftrace](https://github.com/iovisor/bpftrace/blob/master/INSTALL.md) and [BCC](https://github.com/iovisor/bcc/blob/master/INSTALL.md).

Also see:

* [USDT documentation in Bitcoin Core](https://github.com/bitcoin/bitcoin/blob/master/doc/tracing.md)
* [USDT readme](https://github.com/bitcoin/bitcoin/blob/ae69fc37e4fff237a119225061d68f69e6cd61d7/contrib/tracing/README.md)


---

