Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extranonce handling is no-standard for STRATUM #17

Open
AndreaLanfranchi opened this issue May 2, 2020 · 3 comments
Open

Extranonce handling is no-standard for STRATUM #17

AndreaLanfranchi opened this issue May 2, 2020 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@AndreaLanfranchi
Copy link

AndreaLanfranchi commented May 2, 2020

After implementation of "extranonce" in STRATUM flavor I see there's a non-standard behavior in submitting solution.

Extranonce implementation SHOULD behave like this:

  1. workprovider (pool) sends extranonce, say, 127be1
  2. workconsumer (miner) sets its nonce search range as
0x127be00000000000 // low bound
0x127befffffffffff // high bound
  1. Say miner finds solution 127be10002d9b189. Solution submission SHOULD report nonce as 0002d9b189 (i.e. the substring of full hex nonce - omitting the Extranonce initial part). Actually kawpowminer reports the full nonce hex representation.

Tested with minermore to send only the variable part of the nonce and got rejects

Rejected in 142 ms. by rvnt.minermore.com Reason: 20 incorrect size of nonce, must be 8 bytes

While this is not technically a bug it may lead to confusion in implementations.

Why should this matter ?
There are two reasons.

  1. Reporting only the variable part of the nonce (when extranonce is set) saves bytes (which pools should be happy of when handling tons of connections)
  2. Slightly mitigates the man-in-the-middle attack which is possible on non-SSL connections to pools (the sniffer should listen to the whole session and keep track of the extranonces set).
@AndreaLanfranchi
Copy link
Author

AndreaLanfranchi commented May 2, 2020

@traysi
I also suggest to have the Extranonce set to a maximum of 2 bytes and leave wider space for miner to choose its search range within the boundaries.

@AndreaLanfranchi AndreaLanfranchi added the documentation Improvements or additions to documentation label May 2, 2020
@traysi
Copy link
Member

traysi commented May 2, 2020

This would have been a fine change to make some weeks ago but we're 4 days away from the fork and this has already been codified in 5 different miner implementations and all known pools. I don't think altering it is a feasible option at the moment. We should consider a long term solution eventually, though.

@AndreaLanfranchi
Copy link
Author

Sure. I keep the issues as "note" references maybe for future implementations

@fdoving fdoving pinned this issue May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants