bolt12-cli
Minimal Rust/LDK Swiss knife for BOLT 12. Decode offers, invoices, and payer
proofs to curated JSON. Verify official lnp1 payer proofs and the
offer + invoice + preimage triple.
Logic lives in bolt12-common. bolt12-cli is clap + JSON on stdout.
Install
The binary is bolt12.
Build
Decode
HRP is auto-detected (lno / lni / lnp).
decode lnp1 parses through LDK, which also verifies the proof. Invalid proofs
cannot be decoded.
Invoice JSON includes unknown_invoice_tlvs when any TLV type in 160–239 is
not a BOLT 12 invoice field. The key is omitted when the list is empty.
Verify
Official payer proof: LDK cryptographic checks plus pays_offers_recipient
(invoice issuer can sign for this offer's recipient, not "this paid this
exact offer"):
Ocean-style payment triple:
Success is { "valid": true, "checks": [...] } and exit 0. A failed check is
the same shape with "valid": false and exit 1. Argument/decode errors are
{ "error": "...", "message": "..." } and exit 1.
Tests