Bitcoin Forum
May 17, 2024, 05:34:05 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Why is it necessary to mine the genesis block?  (Read 427 times)
BlackHatCoiner (OP)
Legendary
*
Online Online

Activity: 1526
Merit: 7377


Farewell, Leo


View Profile
April 07, 2021, 08:16:18 AM
Merited by vapourminer (1)
 #1

On my way to fork Bitcoin Core, I had to either set the nMaxTipAge = DEFAULT_MAX_TIP_AGE * 10000 in validation.cpp (to avoid any gap troubles) or change the genesis block. I tried the first option, but now I want to change the genesis block and I have this query.

Why do I have to mine the genesis block? A forum member had posted an announcement thread of his project ([ANN] Genesis Block Generator), but it is described that you'll have to mine the genesis block.

Isn't mining necessary only when we want to proof a work? There's no proof of work on the genesis block, only the initial conditions to start the chain.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4193



View Profile
April 07, 2021, 01:44:15 PM
 #2

The genesis block is still a valid block and thus still have a valid PoW. The difficulty has to be at a minimum of 1 or a target of 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Rizzrack
Copper Member
Hero Member
*****
Offline Offline

Activity: 764
Merit: 700


Defend Bitcoin and its PoW: bitcoincleanup.com


View Profile WWW
April 07, 2021, 01:53:06 PM
 #3

As far as I know you don't mine the genesis block, you hardcode it.

BlackHatCoiner (OP)
Legendary
*
Online Online

Activity: 1526
Merit: 7377


Farewell, Leo


View Profile
April 07, 2021, 01:54:04 PM
Last edit: April 07, 2021, 02:05:06 PM by BlackHatCoiner
 #4

The genesis block is still a valid block and thus still have a valid PoW.
What do you mean by saying "valid"? How is a valid block defined? Every other block requires PoW to ensure that the majority of the computational power goes to the current chain to prevent double-spending. Why should the genesis require that?

What exactly do you prove once you mine a genesis block? That you can achieve it with a certain target? As I said, you'd do that after to maintain the longest chain. What difference would it make if Satoshi had picked the first hash with nonce=1? There's nothing to be proved in the genesis block.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4193



View Profile
April 07, 2021, 02:10:03 PM
 #5

What do you mean by saying "valid"? How is a valid block defined? Every other block requires PoW to ensure that the majority of the computational power goes to the current chain and to prevent double-spending.
A valid block has to have at least a target above the minimum value as stated or a difficulty of 1. If it has zero difficulty, it is invalid.  

What exactly do you prove once you mine a genesis block? That you can achieve it with difficulty=1? As I said, you'd do that after to maintain the longest chain. What difference would it make if Satoshi had picked the first hash with nonce=1? There's nothing to be proved in the genesis block.
Probably nothing. I'm not sure whether Core skips the checks for a valid block when it comes to the genesis block. I'm not too familiar with the codes for Bitcoin Core but I'm pretty sure I've read somewhere that the genesis block still has to have sufficient PoW and was validated as per normal for at least in the first few release. Perhaps someone can add on to this.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
j2002ba2
Full Member
***
Offline Offline

Activity: 204
Merit: 437


View Profile
April 07, 2021, 03:31:12 PM
 #6


What exactly do you prove once you mine a genesis block? That you can achieve it with a certain target? As I said, you'd do that after to maintain the longest chain. What difference would it make if Satoshi had picked the first hash with nonce=1? There's nothing to be proved in the genesis block.


The genesis block was likely mined with difficulty 4000. This makes it hard to mess up the beginning of the chain, giving a head start of a week for bitcoin.

Nowdays mining with difficulty one is easy, just do it on a GPU. It should take about a second or less.

NotATether
Legendary
*
Offline Offline

Activity: 1610
Merit: 6746


bitcoincleanup.com / bitmixlist.org


View Profile WWW
April 07, 2021, 04:09:04 PM
Merited by vapourminer (1)
 #7

