Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
NIP-78 nostr relay storage
Search
Takuma Shinohara
August 04, 2023
Technology
0
240
NIP-78 nostr relay storage
Takuma Shinohara
August 04, 2023
Tweet
Share
More Decks by Takuma Shinohara
See All by Takuma Shinohara
What's is Bluesky
shinoharata
0
1.2k
dissolute fat
shinoharata
0
200
20240520_toranoana_lab.pdf
shinoharata
0
190
民主的なSNSは日本を救う
shinoharata
0
330
Nostr x Gorilla Vim Collaboration
shinoharata
0
420
press_on_nostr_book
shinoharata
0
280
abc2023_slide_upload.pdf
shinoharata
0
330
LNBits で始める 家電Hack
shinoharata
0
200
Blueskyのいろいろ作ってみた
shinoharata
0
280
Other Decks in Technology
See All in Technology
Google Cloud Next 2025 Recap マーケティング施策の運用及び開発を支援するAIの活用 / Use of AI to support operation and development of marketing campaign
atsushiyoshikawa
0
280
LLM アプリケーションのためのクラウドセキュリティ - CSPM の実装ポイント-
osakatechlab
0
440
Amplifyとゼロからはじめた AIコーディング。失敗と気づき
mkdev10
1
150
[新卒向け研修資料] テスト文字列に「うんこ」と入れるな(2025年版)
infiniteloop_inc
13
43k
既存の開発資産を活かしながら、 《新規開発コスト抑制》と《開発体験向上》 を両立する拡張アーキテクチャ事例
kubell_hr
0
240
Google Cloud Next 2025 Recap 生成AIモデルとマーケティングでのコンテンツ生成 / Generative AI models and content creation in marketing
kyou3
0
280
Developer 以外にこそ使って欲しい Amazon Q Developer
mita
0
150
Docker Compose で手軽に手元環境を実現する / Simplifying Local Environments with Docker Compose #CinemaDeLT
nabeo
0
220
250510 StepFunctionのテスト自動化始めました vol.1
east_takumi
1
250
木を見て森も見る-モジュールが織りなすプロダクトの森
kworkdev
PRO
0
240
"発信文化"をどうやって計測する?技術広報のKPI探索記/How do we measure communication culture?
bitkey
4
320
問 1:以下のコンパイラを証明せよ(予告編) #kernelvm / Kernel VM Study Kansai 11th
ytaka23
3
590
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
42
7.5k
GitHub's CSS Performance
jonrohan
1031
460k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
Designing for Performance
lara
608
69k
VelocityConf: Rendering Performance Case Studies
addyosmani
329
24k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
570
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Code Review Best Practice
trishagee
68
18k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.7k
Transcript
NIP-78 nostr relay storage 2023/08/04 – t.shinohara
NIP-78
アプリケーション固有データ / 任意のアプリ独自データ 出典:Scrapbox (和訳) https://scrapbox.io/nostr/NIP-78
特徴 出典:Scrapbox (和訳) https://scrapbox.io/nostr/NIP-78 NIP-33 (kind: 30023) の拡張 有名な例 :
Nosli contentや、d以外のタグ利用は何でも OK
リレーをストレージと して使用したいという 思惑? 出典:Scrapbox (和訳) https://scrapbox.io/nostr/NIP-78
Key-value storageとして使え たら便利じゃ ん!!!!!!! 出典:Scrapbox (和訳) https://scrapbox.io/nostr/NIP-78
作った!!!
None
タイムラインの流速を 計測したい
なんで?
タイムラインの流速を 計測したい から
計測データどうする?
Firebase cloud firestore
手間!!!
維持管理!!
なら
リレーに保存しよう 唐突に流れる NIP-78
投げるコードは
殆どが 演習の 1-3
神様ありがとう
どうやって保存してい るの?
データ 構造 const ev = { kind: 30078, content: "none",
tags: [ ["d", "table_name"], ["title", "table_title"], ["t", "table_name"], ["202308041938", "20"], ["202308041938", "17"], ... // 続く ], created_at: currUnixtime(), };
一時的に保存したい データを Post します
僕の使い方
Key-value Storage
なにこれ?
名前:データ で 保存したいものが ひも付きます
Key-value Storage データ 識別名 データ 識別名 データ 識別名 データ 識別名
データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名 データ 識別名
よくある使い方
コード例 const value = getKeyValueStorage(key);
Nostr の NIP-78 使用したライブラリあ るかな?
npm で検索
None
None
None
ないやんけ!!!
作ろ!!
仕 様 検 討 • Key-Values Storage としての利用 • Post
は nostr-tools 等に任せる想定 • 欲しい機能 • DB 初期化 • Get All Table • Get Table • Get Item • Create Table • Insert Table • Update Table • Clear Table
作ってみて
Get Table 便利
Upsert Table 便利
今思っていること
・ Update, Insert 時にテーブルがなかった ら? 自動生成して欲しい ・ テーブルの存在検査をしてから、 テーブル定義を作りたい (なかったら初期化コマンド実行したいなど)
早速つかっています。
野洲田川水系 定点観測所 https://nostr-hotter- site.vercel.app/
None
NIP-78ばり便利