What is the difference between the rpc port 8332 and port 8333?

24

9

What is the difference between the protocol and commands used on default ports 8332 and port 8333?

From what I gather, port 8332 is the RPC port, it's "sensitive", only allowed by local host by default, and it has one username & password.

On the other hand port 8333 is some kind of P2P port that is used with Bitcoin transaction replication.

Can anyone clarify the official names, purposes, and security of each of these ports?

Which one uses JSON, and which is Binary?

goodguys_activate

Posted 2012-12-12T20:15:12.690

Reputation: 11 898

when i try to connect to my json rpc remotely i get the following errors

port 8333: "RemoteDisconnected: Remote end closed connection without response" port 8332: [Errno 61] Connection refused

any ideas if this is a firewall issue on my Ubuntu droplet or ? – Sonic Soul 2018-08-22T12:09:22.487

@SonicSoul not sure, I've left Bitcoin for the most part, pursuing technologies that won't consume as much electricity.goodguys_activate 2018-08-22T20:25:22.993

Answers

23

The Bitcoin.org client will try to communicate to other nodes via port 8333 and those communications follow the Bitcoin protocol. If an explicit connection is given (IP address and port) the port setting can be overridden to use any port.

The bitcoin.org client can be configured to accept JSON-RPC communications, and when that is enabled will, by default, be on port 8332. Earlier versions of Bitcoin Core permitted this to be secured with SSL communications using the same port or a different port, however that capability has since been removed.

Stephen Gornick

Posted 2012-12-12T20:15:12.690

Reputation: 26 118

SSL has been removed from Bitcoin since this answer was posted. It is now recommended to setup an ssh tunnel for encrypting the JSON-RPC connection.alexg 2019-05-14T08:40:03.037

Thank you, alexg. Updated the answer.Stephen Gornick 2019-05-16T02:24:13.173

3

I would add that both ports are TCP (as opposed to UDP), and are listed in wikipedia: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

knocte 2016-06-27T12:43:32.803