From 497c505879fc2cb91a73879530578af6d8338f8d Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Mon, 3 Feb 2025 13:27:54 -0800 Subject: [PATCH] Expand NIP 03 to include relay and user notaries --- 03.md | 49 +++++++++++++++++++++++++++++++++++++++++++++---- README.md | 1 + 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/03.md b/03.md index 74e010cb..477bef47 100644 --- a/03.md +++ b/03.md @@ -1,12 +1,20 @@ NIP-03 ====== -OpenTimestamps Attestations for Events --------------------------------------- +Notarizing Events +----------------- `draft` `optional` -This NIP defines an event with `kind:1040` that can contain an [OpenTimestamps](https://opentimestamps.org/) proof for any other event: +This NIP defines strategies for establishing when an event was first found on the nostr network: + +- [OpenTimestamps](#opentimestamps) +- [Relay Notaries](#relay-notaries) +- [Peer Notaries](#peer-notaries) + +# OpenTimestamps + +An event with `kind:1040` contains an [OpenTimestamps](https://opentimestamps.org/) proof for any event: ```json { @@ -22,7 +30,7 @@ This NIP defines an event with `kind:1040` that can contain an [OpenTimestamps]( - The OpenTimestamps proof MUST prove the referenced `e` event id as its digest. - The `content` MUST be the full content of an `.ots` file containing at least one Bitcoin attestation. This file SHOULD contain a **single** Bitcoin attestation (as not more than one valid attestation is necessary and less bytes is better than more) and no reference to "pending" attestations since they are useless in this context. -### Example OpenTimestamps proof verification flow +## Example OpenTimestamps proof verification flow Using [`nak`](https://github.com/fiatjaf/nak), [`jq`](https://jqlang.github.io/jq/) and [`ots`](https://github.com/fiatjaf/ots): @@ -32,3 +40,36 @@ Using [`nak`](https://github.com/fiatjaf/nak), [`jq`](https://jqlang.github.io/j - sequence ending on block 810391 is valid timestamp validated at block [810391] ``` + +# Relay Notaries + +Relays MAY notarize events by supporting a `NOTARY` message. + +- First a client sends a `NOTARY` message to the relay with an event id as the first argument. +- Next, the relay MAY respond with a `NOTARY` message with the same event id as the first argument and a timestamp matching when the relay first saw the event as the second argument. +- If the relay has not seen the event it SHOULD respond with `null` in the timestamp field. + +Example: + +```jsonc +-> ["NOTARY", "e71c6ea722987debdb60f81f9ea4f604b5ac0664120dd64fb9d23abc4ec7c323"] +<- ["NOTARY", "e71c6ea722987debdb60f81f9ea4f604b5ac0664120dd64fb9d23abc4ec7c323", 1738617405] +``` + +Note that relay-provided notaries provide a weaker guarantee than OTS proofs. Depending on the importance of the verification, multiple relays with a good reputation should be consulted in order to determine a reasonable result. + +# Peer Notaries + +Users MAY notarize events by publishing a `kind:4341` event. `content` MAY provide any human-readable explanation of the event. One or more `notary` tags MUST be included indicating event ids and timestamps. Event addresses MUST NOT be used. + +```jsonc +{ + "content": "I vaguely remember hearing about this note last year", + "tags": [ + ["alt", "A notary event"], + ["notary", "e71c6ea722987debdb60f81f9ea4f604b5ac0664120dd64fb9d23abc4ec7c323", 1738617405] + ] +} +``` + +Note that user-provided notaries provide a weaker guarantee than OTS proofs. Depending on the importance of the verification, multiple users with a good reputation should be consulted in order to determine a reasonable result. diff --git a/README.md b/README.md index 3f416a2c..d4f15db5 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `2003` | Torrent | [35](35.md) | | `2004` | Torrent Comment | [35](35.md) | | `2022` | Coinjoin Pool | [joinstr][joinstr] | +| `4341` | Peer notary | [03](03.md) | | `4550` | Community Post Approval | [72](72.md) | | `5000`-`5999` | Job Request | [90](90.md) | | `6000`-`6999` | Job Result | [90](90.md) |