<p>Bitcoin is a so-called gossip network. They announce any new object to all of their peers (just the hash of the data). If the peer doesn't know the object yet, it asks for the full object. So it's certainly not a DHT or any smart organisation of data: every (full) node (eventually) learns about every block and transaction. They have to, there is no other way of validating history otherwise.</p>

<p>As for how the client discovers peers, see <a href="https://bitcoin.stackexchange.com/questions/3536/how-do-bitcoin-clients-find-each-other">How do Bitcoin clients find each other?</a></p>

CC BY-SA 3.0
2013-05-28T16:49:37.373Z
If you want to know how peers are found: see the link to the potential duplicate (it's independent from what you want to do). If you want to know where blocks and transactions get sent, it'd easy: everywhere.
Pieter Wuille
CC BY-SA 3.0
2013-05-28T06:35:07.217Z
2017-05-18T17:35:23.773Z
2017-05-18T17:35:23.773Z
Pieter Wuille
<p>I am researching Bitcoin; what I can't find much information on though is how the P2P network itself operates. For example, BitTorrent uses a DHT protocol that allows for node discovery and calculating distances between nodes etc.</p>

<p>So if a Bitcoin client wants to do a transaction, how does it know which IP address to connect to in order to announce it?</p>

<p>And how does the node that the transaction gets sent to know which other nodes it needs to connect to, and so on?</p>

CC BY-SA 3.0
2013-05-28T06:35:56.423Z
Not really a duplicate: the question is mostly about how data moves through the network, not actually about how peers are found (I think).
Pieter Wuille
CC BY-SA 3.0
2013-05-28T14:19:19.530Z
The question is based on the false premise that nodes decide which other nodes to connect to based on what they need to do. That's just not how Bitcoin works.
David Schwartz
<client><network><relay>
How do Bitcoin nodes know where to send new transactions and blocks to?
user350325
# How do Bitcoin nodes know where to send new transactions and blocks to?

(Asked by: username_0 on 2013-05-28)

I am researching Bitcoin; what I can't find much information on though is how the P2P network itself operates. For example, BitTorrent uses a DHT protocol that allows for node discovery and calculating distances between nodes etc.

So if a Bitcoin client wants to do a transaction, how does it know which IP address to connect to in order to announce it?

And how does the node that the transaction gets sent to know which other nodes it needs to connect to, and so on?

**Tags:** client, network, relay

> **Comments:**
> **username_1**: Not really a duplicate: the question is mostly about how data moves through the network, not actually about how peers are found (I think).  
> **username_2**: The question is based on the false premise that nodes decide which other nodes to connect to based on what they need to do. That's just not how Bitcoin works.  

---

## 1 answers

### Answer by username_1 on 2013-05-28. Score: 13 | Accepted answer

Bitcoin is a so-called gossip network. They announce any new object to all of their peers (just the hash of the data). If the peer doesn't know the object yet, it asks for the full object. So it's certainly not a DHT or any smart organisation of data: every (full) node (eventually) learns about every block and transaction. They have to, there is no other way of validating history otherwise.

As for how the client discovers peers, see [How do Bitcoin clients find each other?](https://bitcoin.stackexchange.com/questions/3536/how-do-bitcoin-clients-find-each-other)

> **Comments:**
> **username_1**: If you want to know how peers are found: see the link to the potential duplicate (it's independent from what you want to do). If you want to know where blocks and transactions get sent, it'd easy: everywhere.  

---

