lightningdevkit / rust-lightning

A highly modular Bitcoin Lightning library written in Rust. It's rust-lightning, not Rusty's Lightning!
Other
1.12k stars 345 forks source link

BOLT12 Offers Tracking Issue #1970

Open TheBlueMatt opened 1 year ago

TheBlueMatt commented 1 year ago

The following tasks are required to implement BOLT 12 Offers in LDK:

The things left for us to ship BOLT12, in an issue so we don't lose track of things:

After we go public, we should also:

Anything I'm missing here @jkczyz?

jkczyz commented 1 year ago

We also need to do spontaneous/unsolicited invoices, i.e., BOLT11-style invoices not in response to an InvoiceRequest but rather scanned directly by the user. This was a late addition to the spec. https://github.com/lightning/bolts/pull/798/commits/7b0c0fc2b846ec30a2a729d733f4880599734269

I think we can punt on this for now similar to non-Bitcoin-denominated offers. Or a volunteer can work on it in parallel. It would be similar to Refund in that it will have its own struct (probably named SpontaneousInvoice) and share the underlying TLV streams. Like Refund it has it's own bech32 prefix (lni instead of lnr).

jkczyz commented 1 year ago

For bindings, we probably only need non-builder constructors for Offer and Refund as LDK would handle constructing the others. Though it would still be nice to expose them directly if someone wants to use them without a ChannelManager. Just may be a lower priority.

TheBlueMatt commented 1 year ago

Right, like BOLT11 we'll eventually have folks who want to use them, so we definitely need to support it, but it won't be the "common case". I'm not convinced we shouldn't drop the builders and replace them entirely or at least have a simple util method that calls the builder as appropriate, should be pretty trivial if we go the util method route.

valentinewallace commented 1 year ago

We may also eventually want utilities similar to lightning-invoice::utils::create_invoice_from_channelmanager that will automatically supply the payment hash and blinded payment paths

jkczyz commented 1 year ago

FYI, I repurposed this issue to track all work for BOLT 12 Offers. @valentinewallace Could you update the route blinding portion as needed (i.e., split into more tasks and add PRs)?

TheBlueMatt commented 10 months ago

Also on the blinded path flow - https://github.com/lightningdevkit/rust-lightning/pull/2534#discussion_r1328985888