Skip to content

NIP Draft: Application settings and encrypted private data

Christopher David edited this page May 26, 2023 · 1 revision

NIP-XX

Use Replaceable Events for Settings

This NIP encourages applications to use NIP-33 events to store application-specific data, rather than overloading kind-0.

  • Problem 1: Applications currently overload kind-0 events and wind up stepping on each-other's settings
  • Problem 2: Not all settings should be public information

Implementation

Application settings can be serialized as a NIP-33 event with a "d" tag containing a unique-key for that application that is shipped with the application. Applications are encouraged to create a d-tag with the following format:

  • <appname>-<uuid>-<version>

Where appname is a well known name for the app, a uuid is a random 16-byte hex string, and a version is a monotonically increasing version number.

The contents of the event are application-specific, and can contain encrypted values.

Example event contents:

{
"nym": "simulxx",
"auto-clear": true,
"authorizations" : {
   "encrypted": true,
   "value": "<b64EncryptedMessage + '?iv=' + ivBase64>"
}

In this example, the application has chosen to store 2 pieces of information in the clear, "nym" and "auto-clear", and one piece of information encrypted : "authorizations"

Clone this wiki locally