Jump to content
casp0or

Xaya-Mining-Pool - 1% fee - Stratum

Recommended Posts

Hey,

I managed to set up a working pool. I¬īm Testing right now. I announce the pool¬†address later this day after testing is finished¬†ūüėČ

xaya-pool.PNG.d3ca20311d4843b7f4f9cf9246b1639b.PNG

Regards

  • Thanks 1

Share this post


Link to post
Share on other sites

Hey,

yes I think so¬†ūüĎ欆did not find a block until now but I think one or two hours more and I can confirm that it is working without the stratum forkūüėČ

Share this post


Link to post
Share on other sites

Ok, now I¬īm finding blocks¬†ūüĎ欆used "nsgminer-win64-0.9.4"

The last issue is, that the pool or miner does not add the coinbase to the new block -.- have to build this myself tomorrow.

xaya-pool-2.PNG.89c064f293a9d5842c24a8a0ce41e7d8.PNG

If everything is set up tomorrow, I will announce the pool address.

 

Regards

Share this post


Link to post
Share on other sites
15 hours ago, casp0or said:

yes I think so¬†ūüĎ欆did not find a block until now but I think one or two hours more and I can confirm that it is working without the stratum forkūüėČ

Interesting ... when I was talking to somer other miners, they said that the Stratum protocol needs to have some field for the "extra nonce" that it is allowed to change and that's not part of the mined PoW block header but the coinbase tx (for Bitcoin) or the "actual" block header (for Xaya).  For Neoscrypt you don't really need an extra nonce, but the protocol still requires it - so how did you solve that?  Or is my understanding just wrong, as I don't know much about Stratum or mining myself?

Share this post


Link to post
Share on other sites
2 hours ago, domob said:

Interesting ... when I was talking to somer other miners, they said that the Stratum protocol needs to have some field for the "extra nonce" that it is allowed to change and that's not part of the mined PoW block header but the coinbase tx (for Bitcoin) or the "actual" block header (for Xaya).  For Neoscrypt you don't really need an extra nonce, but the protocol still requires it - so how did you solve that?  Or is my understanding just wrong, as I don't know much about Stratum or mining myself?

yes, but this is only an extra nonce for the Merkle-Tree I read somewhere. The "getwork" method is not working and some miner software send strange requests... so I copied the stratum methods for connecting and send share and adjusted them for the requests the miner software sends. 

Quote

Currently this check fails with {"code":-22,"message":"Block does not start with a coinbase "} 

 

Now I try to add it to the block on the server side rather than letting the miner software do their thing and then submit the block to the daemon to check if it is valid or not.

Regards

Share this post


Link to post
Share on other sites

hmm, I discovered that the extraNonce in the header is used to calculate the coinbase ... 

Quote
 
let extraNonce1Buffer = Buffer.from(extraNonce1, 'hex');
logger.silly("extraNonce1Buffer = %s", extraNonce1.toString("hex"));
 
let extraNonce2Buffer = Buffer.from(extraNonce2, 'hex');
logger.silly("extraNonce2Buffer = %s", extraNonce2Buffer.toString("hex"));
 
--> let coinbaseBuffer = job.serializeCoinbase(extraNonce1Buffer, extraNonce2Buffer); <--
logger.silly("coinbaseBuffer = %s", coinbaseBuffer.toString("hex"));
 
let coinbaseHash = coinbaseHasher(coinbaseBuffer);
logger.silly("coinbaseHash = %s", coinbaseHash.toString("hex"));
 

Maybe I try to create the extraNonce myself or we really have to wait for the fork -.-

But I will try to fix this

Share this post


Link to post
Share on other sites
1 hour ago, casp0or said:

hmm, I discovered that the extraNonce in the header is used to calculate the coinbase ...

Yeah, the way I understood the explanation originally is that the Stratum miner needs to be given a template of the "coinbase tx" plus an offset in it where it is allowed to adjust the extra nonce.  In the case of Xaya, the "coinbase tx" is instead the actual Xaya block header, while the "fake block header" that the miner works on is part of the PoW data.  That structure apparently works with Stratum, except that there needs to be a place for the "fake extra nonce" in the real Xaya block header - which is where the fork comes in, as it will allow using the "nonce" field in the block header for just that.

But perhaps there is another way to do this - as I said, I've never really looked into the "hardcore mining stuff".

Share this post


Link to post
Share on other sites
48 minutes ago, domob said:

But perhaps there is another way to do this - as I said, I've never really looked into the "hardcore mining stuff".

 

I¬īm currently trying to save the extra nonce for each coin in the DB¬†and apply it to the share/block right before¬†I check against the daemon for a valid block/share.¬†

This way it's like the extraNonce¬†is present in the header. But never worked with redis¬†before (reading currently some tuts)... I hope this approach works right out of the box since there shouldn¬īt be any differences in the way the extraNonce¬†is applied to the validity check

Share this post


Link to post
Share on other sites

Ok, I think I found the issue

