0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Application Object Protocol (AOP) とは?|Nostr上でアプリケーション状態を同期する考え方

0
Posted at

Application Object Protocol (AOP) とは?

Nostrはイベントを共有するためのプロトコルです

しかし、アプリケーションを作る場合、単純なイベント送信だけでは足りません(たいていの場合)

例えばゲームを考えます

必要になるもの:

  • プレイヤー管理
  • 権限
  • 状態変更
  • 操作履歴
  • 招待
  • 参加管理

これらを毎回アプリごとに設計すると、同じ問題を何度も解決することになります

AOPの考え方

Application Object Protocolでは、アプリケーションの状態をObjectとして扱います

イメージとしては「Object = セッション? (部屋とか?)」です

Objectには:

  • lifecycle
  • users
  • permission
  • history
  • pending actions

などを持たせます

イベントが発生すると、

Nostr Event
 ↓
Action
 ↓
Object State Update
 ↓
New State

という流れで状態を更新します

イベントを状態の履歴として扱う

AOPでは現在状態だけを保存するのではなく、イベント履歴から状態を再構築できることを重視しています

つまり、単に

History = Log

ではなく、

History = Source of State

として扱います

目標

AOPの目的は、Nostr上で動くアプリケーションが共通して利用できる同期モデルを提供することです

次の記事では、この考えをTypeScript SDKとして実装したnostr-aopについて紹介します

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?