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

# Function compute_private_event_commitment

Module: `noir_aztec::event::event_interface`

```rust
pub fn compute_private_event_commitment<Event>(event: Event, randomness: Field) -> Field
where
    Event: EventInterface,
    Event: Serialize
```

A private event's commitment is a value stored on-chain which is used to verify that the event was indeed emitted.

It requires a `randomness` value that must be produced alongside the event in order to perform said validation. This random value prevents attacks in which someone guesses plausible events (e.g. 'Alice transfers to Bob an amount of 10'), since they will not be able to test for existence of their guessed events without brute-forcing the entire `Field` space by guessing `randomness` values.
