libdohj icon indicating copy to clipboard operation
libdohj copied to clipboard

StoredBlock.serializeCompact() trims AuxPoW

Open oscarguindzberg opened this issue 7 years ago • 4 comments

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.

oscarguindzberg avatar Jan 23 '18 01:01 oscarguindzberg

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?)

rnicoll avatar Jan 28 '18 14:01 rnicoll

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.

oscarguindzberg avatar Jan 29 '18 02:01 oscarguindzberg

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?

rnicoll avatar Jan 29 '18 08:01 rnicoll

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 [email protected] 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

oscarguindzberg avatar Jan 30 '18 02:01 oscarguindzberg