dogecoin / libdohj

Java library for adding altcoin support to bitcoinj
Apache License 2.0
107 stars 89 forks source link

StoredBlock.serializeCompact() trims AuxPoW #31

Open oscarguindzberg opened 6 years ago

oscarguindzberg commented 6 years ago

See https://github.com/bitcoinj/bitcoinj/blob/v0.14.2/core/src/main/java/org/bitcoinj/core/StoredBlock.java#L131 This method is invoked by bitcoinj's blockstores (eg LevelDBBlockStore) before storing a block, so AuxPow is missing from blocks stored in blockstores.

rnicoll commented 6 years ago

I think this was vaguely intentional, in that you only need the 80 bytes to make the blockchain and it's therefore enough for SPV clients.

Do you have a specific use-case this needs changing for, or is this a documentation issue (possibly I need a parallel option for retaining AuxPoW?)

oscarguindzberg commented 6 years ago

I see your point of SPV clients.

I have an use case. We have an agent that sends doge block headers to ethereum. That is part of the Doge-Eth bridge. We don't send doge headers as we receive them. We store them and send them later on. My agent should send the full header but is just sending the first 80 bytes.

rnicoll commented 6 years ago

Okay, I'll work with bitcoinj to get some extension hooks in so it can handle non-80-byte headers. Meanwhile if you subclass StoredBlock could that let you make progress?

oscarguindzberg commented 6 years ago

Thanks! We are writing a custom BlockStore as a workaround, so we are fine.

On Mon, Jan 29, 2018 at 5:22 AM, Ross Nicoll notifications@github.com wrote:

Okay, I'll work with bitcoinj to get some extension hooks in so it can handle non-80-byte headers. Meanwhile if you subclass StoredBlock could that let you make progress?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dogecoin/libdohj/issues/31#issuecomment-361171214, or mute the thread https://github.com/notifications/unsubscribe-auth/ABF5LAbmrWczUy2qfGLIwbdUC2Sa8W_nks5tPX-0gaJpZM4Ro7Io .

-- Oscar Guindzberg