Author

Topic: Bitcoin's Genesis Block Difficulty (Read 206 times)

member
Activity: 378
Merit: 93
Enable v2transport=1 and mempoolfullrbf=1
September 05, 2023, 03:04:17 PM
#15
Quote
Any idea why?
Because Satoshi first set 40-bit difficulty for mainnet, and 20-bit for testnet. And then, he changed it from 40 to 32 bits. However, what was already mined, was good enough to be used, because if you have a block with 40 leading zeroes, then you can use it in code, where you need 32 zero bits, and it will work fine.

Wow, mystery solved.  It's a much more reasonable explanation than "Satoshi did it just to show off".
staff
Activity: 3458
Merit: 6793
Just writing some code
September 05, 2023, 12:44:00 PM
#14
Signet is mainly mined on CPUs, and as you can see, the minimal mainnet difficulty was too high for those people, that created signet.
The signet miner is implemented in Python which is way slower than the original built in miner. Also Signet doesn't rely on the PoW so it's difficulty can be much lower.

IIRC even at difficulty 1, a naive single threaded mining program does still take quite a bit longer than 10 minutes. The miner in the original client was definitely naive and single threaded, so there was a lot of easy optimizations that could be done to get significant speed up.
full member
Activity: 224
Merit: 146
September 05, 2023, 11:06:51 AM
#13
Quote
Any idea why?
Because Satoshi first set 40-bit difficulty for mainnet, and 20-bit for testnet. And then, he changed it from 40 to 32 bits. However, what was already mined, was good enough to be used, because if you have a block with 40 leading zeroes, then you can use it in code, where you need 32 zero bits, and it will work fine.

Thank you very much for the response and the other contributions to the thread. It has clarified a lot for me

copper member
Activity: 909
Merit: 2301
September 05, 2023, 07:00:39 AM
#12
Also, if you think that CPU mining is easy, then tell me, why signet difficulty is so much lower than the mainnet difficulty? Compare those two targets:
Quote
Code:
consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); //mainnet
//...
consensus.powLimit = uint256S("00000377ae000000000000000000000000000000000000000000000000000000"); //signet
Signet is mainly mined on CPUs, and as you can see, the minimal mainnet difficulty was too high for those people, that created signet.
legendary
Activity: 3472
Merit: 10611
September 05, 2023, 03:07:13 AM
#11
And also, it would be ridiculously easy to mine the genesis block because the difficulty is so low, and since there were no ASICs or GPUs or things like that mining back then, it was just with a regular CPU that could be completed very fast. That's how regtest manages to work as well, by artificially setting the difficulty to a low-enough value to bootstrap the network.
A regular CPU is already slow and they were even slower back in 2008 compared to today with all the core count rises and the parallelism improvements. It also can not be compared with RegTest because the PoW limit of RegTest is far less than the minimum on MainNet and TestNet.
7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff vs 00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff.
copper member
Activity: 909
Merit: 2301
September 05, 2023, 02:49:36 AM
#10
Quote
Genesis block header hash is this (hex):
 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
 
Note that it starts with 43 zero bits. Why? The block target difficulty was much lower (around 32 bits), so we can assume Satoshi did this on purpose.
There is more: if you use a different extraNonce value of 1, 2, 3 and 4, you will notice that there are more headers starting with 40 zero bits or more:
Code:
extraNonce: 0x01, time: 0x495fab1d, offset: 0x0c, nonce: 0x3429da6f, hash: 00000000 00052ab4 78b6f8a2 dcaba26a 189361c9 030b5d56 c524cb7b ddf00d0c
extraNonce: 0x02, time: 0x495fab20, offset: 0x09, nonce: 0x6f42bb66, hash: 00000000 00381808 e3b876ad 01e1262e 3a4ca528 72b1cc25 ca072fbd bc29d41f
extraNonce: 0x03, time: 0x495fab1f, offset: 0x0a, nonce: 0xe3d4f1f1, hash: 00000000 00792af0 bf962bc1 d3622071 92709091 65ae7c7b f8589911 d8277fa5
extraNonce: 0x04, time: 0x495fab29, offset: 0x00, nonce: 0x7c2bac1d, hash: 00000000 0019d668 9c085ae1 65831e93 4ff763ae 46a2a6c1 72b3f1b6 0a8ce26f
If you try to find just another 40-bit block hash with the same extraNonce, it will be more than 300 seconds away. Here, the offset of time is so close that it seems to be done on purpose.
legendary
Activity: 2268
Merit: 18771
September 05, 2023, 02:25:11 AM
#9
Quote
Code:
///static const unsigned int MINPROOFOFWORK = 40; /// need to decide the right difficulty to start with
static const unsigned int MINPROOFOFWORK = 20;  /// ridiculously easy for testing
This is what you can find in November 2008 version.
Interesting, thanks!

