Tables

See also: https://doc.cuprate.org/cuprate_blockchain/tables & https://doc.cuprate.org/cuprate_blockchain/types.

The CamelCase names of the table headers documented here (e.g. TxIds) are the actual type name of the table within cuprate_blockchain.

Note that words written within code blocks mean that it is a real type defined and usable within cuprate_blockchain. Other standard types like u64 and type aliases (TxId) are written normally.

Within cuprate_blockchain::tables, the below table is essentially defined as-is with a macro.

Many of the data types stored are the same data types, although are different semantically, as such, a map of aliases used and their real data types is also provided below.

AliasReal Type
BlockHeight, Amount, AmountIndex, TxId, UnlockTimeu64
BlockHash, KeyImage, TxHash, PrunableHash[u8; 32]

TableKeyValueDescription
BlockHeaderBlobsBlockHeightStorableVec<u8>Maps a block's height to a serialized byte form of its header
BlockTxsHashesBlockHeightStorableVec<[u8; 32]>Maps a block's height to the block's transaction hashes
BlockHeightsBlockHashBlockHeightMaps a block's hash to its height
BlockInfosBlockHeightBlockInfoContains metadata of all blocks
KeyImagesKeyImage()This table is a set with no value, it stores transaction key images
NumOutputsAmountu64Maps an output's amount to the number of outputs with that amount
OutputsPreRctOutputIdOutputThis table contains legacy CryptoNote outputs which have clear amounts. This table will not contain an output with 0 amount.
PrunedTxBlobsTxIdStorableVec<u8>Contains pruned transaction blobs (even if the database is not pruned)
PrunableTxBlobsTxIdStorableVec<u8>Contains the prunable part of a transaction
PrunableHashesTxIdPrunableHashContains the hash of the prunable part of a transaction
RctOutputsAmountIndexRctOutputContains RingCT outputs mapped from their global RCT index
TxBlobsTxIdStorableVec<u8>Serialized transaction blobs (bytes)
TxIdsTxHashTxIdMaps a transaction's hash to its index/ID
TxHeightsTxIdBlockHeightMaps a transaction's ID to the height of the block it comes from
TxOutputsTxIdStorableVec<u64>Gives the amount indices of a transaction's outputs
TxUnlockTimeTxIdUnlockTimeStores the unlock time of a transaction (only if it has a non-zero lock time)
Last change: 2024-11-18, commit: e8598a0