Skip to content

Kind 30078: Arbitrary custom app data

Overview

Kind 30078 enables remoteStorage-like capabilities for custom applications that do not require interoperability. This addressable event type allows applications to store arbitrary data on Nostr relays, providing a "bring your own database" approach where users can specify their preferred relay for application-specific data storage.

Specification

PropertyValue
Kind Number30078
Event RangeAddressable
Defined inNIP-78

Content Format

The content field can contain anything in any format. There are no restrictions on the structure or type of data stored in the content field, allowing maximum flexibility for application developers.

Schema

json
// No specific schema - content can be any format:
// - Plain text
// - JSON objects
// - Binary data (base64 encoded)
// - Application-specific formats

Tags

Tag NameDescriptionFormatRequired
dApp name and context reference["d", "<app-reference-string>"]Yes

The d tag contains some reference to the app name and context, or any other arbitrary string that identifies the specific data being stored. Important: The d value space is shared by all applications globally, so the value must be globally unique across all apps. It is recommended that the app's name be part of the value, and using reverse-DNS notation is encouraged (e.g., com.example.myapp.user-settings).

Other tags can be anything or in any format as needed by the application.

Client Behavior

Clients using this kind should:

  • Use the d tag to uniquely identify different data contexts within their application.
  • Ensure the d tag value is globally unique across all applications by including the app name and preferably using reverse-DNS notation.
  • Handle the content field according to their application's specific requirements.
  • Allow users to specify their preferred relay for data storage.
  • Implement proper error handling for cases where the relay is unavailable.

Relay Behavior

Relays should treat these events as standard addressable events:

  • Store and replace events based on the combination of pubkey, kind, and d tag value.
  • Apply standard relay policies for storage and retrieval.
  • No special processing is required for the content or additional tags.

Use Cases

  • User personal settings on Nostr clients and other applications unrelated to Nostr.
  • A way for client developers to propagate dynamic parameters to users without requiring app updates.
  • Personal private data generated by apps that have nothing to do with Nostr, but allow users to use Nostr relays as their personal database.
  • Application configuration storage.
  • User preferences and customization data.
  • Temporary application state that needs to persist across sessions.

Example

json
{
  "id": "...",
  "pubkey": "...",
  "created_at": 1671217411,
  "kind": 30078,
  "tags": [
    ["d", "com.example.myapp.user-settings"]
  ],
  "content": "{\"theme\": \"dark\", \"language\": \"en\", \"notifications\": true}",
  "sig": "..."
}

References

  • Kind 30000-39999: Other addressable event kinds that provide structured data storage

Notes

This NIP is marked as draft and optional, indicating it may change and is not required for basic Nostr compatibility. Applications using this kind should be prepared for potential changes to the specification and should implement fallback mechanisms for data storage.