> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/mainnet/llms.txt

# Module facts

Module: `noir_aztec::facts`

Per-contract storage of immutable facts grouped into collections.

A fact is a contract-defined, typed, immutable datum. Facts are grouped into collections identified by a `(collection type, collection id)` tuple, within a [`FactScope`](/aztec-nr-api/mainnet/noir_aztec/facts/struct.FactScope.md).

They are stored in PXE's FactStore, which automatically deals with reorgs by removing any facts associated with blocks that have been pruned.

## Structs

- [Fact](/aztec-nr-api/mainnet/noir_aztec/facts/struct.Fact.md): A single immutable fact in a collection.
- [FactCollection](/aztec-nr-api/mainnet/noir_aztec/facts/struct.FactCollection.md): A fact collection as returned by the store.
- [FactScope](/aztec-nr-api/mainnet/noir_aztec/facts/struct.FactScope.md): The scope a fact collection belongs to.
- [OriginBlockState](/aztec-nr-api/mainnet/noir_aztec/facts/struct.OriginBlockState.md): Chain state of a retractable fact's origin block, mirroring the L2 chain tips.
- [RetractableFactOrigin](/aztec-nr-api/mainnet/noir_aztec/facts/struct.RetractableFactOrigin.md): A retractable fact's origin block.

## Functions

- [delete_fact_collection](/aztec-nr-api/mainnet/noir_aztec/facts/fn.delete_fact_collection.md): Deletes a fact collection, removing all its facts from PXE storage.
- [get_fact_collection](/aztec-nr-api/mainnet/noir_aztec/facts/fn.get_fact_collection.md): Fetches a fact collection.
- [get_fact_collections_by_type](/aztec-nr-api/mainnet/noir_aztec/facts/fn.get_fact_collections_by_type.md): Returns every fact collection of `fact_collection_type_id`.
- [record_non_retractable_fact](/aztec-nr-api/mainnet/noir_aztec/facts/fn.record_non_retractable_fact.md): Records a non-retractable fact into a collection: it survives reorgs and will persist until the fact collection itself is deleted. Re-recording an identical fact is a no-op.
- [record_retractable_fact](/aztec-nr-api/mainnet/noir_aztec/facts/fn.record_retractable_fact.md): Records a retractable fact into a collection: PXE prunes it if `origin_block` is reorg'd away. Re-recording an identical fact is a no-op.
