Modules

  • This is a basic kv database that stores all metadata about our blockchain and utreexo state.
  • A collection of functions that implement the consensus rules for the Bitcoin Network. This module contains functions that are used to verify blocks and transactions, and doesn’t assume anything about the chainstate, so it can be used in any context. We use this to avoid code reuse among the different implementations of the chainstate.
  • A partial chain is a chain that only contains a subset of the blocks in the full chain. We use multiple partial chains to sync up with the full chain, and then merge them together to get the full chain. This allows us to make Initial Block Download in parallel.
  • UData is the serialized data used for proof propagation in utreexo. It contains all data needed for validating some piece of information, like a transaction and a block.

Enums

  • A notification is a hook that a type implementing BlockchainInterface sends each time the given event happens. This is use to notify new blocks to the Electrum server. In the future, it can be expanded to send more data, like transactions.

Traits

  • This trait is the main interface between our blockchain backend and other services. It’ll be useful for transitioning from rpc to a p2p based node
  • ChainStore is a trait defining how we interact with our chain database. This definitions will be used by the [ChainState] to save and retrieve data about the blockchain, likely on disk. Right now, you can use the [KvChainStore] in your code, it implements this trait and uses a key-value store to save data. The DatabaseError is a simple trait that can be implemented by any error type that implements [std::error::Error] and [std::fmt::Display]. This is useful to abstract the database implementation from the blockchain. See the documentation of DatabaseError for more info.
  • UpdatableChainstate is a contract that a is expected from a chainstate implementation, that wishes to be updated. Using those methods, a backend like the p2p-node, can notify new blocks and transactions to a chainstate, allowing it to update it’s state.