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

# Function custom_note

Module: `noir_aztec::macros::notes`

```rust
pub comptime fn custom_note(s: TypeDefinition) -> Quoted
```

Generates code for a custom note implementation that requires specialized note hash or nullifier computation.

## Generated Code

- NoteTypeProperties: Defines the structure and properties of note fields
- NoteType trait implementation: Provides the note type ID

## Requirements

The note struct must:

- Implement the `Packable` trait
- Not exceed `MAX_NOTE_PACKED_LEN` when packed

## Registration

Registers the note in the global `NOTES` BoundedVec to enable note processing functionality.

## Use Cases

Use this macro when implementing a note that needs custom:

- Note hash computation logic
- Nullifier computation logic

The macro omits generating default NoteHash trait implementation, allowing you to provide your own.

## Example

```rust
#[custom_note]
pub struct CustomNote {
    value: Field,
    metadata: Field
}

impl NoteHash for CustomNote {
    // Custom note hash computation...
    fn compute_note_hash(...) -> Field { ... }

    // Custom nullifier computation...
    fn compute_nullifier(...) -> Field { ... }
    fn compute_nullifier_unconstrained(...) -> Field { ... }
}
```
