NIP-39
> External Identities in Profiles
プロファイルのメタデータに外部のソーシャルネットワークアカウントを紐付けることができる。
現在は GitHub, Twitter, Mastodon, Telegram に対応しているが、後述するように拡張される可能性が高い。
event.json{
"id": <id>,
"pubkey": <pubkey>,
...
"tags": [
["i", "github:semisol", "9721ce4ee4fceb91c9711ca2a6c9a5ab"],
["i", "twitter:semisol_public", "1619358434134196225"],
["i", "mastodon:bitcoinhackers.org/@semisol", "109775066355589974"]
["i", "telegram:1087295469", "nostrdirectory/770"]
]
}
i
タグに platform:identity
と proof
の2つのパラメータを持たせる。
platform:identity
: プラットフォーム名( github
など)と、そのプラットフォームでのID ( h3y6e
など)を :
で繋いだもの。
proof
: このIDを所有していることを証明する文字列
クライアントは、将来の拡張性のために2つ以上の値を持つ i
タグを処理するべきである(SHOULD)。
platform
は、 a-z
, 0-9
, および文字 ._-/
のみを含むべきであり、 :
を含んではならない(MUST NOT)。
identity
は、可能であれば大文字を小文字に置き換えて正規化すべきであり、あるエンティティに複数の別名がある場合は、プライマリのものを使用すべきである(SHOULD)。
github
identity
: GitHub ユーザ名
proof
: GitHub Gist ID。このGistファイルは <identity>
によって作成され、 Verifying that I control the following Nostr public key: <npub encoded public key>
というテキストを持つ必要がある。このファイルは https://gist.github.com/<identity>/<proof>
に置かれる。
PublicでもSecretでもどちらでも良い (Secret GistはURLを知っていれば誰でも見える為)
説明やファイル名は空で良い
twitter
identity
: Twitter ユーザ名
proof
: ツイートID。このツイートは <identity>
によって投稿され、 Verifying my account on nostr My Public Key: "<npub encoded public key>"
というテキストを持つ必要がある。このツイートは https://twitter.com/<identity>/status/<proof>
に置かれる。
mastodon
identity
: <Mastodonインスタンス名>/@<ユーザ名>
proof
: Mastodonの投稿ID。この投稿は @<ユーザ名>@<インスタンス名>
によって投稿され、 Verifying that I control the following Nostr public key: "<npub encoded public key>"
というテキストを持つ必要がある。この投稿は https://<identity>/<proof>
に置かれる。
telegram
identity
: Telegram ユーザID
proof
: 名前 <ref>
とメッセージID <id>
を持つ公開チャンネルまたはグループで公開されたメッセージを指す、 <ref>/<id>
の形式の文字列。このメッセージは <identity>
によって送信され、 Verifying that I control the following Nostr public key: "<npub encoded public key>".
というテキストを持つ必要がある。このメッセージは https://t.me/<proof>
に置かれる。
つまり、 npub
から始まる文字列がテキストに含まれていればそれでよく、 Verifying my account on nostr My Public Key
や Verifying that I control the following Nostr public key
の文字列は実際は何でもよさそう (文脈の無い公開鍵を外部SNSにいる人が見て驚かないようにする程度の意味)。
Amethystで確認した様子 (2022/3/11 現在はTwitter, GitHub, Mastodonに対応)
※ Mastodonは現在うまくパース出来ていないので修正PRを投げています。マージされたら治るはず
マージされました