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

# Struct Fact

Module: `noir_aztec::facts`

```rust
pub struct Fact {
    pub fact_type_id: Field,
    pub payload: EphemeralArray<Field>,
    pub origin_block: Option<RetractableFactOrigin>,
}
```

A single immutable fact in a collection.

## Fields

```rust
fact_type_id: Field
```

A user-defined identifier for fact kinds. Typically used to determine how to deserialize `payload`.

```rust
payload: EphemeralArray<Field>
```

```rust
origin_block: Option<RetractableFactOrigin>
```

The block the fact is associated to, if any. A fact with an origin block is said to be a 'retractable' fact, and will be automatically deleted if its origin block gets pruned in a reorg. Typically used by facts associated with a transaction (e.g. 'processed entry X using data from tx Y in block Z').

## Trait implementations

```rust
impl Deserialize for Fact
```

```rust
pub fn deserialize(fields: [Field; 6]) -> Self
```

```rust
pub fn stream_deserialize<let K: u32>(reader: &mut Reader<K>) -> Self
```

```rust
impl Serialize for Fact
```

```rust
pub fn serialize(self) -> [Field; 6]
```

```rust
pub fn stream_serialize<let K: u32>(self, writer: &mut Writer<K>)
```
