public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Prayank <prayank@tutanota•de>
To: Bitcoin Dev <bitcoin-dev@lists•linuxfoundation.org>
Subject: [bitcoin-dev] non-default ports for automatic connections in Bitcoin P2P network
Date: Sat, 29 Jan 2022 23:02:24 +0100 (CET)	[thread overview]
Message-ID: <Mubr4YT--3-2@tutanota.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 2660 bytes --]

## Using non-default ports for automatic connections in Bitcoin P2P network


ISPs can block default port 8333 used by Bitcoin nodes. One example:
https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-September/010798.html

While it would still be possible for crawlers and scanners to know about bitcoin nodes listening on non-default ports using other methods, it can be helpful in lot of countries that use basic things to block: domain, port etc.

In October 2021 a [pull request][1] was merged in Bitcoin Core in which lot of contributors
agreed to allow non default ports for automatic connections. It did not implement everything,
was limited to discussing the concept and allow AddrMan to support multiple ports per IP.

It was followed by another [pull request][2] in November 2021 which is still open and makes most
of the changes required for non-default ports to work with automatic connections.

I could not find any major issues with the changes however had some nits including a discussion on
mailing list which was even requested by a few other reviewers.


===Things that I found during my review, research and testing===

1.One user had posted about issues with default port 8333 on [bitcointalk][3] in July 2010. VMWare server
also used port 8333 so an option was requested to change port. This option was added in [May 2011][4] by Gavin Andresen. Gavin has discussed this option and related issues in detail with others on [bitcointalk][5].

2.I tried running signet for 1 hour v22.0 and 1 hour PR branch with debug=net. v22.0 had only 38333 port with different IPs in debug.log for connections. PR branch had 2 feeler connections with non-default ports 38331 and 13833.

Note: Default ports used in Bitcoin Core are 8333(mainnet), 18333(testnet), 18444(regtest) and 38333(signet)

3.Wrote a [PowerShell script][6] and tested it on v22.0 and PR branch which bans all peers every 100 seconds using default port. It works as expected and I could see one peer using port 3111 on signet.

4.I am not sure about the 'bad ports' list in Bitcoin Core added in PR #23542


8333 in leet becomes 'beee' in plain text. Not sure if this was considered by Satoshi to hardcode 8333 for Bitcoin.


  [1]: https://github.com/bitcoin/bitcoin/pull/23306
  [2]: https://github.com/bitcoin/bitcoin/pull/23542
  [3]: https://bitcointalk.org/index.php?topic=322.0
  [4]: https://github.com/bitcoin/bitcoin/pull/221
  [5]: https://bitcointalk.org/index.php?topic=589.0
  [6]: https://github.com/prayank23/bitcoin-ps-scripts/blob/main/Scripts/Node/ban_default_peers.ps1

-- 
Prayank

A3B1 E430 2298 178F

[-- Attachment #2: Type: text/html, Size: 3889 bytes --]

             reply	other threads:[~2022-01-29 22:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-29 22:02 Prayank [this message]
2022-02-02 13:30 ` Vasil Dimov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Mubr4YT--3-2@tutanota.de \
    --to=prayank@tutanota$(echo .)de \
    --cc=bitcoin-dev@lists$(echo .)linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox