<p>It's the IP address of the node that first sent us the transaction. As transaction broadcast works a bit like gossip, it's not <em>guaranteed</em> to be the original node (it could be a node "in the middle"). However, as BlockCypher is connected to quite a few nodes on the network, so over multiple transactions you're highly likely to be able to identify the right originating IP.</p>

<p>This is not a bulletproof method, as a more sophisticated attacker could just use Tor for transactions broadcast. Practically this is the exception and quite frankly, simply using a web wallet with a good VPN is a much simpler way to achieve a similar level of anonimity.</p>

<p>So for most applications you can get a fairly accurate originating IP address using <code>relayed_by</code> over multiple transactions.</p>

<p>Full disclosure: I'm CTO and co-founder at BlockCypher.</p>

CC BY-SA 4.0
2018-06-28T19:47:45.153Z
wow somehow I didn't expect someone from BlockCypher to answer this; thanks so much! Since blockchain.info is so buggy right now BlockCypher is definitely our go-to.
dhmq
CC BY-SA 4.0
2018-06-28T00:11:58.250Z
2018-06-28T00:11:58.250Z
Matthieu
<p>EDIT: I misread the question, my answer pertains to blocks, not transactions. </p>

<p><strike></p>

<blockquote>
  <p>...includes the "relayed_by" field, which the documentation describes as "Address of the peer that sent us this transaction". Is this the IP address of the original node that broadcasts the transaction?</p>
</blockquote>

<p>Not necessarily, the node listed may be the one that found the block, or that node may have heard about the block from some other node. </p>

<blockquote>
  <p>In general, we're trying to gather geographical data of the transactions; is there a reliable way to do so?</p>
</blockquote>

<p>Not really. An interested user could set up many nodes, in an effort to 'have eyes' in many different places on the network, thus increasing confidence about which node each new block originates from. But even that data is not strongly tied to geography, for example nodes can connect through hidden services such as tor. </p>

<p>In addition to this, many mining pools are composed of geographically distributed miners, so learning the location of a mining pool's node doesn't necessarily tell you anything about where the hardware that actually found the block is located.</p>

<p>Miners can vary the data in the coinbase transaction, and some elect to put a name on this field. For example, <a href="https://blockchain.info/tx/e05111642e876ccc290f424538408374c1ffa31e2f3eda63169351de70a2efbe?show_adv=true" rel="nofollow noreferrer">see this recent block</a>: when decoded we can see the coinbase transaction includes the text <code>ViaBTC/Mined by zout905</code>. Worth mentioning: this data is not entirely conclusive, as any miner can put any data they'd like here, so it is possible for someone else to put 'ViaBTC' in a block they find, and it is possible for ViaBTC to put nothing at all. </p>

<p>Another way to distinguish who found a block is to look at the payout address. Some miners/pools will always pay the coinbase transaction to the same address, so you can track which blocks they've found by looking at the payout address. But this would only work for miners that pay to the same address, and requires an assumption they will continue to only pay to that address. </p>

<p></strike></p>

CC BY-SA 4.0
2018-06-28T00:13:11.947Z
The IP will never be the one of the miner who found or broadcasted, the `relayed_by` field is strictly for transaction relay. Block broadcast and transaction broadcast are completely distinct, and mining pools have nothing to do with the latter either.
Matthieu
CC BY-SA 4.0
2018-06-28T00:13:54.747Z
@Matthieu oh shoot! I now realize I misread this question (and API docs), and answered in terms of blocks, not transactions. My mistake, thanks for clarifying.
chytrik
CC BY-SA 4.0
2018-06-26T21:38:23.830Z
2018-06-28T00:16:36.490Z
2018-06-28T00:16:36.490Z
chytrik
<p>The transaction data returned by the <a href="https://blockcypher.github.io/documentation/#transactions" rel="nofollow noreferrer">BlockCypher's API</a> includes the "relayed_by" field, which the documentation describes as "Address of the peer that sent us this transaction". Is this the IP address of the original node that broadcasts the transaction?</p>

<p>In general, we're trying to gather geographical data of the transactions; is there a reliable way to do so?</p>

<blockcypher>
What does the "relayed_by" field in the BlockCypher API represent? Is there a way to gather geographical data of transactions?
dhmq
# What does the "relayed_by" field in the BlockCypher API represent? Is there a way to gather geographical data of transactions?

(Asked by: username_0 on 2018-06-26)

The transaction data returned by the [BlockCypher's API](https://blockcypher.github.io/documentation/#transactions) includes the "relayed\_by" field, which the documentation describes as "Address of the peer that sent us this transaction". Is this the IP address of the original node that broadcasts the transaction?

In general, we're trying to gather geographical data of the transactions; is there a reliable way to do so?

**Tags:** blockcypher


---

## 2 answers

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

It's the IP address of the node that first sent us the transaction. As transaction broadcast works a bit like gossip, it's not *guaranteed* to be the original node (it could be a node "in the middle"). However, as BlockCypher is connected to quite a few nodes on the network, so over multiple transactions you're highly likely to be able to identify the right originating IP.

This is not a bulletproof method, as a more sophisticated attacker could just use Tor for transactions broadcast. Practically this is the exception and quite frankly, simply using a web wallet with a good VPN is a much simpler way to achieve a similar level of anonimity.

So for most applications you can get a fairly accurate originating IP address using `relayed_by` over multiple transactions.

Full disclosure: I'm CTO and co-founder at BlockCypher.

> **Comments:**
> **username_0**: wow somehow I didn't expect someone from BlockCypher to answer this; thanks so much! Since blockchain.info is so buggy right now BlockCypher is definitely our go-to.  

---

### Answer by username_2 on 2018-06-26. Score: 0

EDIT: I misread the question, my answer pertains to blocks, not transactions.

> ...includes the "relayed\_by" field, which the documentation describes as "Address of the peer that sent us this transaction". Is this the IP address of the original node that broadcasts the transaction?

Not necessarily, the node listed may be the one that found the block, or that node may have heard about the block from some other node.

> In general, we're trying to gather geographical data of the transactions; is there a reliable way to do so?

Not really. An interested user could set up many nodes, in an effort to 'have eyes' in many different places on the network, thus increasing confidence about which node each new block originates from. But even that data is not strongly tied to geography, for example nodes can connect through hidden services such as tor.

In addition to this, many mining pools are composed of geographically distributed miners, so learning the location of a mining pool's node doesn't necessarily tell you anything about where the hardware that actually found the block is located.

Miners can vary the data in the coinbase transaction, and some elect to put a name on this field. For example, [see this recent block](https://blockchain.info/tx/e05111642e876ccc290f424538408374c1ffa31e2f3eda63169351de70a2efbe?show_adv=true): when decoded we can see the coinbase transaction includes the text `ViaBTC/Mined by zout905`. Worth mentioning: this data is not entirely conclusive, as any miner can put any data they'd like here, so it is possible for someone else to put 'ViaBTC' in a block they find, and it is possible for ViaBTC to put nothing at all.

Another way to distinguish who found a block is to look at the payout address. Some miners/pools will always pay the coinbase transaction to the same address, so you can track which blocks they've found by looking at the payout address. But this would only work for miners that pay to the same address, and requires an assumption they will continue to only pay to that address.

> **Comments:**
> **username_1**: The IP will never be the one of the miner who found or broadcasted, the `relayed_by` field is strictly for transaction relay. Block broadcast and transaction broadcast are completely distinct, and mining pools have nothing to do with the latter either.  
> **username_2**: @username_1 oh shoot! I now realize I misread this question (and API docs), and answered in terms of blocks, not transactions. My mistake, thanks for clarifying.  

---

