AuxPoW Abstraction
JeremyRand opened this issue · 12 comments
Merge-mined blockchains such as Namecoin and Dogecoin use a different proof of work scheme (AuxPoW), in which a block header and coinbase transaction from a parent chain (usually Bitcoin or Litecoin) is included in the Namecoin or Dogecoin block header. This extra data (referred to as an AuxPoW header) is required in order to verify the PoW (meaning that SPV cannot work without this data).
As far as I can tell, ElectrumX does not currently support sending AuxPoW headers when it sends block headers to a client. As a result, ElectrumX servers cannot be used with Electrum clients that validate AuxPoW, which makes ElectrumX's support for Namecoin and Dogecoin basically useless unless the client fully trusts the server to serve the chain with the most work.
Is there any chance this could be added? I'm not too familiar with the ElectrumX codebase, but at first glance it looks like overriding the electrum_header
method might be a reasonable way of doing it.
Sure; please feel free to submit a PR. I'm not familiar with this stuff - but presumably you have Electrum clients that expect an enhanced electrum header?
I assume these coins have working electrum-server implementations?
Didn't want to add a new issue for this as I think it may be related to auxpow extraction. I was trying to setup electrumx for Crown. Electrumx seems to be a much faster server than any of the older auxpow clients. I noticed Doge was on here as well, So i assume that the chain is able to sync?
Part way through the sync the server errors during an assertion check in read_block of lib/tx.py.
The block in question that it stop's on is after a few aux blocks have already been mined, I can't see any change in the block header, or coinbase header, Possible you could point me toward anything that may help with debugging our issue? Think I found the block in question. https://chainz.cryptoid.info/crw/block.dws?65113a4acb2165610335336eb15033b24136462d7fb6794edc32f5c995fc425a.htm
after that point the nonce drops to 0 and doesnt return to it's normal value. And the coinbase changed.... -_-
Still a bit confused as to how dogecoin has no issues now? Considering they also have support for merged mining? Older versions of electrum work with our chain just fine. And we would love to use electrumx as opposed to electrum-server because of the performance benefits of electrumx
I'm almost sure this is related to auxpow, as it seems that the first block with the change in the coinbase transaction hash. fails to get checked in electrumx, We seem to use a similar coinbase hash to namecoins, and had domob from namecoin implement the code originally. I'm guessing that we're able to load the blockchain up until that point because we didn't implement auxpow until that block and the coinbase used was similar to bitcoin's not namecoin's.
Thanks, I'll create an issue and see if we can get it sorted then :)
To be clear, I'm not going to fix this, as I don't use these coins and so am unable to test what is and isn't working.
I will accept a pull request that fixes the issue(s). It sounds like the main issue might be as simple as bumping the header size at the right height, all that is needed there is a simple change to the coin definition in coins.py