As a fun project I have decided to develop a mining pool. I know most pools just use z-NOMP or some variation/fork of this github project. I have looked through the code and personally am not a fan of Node.js. I think there is a lot of overhead there and wanted to develop a new pool from the ground up.
I am looking for some sources that are accurate and have very detailed explanations of how the work distribution occurs. Stratum procotol seems like unecessary overhead and may be something I look at later, but at the moment I am trying to figure how to distribute work successfully. Obviously the daemon is polled for getblocktemplate, then from what I can gather the following steps are done :
- Version is packed into 4 bytes (little endian)
- Previous block hash is appended 32 bytes (Little endian conversion from getblocktemplate required)
- Merkle root hash is appended 32 (Little endian, but calculation is done using transactions and coinbasetxn)
- From what I gather I need to add a TXN to this merkle root calculation for finding the block to get the reward.
- 32 bytes of reserved hash
- 4 bytes of curTime UTC format
- 4 bytes of bits field (difficulty encoded)
- 32 bit nonce which is incremented by the miner
- 3 bits of how large the equihash solution is (Always 1344 supposedly)
- Equihash solution
I have read over the Zcash specification and will continue to do so since I just started this endeavor, but I was looking for some advice on references and good places to look. I also am aware that Zcash is heavily based on Bitcoin protocols, so the bitcoin wiki is pretty useful.
If there is anyone that has developed a pool that would be able to give me some pointers please let me know!
I am also looking for a miner that I can use for verification purposes, I don't know if there is such a thing, but I wanted to get one so that I could verify older blocks that already have been solved to make sure that my algorithms are correct.