What exactly do you prove once you mine a genesis block? That you can achieve it with difficulty=1? As I said, you'd do that after to maintain the longest chain. What difference would it make if Satoshi had picked the first hash with nonce=1? There's nothing to be proved in the genesis block.
Probably nothing. I'm not sure whether Core skips the checks for a valid block when it comes to the genesis block. I'm not too familiar with the codes for Bitcoin Core but I'm pretty sure I've read somewhere that the genesis block still has to have sufficient PoW and was validated as per normal for at least in the first few release. Perhaps someone can add on to this.

It really does skip the validation checks for genesis block, at least for mainnet and signet, and I'm sure that's how testnet works too. mainnet signet



Why do I have to mine the genesis block? A forum member had posted an announcement thread of his project ([ANN] Genesis Block Generator), but it is described that you'll have to mine the genesis block.

You only have to do that if your blockchain is empty (like his), like Satoshi did in the early days.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4193



View Profile
April 07, 2021, 04:19:43 PM
 #8

It really does skip the validation checks for genesis block, at least for mainnet and signet, and I'm sure that's how testnet works too. mainnet signet
Yeah. In the earlier versions, the validation logic doesn't exclude the genesis block or at least that is my understanding of the code.

Do review the codes and let me know if I'm missing something.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
April 07, 2021, 04:25:03 PM
 #9

the real answer is that you don't have to do anything, bitcoin's genesis block is defined this way that Satoshi decided to also mine that block too so that block zero also has a valid proof of work. otherwise if you are changing stuff you can also change this little detail so that the software uses an arbitrary block 0 with no proof of work.
there is also no reason to validate block 0 proof of work.

There is a FOMO brewing...
odolvlobo
Legendary
*
Offline Offline

Activity: 4312
Merit: 3219



View Profile
April 07, 2021, 07:30:32 PM
 #10

Why do I have to mine the genesis block?...
Isn't mining necessary only when we want to proof a work? There's no proof of work on the genesis block, only the initial conditions to start the chain.

You can make exceptions for certain blocks, but it is better if you don't.

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
BlackHatCoiner (OP)
Legendary
*
Online Online

Activity: 1526
Merit: 7377


Farewell, Leo


View Profile
April 08, 2021, 04:40:13 PM
 #11

You only have to do that if your blockchain is empty (like his), like Satoshi did in the early days.
What difference would it make if it wasn't empty? I'm forking Bitcoin Core and I'm wondering if I can just enter a random hash, since you wrote that it doesn't check it. Also, by the way if you know it, where's the function that performs SHA256 to the genesis conditions and returns the hash?

bitcoin's genesis block is defined this way that Satoshi decided to also mine that block too so that block zero also has a valid proof of work.
And I'm asking again:  What do you mean by saying "valid"? A proof of work is proof only if it's necessary. For example finding hash that doesn't exceed a certain target. Is your proof of work valid if you don't find such hash? You may have worked, but not enough to "prove" something. Satoshi worked, but there wasn't any purpose to do so. There wasn't something to be proved and thus, it's wrong to say that he mined the genesis block.

You can make exceptions for certain blocks, but it is better if you don't.
If you're referring to Bitcoin, it does have an exception. The output of block 0 can't be spent.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
April 08, 2021, 05:19:08 PM
 #12

bitcoin's genesis block is defined this way that Satoshi decided to also mine that block too so that block zero also has a valid proof of work.
And I'm asking again:  What do you mean by saying "valid"?
valid means when you compute the hash of genesis block the result is indeed lower than the target (which is minimum value for block 0).

Quote
A proof of work is proof only if it's necessary.
proof of work is just proof that you have worked!
meaning by publishing the nonce (and the combination that is the header) you prove that you have actually performed some work to find that combination so that the hash of it is lower than the target. it is not possible to guess such a combination.

Quote
For example finding hash that doesn't exceed a certain target. Is your proof of work valid if you don't find such hash?
you won't have any proof if the hash is not lower than the target, it might as well be an arbitrary hash.

Quote
Satoshi worked, but there wasn't any purpose to do so. There wasn't something to be proved and thus, it's wrong to say that he mined the genesis block.
that's a different question. Satoshi probably mined genesis block because it is still a valid bitcoin block and he also had enough time to mine it since there was no competition or anything like that.

There is a FOMO brewing...
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4193



View Profile
April 08, 2021, 06:00:35 PM
 #13

