What is a correct extranonce2 value in the stratum protocol? I'm developing a stratum mining client. I read on stratum v1 docs on braiins.com how mining work is done on the stratum protocol and that the coinbase is done by concatenating coinb1+extranonce1+extranonce2+coinb2. At the end, mining work is submitted by sending this JSON: {&quot;params&quot;: [&quot;&lt;worker&gt;&quot;, &quot;&lt;job_id&gt;&quot;, &quot;&lt;extranonce2&gt;&quot;, &quot;&lt;ntime&gt;&quot;, &quot;&lt;nonce&gt;&quot;], &quot;id&quot;: 4, &quot;method&quot;: &quot;mining.submit&quot;}.
It says that the extranonce2 value is generated by the miner but must be based on the extranonce2 size provided by the pool. The extranonce2_size im getting from the pool is: 4 (4 bytes). So an extranonce2 value of 00000001(in hex) can be valid.
However, when i'm trying to submit a random miner work to the pool(just testing) by throwing in random nonce and extraonce2(but of course using the current jobId and ntime provided by the response i got from the pool) i keep getting this error response: 20,incorrect size of extranonce2.
The random extranonce2 i'm sending is '00000002' and random nonce is 'b2957c02'. Shouldn't i get a rejected share and not an incorrect extranonce2 size? I'm still new to this and don't yet understand exactly how everything works so where's my mistake here? or is it a pool problem? I know there's a lot of stuff to do before sending the miner work but here i'm trying to send a random miner work here.
btw is the request id always 4 in stratum for submitting work(or id: 'mining.submit')?
I'm authorizing the miner before submitting.
Turns out that there was a bug in my code and not the invalid extranonce2 value!