nips/03.md

35 lines
1.2 KiB
Markdown
Raw Normal View History

2022-05-01 10:48:57 +00:00
NIP-03
======
OpenTimestamps Attestations for Events
--------------------------------------
`draft` `optional` `author:fiatjaf` `author:constant`
2022-05-01 10:48:57 +00:00
This NIP defines an event with `kind:1040` that can contain an [OpenTimestamps](https://opentimestamps.org/) proof for any other 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 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]
```