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?

  • 1
    Does this answer your question? How does one attain 1,000+ connections like blockchain.info?
    – MCCCS
    Dec 18, 2020 at 21:35
  • Why would you want/need to?
    – chytrik
    Dec 18, 2020 at 21:41
  • @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
    Dec 18, 2020 at 22:50
  • 1
    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: serverfault.com/questions/160996/… Dec 18, 2020 at 22:56
  • 1
    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: usenix.org/system/files/conference/usenixsecurity15/… Dec 18, 2020 at 23:57


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.