upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/03.md
diff options
context:
space:
mode:
authorSemisol <45574030+Semisol@users.noreply.github.com>2023-11-19 01:45:41 +0100
committerGitHub <noreply@github.com>2023-11-19 01:45:41 +0100
commitda19c078ab892b578a5c35968443205c9e8ac27f (patch)
tree17a9f4f3105acdae234d3bc67e42571aed261fa2 /03.md
parent4d709d1804de45bab3739ce814d4b0c0b211c273 (diff)
parent5dcfe85306434f21ecb1e7a47edd92b2e3e64f9a (diff)
Merge branch 'master' into clarify-json-serialization
Diffstat (limited to '03.md')
-rw-r--r--03.md31
1 files changed, 21 insertions, 10 deletions
diff --git a/03.md b/03.md
index 3c5d764..74e010c 100644
--- a/03.md
+++ b/03.md
@@ -4,20 +4,31 @@ NIP-03
4OpenTimestamps Attestations for Events 4OpenTimestamps Attestations for Events
5-------------------------------------- 5--------------------------------------
6 6
7`draft` `optional` `author:fiatjaf` 7`draft` `optional`
8 8
9When there is an OTS available it MAY be included in the existing event body under the `ots` key: 9This NIP defines an event with `kind:1040` that can contain an [OpenTimestamps](https://opentimestamps.org/) proof for any other event:
10 10
11``` 11```json
12{ 12{
13 "id": ..., 13 "kind": 1040
14 "kind": ..., 14 "tags": [
15 ..., 15 ["e", <event-id>, <relay-url>],
16 ..., 16 ["alt", "opentimestamps attestation"]
17 "ots": <base64-encoded OTS file data> 17 ],
18 "content": <base64-encoded OTS file data>
18} 19}
19``` 20```
20 21
21The _event id_ MUST be used as the raw hash to be included in the OpenTimestamps merkle tree. 22- The OpenTimestamps proof MUST prove the referenced `e` event id as its digest.
23- 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.
24
25### Example OpenTimestamps proof verification flow
22 26
23The attestation can be either provided by relays automatically (and the OTS binary contents just appended to the events it receives) or by clients themselves when they first upload the event to relays — and used by clients to show that an event is really "at least as old as [OTS date]". 27Using [`nak`](https://github.com/fiatjaf/nak), [`jq`](https://jqlang.github.io/jq/) and [`ots`](https://github.com/fiatjaf/ots):
28
29```bash
30~> nak req -i e71c6ea722987debdb60f81f9ea4f604b5ac0664120dd64fb9d23abc4ec7c323 wss://nostr-pub.wellorder.net | jq -r .content | ots verify
31> using an esplora server at https://blockstream.info/api
32- sequence ending on block 810391 is valid
33timestamp validated at block [810391]
34```