Demonstration code: https://github.com/fjahr/bitcoin/commit/d6ced70903d9d49b8acdfe48a97b6f991b50cc17 (building on top of #28669, the file hashing and additional logging were just added as sanity checks)
It seems that changing certain content of a Txoutset dump doesn’t change the fact that it is considered valid and that the UTXO set is loaded correctly. This doesn’t have to be bad since the hash of the UTXO set still matches, but it was new to me that two different dump files could both be valid and result in the same UTXO set.
I have not been able to figure out yet why exactly this is the case though. From my understanding, the byte I am changing is the Coin VARINT((coinbase ? 1 : 0) | (height << 1))
. The original value of the byte is \x82
, implying it’s just the value in this one byte. Changing it should result in a different UTXO set. I must be missing something about the serialization of Coin
or the dumptxoutset
in general…