{
  "slug": "bech32-codec",
  "name": "gizza-ai/bech32-codec",
  "version": "0.1.0",
  "title": "Bech32 & Bech32m Encoder / Decoder (BIP 173 / BIP 350) — gizza.ai",
  "description": "Encode and decode checksummed Bech32 and Bech32m strings (HRP + data) as used by SegWit, Taproot, Lightning and Nostr. Free, private, browser-local.",
  "tags": [
    "bech32",
    "bech32m",
    "bech32 encoder",
    "bech32 decoder",
    "bip173",
    "bip350",
    "segwit address",
    "taproot",
    "lightning invoice",
    "nostr npub"
  ],
  "category": "encoding",
  "urls": {
    "page": "https://gizza.ai/tools/bech32-codec/",
    "markdown": "https://gizza.ai/tools/bech32-codec/index.md",
    "descriptor": "https://gizza.ai/tools/bech32-codec/tool.json",
    "deep_link_example": "https://gizza.ai/tools/bech32-codec/?input=751e76e8199196d454941c45d1b3a323f1433bd6&mode=encode&hrp=bc&variant=bech32&format=hex"
  },
  "cli": "gizza tool bech32-codec \"751e76e8199196d454941c45d1b3a323f1433bd6\"",
  "tool": {
    "description": "Encode a human-readable prefix (HRP) plus data into a checksummed Bech32 (BIP 173) or Bech32m (BIP 350) string, or decode/validate a Bech32 string back to its HRP, variant, and data. Bech32 is the encoding behind SegWit Bitcoin addresses, Lightning invoices, Nostr npub/nsec keys, and Cosmos addresses. Use mode='encode' (default) with an 'hrp' (e.g. bc, tb, lnbc) and a data payload, choosing variant='bech32' or 'bech32m'; the tool computes the base-32 data part and the 6-character BCH checksum. Use mode='decode' to validate a string and get back its prefix, detected variant, and data (variant is auto-detected). Use format='hex' (default) for binary payloads or format='text' for UTF-8. Data bytes are converted to/from 5-bit groups per the BIP 173 convertbits algorithm. Runs locally and never uploads data.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "format": {
          "default": "hex",
          "description": "How to read the payload on encode, or render it on decode. 'hex' (default) is a hex byte string for binary data; 'text' is UTF-8.",
          "enum": [
            "hex",
            "text"
          ],
          "type": "string"
        },
        "hrp": {
          "description": "Encode only: the human-readable prefix, e.g. 'bc' (Bitcoin mainnet), 'tb' (testnet), 'lnbc' (Lightning), 'npub' (Nostr). Lower-cased in output. Ignored on decode (read from the string).",
          "type": "string"
        },
        "input": {
          "description": "On encode: the data payload (hex bytes or UTF-8 text per 'format'). On decode: the Bech32/Bech32m string to validate and unpack.",
          "type": "string"
        },
        "mode": {
          "default": "encode",
          "description": "Direction: 'encode' (default) builds a checksummed Bech32 string from an HRP + data; 'decode' validates a Bech32 string and returns its HRP, variant, and data.",
          "enum": [
            "encode",
            "decode"
          ],
          "type": "string"
        },
        "variant": {
          "default": "bech32",
          "description": "Checksum variant to write on encode: 'bech32' (BIP 173, SegWit v0) or 'bech32m' (BIP 350, Taproot/v1+). On decode the variant is auto-detected and reported.",
          "enum": [
            "bech32",
            "bech32m"
          ],
          "type": "string"
        }
      },
      "required": [
        "input"
      ],
      "type": "object"
    }
  }
}