Negentropy

NIP-77, Negentropy Syncing

A general set reconciliation protocol that Nostr uses to help clients and relays figure out which events each side is missing without exchanging every event ID.

Negentropy is a general set reconciliation protocol for comparing large sets efficiently. Nostr uses it for syncing. Negentropy is not Nostr-specific and was not developed for Nostr. Instead of sending a full list of event IDs, both sides exchange compact messages that reveal which items overlap and which ones are missing on either side.

In Nostr, Negentropy is used through NIP-77, one of the Nostr NIPs. NIP-77 adapts the underlying protocol to Nostr so a client and relay can compare the events they have within a chosen filter. Once both sides know what is missing, they can sync the actual events through the usual Nostr flow.

This makes sync cheaper when a client and relay already share much of the same history. It is useful for client-relay sync, relay-relay sync, and other cases where bandwidth matters and both sides want to reconcile large event sets with minimal overhead.

References