Feature: Expose Hold Invoice API via Nostr RPC (Kind 21000) #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
For ATM cash-out operations, we need hold invoices to ensure safe dispensing. The current flow has a risk window: user pays invoice, but if dispenser jams, user loses funds. Hold invoices solve this by delaying settlement until cash is physically dispensed.
Problem: Current Flow (Risky)
Solution: Hold Invoice Flow (Safe)
Technical Background
LND supports hold invoices via:
AddHoldInvoice: Create invoice with known preimage hashSettleInvoice: Release funds (ATM provides preimage)CancelInvoice: Return funds to payerCurrent Status in Lightning.Pub
Lightning.Pub's codebase includes LND protobuf definitions for hold invoices:
However: These are not currently exposed in Lightning.Pub's HTTP/Nostr API.
Proposed Implementation
Expose hold invoice methods via Nostr RPC (kind 21000):
Example Usage Flow
Timeout Handling
Benefits
References