Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions nips/13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
NIP-13
======

Nostr Alias
-----------

`draft` `optional` `author:vinliao`

The event with kind `13` links two pubkeys together, creating an alt pubkey from a main pubkey. Two pubkeys (main and alt) can be cryptographically linked by creating these two events:

`main event` (created by main):
```
{
"id": <main event id>
"pubkey": <main's pubkey>,
"created_at": <unix timestamp in seconds>,
"kind": 13,
"tags": [
["p", <alt's pubkey>],
]
"content": <empty string>,
"sig": <64-bytes signature of the sha256 hash of the serialized event data, which is the same as the "id" field>,
}
```

`alt event` (created by alt):
```
{
"id": <alt event id>
"pubkey": <alt's pubkey>,
"created_at": <unix timestamp in seconds>,
"kind": 13,
"tags": [
["e", <main event id>],
["p", <main's pubkey>],
]
"content": <empty string>,
"sig": <64-bytes signature of the sha256 hash of the serialized event data, which is the same as the "id" field>,
}
```

The tag of `main event` MUST contain alt's pubkey. The tag of `alt event` MUST contain main's pubkey and the event id of `main event`.

A main or alt can prove its main-alt relationship by providing `main event` and `alt event`; the main-alt relationship is invalid until `alt event` is presented.

`main event` and `alt event` can be posted publicly like a NIP-01 event or sent privately with NIP-04. Clients MAY treat alt as the same entity as main by displaying the same "petname."