nips/114.md
2024-02-06 15:33:10 +02:00

1.4 KiB

NIP-114

ids_only filter

Description

When a filter has ids_only: true, the relay must return only the ids of the events that match the filter.

The ids are returned as ["HAVE", subscriptionID, eventID] messages.

Clients may request the full events by id with a ["GET", eventId] message. Relays reply to GET requests with ["EVENT", "*", eventJson] messages, where * is a placeholder subscription id.

Clients may also request the full events by id with a normal ["REQ", subscriptionId, {ids}] message.

Motivation

ids_only filter allows a client to request the full event only when it is not already stored locally or received from another relay. This can save a lot of bandwidth, especially when connecting to multiple relays or subscribing to a lot of data.

Implementations