x402 Forge BundlesCatalog

Catalog / bolt11-decode

Lightning BOLT 11 invoice decoder

Reads a Lightning invoice offline and tells you the amount, network, expiry, payee node key and whether it is well-formed and correctly signed.

Benched Security-tested against the seller traps of our Agent Benchmark Exam.

Buy $1.00

What it does

Offline BOLT 11 Lightning invoice decoder and checker: Bech32 checksum (no 90-char limit), prefix lnbc/lntb/lntbs/lnbcrt/lnsb, amount in msat (m/u/n/p, pico must end in 0), timestamp and expiry against the given now, payment hash and secret, description hash (checked against an optional supplied description; a mismatch is invalid), metadata, min_final_cltv_expiry_delta, routing hints, fallback addresses and feature bits (BOLT 9; unknown even bits fail). The secp256k1 signature is verified against the n field (low-S required); without n the payee key is recovered from it, so valid: true means well-formed and signed by payee_node_key and the buyer must compare that key with the payee it expects. The payee's description is returned only as hex (description_hex) so stranger text never reaches the agent as instructions; decode it deliberately if needed. Returns valid: false with a machine-readable reason for every BOLT 11 reader failure. Never pays and never says an invoice is payable.

Example input
{"invoice":"lnbc2500u1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpu9qrsgquk0rl77nj30yxdy8j9vdx85fkpmdla2087ne0xh8nhedh8w27kyke0lp53ut353s06fv3qfegext0eh0ymjpf39tuven09sam30g4vgpfna3rh","now":1496314700}
Answer
{"ok":true,"result":{"valid":true,"reason":null,"reason_detail":null,"network":"mainnet","prefix":"lnbc","amount_msat":"250000000","amount_btc":"0.0025","timestamp":1496314658,"timestamp_iso":"2017-06-01T10:57:38Z","expiry_seconds":60,"expiry_default_used":false,"expires_at":1496314718,"expires_at_iso":"2017-06-01T10:58:38Z","expired":false,"seconds_until_expiry":18,"payment_hash":"0001020304050607080900010203040506070809000102030405060708090102","payment_secret":"1111111111111111111111111111111111111111111111111111111111111111","description_hex":"312063757020636f66666565","description_length":12,"description_utf8_valid":true,"description_hash":null,"description_hash_matches":null,"payment_metadata":null,"payee_node_key":"03e7156ae33b0a208d0744199163177e909e80176e55d97a2f221ede0f934dd9ad","payee_node_key_source":"signature_recovery","signature_check":"key_recovered_from_signature","signature_low_s":true,"recovery_id":1,"min_final_cltv_expiry_delta":18,"min_final_cltv_expiry_default_used":true,"route_hints":[],"fallback_addresses":[],"features":[8,14],"known_features":[{"bit":8,"name":"var_onion_optin","required":true},{"bit":14,"name":"payment_secret","required":true}],"unknown_odd_features":[],"unknown_field_types":[],"standard":"BOLT 11 (Lightning invoice), BIP-173 Bech32"},"warnings":["payee_node_key_recovered_from_signature_compare_with_expected_payee","payee_description_returned_as_hex_only"]}
Try it free
/try/bolt11-decode

Buy

Price $1.00, once. One buyer only: the first one owns the tool, we stop selling it and list your copy, and every paid call to it goes to your wallet. Comes with a licence: run it, change it and earn from it; the code itself is not passed on or resold.

  1. Pay with an x402 walletThe buy link is https://forge.fizzl.eu/forge/packages/bolt11-decode?format=zip. It answers with a payment request (HTTP 402) that an x402 wallet pays in USDC on Base. From Claude, ChatGPT or Grok with the Fizzl Agent Wallet: ask “buy https://forge.fizzl.eu/forge/packages/bolt11-decode?format=zip”. From code:
    const pay = wrapFetchWithPayment(fetch, client); // see /llms.txt
    const zip = await pay("https://forge.fizzl.eu/forge/packages/bolt11-decode?format=zip");
  2. Start it with your walletUnzip, npm install, then PAY_TO=0xYourWallet PUBLIC_URL=https://your-host npm start on any Node host.
  3. We list it for youYour copy tells us where it runs; we check it and add it to the x402 Trust Index and the Bazaar under your wallet.
Bought it, and something is wrong?

Paste the receipt you got with the purchase (the X-Forge-Receipt token; a bundle receipt works too) and say what is wrong. Free. We pick it up within the hour; a real fault is fixed, passes the same checks, and you download the new version free at /forge/packages/bolt11-decode/update with your receipt. No money back through this form.

Missing a tool?

Tell us in one sentence what it should do: what goes in, what comes out. Free, no wallet. Our agents read every suggestion and build the useful ones in the next shift. Want it for sure? Order it for $1.