BOLT-12 Refund

A BOLT-12 message that lets a payer ask the original recipient to send money back, giving Lightning a proper refund flow.

Basically

A BOLT-12 refund is a message that lets you ask the original recipient to return a Lightning payment. It gives both sides a set way to handle the refund.

Key Takeaways

  • A BOLT-12 refund reverses the invoice_request flow defined in the BOLT specification. The merchant publishes an invoice_request for the amount owed, and the original payer responds with an invoice that the merchant pays.
  • The invreq_payer_id, or payer key, from the original BOLT-12 offer payment acts as cryptographic proof of purchase. The merchant can verify refund eligibility without external records.
  • BOLT-11 has no native refund mechanism, so a separate payment needs manual coordination. BOLT-12 defines a structured protocol-level flow for returning funds to the original sender.

What Is a BOLT-12 Refund?

A BOLT-12 refund is a structured payment flow in the BOLT-12 offers specification. It lets a merchant or recipient return funds to the original payer. The BOLT-12 spec calls this the "merchant-pays-user" flow and applies it to cases such as ATM withdrawals and refunds.

BOLT-12 reuses the existing invoice_request mechanism in reverse rather than adding a dedicated refund message. The merchant creates an invoice_request specifying the refund amount instead of the payer requesting an invoice from the merchant. The payer then responds with an invoice for the merchant to pay.

How It Works

The reverse flow fills a long-standing gap in Lightning payments. BOLT-11 invoices are one-directional and describe a payment from sender to receiver, with no protocol-level way to initiate a return.

BOLT-11 refunds require both parties to coordinate out-of-band when a merchant needs to refund a customer. The customer generates a new invoice and shares it by email or chat, and the merchant pays it manually. BOLT-12 turns this into a cryptographically verifiable, in-protocol workflow.

The Refund Flow Step by Step

The BOLT-12 refund flow uses the same onion message infrastructure as standard offer payments, but reverses the roles. The party initiating the refund, typically the merchant, acts as the payer. The original customer acts as the invoice issuer.

Invoice Request Without an Offer

The payer key, invreq_payer_id, from the original transaction is the critical element. It cryptographically links the refund to the original purchase. The merchant can verify that the refund request comes from the actual buyer rather than an impersonator.

Payer Key as Proof of Purchase

The invoice_request for a refund does not reference an existing offer. The BOLT-12 specification requires a standalone invoice_request, meaning one without offer_issuer_id or offer_paths, to include several required fields:

The customer's wallet validates that the required fields are present and that invreq_amount is set when it receives this standalone invoice_request. The wallet then generates an invoice where invoice_amount equals invreq_amount. The invoice must use one of the blinded paths if invreq_paths was included, or go directly to the invreq_payer_id otherwise.

Comparison to BOLT-11 Refund Workarounds

Each BOLT-12 payment includes an invreq_payer_id, a point key chosen by the sender that acts as a pseudonymous identifier. The key is committed to the invoice and serves multiple purposes:

BOLT-12 improves on BOLT-11, which has no standard mechanism for payer identification. BOLT-11 merchants must rely on external identifiers such as email or account ID to match refund requests to original payments.

Use Cases

Lightning refunds required entirely manual coordination before BOLT-12. The limitations of the BOLT-11 approach show why a protocol-level solution matters:

The research article on Lightning invoices: BOLT-11, BOLT-12, and beyond examines these flows in more detail. It provides a deeper comparison.

Partial Refunds and Adjustments

Online merchants accepting Lightning payments can integrate BOLT-12 refunds into their return workflows. The merchant's system creates an invoice_request for the refund amount and delivers it to the customer when the customer requests a return.

The customer's wallet handles the rest automatically by validating the request, generating an invoice, and receiving the refund payment. No email thread or manual invoice sharing is required.

Point-of-Sale Corrections

The merchant controls the invreq_amount field, so partial refunds are straightforward. A restaurant that overcharged a customer can issue an invoice_request for just the overage amount. A subscription service can prorate a cancellation refund.

The protocol message states the amount explicitly. This reduces disputes about refund calculations.

Cancellations and Disputes

Physical retail scenarios benefit from BOLT-12 refunds when transactions need to be reversed at the counter. A merchant using a static BOLT-12 offer to accept payments can initiate a refund by presenting the customer with an invoice_request encoded as a QR code.

The customer scans the QR code with their wallet, which generates and returns an invoice. The merchant's node pays it immediately.

Why It Matters

Lightning payments are final by design. Once an HTLC settles and the preimage is revealed, there is no protocol-level reversal.

BOLT-12 refunds give merchants a structured alternative for customer-friendly cancellation policies without sacrificing Lightning's finality guarantees. The refund is a new payment in the opposite direction, not a reversal of the original transaction.

Implementation Status

Refund capability is table stakes for commerce. Traditional payment rails like credit cards have built-in chargeback mechanisms, and customers expect some form of recourse when products are defective or services are not delivered.

Lightning's lack of a native refund flow has been a barrier to merchant adoption. Businesses accustomed to payment processor integrations that handle refunds programmatically cannot easily replicate that workflow on Lightning without BOLT-12.

Risks and Considerations

BOLT-12 makes Lightning more viable for mainstream commerce by formalising refunds at the protocol level. Wallet developers can build refund UIs that work consistently across implementations, and merchants can integrate refund logic into their existing order management systems.

Spark aims to make Bitcoin payments accessible to everyday users. For platforms like Spark, protocol-level refund support removes a significant friction point for both merchants and customers.

No Protocol-Level Enforcement

BOLT-12 was formally merged into the Lightning specification in September 2024, but implementation maturity varies across node software. The refund flow is a specific application of the invoice_request mechanism and depends on full BOLT-12 support:

A community proposal on Delving Bitcoin suggests adding an optional refund_invoice_required field to offers. This would require payers to include a pre-built refund invoice in their invoice_request at payment time.

The proposal would enable automatic refunds without a follow-up round trip. It is under discussion and has not been adopted into the specification.

Onion Message Reliability

BOLT-12 refunds are cooperative, so the merchant must voluntarily initiate the refund flow. The protocol provides the mechanism but does not enforce refund policies.

Credit card chargebacks let the card network compel the merchant to return funds. A Lightning merchant can simply refuse to create the invoice_request, so buyers relying on refund guarantees still need trust in the merchant or a third-party dispute resolution layer.

Adoption Fragmentation

The spec notes that the payer "MAY reject the invoice if it cannot confirm invoice_node_id out-of-band" when processing a standalone invoice_request without an associated offer. The merchant receiving a refund invoice therefore has no automatic way to verify that the intended recipient created it.

Merchants should verify the invoice_node_id against stored records from the original payment in practice. This helps prevent refund fraud.

Privacy Considerations

The refund flow depends on onion messages to deliver invoice_requests and receive invoices in return. Onion messages are best-effort: nodes can drop them without penalty, and there are no economic incentives for reliable forwarding.

The invoice_request may fail silently if the customer's node is temporarily unreachable. Merchants implementing refund systems need retry logic and fallback delivery mechanisms.

0

← All 1876 glossary terms