Can anyone help me to find out the format of rev*.dat
file?
There is an array with [F9BEB4D9
+ 32byte number
+ variable raw data
] for each element.
What is that 32b number? And may be how to understand what is the other variable data?
The rev*.dat
files (the "undo files"), contain all UTXOs spent by the inputs of a block. It was introduced in Bitcoin Core 0.8, and contains a concatenation of records, one for each block. This mimicks the structure of the blk*.dat
files which contain blocks.
Each block record consists of:
A CBlockUndo record consists of a serialized vector of CTxUndo records, one for each transaction in the block excluding the coinbase transaction. Vector serialization first writes a CompactSize-encoded length of the number of records (the transaction count - 1, in this case), and then serialized all the records themselves sequentially.
A CTxUndo record consists of a serialized vector of CTxInUndo records, one for each input in the transaction.
A CTxInUndo record consists of:
Until Bitcoin Core 0.14.x, the height is zero for all but the last output of a given transaction being spent. In Bitcoin Core 0.15 (to be released soon), it will be present for every spend.
For more information about the detailed encodings, see the comments in the Bitcoin Core source code: CompactSize, VarInt, CompressedScript, and CompressedAmount.
A CBlockUndo record consists of a serialized vector of CTxUndo records
what does it mean? For example when size of CBlockUndo
record = 1 and the record is 00
. In this case dsha256 present in data and not equal to zero. It seems strange
Commented
Aug 13, 2017 at 10:47