electrum icon indicating copy to clipboard operation
electrum copied to clipboard

initial support bolt12 offers

Open accumulator opened this issue 5 months ago • 4 comments

This PR contains initial support for BOLT12

  • parses bolt12 offer payment identifiers,
  • requests bolt12 invoice by sending invoice_request via onion message
  • handles invoice and invoice_error responses
  • initial support for paying bolt12 invoice
    • currently 'abusing' bolt11 data structures like LnAddr, to minimize changes in payment sending code path
    • bolt12 invoice currently stored in Invoice.lightning_invoice with a prefix, because adding a new field to an @attr.s object is a PITA when switching branches, final storage location TBD.
  • CLI commands add_offer, get_offer, delete_offer and list_offers for managing offers.
  • handles incoming invoice_request and replies with invoice if request can be matched with an offer.
  • accepts incoming HTLCs with blinding
  • initial Qt GUI should be working for sending to offer
  • initial QML GUI should be working for sending to offer

notes w.r.t current state:

  • only first path in invoice_paths is tried, iteration of multiple path is TODO
  • needs gossip enabled, no support for trampoline routing yet.
  • expired offers are not automatically removed from the wallet db.
  • adds extra blinding field to HTLCs in adds log, making the wallet file non-backward compatible

accumulator avatar Aug 07 '25 10:08 accumulator

I have pushed a new version of https://github.com/spesmilo/electrum/commits/test_blinded_payment_onion This branch adds a unit test for the blinded payment onion creation test vector from the BOLT

ecdsa avatar Oct 12 '25 12:10 ecdsa

rebase after #10230

accumulator avatar Dec 01 '25 13:12 accumulator

I pushed a commit to your branch, that adds a regtest for the scenario alice pays carol throught bob. Please try to make this work first; we can worry about the GUI later.

Edit: sorry, I had to force-push, because I made a mistake. The branch is now rebased on master.

ecdsa avatar Dec 06 '25 15:12 ecdsa

adds extra blinding field to HTLCs in adds log, making the wallet file non-backward compatible

there should be a wallet_db upgrade for that

ecdsa avatar Dec 06 '25 17:12 ecdsa