And I'm asking again:  What do you mean by saying "valid"? A proof of work is proof only if it's necessary. For example finding hash that doesn't exceed a certain target. Is your proof of work valid if you don't find such hash? You may have worked, but not enough to "prove" something. Satoshi worked, but there wasn't any purpose to do so. There wasn't something to be proved and thus, it's wrong to say that he mined the genesis block.
I think I have touched on the validity of a block above?

Proof of work is a concept that proves that someone has expended resources in exchange for finding a hash that meets a target. Satoshi's genesis block proves exactly this and I'm sure he didn't get it by chance.

You really don't have to make the genesis block valid, it is after all just something for your subsequent blocks to reference. You can test it out and construct it without meeting the target but I'm not sure whether it would fail with any validation or not.  There is really no issues as long as you can exclude it from any (if any) PoW checks.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
vjudeu
Hero Member
*****
Offline Offline

Activity: 689
Merit: 1597



View Profile
April 09, 2021, 07:05:24 AM
Merited by vapourminer (1)
 #14

It is necessary to prevent Genesis Block overwriting. Satoshi timestamped Genesis Block with the NY Times message to prove that this block was not mined earlier. In old versions, Genesis Block was not any special case in code. You just started from zero hash and built on top of it. But then, everyone could overwrite the whole chain, including the Genesis Block. And later, Satoshi hardcoded Genesis Block data in the client to prevent that kind of attack. But he forgot about adding that transaction to the database, so it became unspendable.

So, you can start with no Genesis Block at all, just build on top of zero hash and you will get simpler code. But then, overwriting all blocks will be possible, including the first block in the chain.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
pooya87
Legendary
*
Offline Offline

Activity: 3458
Merit: 10564



View Profile
April 09, 2021, 07:24:41 AM
 #15

But then, everyone could overwrite the whole chain, including the Genesis Block.
To "overwrite" the whole chain, one requires the majority hashrate (51% attack) so that they can build a chain that can be longest. With or without a hardcoded genesist block, this attack is always possible as long as one can acquire that much of the hashrate.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
vjudeu
Hero Member
*****
Offline Offline

Activity: 689
Merit: 1597



View Profile
April 09, 2021, 10:24:12 AM
 #16

Yes, but if you can overwrite the Genesis Block, then you can start the whole chain earlier. So, for example, instead of starting from 2009-01-03, you could start from 1970-01-01. And then, you could pretend that the whole chain existed earlier. So, this block was hardcoded to prevent pretending that Bitcoin was invented before by someone else than Satoshi.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4193



View Profile
April 09, 2021, 10:43:58 AM
Last edit: April 10, 2021, 03:32:33 AM by ranochigo
Merited by pooya87 (1)
 #17

Yes, but if you can overwrite the Genesis Block, then you can start the whole chain earlier. So, for example, instead of starting from 2009-01-03, you could start from 1970-01-01. And then, you could pretend that the whole chain existed earlier. So, this block was hardcoded to prevent pretending that Bitcoin was invented before by someone else than Satoshi.
The inclusion of the scriptsig's message was a reference to the article so yes, that is what Satoshi intended; proving that he started the chain no earlier than the date but it has nothing to do with who invented what, and when was it invented. The genesis block is not important, you can just attack by reorganizing everything after the genesis block and it would achieve the same thing. It is definitely better to have a pre-defined starting point for a blockchain though.

