#attestation #nostr #events #concepts #proof #open-timestamps #nip-03

nostr-ots

Implementation of NIP-03: OpenTimestamps Attestations for Events

4 releases

0.2.1 Apr 13, 2023
0.2.0 Feb 24, 2023
0.1.1 Feb 14, 2023
0.1.0 Feb 14, 2023

#22 in #attestation

Download history 12/week @ 2024-07-20 31/week @ 2024-07-27 26/week @ 2024-08-03 22/week @ 2024-08-10 22/week @ 2024-08-17 27/week @ 2024-08-24 44/week @ 2024-08-31 40/week @ 2024-09-07 18/week @ 2024-09-14 39/week @ 2024-09-21 23/week @ 2024-09-28 9/week @ 2024-10-05 15/week @ 2024-10-12 12/week @ 2024-10-19 39/week @ 2024-10-26 49/week @ 2024-11-02

115 downloads per month
Used in 2 crates (via nostr)

MIT license

11KB
177 lines

Proof of concept implementation of Nostr NIP-03 OpenTimestamps Attestations for Events

Usage

let mut event_json = serde_json::json!(
  {
   "id":"2be17aa3031bdcb006f0fce80c146dea9c1c0268b0af2398bb673365c6444d45"
   // other event fields as defined in https://github.com/nostr-protocol/nips/blob/master/01.md#events-and-signatures
  }
);
let event_id = event_json["id"].as_str().unwrap();
let ots = nostr_ots::timestamp_event(event_id).unwrap();
event_json["ots"] = serde_json::Value::String(ots);

Test

Test implementation against OpenTimestamps python client


$ echo "Proof of concept implementation of NIP-03" > example

$ shasum -a 256 example
d6f3c7616621ea55fa99444dc82ce7eafed2e71352a0890882b2e42285b90724  example

$ cargo run --example stamp -- d6f3c7616621ea55fa99444dc82ce7eafed2e71352a0890882b2e42285b90724 | base64 --decode >example.ots

$ ots info example.ots
File sha256 hash: d6f3c7616621ea55fa99444dc82ce7eafed2e71352a0890882b2e42285b90724
Timestamp:
 -> append 35abd6957bb035a904df2a74d1287c56
    sha256
    prepend 63ebc438
    append ba3242b113ee37d7
    verify PendingAttestation('https://bob.btc.calendar.opentimestamps.org')
 -> append 77cf7970f11e52ec3531b27b44d856e7
    sha256
    prepend 63ebc439
    append bd08b13e2e6f49f5
    verify PendingAttestation('https://btc.calendar.catallaxy.com')
 -> append a2231bf8052e0f79947121c687b3f97e
    sha256
    append b80ffca6f3ea6ad3e5a4bb0b0be819ba4753bc5a3a8987c46fa0fde76847a520
    sha256
    prepend 63ebc438
    append cf1c91194578d4e3
    verify PendingAttestation('https://finney.calendar.eternitywall.com')
 -> append ab64d01a5ebe068d205024e098a69feb
    sha256
    prepend 1153c8b5ab758ff941eaf6507c3e774abd58a81089e86c8bbec137a0e36c6680
    sha256
    prepend 63ebc438
    append 59e9634366c30207
    verify PendingAttestation('https://alice.btc.calendar.opentimestamps.org')

Used by

Dependencies

~6–8MB
~142K SLoC