<p>No, such a function does not exist. A node will not provide a transaction that it has not previously offered to the requesting peer—that would make nodes trivially fingerprintable. Also, it would be expensive for nodes to look up arbitrary transactions, as RedGrittyBrick pointed out in the other answer.</p>
<p>Bitcoin Core will only relay each transaction when it first learns about it. It will at that point announce its new inventory to all its peers, which may request the newly offered transaction after the announcement. If a transaction does not propagate to every node at that time, that’s fine—if the transaction is included in a block, it’s guaranteed to reach everyone.</p>

CC BY-SA 4.0
2023-03-10T15:13:09.183Z
2023-03-10T17:36:33.800Z
2023-03-10T17:36:33.800Z
Murch
<p>See <a href="https://en.bitcoin.it/wiki/Protocol_documentation#getdata" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Protocol_documentation#getdata</a> for the original reason why this is not possible:</p>
<blockquote>
<p>arbitrary access to transactions in the chain is not allowed to avoid having clients start to depend on nodes having full transaction indexes (which modern nodes do not).</p>
</blockquote>
<p>Update</p>
<p>As <a href="https://bitcoin.stackexchange.com/a/117547/13866">Murch</a> and Pieter Wuille explained, there are also privacy-related safeguards against obtaining arbitrary transaction data from peers:</p>
<p>Some of these are described in <a href="https://github.com/bitcoin/bitcoin/pull/18861" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/pull/18861</a> (May 2020):</p>
<blockquote>
<p>In general, we should try to not leak information about what transactions we have (recently) learned about before deciding to announce them to our peers. There is a controlled transaction dissemination process that reveals our transactions to peers that has various safeguards for privacy (it's rate-limited, delayed &amp; batched, deterministically sorted, ...), and ideally there is no way to test which transactions we have before that controlled process reveals them.</p>
</blockquote>
<p>I think it is worth reading that web-page in full to see the full rationale and some further comments there.</p>

CC BY-SA 4.0
2023-03-10T16:09:21.087Z
Historically that was the reason why arbitrary transaction fetching was not allowed, but in more recent times that rationale on the wiki is actually outdated. You can't even request arbitrary mempool transactions anymore if they haven't been announced to you yet (because of privacy reasons, see @Murch's answer).
Pieter Wuille
CC BY-SA 4.0
2023-03-10T18:33:48.790Z
Specifically, see https://github.com/bitcoin/bitcoin/pull/18861
Pieter Wuille
CC BY-SA 4.0
2023-03-10T22:00:04.770Z
OK, I've added something to my answer to point that out (I considered just deleting mine in favour of Murch's answer but can't yet).
RedGrittyBrick
CC BY-SA 4.0
2023-03-10T15:13:27.367Z
2023-03-10T21:56:52.310Z
2023-03-10T21:56:52.310Z
RedGrittyBrick
<p>I'm trying to request tx messages from known peers but it doesn't appear as though this is supported with bitcoin-cli. Is there a way to do this?</p>

<transactions><p2p><inventory>
Request tx messages from other peers?
bitcoinluvr6969
# Request tx messages from other peers?

(Asked by: username_0 on 2023-03-10)

I'm trying to request tx messages from known peers but it doesn't appear as though this is supported with bitcoin-cli. Is there a way to do this?

**Tags:** transactions, p2p, inventory


---

## 2 answers

### Answer by username_2 on 2023-03-10. Score: 4 | Accepted answer

See <https://en.bitcoin.it/wiki/Protocol_documentation#getdata> for the original reason why this is not possible:

> arbitrary access to transactions in the chain is not allowed to avoid having clients start to depend on nodes having full transaction indexes (which modern nodes do not).

Update

As [username_1](https://bitcoin.stackexchange.com/a/117547/13866) and username_3 username_3 explained, there are also privacy-related safeguards against obtaining arbitrary transaction data from peers:

Some of these are described in <https://github.com/bitcoin/bitcoin/pull/18861> (May 2020):

> In general, we should try to not leak information about what transactions we have (recently) learned about before deciding to announce them to our peers. There is a controlled transaction dissemination process that reveals our transactions to peers that has various safeguards for privacy (it's rate-limited, delayed & batched, deterministically sorted, ...), and ideally there is no way to test which transactions we have before that controlled process reveals them.

I think it is worth reading that web-page in full to see the full rationale and some further comments there.

> **Comments:**
> **username_3**: Historically that was the reason why arbitrary transaction fetching was not allowed, but in more recent times that rationale on the wiki is actually outdated. You can't even request arbitrary mempool transactions anymore if they haven't been announced to you yet (because of privacy reasons, see @username_1's answer).  
> **username_3**: Specifically, see https://github.com/bitcoin/bitcoin/pull/18861  
> **username_2**: OK, I've added something to my answer to point that out (I considered just deleting mine in favour of username_1's answer but can't yet).  

---

### Answer by username_1 on 2023-03-10. Score: 2

No, such a function does not exist. A node will not provide a transaction that it has not previously offered to the requesting peer—that would make nodes trivially fingerprintable. Also, it would be expensive for nodes to look up arbitrary transactions, as username_2 pointed out in the other answer.

Bitcoin Core will only relay each transaction when it first learns about it. It will at that point announce its new inventory to all its peers, which may request the newly offered transaction after the announcement. If a transaction does not propagate to every node at that time, that’s fine—if the transaction is included in a block, it’s guaranteed to reach everyone.


---