Genesis block was hardcoded for the start, if I'm not wrong. Here's the snippet of the code.
Code:
   //
    // Init with genesis block
    //
    if (mapBlockIndex.empty())
    {
        if (!fAllowNew)
            return false;


        // Genesis Block:
        // GetHash()      = 0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
        // hashMerkleRoot = 0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
        // txNew.vin[0].scriptSig     = 486604799 4 0x736B6E616220726F662074756F6C69616220646E6F63657320666F206B6E697262206E6F20726F6C6C65636E61684320393030322F6E614A2F33302073656D695420656854
        // txNew.vout[0].nValue       = 5000000000
        // txNew.vout[0].scriptPubKey = 0x5F1DF16B2B704C8A578D0BBAF74D385CDE12C11EE50455F3C438EF4C3FBCF649B6DE611FEAE06279A60939E028A8D65C10B73071A6F16719274855FEB0FD8A6704 OP_CHECKSIG
        // block.nVersion = 1
        // block.nTime    = 1231006505
        // block.nBits    = 0x1d00ffff
        // block.nNonce   = 2083236893
        // CBlock(hash=000000000019d6, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=4a5e1e, nTime=1231006505, nBits=1d00ffff, nNonce=2083236893, vtx=1)
        //   CTransaction(hash=4a5e1e, ver=1, vin.size=1, vout.size=1, nLockTime=0)
        //     CTxIn(COutPoint(000000, -1), coinbase 04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73)
        //     CTxOut(nValue=50.00000000, scriptPubKey=0x5F1DF16B2B704C8A578D0B)
        //   vMerkleTree: 4a5e1e

        // Genesis block
        char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
        CTransaction txNew;
        txNew.vin.resize(1);
        txNew.vout.resize(1);
        txNew.vin[0].scriptSig     = CScript() << 486604799 << CBigNum(4) << vector<unsigned char>((unsigned char*)pszTimestamp, (unsigned char*)pszTimestamp + strlen(pszTimestamp));
        txNew.vout[0].nValue       = 50 * COIN;
        txNew.vout[0].scriptPubKey = CScript() << CBigNum("0x5F1DF16B2B704C8A578D0BBAF74D385CDE12C11EE50455F3C438EF4C3FBCF649B6DE611FEAE06279A60939E028A8D65C10B73071A6F16719274855FEB0FD8A6704") << OP_CHECKSIG;
        CBlock block;
        block.vtx.push_back(txNew);
        block.hashPrevBlock = 0;
        block.hashMerkleRoot = block.BuildMerkleTree();
        block.nVersion = 1;
        block.nTime    = 1231006505;
        block.nBits    = 0x1d00ffff;
        block.nNonce   = 2083236893;

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
pooya87
Legendary
*
Offline Offline

Activity: 3458
Merit: 10564



View Profile
April 10, 2021, 03:37:00 AM
 #18

Yes, but if you can overwrite the Genesis Block, then you can start the whole chain earlier. So, for example, instead of starting from 2009-01-03, you could start from 1970-01-01. And then, you could pretend that the whole chain existed earlier. So, this block was hardcoded to prevent pretending that Bitcoin was invented before by someone else than Satoshi.
You keep saying "overwrite" but the bitcoin blockchain is immutable and not a single block can change specially when they are deep. It doesn't matter what the "text" in signature script of a block says, you still have to mine n+1 blocks when the main chain has n blocks to be able to overwrite any of the blocks.

The only purpose that this text serves is that it proves that "Satoshi" didn't mine genesis block in 1970-01-01!

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
vjudeu
Hero Member
*****
Offline Offline

Activity: 689
Merit: 1597



View Profile
April 10, 2021, 05:53:32 AM
 #19

Yes, today the chain is strong and overwriting it is hard. But at the beginning, nothing protected the network from overwriting blocks, even Satoshi mentioned that "The software is still alpha and experimental. There's no guarantee the system's state won't have to be restarted at some point if it becomes necessary, although I've done everything I can to build in extensibility and versioning". Of course in early versions, the longest chain was counted as "valid", but later it was changed to the "heaviest" chain. So, Satoshi always wanted to define "Bitcoin" as "the chain with the most Proof of Work". And in case of disagreement, the Genesis Block with the most proof of work would be treated as the starting point. So, by mining Genesis Block, overwriting everything is just more difficult.

Also, if more than one person is involved in coin creation, then it is possible to use Proof of Work to decide which Genesis Block should be used. Just N people can buy the newspaper on selected date (for example today), include message from it, and start running their PCs to mine the Genesis Block with the most Proof of Work. After some time (for example 24 hours), the best block could be selected and hardcoded into mining software.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
GameUnits
Jr. Member
*
Offline Offline

Activity: 102
Merit: 5

GameBit - The Network


View Profile WWW
April 22, 2021, 08:20:41 PM
 #20

As far as I know you don't mine the genesis block, you hardcode it.

Exactly, to calculate the genesis hash you need write your own code within your bitcoin clone. It's a bit complicated for beginners Wink
Cheers

Coffee works!
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!