updated as suggested

ref: https://gist.github.com/Semisol/3bfe26b41d670abfb958e4b841de1413
This commit is contained in:
pseudozach 2023-01-29 15:30:54 -08:00
parent 6fdda92a66
commit 24d6233f2c

59
39.md

@ -1,36 +1,59 @@
NIP-39
======
Digital Identities in Profile
-----------------
External Identities in Profiles
-------------------------------
`draft` `optional` `author:pseudozach` `author:semisol`
`draft` `optional` `author:pseudozach` `author:Semisol`
## Abstract
Nostr protocol users may have other online identities such as usernames, profile pages, keypairs etc. they control and they may want to include this data in their profile metadata so clients can parse, validate and display this information.
## `identities` field in metadata content
## `i` tag on a metadata event
A new optional `identities` field is introduced for `kind 0` metadata event contents in addition to name, about, picture fields as included in [NIP-01](https://github.com/nostr-protocol/nips/blob/master/01.md):
A new optional `i` tag is introduced for `kind 0` metadata event contents in addition to name, about, picture fields as included in [NIP-01](https://github.com/nostr-protocol/nips/blob/master/01.md):
```json
{
"id": "123",
"pubkey": "xxx",
...
"content": {
"name": "asd",
...
"identites": [
{"type": "twitter", "claim": "Semisol_Public", "proof": "https://twitter.com/Semisol_Public/status/xxx"},
{"type": "github", "claim": "semisol", "proof": "https://github.com/Semisol"},
]
}
"tags": [
["i", "github:semisol", "9721ce4ee4fceb91c9711ca2a6c9a5ab"],
["i", "twitter:semisol_public", "1619358434134196225"],
["i", "mastodon:bitcoinhackers.org/@semisol", "109775066355589974"]
["i", "telegram:1087295469", "nostrdirectory/770"]
]
}
```
`identities` field is an array of objects that include:
* `type` may be the name of the service, website, a protocol or other identity system like `bitcoin` or `paynym` depending on what's being claimed.
* `claim` should be the name of the digital estate like the profile name or bitcoin address.
* `proof` should point to a URL that includes a way to prove that the digital identity being claimed is indeed controlled by the pubkey that signed this event.
Clients should validate the information locally when possible or crawlers can remotely check the claim being made before displaying the claims as verified to other users e.g. the linked twitter proof indeed includes a statement such as "I control pubkey xxx" where xxx is the pubkey that published this kind 0 event.
An `i` tag will have two parameters, which are defined as the following:
1. `identity`: This is the identity provider name (for example `github`) and the identity (for example `semisol`) joined together.
2. `proof`: String or object that points to the proof of owning this identity.
Clients SHOULD process any `i` tags with more than 2 values for future extensibility.
Identity provider names SHOULD only include `a-z`, `0-9` and the characters `._-/` and MUST NOT include `:`.
Identity names SHOULD be normalized by replacing uppercase letters with lowercase letters and if there are multiple aliases for an entity using the primary one.
If a matching metadata event is found when trying to look up an identity, a client SHOULD check if it's the latest version, and if not if it has this claim. This is to prevent showing or checking public keys that disowned a claim.
## Claim types
### `github`
Identity: A GitHub username.
Proof: The ID of the GitHub Gist located at `https://gist.github.com/<identity>/<proof>` with a single file with the text `Verifying that I control the following Nostr public key: <npub encoded public key>`
### `twitter`
Identity: A Twitter username.
Proof: The ID of the Twitter tweet located at `https://twitter.com/<identity>/status/<proof>` with the text `Verifying my account on nostr My Public Key: "<npub encoded public key>"`
### `mastodon`
Identity: A Mastodon instance and username.
Proof: The ID of the mastodon post located at `https://<identity>/<proof>` with the text `Verifying that I control the following Nostr public key: "<npub encoded public key>"`
### `telegram`
Identity: A Telegram user id.
Proof: The ID of the telegram post located at `https://t.me/<proof>` with the text `Verifying My Public Key: "<npub encoded public key>"`