So although he did set the difficulty higher initially, this must have been changed prior to the genesis block being mined, since the new lower difficulty is already specified in the genesis block's block header. He couldn't have mined the genesis block and then changed the difficulty afterwards since that would change the nBits field, change the hash, and therefore invalidate the block.
copper member
Activity: 909
Merit: 2301
September 05, 2023, 02:17:12 AM
#8
Quote
it would be ridiculously easy to mine the genesis block because the difficulty is so low
No, it was "not so low", when it comes to CPU mining. You can try to mine it on your CPU. Also, if you want to see, which other blocks could be mined, then you can try to move those testnet coins: 16fb1c624b3658c78630c39f1c33e8f3dbdb71373f33eb22c6abe4405c0815bc. As you can notice, one of those outputs were spent, those related to the Genesis Block: ca079dbe1bc20d1ead479416ba4859dde4f3623a114da773a48dcdfb96baab1d.

You can spend other coins in a similar way, just change your extraNonce, and re-mine it with your CPU.

Quote
Do you have a source on that?
Quote
Code:
///static const unsigned int MINPROOFOFWORK = 40; /// need to decide the right difficulty to start with
static const unsigned int MINPROOFOFWORK = 20;  /// ridiculously easy for testing
This is what you can find in November 2008 version.
legendary
Activity: 2268
Merit: 18771
September 05, 2023, 02:09:12 AM
#7
Because Satoshi first set 40-bit difficulty for mainnet, and 20-bit for testnet. And then, he changed it from 40 to 32 bits.
Do you have a source on that?

The nBits field for both the genesis block and block 1 (and many subsequent blocks) is 0x1d00ffff. All of these blocks have the same target:
Code:
0x00000000ffff0000000000000000000000000000000000000000000000000000

That same target is also hard coded in to Core: https://github.com/bitcoin/bitcoin/blob/6f03c45f6bb5a6edaa3051968b6a1ca4f84d2ccb/src/kernel/chainparams.cpp#L54. How could the genesis block have a lower target than the one specified?
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
September 05, 2023, 01:13:37 AM
#6
And also, it would be ridiculously easy to mine the genesis block because the difficulty is so low, and since there were no ASICs or GPUs or things like that mining back then, it was just with a regular CPU that could be completed very fast. That's how regtest manages to work as well, by artificially setting the difficulty to a low-enough value to bootstrap the network.
legendary
Activity: 2380
Merit: 5213
September 05, 2023, 12:28:11 AM
#5
The more leading zeros doesn't necessarily mean that the block has a bigger difficulty.

Here is another example.

Block number 805936: 000000000000000000047b9acd5e05dacd3e64d1feff262820fdc9a771ef799a
Block number 805937: 000000000000000000000082bd248e332be398836e10ea5de3ad796983f1ca56


As you see, the hash of block number 805937 which was mined only 3 days ago has 3 more leading zeros than the hash of its previous block.
copper member
Activity: 909
Merit: 2301
September 05, 2023, 12:14:47 AM
#4
Quote
Any idea why?
Because Satoshi first set 40-bit difficulty for mainnet, and 20-bit for testnet. And then, he changed it from 40 to 32 bits. However, what was already mined, was good enough to be used, because if you have a block with 40 leading zeroes, then you can use it in code, where you need 32 zero bits, and it will work fine.
legendary
Activity: 3472
Merit: 10611
September 04, 2023, 10:46:44 PM
#3
When mining, we are trying to find a block header hash that is smaller than or equal to the target. So the actual hash can be a little smaller than the target or a lot smaller. Since the hash we find is completely random, there is always a chance that it ends up being a lot smaller like what you've found.
The difficulty doesn't change though. It is calculated based on the target.
sr. member
Activity: 602
Merit: 387
Rollbit is for you. Take $RLB token!
September 04, 2023, 08:13:45 PM
#2
Its difficulty is 1 as three block explorers below show. You can get the same information for Genesis block's difficulty with more Bitcoin block explorers.

List of useful Bitcoin block explorers

https://blockchair.com/bitcoin/block/0
https://www.blockchain.com/explorer/blocks/btc/0
https://bitinfocharts.com/bitcoin/block/0
full member
Activity: 224
Merit: 146
September 04, 2023, 07:23:52 PM
#1
Hi everyone,

I was looking into the Bitcoin Genesis block and noticed something interesting. The hash of the Genesis block, 0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f, has two more leading zeros in its hex representation. This means its difficulty is thousands of times higher than what was initially set.

Any idea why?

I'll print the next 3 block hashes to illustrate:

Block0:0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
Block1:0x00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048
Block2:0x000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd
Block3:0x0000000082b5015589a3fdf2d4baff403e6f0be035a5d9742c1cae6295464449
Jump to: