nips/03.md

66 lines
2.5 KiB
Markdown
Raw Normal View History

2022-05-01 10:48:57 +00:00
NIP-03
======
2025-02-03 21:35:02 +00:00
Timestamp Attestations for Events
---------------------------------
2022-05-01 10:48:57 +00:00
2023-11-16 00:42:51 +00:00
`draft` `optional`
2022-05-01 10:48:57 +00:00
This NIP defines strategies for establishing when an event was first found on the nostr network:
- [OpenTimestamps](#opentimestamps)
2025-02-03 21:35:02 +00:00
- [Attestation Event](#attestation-event)
# OpenTimestamps
An event with `kind:1040` contains an [OpenTimestamps](https://opentimestamps.org/) proof for any event:
2022-05-01 10:48:57 +00:00
```json
2022-05-01 10:48:57 +00:00
{
"kind": 1040
"tags": [
["e", <event-id>, <relay-url>],
["alt", "opentimestamps attestation"]
],
"content": <base64-encoded OTS file data>
2022-05-01 10:48:57 +00:00
}
```
- 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
2022-05-01 10:48:57 +00:00
Using [`nak`](https://github.com/fiatjaf/nak), [`jq`](https://jqlang.github.io/jq/) and [`ots`](https://github.com/fiatjaf/ots):
```bash
~> nak req -i e71c6ea722987debdb60f81f9ea4f604b5ac0664120dd64fb9d23abc4ec7c323 wss://nostr-pub.wellorder.net | jq -r .content | ots verify
> using an esplora server at https://blockstream.info/api
- sequence ending on block 810391 is valid
timestamp validated at block [810391]
```
2025-02-03 21:35:02 +00:00
# Attestation Event
2025-02-03 21:35:02 +00:00
Users MAY verify when they first saw an event by publishing a `kind:4341` event.
2025-02-03 21:35:02 +00:00
- One or more `stamp` tags MUST be included indicating event ids and timestamps. Event addresses MUST NOT be used.
2025-02-03 21:42:44 +00:00
- One or more `k` tags SHOULD be included indicating the kind(s) of the event(s) being referred to.
- The `content` field MAY provide any human-readable explanation of the event.
```jsonc
{
2025-02-03 21:42:44 +00:00
"kind": 4341,
"content": "I vaguely remember hearing about this note last year",
"tags": [
2025-02-03 21:35:02 +00:00
["alt", "A timestamp attestation event"],
2025-02-03 21:42:44 +00:00
["stamp", "e71c6ea722987debdb60f81f9ea4f604b5ac0664120dd64fb9d23abc4ec7c323", 1738617405],
["k", "10002"]
]
}
```
2025-02-03 21:35:02 +00:00
Note that user-provided attestations 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.
Relays MAY also provide these attestations by generating and signing them on the fly using the pubkey listed in the relay's [NIP 11](./11.md) document.