SNIP-03: PGP Identity Verification (Nostr-Native)

⚡tephen

published

draft optional

This SNIP defines a standard for linking a PGP public key to a Nostr identity by storing both the Public Key and the Verification Proof as Application Specific Data (kind:30078) events on relays, rather than relying on external web servers or keyservers.

Motivation

Previous iterations of PGP linking required users to host proof files on HTTP servers or upload keys to keyservers. This introduced centralization points and link-rot.

By using parameterized replaceable events (kind:30078), we allow users to:

  1. Store their PGP Public Key directly on Nostr.
  2. Store their signed ownership proof directly on Nostr.
  3. Link to these events in their profile metadata.

This ensures that as long as the user's relays are online, their identity proof is available.

1. The PGP Public Key Event

The user MUST publish their ASCII-armored PGP Public Key to relays.

  • Kind: 30078 (Application Specific Data)
  • Tags:
    • d: pgp-key
  • Content: The full ASCII-armored PGP Public Key.

Example

{  
  "kind": 30078,  
  "tags": [  
    ["d", "pgp-key"]  
  ],  
  "content": "-----BEGIN PGP PUBLIC KEY BLOCK-----n...n-----END PGP PUBLIC KEY BLOCK-----"  
}

2. The Proof Event

The user MUST publish a clearsigned message asserting control of their Nostr public key.

  • Kind: 30078 (Application Specific Data)
  • Tags:
    • d: pgp-proof
  • Content: A PGP clearsigned message (containing the message content and the ASCII-armored signature).

Message Requirement

The body of the message MUST contain the exact line:

Verifying that I control the following Nostr public key: <npub...>

Example

{  
  "kind": 30078,  
  "tags": [  
    ["d", "pgp-proof"]  
  ],  
  "content": "-----BEGIN PGP SIGNED MESSAGE-----nHash: SHA256nnVerifying that I control the following Nostr public key: npub1...n-----BEGIN PGP SIGNATURE-----n..."  
}

To link the identity, the user adds a specific i tag to their kind:0 metadata event.

Usage

["i", "pgp:<FINGERPRINT>", "<proof-coordinate>"]

Parameters

  • "pgp:" — The full 40-character PGP fingerprint (hexadecimal, case-insensitive).
  • "" — A reference to the Proof Event defined in section 2. This SHOULD be a NIP-19 naddr string (pointing to kind:30078, pubkey, d=pgp-proof), but clients MAY support other coordinate formats.

Example Tag

[  
  "i",   
  "pgp:9A3D4F5C7B8E9D10A1B2C3D4E5F6789012345678",   
  "nostr:naddr1qqxxuue6x5unyw3hxqurqw3hxqmryv3j8yun894hqamnwvaz7tmwdaehgu3wdau8gu3wv3jhvtkkd3jk2tw0055n6"  
]

Verification Flow (Client Side)

To verify a user's PGP identity, a client:

  1. Reads the Profile: Fetches the user's kind:0 and finds the i tag starting with pgp:.
  2. Parses Reference: Decodes the naddr in the third position of the tag.
  3. Fetches Proof: Queries relays for the event specified in the naddr (Target: kind:30078, d:pgp-proof, Author: User).
  4. Fetches Key: Queries relays for the user's PGP Key event (Target: kind:30078, d:pgp-key, Author: User).
  5. Validates Fingerprint: Ensures the fingerprint of the fetched PGP Key matches the fingerprint claimed in the kind:0 i tag.
  6. Verifies Signature: Uses the fetched PGP Key to cryptographically verify the signature inside the Proof Event content.
  7. Validates Text: Checks that the signed text contains the correct npub for the user.

Security Considerations

  • Fingerprint Mismatch: Clients MUST fail verification if the fingerprint derived from the fetched pgp-key event does not match the fingerprint stored in the kind:0 tag.
  • Key ID vs Fingerprint: Clients should rely on the full fingerprint, not short Key IDs, to avoid collision attacks.
  • Relay Availability: If the relay hosting the proof or key is offline, verification will fail. Users should publish these events to their write relays (NIP-65).

Compatibility

This SNIP updates the i tag usage from NIP-39. While NIP-39 generally expects a URL in the third position, this SNIP leverages the flexibility of Nostr clients to resolve nostr: links or naddr strings as internal references.

Cited links

Discussion

Connect a key to comment.