Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a3292f4
First Draft
vitorpamplona Sep 4, 2023
b7aa64d
Quick adjustments
vitorpamplona Sep 4, 2023
0006b13
adds privately
vitorpamplona Sep 4, 2023
5cc0c93
correct typo
sudocarlos Sep 4, 2023
fe00ddd
Merge pull request #1 from sudocarlos/patch-1
vitorpamplona Sep 6, 2023
dc4af5d
Refines proposal to make relationships private.
vitorpamplona Feb 7, 2024
bd1755f
Improves formatting
vitorpamplona Feb 7, 2024
73a2aab
Optional n tag
vitorpamplona Feb 7, 2024
225be8a
correcting the example
vitorpamplona Feb 7, 2024
0f4edef
Switch to random UUID for better security.
vitorpamplona Feb 7, 2024
c31a504
Updating NIP-81 to add private and public statuses
vitorpamplona Feb 12, 2024
6868e02
formatting
vitorpamplona Feb 12, 2024
ee6d4e6
enhancing the example with private ntags
vitorpamplona Feb 12, 2024
1bcbd31
wording
vitorpamplona Feb 12, 2024
df362d1
formatting
vitorpamplona Feb 12, 2024
873569c
formatting
vitorpamplona Feb 12, 2024
fbb5aba
Merge remote-tracking branch 'upstream/master' into relationship-status
vitorpamplona Feb 12, 2024
1e7da2b
Moves to 10008 kind for name maps
vitorpamplona Feb 12, 2024
3ff65d1
Adds edge cases
vitorpamplona Feb 12, 2024
a401682
renames nicknames to petnames
vitorpamplona Feb 14, 2024
61898c0
Simplifying statuses
vitorpamplona Mar 19, 2024
4482a41
Creating two event kinds.
vitorpamplona Mar 19, 2024
a3a6784
Update 81.md
vitorpamplona May 10, 2024
08d8b1e
Update 81.md
vitorpamplona May 10, 2024
a5ff486
Update 81.md
vitorpamplona May 10, 2024
89e8124
Merge remote-tracking branch 'upstream/master' into relationship-status
vitorpamplona May 10, 2024
bae459a
Updates relationship status to use event sets.
vitorpamplona May 11, 2024
a8c573f
adds public relationship status to the readme
vitorpamplona May 11, 2024
4e0b5fa
Aligning the Private Relationship status Kind with the other PRs
vitorpamplona Jun 20, 2024
3ba8526
Fixing kind numbers
vitorpamplona Jun 20, 2024
8cb2ebc
Merge remote-tracking branch 'upstream/master' into relationship-status
vitorpamplona Oct 11, 2024
8dafaf8
moves event set names to the right position on readme
vitorpamplona Oct 11, 2024
63c34ab
Merge branch 'master' into relationship-status
vitorpamplona Aug 18, 2025
4d46dd0
Changes to Contact Cards
vitorpamplona Aug 18, 2025
15d943f
Update 81.md
vitorpamplona Aug 18, 2025
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
76 changes: 76 additions & 0 deletions 81.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
NIP-81
======

Contact Cards
-------------

`draft` `optional`

This NIP defines two event kinds (`30382` and `31382`) to document additional information about a contact.

Both kinds offer public and private tags. Private tags are JSON-stringified, [NIP-44](44.md)-encrypted to the signer's keys and placed inside the `.content` of the event.

### Public Contact Cards

Event kind `30382` is used when the relationship between two keys is public. The `d` tag contains the target public key in hex.

```js
{
"kind": 30382,
"tags": [
["d", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411"],
["n", "follow"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably standardize a "follow" type

["n", "bitcoiner"],
["n", "6064460175057025"]
],
"content": nip44Encrypt(JSON.stringify([
["petname", "NVK (Coldcard)"],
["summary", "Owes me a beer"]
])),
// ...other fields
}
```

`petname` SHOULD be rendered instead of the person's display name in all interfaces when the signer of this event is logged in.

### Contact Sets

Optional `n` tags `["n", "<identifier>"]` add the contact to a set. This allows clients to query by `n` and download all members of a set.

The `<identifier>` can be human-readable and public or encoded and private.

For private cases, a new event kind named "Contact Set Names" (`kind:10008`) uses `map` tags to store the set name.
Clients SHOULD display the `name` instead of the `identifier` if the `identifier` is present in this event.

```js
{
"kind": 10008,
"content": nip44Encrypt(JSON.stringify([
["map", "<identifier>", "<name>"],
["map", "bitcoiner", "bitcoiner"],
["map", "6064460175057025", "debtor"]
])),
// ...other fields
}
```

### Private Contact Cards

For contacts that must remain private (e.g, private follows, client lists, etc), the event kind `31382` uses a similar structure but with a hashed `d` tag using [NIP-44](44.md)'s `hkdf` function.

```js
{
"kind": 31382,
"tags": [
["d", sha256(hkdf(private_key, salt: 'nip81') || "<pubkey>")],
["n", "6064460175057025"],
],
"content": nip44Encrypt(JSON.stringify([
["p", "<pubkey>", "<relay url>"],
["n", "client-list"],
["petname", "<My buddy>"],
["summary", "<Summary of the relationship>"],
])),
// ...other fields
}
```
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
- [NIP-77: Negentropy Syncing](77.md)
- [NIP-78: Application-specific data](78.md)
- [NIP-7D: Threads](7D.md)
- [NIP-81: Contact Cards](81.md)
- [NIP-84: Highlights](84.md)
- [NIP-86: Relay Management API](86.md)
- [NIP-87: Ecash Mint Discoverability](87.md)
Expand Down Expand Up @@ -192,6 +193,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `10005` | Public chats list | [51](51.md) |
| `10006` | Blocked relays list | [51](51.md) |
| `10007` | Search relays list | [51](51.md) |
| `10008` | Event Set Names | [81](81.md) |
| `10009` | User groups | [51](51.md), [29](29.md) |
| `10012` | Favorite relays list | [51](51.md) |
| `10013` | Private event relay list | [37](37.md) |
Expand Down Expand Up @@ -240,6 +242,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `30312` | Interactive Room | [53](53.md) |
| `30313` | Conference Event | [53](53.md) |
| `30315` | User Statuses | [38](38.md) |
| `30382` | Public Relationship Status | [81](81.md) |
| `30388` | Slide Set | [Corny Chat][cornychat-slideset] |
| `30402` | Classified Listing | [99](99.md) |
| `30403` | Draft Classified Listing | [99](99.md) |
Expand All @@ -248,6 +251,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `30818` | Wiki article | [54](54.md) |
| `30819` | Redirects | [54](54.md) |
| `31234` | Draft Event | [37](37.md) |
| `31382` | Private Contact Card | [81](81.md) |
| `31388` | Link Set | [Corny Chat][cornychat-linkset] |
| `31890` | Feed | [NUD: Custom Feeds][NUD: Custom Feeds] |
| `31922` | Date-Based Calendar Event | [52](52.md) |
Expand Down