Skip to main content

Ditto Server Keypair

Each Ditto server has its own Nostr account for internal use, configured with the DITTO_NSEC environment variable. This account is used to sign events that are generated by the server itself, such as configuration events, connection events, and more.

Connection Events

When users need to sign Nostr events or pay Lightning invoices, the Ditto server signs and publishes NIP-46 and NIP-47 events respectively.

Pleroma Configuration

Ditto supports Pleroma's Admin Config API, making it usable with Soapbox and partially supporting AdminFE.

Config is encoded in a NIP-78 event with the identifier set to pub.ditto.pleroma.config.

kind: 30078,
pubkey: ditto_pubkey,
content: nip44_encrypted_configs,
tags: [['d', 'pub.ditto.pleroma.config']],

Username Labels

When a NIP-05 username is granted to a user, the Ditto server signs a NIP-32 label with the fully-qualified username (including domain) and the user's pubkey.

These labels are the Ditto server's source of truth for NIP-05 ownership.

kind: 1985,
pubkey: ditto_pubkey,
tags: [
['L', 'nip05'],
['l', username_at_domain],
['p', pubkey],

Event Deletions

When the Ditto server signs a kind 5 deletion event, the Ditto relay accepts it as valid and deletes the event from the database, even though the event itself is not signed by the original author.

kind: 5,
pubkey: ditto_pubkey,
tags: [['e', event_id]],

Moderation Lists

When the Ditto server signs NIP-51 list events, they impact the entire Ditto server.

  • Mute list (kind 10000) - Ditto will reject events from the listed pubkeys.
  • Blocked relays (kind 10006) - Ditto will never connect to the listed relays, overriding user preferences.
  • Search relays (kind 10007) - the relays are used in the search API instead of using SQLite FTS.
  • Emojis (kind 10030) - custom emojis listed through the API.

Relay List

External relay connections are configured by NIP-65 events.

  • Read relays are used by Ditto's firehose, and may be used for making just-in-time requests to relays.
  • Write relays are used when users publish events through the Mastodon API.