NebulousLabs / Sia

Blockchain-based marketplace for file storage. Project has moved to GitLab: https://gitlab.com/NebulousLabs/Sia
https://sia.tech
MIT License
2.71k stars 440 forks source link

why Sia still not support GetBlockTemplate yet? #3055

Open bitkevin opened 6 years ago

bitkevin commented 6 years ago

Right now, most device mining Sia are ASIC miners, and almost all asic miners using stratum protocol, https://github.com/SiaMining/Stratum, I am wondering when will Sia support GetBlockTemplate?

https://siamining.com/stratum https://github.com/SiaMining/Stratum

https://github.com/NebulousLabs/Sia/issues/2400

bitkevin commented 6 years ago

8 bytes is more than enough nonce space, you need 2^64 operations to grind through it, and world class theoretical ASICs would still take days to grind through the full nonce space.

8 Bytes is not enough at all, for mining pool, extra nonce1 is 4 bytes. Only left 4 bytes for asic miner, that's far from enough.

Innosilicon S11 SiaMaster Specifications: – Hashrate: 3.83 TH/s

tbenz9 commented 6 years ago

Getblocktemplate is something that would need to be implemented by the mining pool, not by the sia daemon.

The Sia team does not run or maintain any mining pool. Do you believe there is some functionality required in the Sia daemon that is missing?

FYI: @nitronick600, @siamining

hashbender commented 6 years ago

getblocktemplate should be provided by the daemon which is a core implementation.

https://en.bitcoin.it/wiki/Getblocktemplate

DavidVorick commented 6 years ago

@bitkevin does the pool need a full 32 bits for extra nonce 1? The pool internally can roll the arb data, any decent server is going to give you at least tens of thousands of starting points per second. Then you take 2 bytes that you use to distinguish between different miners, that gives you close to 1 billion different jobs you can pass to miners per second.

Then the miner itself gets 6 bytes, which is more than a minute of mining at 4 TH/s. The miner should be getting new headers every few seconds anyway, to update what transactions its mining.

That's plenty of space. And if your mining pool gets over 1 billion machines doing 4 TH/s, you can just buy a few more servers, you'll be able to afford it at that point.

bitkevin commented 6 years ago

@DavidVorick

There are potential problems:

  1. If there is stratum-proxy/agent between pool and miners, how many bytes left for the proxy? I think it's zero.
  2. If get work from specific Siad server, than have to submit the new block to the specific Siad server. For mining pool, usually submit the new block hex to many Siad servers.

So the best way for mining pool is Siad return the candidate block with fully data by json-RPC, let the pool handle the arb tx and merkle root hash. Just like bitcoin.