I'm trying to develop a solo miner for bitcoin, now I'm in the stage of generating the merkle root. To make the coinbase transaction I looked at
https://bitcoin.org/en/developer-reference#coinbase , but I don't understand the structure etc
as I understand, to generate the merkle root, the transactions should be taken from mempool and should be hashed plus the coinbase transaction should be placed as the first transaction when hashing.
the above link states he coinbase transaction should be as follows, this is the candidate block structure right?
hash (null)
index (UINT32_MAX)
script bytes
height
coinbase script
sequence
so to hash it as a candidate block what should I do? concatenate all the information and double SHA256 it and convert to little endian?
(hash (null) & index (UINT32_MAX) & script bytes & height & coinbase script & sequence) --> convert to little endian?
and where do I place my public wallet address? inside the "script bytes"? Can someone shed some light here?
script bytes --> Wallet address: 18ib9rJq7LiNZTSbGL7fHdJmZgWW6QEJCD