Commit to Metadata and splitting extranonce
Currently in the code we only have one extranonce. The stratum protocol has two extranonces, extranonce1 which is set by the pool and extranonce2 which is 32-bits and set by the miner when he runs out of nonce space in the block header and version rolling.
I propose we split our extranonce as follows:
extranonce1 = "Braidpool|" + <miner_id> + "|" + <miner_metadata>
where <miner_id> is a string the miner can add like "Bob's awesome mine" and <miner_metadata> is arbitrary metadata that the miner can add and we may use later to identify braidpool nodes, mine sites, downstream customers, or individual mining devices.
Tasks:
- Add extranonce1 to the
uncommitted_metadatastruct, and update its serialization/deserialization accordingly. - Rename extranonce in
uncommitted_metadatatoextranonce1 - Construct extranonce1 as "Braidpool|" +
where the miner can put "Bob's awesome mine" in the config file. - Provide a programmatic way for the miner to construct miner_metadata. This might be an external function or script we call, provided by the miner. What's the best way to do this?
- Update database serialization/deserialization with all the above.
@mcelrath Can I work on this issue ???
You should coordinate with @Sansh2356 on this if you want to work on it. You can find him on our discord.
Solved partially in #265 .