lightning-decodepay -- Command for decoding a bolt11 string (low-level)
SYNOPSIS
decodepay bolt11 [description]
DESCRIPTION
Command added in v23.05.
WARNING: deprecated: use decode which also handles bolt12.
The decodepay RPC command checks and parses a bolt11 string as specified by the BOLT 11 specification.
- bolt11 (string): Bolt11 invoice to decode.
- description (string, optional): Description of the invoice to decode.
RETURN VALUE
On success, an object is returned, containing:
- currency (string): The BIP173 name for the currency.
- created_at (u64): The UNIX-style timestamp of the invoice.
- expiry (u64): The number of seconds this is valid after timestamp.
- payee (pubkey): The public key of the recipient.
- payment_hash (hash): The hash of the payment_preimage.
- signature (signature): Signature of the payee on this invoice.
- min_final_cltv_expiry (u32): The minimum CLTV delay for the final node.
- amount_msat (msat, optional): Amount the invoice asked for.
- description (string, optional): The description of the purpose of the purchase.
- description_hash (hash, optional): The hash of the description, in place of description.
- payment_secret (hash, optional): The secret to hand to the payee node.
- features (hex, optional): The features bitmap for this invoice.
- payment_metadata (hex, optional): The payment_metadata to put in the payment.
- fallbacks (array of objects, optional): Onchain addresses.:
- type (string) (one of "P2PKH", "P2SH", "P2WPKH", "P2WSH", "P2TR"): The address type (if known).
- hex (hex): Raw encoded address.
- addr (string, optional): The address in appropriate format for type.
- routes (array of arrays, optional): Route hints to the payee.:
- (array of objects): Hops in the route.
- pubkey (pubkey): The public key of the node.
- short_channel_id (short_channel_id): A channel to the next peer.
- fee_base_msat (msat): The base fee for payments.
- fee_proportional_millionths (u32): The parts-per-million fee for payments.
- cltv_expiry_delta (u32): The CLTV delta across this hop.
- (array of objects): Hops in the route.
- extra (array of objects, optional): Any extra fields we didn't know how to parse.:
- tag (string) (always 1 characters): The bech32 letter which identifies this field.
- data (string): The bech32 data for this field.
Technically, the description field is optional if a description_hash field is given, but in this case decodepay will only succeed if the optional description field is passed and matches the description_hash. In practice, these are currently unused.
AUTHOR
Rusty Russell <[email protected]> is mainly responsible.
SEE ALSO
lightning-pay(7), lightning-getroute(7), lightning-sendpay(7)
RESOURCES
Main web site: https://github.com/ElementsProject/lightning
EXAMPLES
Example 1:
Request:
lightning-cli decodepay -k "bolt11"="lnbcrt100n1pn2s3xxsp5s4wvy67lduz0tpxzmw0x0m8z5krfn6ppeu3a9t559tcdxquqwjfqpp5r0zx30ded4lpxp7vrdxqenmwr9rqftn93dcymvmuaxpu8y5zxunqdqcdscnzgryv4ekxunfwp6xjmmwxqyjw5qcqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqd5qqqqgqqyqqqqqpqqqqqzsqqc9qxpqysgqyk0lnqhsl07405jsqzyyaheu3dhxdv6s498ex97yvacs04gf6carplepnh5drlse8spy8nluz4uwj78h47ez6hak9md2s8mtg6yy5tcqt8yfsj"
{
"id": "example:decodepay#1",
"method": "decodepay",
"params": {
"bolt11": "lnbcrt100n1pn2s3xxsp5s4wvy67lduz0tpxzmw0x0m8z5krfn6ppeu3a9t559tcdxquqwjfqpp5r0zx30ded4lpxp7vrdxqenmwr9rqftn93dcymvmuaxpu8y5zxunqdqcdscnzgryv4ekxunfwp6xjmmwxqyjw5qcqp9rzjqgkjyd3q5dv6gllh77kygly9c3kfy0d9xwyjyxsq2nq3c83u5vw4jqqqd5qqqqgqqyqqqqqpqqqqqzsqqc9qxpqysgqyk0lnqhsl07405jsqzyyaheu3dhxdv6s498ex97yvacs04gf6carplepnh5drlse8spy8nluz4uwj78h47ez6hak9md2s8mtg6yy5tcqt8yfsj"
}
}
Response:
{
"currency": "bcrt",
"created_at": 1722303686,
"expiry": 604800,
"payee": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
"amount_msat": 10000,
"description": "l11 description",
"min_final_cltv_expiry": 5,
"payment_secret": "855cc26bdf6f04f584c2db9e67ece2a58699e821cf23d2ae942af0d303807492",
"features": "02024100",
"routes": [
[
{
"pubkey": "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59",
"short_channel_id": "109x1x1",
"fee_base_msat": 1,
"fee_proportional_millionths": 10,
"cltv_expiry_delta": 6
}
]
],
"payment_hash": "1bc468bdb96d7e1307cc1b4c0ccf6e194604ae658b704db37ce983c392823726",
"signature": "30440220259ff982f0fbfd57d25000884edf3c8b6e66b350a94f9317c4677107d509d63a022030ff219de8d1fe193c0243cffc1578e978f7afb22d5fb62edaa81f6b46884a2f"
}