nips/110.md

52 lines
1.5 KiB
Markdown
Raw Normal View History

2023-10-31 21:10:00 -04:00
NIP-110
=======
2023-11-05 18:38:32 -05:00
License tag
2023-10-31 21:10:00 -04:00
-----------
`draft` `optional` `author:degenrocket`
2023-11-05 18:38:32 -05:00
This NIP defines how to add licenses to Nostr events.
2023-10-31 21:10:00 -04:00
2023-11-05 18:38:32 -05:00
### Problems
2023-10-31 21:10:00 -04:00
2023-11-05 18:38:32 -05:00
Currently, the Nostr ecosystem is growing in a very friendly environment, but once the environment will change to hostile, relays and clients can face legal responsibilities for distributing the copyright-protected content. At the moment of writing, a user who signs a Nostr event doesn't give an explicit permission for his content to be distributed without any restriction.
2023-10-31 21:10:00 -04:00
2023-11-05 18:38:32 -05:00
Another problem is that some users want to use different licenses for different content like text and media files.
2023-10-31 21:10:00 -04:00
### Solution
2023-11-05 18:38:32 -05:00
The easiest solution for this problem is to add a license to each signed event in accordance with the [SPASM](https://github.com/degenrocket/spasm) specification.
2023-10-31 21:10:00 -04:00
2023-11-05 18:38:32 -05:00
Then relays and clients can check whether events have an MIT license or any other license and choose whether to display/distribute such events or not.
2023-10-31 21:10:00 -04:00
2023-11-05 18:38:32 -05:00
While adding a dedicated license field (e.g., `"license":"MIT"`) would be ideal, the easiest solution with backwards-compatibility is to add a license as a tag.
2023-10-31 21:10:00 -04:00
```js
tags: [
[
"license",
"MIT"
]
]
```
### Implementation
Here is an example of adding an MIT license to each Nostr event as a tag.
```js
let nostrEvent = {
kind: 1,
created_at: Math.floor(Date.now() / 1000),
tags: [
[
"license",
"MIT"
]
],
content: "not your keys, not your words",
pubkey: "b0635d6a9851d3aed0cd6c495b282167acf761729078d975fc341b22650b07b9",
}
```