I am trying to figure out how blocks are generated from a developer view of perspective. I am not interested in pool mining etc. Just learning how different blockchains work. So, I know how BTC and XMR blockchains work when creating blocks. But, I couldn’t figure out Equihash coins generation.
For example, high level abstraction for Bitcoin mining (solo + local node) process could be :
GetBlockTemplate from node
Header_Array = CreateYourHeader (combine all these block version, prev hash, merkle root, current time, block bits, zero nonce)
While (target_not_met)
- nonce ++
- place nonce in the Header_Array
- hash = SHA256(SHA256(Header_Array)) then reverse
- If (hash < target) target_not_met=false
SubmitBlock with nonce
So, how equihash + blake2b are used in BTG, ZEC, etc… ?
Let’s say I started with GetBlockTemplate like BTC…
Then ? Can anyone give me a high level algorithm like I mentioned above please?