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

# Function encode_private_event_message

Module: `noir_aztec::messages::logs::event`

```rust
pub fn encode_private_event_message<Event>(
    event: Event,
    randomness: Field,
) -> [Field; <Event as protocol_types::traits::Serialize>::N + 2]
where
    Event: EventInterface,
    Event: Serialize
```

Creates the plaintext for a private event message (i.e. one of type [`PRIVATE_EVENT_MSG_TYPE_ID`](/aztec-nr-api/v6.0.0/noir_aztec/messages/msg_type/global.PRIVATE_EVENT_MSG_TYPE_ID.md)).

This plaintext is meant to be decoded via \[`decode_private_event_message`].
