Cryptocurrency Statistic Locations


This article will outline where you can find the block time and reward, coin cap, difficulty algorithm, ports, and first letter of an address. When I mention line numbers, the line may not always be there, look above or below because devs may add comments, etc.

Block Time

Block time can be found in line 837 of main.cpp. It is measured in seconds.

LINE 837 static const int64 nTargetSpacing = 60;

In this case the block time is 60 seconds, or one minute.

Block Reward

The block reward for a cryptocoin can be found in the main.cpp file, on line 831.

LINE 831 int64 nSubsidy = 1 * COIN

(In this case it is 1 coin per block)

Coin Cap

The total number of coins ever minted can be found on line 43 of the main.h file.

LINE 43 static const int64 MAX_MONEY = 21000000 * COIN;

In this case the maximum number of coins is 21 million.

Difficulty Calculation

In the main.cpp file, on line 836 and on line 842, you can find difficulty details. Line 836 shows the number of seconds between each difficulty retarget (in this case, 120 seconds or two minutes). Line 842 shows the number of times the retarget history the coin should look back to calculate the difficulty. In this example, it looks back 4 * 60 * 2 seconds. If that is hard to understand, imagine that a coin has two minute blocks and the same difficulty stats as below. That means that the difficulty retargets after every block. Line 842 tells the coin to calculate the difficulty as an average of the four previous blocks (4 * 1 block).

LINE 836 static const int64 nTargetTimespan = 60 * 2;
LINE 842 static const int64 nReTargetHistoryFact = 4;

Coin RPC and P2P Ports

You can find the RPC port number of a coin by looking in the bitcoinrpc.cpp file. The RPC port should be on line 2893.

LINE 2893:  ip::tcp::endpoint endpoint(bindAddress, GetArg("-rpcport", 1234));

You can find the P2P and Testnet port numbers of a coin by looking in the init.cpp file. The port numbers are on line 235.

LINE 235 "  -port= " + _("Listen for connections on  (default: 2345 or testnet: 6789)") + "\n" +

(P2P port is 2345, testnet port is 6789)

Address First Letter

The first letter of a coin's address is found in the base58.h file, on line 280. The first “bit” is a character's base 58 code.


For example, the above firstbit is a capital letter “J”.


The information from this article was found at shakezula (Adam m's) website.


QR Code
QR Code cryptocurrency_statistic_locations (generated for current page)