This document describes a simple relay filter extension to allow event database syncing between relays and clients. It works for both client-relay and relay-relay scenarios when the majority of the events have been downloaded in a previous session.
### Motivation
Clients that keep a local database (either in memory or in disk) wish to update that database with any new events from each relay. Currently, the only way to know if the client is up-to-date is to re-download all events. This NIP allows a client to request a hash for each week of records from the relay. If the local hash matches the remote hash for the week, the client is up-to-date. If the hash is different, the client can request to download all events in that week using the regular `since` and `until` filters.
### Sync Protocol
The client sends a `WEEKLY-HASHES` message to the relay with a subscription ID and appropriate filters for the content to be checked.
Request:
```js
[
"WEEKLY-HASHES",
<subscriptionIDstring>,
<nostrfilter>, <nostrfilter2>, <nostrfilter3>
]
```
The relay calculates weekly hashs and responds with a sequence of
Simplicity. We could do a recursive approach where the Client chooses the format (e.g: `YYYY`, `YYYY-ww`, `YYYY-MM`, `YYYY-MM-dd`, `YYYY-MM-ddHH`, `YYYY-MM-ddHHmm`). This flexibility allows for some cost savings but adds complexity to the implementation of this NIP.