mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-22 16:35:52 -05:00
make it clear that relays can keep multiple replaceable event versions.
This commit is contained in:
parent
7dc6385f1b
commit
b33409c099
6
01.md
6
01.md
|
@ -82,12 +82,14 @@ Kinds specify how clients should interpret the meaning of each event and the oth
|
||||||
And also a convention for kind ranges that allow for easier experimentation and flexibility of relay implementation:
|
And also a convention for kind ranges that allow for easier experimentation and flexibility of relay implementation:
|
||||||
|
|
||||||
- for kind `n` such that `1000 <= n < 10000`, events are **regular**, which means they're all expected to be stored by relays.
|
- for kind `n` such that `1000 <= n < 10000`, events are **regular**, which means they're all expected to be stored by relays.
|
||||||
- for kind `n` such that `10000 <= n < 20000 || n == 0 || n == 3`, events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event is expected to (SHOULD) be stored by relays, older versions are expected to be discarded.
|
- for kind `n` such that `10000 <= n < 20000 || n == 0 || n == 3`, events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event MUST be stored by relays, older versions MAY be discarded.
|
||||||
- for kind `n` such that `20000 <= n < 30000`, events are **ephemeral**, which means they are not expected to be stored by relays.
|
- for kind `n` such that `20000 <= n < 30000`, events are **ephemeral**, which means they are not expected to be stored by relays.
|
||||||
- for kind `n` such that `30000 <= n < 40000`, events are **parameterized replaceable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag's first value, only the latest event is expected to be stored by relays, older versions are expected to be discarded.
|
- for kind `n` such that `30000 <= n < 40000`, events are **parameterized replaceable**, which means that, for each combination of `pubkey`, `kind` and the `d` tag's first value, only the latest event MUST be stored by relays, older versions MAY be discarded.
|
||||||
|
|
||||||
In case of replaceable events with the same timestamp, the event with the lowest id (first in lexical order) should be retained, and the other discarded.
|
In case of replaceable events with the same timestamp, the event with the lowest id (first in lexical order) should be retained, and the other discarded.
|
||||||
|
|
||||||
|
When answering to `REQ` messages for replaceable events such as `{"kinds":[0],"authors":[<hex-key>]}`, even if the relay has more than one version stored, it SHOULD return just the latest one.
|
||||||
|
|
||||||
These are just conventions and relay implementations may differ.
|
These are just conventions and relay implementations may differ.
|
||||||
|
|
||||||
## Communication between clients and relays
|
## Communication between clients and relays
|
||||||
|
|
Loading…
Reference in New Issue
Block a user