Skip to content

pay command doesn't work for BOLT12 #5473

@raphjaph

Description

@raphjaph

I'm trying to pay a BOLT12 offer but lightning-cli tells me it doesn't like the prefix. It seems like it recognises that it is BOLT12 but somehow tries to parse a BOLT11. Decoding the offer works perfectly.

lightning-cli pay lno1pg34g6tsypnx7u3qgf5hgcm0d9hr5gzpyptk7untyp5kugzswfhkwun9wde3grjndfhhyueq2pex7an0daehg83qxalcjym827wseh7zsvauxgap6q23fm4yp4yve6rdx83esg37pjelqsqk0mxa75uwy2j8qpyce7vet0xn8vfq4yjq02r4rly6agvhy0jvqp2r0cdl6fsl3qu72jf5wvlr3hgkmzlgg5ezut4q9z50saxvnaqtq 1000sat
{
   "code": -32602,
   "message": "Invalid bolt12: unexpected prefix lno"
}

lightning-cli decode lno1pg34g6tsypnx7u3qgf5hgcm0d9hr5gzpyptk7untyp5kugzswfhkwun9wde3grjndfhhyueq2pex7an0daehg83qxalcjym827wseh7zsvauxgap6q23fm4yp4yve6rdx83esg37pjelqsqk0mxa75uwy2j8qpyce7vet0xn8vfq4yjq02r4rly6agvhy0jvqp2r0cdl6fsl3qu72jf5wvlr3hgkmzlgg5ezut4q9z50saxvnaqtq
{
   "type": "bolt12 offer",
   "offer_id": "fac19e85de6bb306117cf8d8b167f1610d7e29c54c56400262b05500cafe3e30",
   "description": "Tip for Bitcoin: A Work in Progress",
   "issuer": "Sjors Provoost",
   "vendor": "Sjors Provoost",
   "node_id": "377f891367579d0cdfc2833bc323a1d01514eea40d48cce86d31e398223e0cb3",
   "signature": "167ecddf538e22a4700498cf9995bcd33b120a92407a8751fc9aea19723e4c005437e1bfd261f8839e54934733e38dd16d8be845322e2ea028a8f874cc9f40b0",
   "valid": true
}

Is this the correct way of using this command? A workaround, which works: lightning-cli fetchinvoice <bolt12> | jq '.invoice' | xargs lightning-cli pay

I'm running version 0.11.2 and have the correct experimental features enabled.

lightning-cli listconfigs
{
   "# version": "v0.11.2",
   ...
   "experimental-onion-messages": true,
   "experimental-offers": true,
   ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions