Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Nostr版togetterのNosliとNIP-33 / About Nosli and N...

鎌倉
March 10, 2023

Nostr版togetterのNosliとNIP-33 / About Nosli and NIP-33

Nostrを利用して動くtogetterライクなサービス「nosli」を開発しました。
サービスの概要と、その際に利用することになったNIP-33という仕様、またそれらを取り巻く関連NIP (NIP-02、NIP-16、NIP-23、NIP-58) について説明しています。

鎌倉

March 10, 2023
Tweet

More Decks by 鎌倉

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ • ח૔ / @akiomik • NostrͰ͸Nostrends (nostr൛;͊΅ͬͨʔతͳ΋ͷ) Λ࡞ͬͨ •

    ࠷ۙ͸Bluesky༻ͷAndroidΞϓϦʮ੨Ӣʯͷ։ൃ • དྷि΋ATP/Blueskyษڧձʹొஃ༧ఆ😢 • https://iris.to/akiomik.github.io
  2. NIP-02 Contact List and Petnames { "kind": 3, "tags": [

    [ "p", "91cf9..4e5ca", "wss://alicerelay.com/", "alice" ], [ "p", "14aeb..8dad4", "wss://bobrelay.com/nostr", "bob" ], ], ...other fields } • ࣗ෼͕୭ΛϑΥϩʔ͠ ͍ͯΔ͔ͷϦετ • ϑΥϩʔ͍ͯ͠Δਓͷ npub͕ྻڍ͞Ε͍ͯΔ
  3. NIP-16 (Replaceable Events) • NIP-16͸֤छΠϕϯτΛఆ͍ٛͯ͠Δ • Replaceable Events͸NIP-02ͷKind3Λ൚༻తʹͨ͠΋ͷ • Kind

    10000 <= n < 20000 • ͢Ͱʹࣗ෼͕ૹͬͨKind͕ଘࡏ͢Δ৔߹͸্ॻ͖͢Δ (SHOULD) • ར༻ྫ: NIP-65 Relay List Metadata (Kind 10002) • 㱺 ͜ΕͰϢʔβ × KindͰσʔλΛอ࣋Ͱ͖ΔΑ͏ʹͳͬͨ
  4. NIP-33 Parameterized Replaceable Events • Kind 30000 <= n <

    40000 • NIP-16ͷ֓೦ʹdλάͱ͍͏Ωʔ͕ՃΘͬͨ΋ͷ • ݹ͍σʔλ͸৽͍͠σʔλͰஔ׵͞ΕΔ͜ͱΛظ଴ (SHOULD) • ެ։伴 × Kind × dλάͰҰҙʹͳΔσʔλ • 㱺 ϢʔβID × ςʔϒϧ × ओΩʔ ͱΈͳͤ͹KVSͱͯ͠࢖͑Δ
  5. NIP-23 Long-form Content { "kind": 30023, "created_at": 1675642635, "content": "Lorem

    ipsum #[3] #[4]", "tags": [ ["d", "lorem-ipsum"], ["title", "Lorem Ipsum"], ["published_at", "1296962229"], ["t", "placeholder"], ["e", "b3e3...4f87", "wss://relay.example.com"], [ "a", "30023:a695...a919:ipsum", "wss://relay.nostr.org" ] ], "pubkey": "...", "id": "..." } • Kind 30023 • NIP-33Λ࢖ͬͯఆٛ͞ Ε͍ͯΔ • ؆୯ʹ͍͑͹ϒϩά
  6. Nosliͷ σʔλ { "kind": 30023, "content": "#[4] #[5] #[6]...", "tags":

    [ ["d", "welcome-to-bluesky"], ["title", "NostrຽɺBluesky΁ཱཱྀͭ"], ["t", "nosli"], ["e", "b3e3...4f87"], ["e", "a3b3...a6d6"], ["e", "030a...36ba"], ], "pubkey": "...", "id": "..." } • Kind 30023ͦͷ·· • ଞͷαʔϏεͷσʔλΛ ಡΈࠐ·ͳ͍ͨΊʹ nosli λά͕෇༩͞Ε͍ͯΔ
  7. NIP-58 Badges { "pubkey": "alice", "kind": 30009, "tags": [ ["d",

    "bravery"], ["name", "Medal of Bravery"], [ "image", "https://nostr.io/bravery.png", "1024x1024" ], ], ... } { "kind": 30008, "pubkey": "bob", "tags": [ ["d", "profile_badges"], ["a", "30009:alice:bravery"], [ "e", "<bravery badge award event id>", "wss://nostr.academy" ], ["a", "30009:alice:honor"], ], ... } • Kind 30009/8/30008 • ͦΕͧΕόοδఆٛɺ όοδ෇༩ɺϢʔβ όοδΛද͍ͯ͠Δ