Jump to content
Sign in to follow this  
casp0or

Need some help with Xaya-BlockHeader and description in docs

Recommended Posts

Hi,

I´m currently working on the mining pool for xaya. So far so good I managed to get a step further and it seems that only one problem is in my way now...

The "normal block header" is accepted and parsed into the daemon. The next step defining the mining algo was also successful. But I can´t figure out what the remaining data has to look like.

The docs say:

 
 
1
 
 
 
Quote

The difficulty target for the chosen algorithm follows in the nBits field. The nBits field in the block header is unused, and must be set to zero. (Without the PoW data, the block header alone does not specify the mining algorithm, so it doesn't make sense to specify the difficulty in it.) When validating a block header with the PoW data, the usual rules apply:

Does this mean, that the powdata has two parts? One with the mining algo at byte 1 and the next 4 bytes are the above mentioned nBits field, follow by an empty blockheader (80 bytes) with only the "normal header" based on byte 37-68 ??? Or do I have to put the nBits filed in the "remainder" POW data 80 bytes? But this would mean, that the first part has to be 5 bytes with only the 0x02 flag defining the mining algo?

Because the blockheader is only decoded at the daemon when the blockheader is 165 bytes long ... 

 
 
 
Quote

80 bytes -> normal block header with nBits set to 0
5 bytes -> mining flag ??plus nBits??
80 bytes -> POW data with ??ONLY?? above "normal header" as a hash on bytes 37-68 

or do I miss something, because the docs say:

 
 
1
Quote

The format of the remainder of the PoW data depends on whether or not merged mining is used. If it is, then an "auxpow" data structure as per Namecoin's merged mining follows. If the block is stand-alone mined, then 80 bytes follow, such that:

Their hash according to the selected algorithm (Neoscrypt) satisfies the difficulty target.

Bytes 37 to 68, where the Merkle root hash would be in a Bitcoin block header, contains exactly the hash of the Xaya block header.

Regards

Share this post


Link to post
Share on other sites

good work - 

You'll need to wait for Daniel to respond regarding pow and unfortunately he is on vacation for 2 or so weeks.

Share this post


Link to post
Share on other sites
Posted (edited)

thanks, I knew this already 😅 sent a message right before he went off 

hoped, someone else could give me a hint 😵

 

EDIT: Why can´t I edit this thread Oo I can edit this post but not the main post ...

Edited by casp0or

Share this post


Link to post
Share on other sites

Ok, by searching in the core daemon files I found these lines 

 
 
 
Quote
 
 
 
Quote
READWRITE (algo);
READWRITE (nBits);
 
if (isMergeMined ())
{
..NO IS NOT........
}
else
{
if (ser_action.ForRead ())
{
auxpow.reset ();
fakeHeader = std::make_shared<CPureBlockHeader> ();
}
assert (fakeHeader != nullptr);
READWRITE (*fakeHeader);
}

so I´m right with setting the algorithm field first (1 byte), then attaching the nBits field (4 bytes) and finally the (80 bytes) fake header with only the hash from "normal header" at byte 37-68 ...

Now I think, only the hashing method for the "normal header" is wrong... because I get the log message from daemon:

 
 
1
 
 
 
Quote
 
 
1
Quote
2019-05-25T18:44:08Z ERROR: isValid: fake header commits to wrong hash

Regards

Share this post


Link to post
Share on other sites

hmm, I think I solved it ^^

hashed the header with the wrong function ... had to use "sha-256d"

 

Hopefully, I can release the pool on xaya-gaming.net tomorrow with 0% fee for the first month

Regards

Share this post


Link to post
Share on other sites
24 minutes ago, casp0or said:

hmm, I think I solved it ^^

hashed the header with the wrong function ... had to use "sha-256d"

 

Hopefully, I can release the pool on xaya-gaming.net tomorrow with 0% fee for the first month

Regards

cool, i will switch my rigs to your new pool for testing。

Share this post


Link to post
Share on other sites
3 minutes ago, sorji said:

cool, i will switch my rigs to your new pool for testing。

nice ^^ I need to find a block to prove that everything is working, then I will activate the pool on xaya-gaming 😁 

I make an announcement when everything is ok later this day

Regards

Share this post


Link to post
Share on other sites
5 minutes ago, casp0or said:

nice ^^ I need to find a block to prove that everything is working, then I will activate the pool on xaya-gaming 😁 

I make an announcement when everything is ok later this day

Regards

no worried,i can support 30M hash, that would easy find a single block on current diff.

  • Like 1

Share this post


Link to post
Share on other sites
6 minutes ago, sorji said:

no worried,i can support 30M hash, that would easy find a single block on current diff.

I´m currently only hashing with my rtx 2070 @ 1.250 Mh/s but I´m too tired right now to start my other two rigs with each 10 Mh/s 😅 Here in Germany it´s 4:42 in the morning

I will leave this until I wake up in some hours ^^

But thank you for the offer, I will write you the address in a PM, If you want to point one rig or so onto the pool to help to find a block 😉

And good night/morning

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

Your use of this site is governed by our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.