ASICseer / asicseer-pool

ASICseer Pool: Fast, C-based, multithreaded mining pool software for Bitcoin Cash
https://asicseer.net
4 stars 6 forks source link

Consider removal of extra data from coinbase scriptsig #16

Closed tfaoro closed 4 years ago

cculianu commented 4 years ago

Yeah man good call. There's all this crap that's inserted before the first '/' character in the coinbase scriptsig. For (my and your) reference, here's the stuff inserted:

With the exception of block_height above (which is required by bitcoin), potentially all of the above can be removed. However it looks like ck went to great care to nonceify and otherwise uniquely mark each work unit generated by doing this to the coinbase. I can't be sure yet what effects removing this data has on mining, or on forging work unit results to game the hash rate, etc. I have to be very careful here.

This response is just to illuminate the discussion so we know what is there (and what can be potentially removed).

cculianu commented 4 years ago

I pushed a commit just now that removes some of this data, but still leaves some of it. Here is the data removed:

In addition, the timestamp field has been made a fixed size, 8-byte integer. This shaves off 2 bytes of average.

On average about 4 bytes were saved. Not a huge savings. I'm wary to delete the other fields (especially the timestamp and the nonce_length) because I'm unclear yet what they do. I am also unclear about how the pool defends against attacks where a user can fake their hash rate by submitting multiple duplicate shares. I suspect the timestamp plays into this.

cculianu commented 4 years ago

This has been fully addressed in v1.2.0 commit 3dddb6efce046139ef321dfda3ce39e2722f555a