<p>I found on the internet that Bitcoin uses TCP to communicate with other nodes, connecting to them and sending messages. But a computer cannot bind more than 65536 sockets (because of TCP ports), so how can a node connect to more than 65536 nodes?</p>

CC BY-SA 4.0
2020-12-18T21:35:38.607Z
Does this answer your question? [How does one attain 1,000+ connections like blockchain.info?](https://bitcoin.stackexchange.com/questions/8109/how-does-one-attain-1-000-connections-like-blockchain-info)
MCCCS
CC BY-SA 4.0
2020-12-18T21:41:06.423Z
Why would you want/need to?
chytrik
CC BY-SA 4.0
2020-12-18T22:50:58.420Z
@MCCCS Um, the answers to that question say that a Bitcoin node will not open more than 8 connections. So, as I understand it, for a block to be spread to several nodes, one node passes to another, which passes to another, and so on. Right? And if the answer is yes, wouldn't that be bad and would you need one node to trust the other nodes in the network?
Papaulo
CC BY-SA 4.0
2020-12-18T22:51:23.547Z
@chytrik I am trying to learn and understand Bitcoin protocol.
Papaulo
CC BY-SA 4.0
2020-12-18T22:56:05.063Z
This does not seem related to Bitcoin, but is a generic question about TCP/IP network stacks. The relevant part on this SE site is simple: Bitcoin nodes only make a few outbound connections (usually in the range 4-10). The generic part is asked and answered here: https://serverfault.com/questions/160996/more-than-65536-tcp-connections-on-linux
Pieter Wuille
CC BY-SA 4.0
2020-12-18T23:08:32.177Z
@PieterWuille But isn't bad that a node needs to trust that other nodes will broadcast its transaction or block?
Papaulo
CC BY-SA 4.0
2020-12-18T23:57:27.250Z
That seems like an independent question. In short: for transactions, perhaps, but you can always connect to miners directly, and there isn't much that can be done about it (the network would rapidly run out of sockets if everyone connected to everyone; most nodes can't even be connected to at all). For blocks, nodes have an incentive to relay blocks (to help the network converge to their own view of the chain), and you will detect when you're partitioned off. Related reading: https://www.usenix.org/system/files/conference/usenixsecurity15/sec15-paper-heilman.pdf
Pieter Wuille
<network><tcp>
How does a Bitcoin node connect to more than 65536 other nodes?
Papaulo
# How does a Bitcoin node connect to more than 65536 other nodes?

(Asked by: username_0 on 2020-12-18)

I found on the internet that Bitcoin uses TCP to communicate with other nodes, connecting to them and sending messages. But a computer cannot bind more than 65536 sockets (because of TCP ports), so how can a node connect to more than 65536 nodes?

**Tags:** network, tcp

> **Comments:**
> **username_1**: Does this answer your question? [How does one attain 1,000+ connections like blockchain.info?](https://bitcoin.stackexchange.com/questions/8109/how-does-one-attain-1-000-connections-like-blockchain-info)  
> **username_2**: Why would you want/need to?  
> **username_0**: @username_1 Um, the answers to that question say that a Bitcoin node will not open more than 8 connections. So, as I understand it, for a block to be spread to several nodes, one node passes to another, which passes to another, and so on. Right? And if the answer is yes, wouldn't that be bad and would you need one node to trust the other nodes in the network?  
> **username_0**: @username_2 I am trying to learn and understand Bitcoin protocol.  
> **username_3**: This does not seem related to Bitcoin, but is a generic question about TCP/IP network stacks. The relevant part on this SE site is simple: Bitcoin nodes only make a few outbound connections (usually in the range 4-10). The generic part is asked and answered here: https://serverfault.com/questions/160996/more-than-65536-tcp-connections-on-linux  
> **username_0**: @username_3 But isn't bad that a node needs to trust that other nodes will broadcast its transaction or block?  
> **username_3**: That seems like an independent question. In short: for transactions, perhaps, but you can always connect to miners directly, and there isn't much that can be done about it (the network would rapidly run out of sockets if everyone connected to everyone; most nodes can't even be connected to at all). For blocks, nodes have an incentive to relay blocks (to help the network converge to their own view of the chain), and you will detect when you're partitioned off. Related reading: https://www.usenix.org/system/files/conference/usenixsecurity15/sec15-paper-heilman.pdf  

---

## 0 answers

