{
  "slug": "nostr-key-encoder",
  "name": "gizza-ai/nostr-key-encoder",
  "version": "0.1.0",
  "title": "Nostr Key Encoder — NIP-19 npub/nsec/note ↔ Hex Converter — gizza.ai",
  "description": "Convert Nostr keys and event ids between raw hex and NIP-19 bech32: npub, nsec, note, nprofile and nevent. Runs locally in your browser.",
  "tags": [
    "nostr",
    "nip-19",
    "npub",
    "nsec",
    "bech32",
    "nostr key converter",
    "nprofile",
    "nevent"
  ],
  "category": "encoding",
  "urls": {
    "page": "https://gizza.ai/tools/nostr-key-encoder/",
    "markdown": "https://gizza.ai/tools/nostr-key-encoder/index.md",
    "descriptor": "https://gizza.ai/tools/nostr-key-encoder/tool.json",
    "deep_link_example": "https://gizza.ai/tools/nostr-key-encoder/?input=7e7e9c42a91bfef19fa929e5fda1b72e0ebc1a4c1141673e2794234d86addf4e&mode=auto&type=npub&relays=wss%3A%2F%2Frelay.example.com%2C%20wss%3A%2F%2Frelay.damus.io&author=3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d&kind=1"
  },
  "cli": "gizza tool nostr-key-encoder \"7e7e9c42a91bfef19fa929e5fda1b72e0ebc1a4c1141673e2794234d86addf4e\"",
  "tool": {
    "description": "Convert Nostr identifiers between raw hex and their NIP-19 bech32 forms. Encode a 64-char hex key/id into npub (public key), nsec (private key), or note (event id), or into the TLV forms nprofile (pubkey + relays) and nevent (event id + optional relays, author, kind). Decode any NIP-19 string (npub/nsec/note/nprofile/nevent, plus naddr/nrelay) back to hex or a labeled report. Set mode='auto' (default) to detect direction, or force 'encode'/'decode'. Nostr uses the plain Bech32 (BIP 173) checksum with no 90-char length cap. Runs locally; never uploads keys.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "author": {
          "description": "Encode only (nevent): optional 64-char hex public key of the event author, embedded as a TLV hint. Ignored for other types and on decode.",
          "type": "string"
        },
        "input": {
          "description": "The identifier to convert: either a raw 64-char hex key/id (to encode) or a NIP-19 bech32 string like npub1…/nsec1…/note1…/nprofile1…/nevent1… (to decode). A leading 0x and whitespace are ignored on hex input.",
          "type": "string"
        },
        "kind": {
          "default": -1.0,
          "description": "Encode only (nevent): optional Nostr event kind as a 32-bit unsigned integer (0..=4294967295), e.g. 1 for a text note. Use -1 (default) to omit it. Ignored for other types and on decode.",
          "type": "integer"
        },
        "mode": {
          "default": "auto",
          "description": "Direction. 'auto' (default) decodes if the input is a NIP-19 bech32 string and encodes otherwise; 'encode' forces hex→bech32 using 'type'; 'decode' forces bech32→hex/report.",
          "enum": [
            "auto",
            "encode",
            "decode"
          ],
          "type": "string"
        },
        "relays": {
          "description": "Encode only (nprofile/nevent): optional relay URLs where the entity can be found, e.g. 'wss://relay.example.com'. Separate multiple with commas, spaces, or newlines. Ignored for bare types and on decode.",
          "type": "string"
        },
        "type": {
          "default": "npub",
          "description": "Target NIP-19 prefix when ENCODING hex. 'npub' public key, 'nsec' private key, 'note' event id (all 32-byte); 'nprofile' pubkey + relays; 'nevent' event id + optional relays/author/kind. Ignored on decode (the prefix is read from the string).",
          "enum": [
            "npub",
            "nsec",
            "note",
            "nprofile",
            "nevent"
          ],
          "type": "string"
        }
      },
      "required": [
        "input"
      ],
      "type": "object"
    }
  }
}