The submitted BlockHeader is not as described in your stats and the first bytes of PoW data indicates not the algo ... I don¬īt think a fork solves this issue because of the multi mining.

I try to create a new blockheader validation tomorrow and if it is working, I create a merge request at the "stratum-pool" repository.

not present:

Quote
  • The first byte of the PoW data indicates the¬†mining algorithm
  • The block header¬†nBits¬†field must be zero.¬†
  • The PoW data¬†nBits¬†field must match the expected difficulty for the selected algorithm, following the difficulty retargeting for that algorithm.
  • The PoW must match the¬†nBits¬†difficulty target specified in the PoW data.
  • 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, contain exactly the hash of the Xaya block header.

Regards

Share this post


Link to post
Share on other sites

Thanks for your work on this!  Again, as I understood the discussion with other miners originally, you seem to be on a wrong path here.  For Xaya Neoscrypt mining, there is a "fake block header" that has the actual PoW and commits to the real Xaya block header through the Merkle root field.  So your Stratum miner would never even see the real Xaya block header (with the things you quoted above), it would only work on that fake header.  The real Xaya block header would be seen by it like a coinbase transaction, which is also linked to the block header through the Merkle root field.  And that's where the extra nonce comes in:  For Bitcoin mining, the extra nonce is part of the coinbase transaction - so the Stratum protocol requires some field in that data (which for Xaya is the real Xaya block header) that the miner is allowed to change.  And after the fork, it will be the nonce value.  Then all should work.

Share this post


Link to post
Share on other sites

ok, I misunderstood¬†this, then I have one last question¬†ūüėÖ can¬īt I use the "getwork"¬†function?¬†

I saw that some mining software send a "getwork" POST request but the new pool software does not implement this or is this only for solo mining? (info from xaya specs)

Share this post


Link to post
Share on other sites

I think you can use "getwork".  It will return you a work that corresponds exactly to this "fake block header" you need to solve.  So as long as you get your pool miners to solve the work somehow (as an ordinary Bitcoin block header, basically, except of course with Neoscrypt), you can submit it afterwards.  However, if you use "getwork", then I think you won't be able to get the real block header / pass it as coinbase transaction to the pool miners.  I don't know enough about Stratum to tell whether or not that is a problem.

I think the miners that I talked to previously planned to call "getblocktemplate" and build the block header as well as the PoW data and stuff themselves, so they have full control over it.  As far as I know, that will at least after the fork work for sure.

Share this post


Link to post
Share on other sites
1 hour ago, domob said:

I think the miners that I talked to previously planned to call "getblocktemplate" and build the block header as well as the PoW data and stuff themselves, so they have full control over it.  As far as I know, that will at least after the fork work for sure.

Ok this was my plan too¬†ūüėÖ¬†don¬īt know much about stratum either but I created a pool for a friend with new frontend and dig now into the stratum protocol.¬†

Everything is written in a language I¬īm good at. So I think after some approaches I can get this to work.¬†But I thought I can build the BlockHeader myself after your specs and submit it.¬†Maybe I¬īm not deep enough into this to understand the whole process ...¬†Do I really need the fork for this when I build it after your¬†specs???

Ok ... Back to code ... Trying to understand it¬†ūüėĶ

Regards

Share this post


Link to post
Share on other sites
17 hours ago, casp0or said:

Everything is written in a language I¬īm good at. So I think after some approaches I can get this to work.¬†But I thought I can build the BlockHeader myself after your specs and submit it.¬†Maybe I¬īm not deep enough into this to understand the whole process ...¬†Do I really need the fork for this when I build it after your¬†specs???

 

Well - you can certainly build blocks yourself and submit them right now if you follow the specs.  The only reason why you need the fork is because apparently the current restriction of "nonce for the actual header has to be zero" is in conflict with how the Stratum protocol works; but I may be wrong here.

Share this post


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

is't the pool up and work? the pool address? thanks

 

no sry, I tried to mine a block at block height 400.030 but got "coinbase missing" error. I think it is because of the missing specs for algo etc

So I have to build the blockheader myself today with getblocktemplate. If I managed to get this working, I post the pool address here.

But I try to do this as fast as possible.ūüĎć

Regards

 

Edited by casp0or

Share this post


Link to post
Share on other sites
Just now, casp0or said:

 

no sry, I tried to mine a block at block height 400.030 but got "coinbase missing" error. I think it is because of the missing specs for algo etc

So I have to build the blockheader myself today with getblocktemplate. If I managed to get this working, I post the pool address here.

Regards

 

Noted with thanks,  cos i don't find any working pool after fork.

Share this post


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

Noted with thanks,  cos i don't find any working pool after fork.

yes because it won¬īt work out of the box after the fork... I tested it¬†ūüėÖ

Share this post


Link to post
Share on other sites
13 hours ago, sorji said:

@casp0or

Have u get the pool mining sort?

No, sry but I try to fix this today. One or two bugs are still remaining¬†ūüėÖ

But I¬īm in a good way and think that I get this working today or tomorrow

Regards

Edited by casp0or
  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×