The genesis block is not predicted. The genesis block is decided upon in advance, and then hard coded as the first block that must appear in the blockchain.
You can see it hard coded in the codebase here:
std::string const GENESIS_TX = "013c01ff0001ffffffffffff03029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd08807121017767aafcde9be00dcfd098715ebcf7f410daebc582fda69d24a28e9d0bc890d1";
(See https://github.com/monero-project/monero/blob/8361d60aef6e17908658128284899e3a11d808d4/src/cryptonote_config.h#L162)
What that hardcoded transaction means is: Create 17.592186044415 XMR out of thin air (that is the base 10 representation of the amount ffffffffffff03
in hex) as a mining reward, and let the recipient of the amount be whoever knows the private key corresponding to the output public key 9b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd088071
.
There is a transaction public key included in the transaction which would help the recipient's wallet automatically determine that this output was destined for the wallet via the usual Monero mechanisms (the tx public key is combined with the recipient's wallet's private view key and public spend key, and this is cross referenced with the output public key to check if that output is destined for the wallet).
At first, we don't have any wallet. So, how can you make a transaction to the wallet "9b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd088071" ?
Firstly, 9b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd088071 is not the destination wallet. It's something called the transaction public key, which is an elliptic curve point which the destination wallet uses to figure out whether the transaction is destined for that destination wallet, and helps the destination wallet figure out how to construct the necessary keys to later spend the funds.
To be able to receive funds, all you need is two private/public key pairs (your private/public spend and view keys), and these can be generated independently. It's just math. To generate the tx public key, you just create a random number r
and then determine the tx public key by multiplying r
with the ed25519 elliptic curve base point G
. To generate the output public key, you combine the recipient's public view and spend keys with r
(the specific algebra is Hs(rA)G+B
).
How can you get the transaction id ?
The transaction id is just a hash of the transaction, which can be determined after you manually create the genesis transaction. It can be determined by simply performing a Keccak hash on the hard coded transaction.
How can you predict the wallet address ?
As mentioned above, you manually create it by creating two public/private key pairs.
Are you supposed to create a wallet before you start the blockchain ?
You just need to create the two public/private key pairs. As side note, technically you don't actually need to even create wallet private/public key pairs to receive funds. If you know the specific output that is yours, you can spend it directly if you know the output private key (which you could know if you manually created the transaction yourself, but not if someone else created it for you). But wallet addresses and tx public keys are there so that the wallet can detect the incoming funds and mathematically determine the correct output private key without having to be told this information outside of the blockchain.
Or maybe this wallet is fake and "locked", and the amount inside is "lost" ?
The genesis block was created by thankful_for_today, see https://bitcointalk.org/index.php?topic=563821.0
If thankful_for_today wanted to, they could certainly spend the funds created in that block (as long as thankful_for_today didn't intentionally mangle the output public key so that there is no known key to spend the funds - we can't tell from looking at the blockchain). Perhaps thankful_for_today did spend it - Monero's ring signatures make it impossible to know.