02 / Architecture
The archive is the store.
rbitcoin uses indexed transaction history to find previous outputs and check whether they have been spent. It records spends alongside that history, without maintaining a separate UTXO database.
An output stays in history.
Bitcoin Core keeps block files alongside a separate set of unspent outputs. rbitcoin looks up outputs in its archive and uses spend records and the selected chain to determine whether they are available to spend.
Output B is unspent and appears in both stores.
Spend status follows the selected chain. Keeping the output in history does not allow it to be spent twice.
Three parts, one node.
- Archive
- Headers, outputs, inputs, witness, and spend records. Historical blocks are reconstructed from these transaction parts, rather than permanently stored as complete raw blocks.
- Chain state
- Which chain is selected and where transactions appear in it. This determines how the node interprets the archive, including which spends count.
- Wallet indexes
- Optional indexes for queries such as address history and compact block filters. Wallet queries combine indexed history, spend status, and unconfirmed transactions in the mempool.
The transaction index is built during sync and is part of the node’s storage model. Wallet indexes are optional. The same process validates blocks and serves wallets, without a separate Electrum indexer.
The store uses ordinary files; you do not need to install a database server.
Keep the working data fast.
Outputs, spends, the transaction index, and wallet indexes stay in the main data
directory. Inputs, witness, and fee statistics can go on a second, slower disk with
--datadir-cold. Block filters and the silent-payment index use that volume
when they are enabled. Without that option, everything stays together.
| Space | Used for |
|---|---|
| ~730 GiB total | One measured mainnet archive, including inputs and witness. |
| ~200 GiB hot | Outputs, spends, and the transaction index on the fast disk. |
These sizes are approximate. Allow room for chain growth; disk use varies with chain height and enabled indexes. Plan for a 1 TB-class disk.
The default keeps the full witness history.
--prune-seqsigwit keeps a recent window of 288 blocks instead. Silent
payments require the full witness, so that window cannot be combined with them.
There is no separate coins cache to size and flush. The operating system’s page cache still uses RAM to keep frequently read data close.
Validation in Rust.
rbitcoin implements consensus rules and script validation in Rust. It uses rust-bitcoin types and libsecp256k1 for ECDSA and Schnorr cryptography, rather than Bitcoin Core’s script interpreter. Explore validation and testing.