Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 51 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions docs/api-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ These RPCs support a manual claim/fail workflow for held payments. See
| RPC | Description |
|------------------------|--------------------------------------------------------------------|
| `Bolt11ReceiveForHash` | Create an invoice for a given payment hash (manual claim required) |
| `Bolt11ClaimForHash` | Claim a held payment by providing the preimage |
| `Bolt11FailForHash` | Reject a held payment |
| `Bolt11ClaimForId` | Claim a held payment by its payment ID and preimage |
| `Bolt11FailForId` | Reject a held payment by its payment ID |

### BOLT11 JIT Channels (LSPS2)

Expand All @@ -130,8 +130,9 @@ when the invoice is paid.

| RPC | Description |
|-----------------|-------------------------------------------------------------------------|
| `Bolt12Receive` | Create a BOLT12 offer (fixed or variable amount) |
| `Bolt12Send` | Pay a BOLT12 offer (with optional quantity, payer note, routing config) |
| `Bolt12Receive` | Create a BOLT12 offer (fixed or variable amount) |
| `Bolt12Send` | Pay a BOLT12 offer (with optional quantity, payer note, routing config) |
| `Bolt12CreatePayerProof` | Create a BOLT 12 payer proof from a successful payment |

### Spontaneous and Unified Send

Expand Down Expand Up @@ -230,11 +231,11 @@ optional Basic Auth. See [Configuration](configuration.md#metrics) for setup.
Hodl invoices allow you to inspect and conditionally accept incoming payments:

1. **Create the invoice:** Call `Bolt11ReceiveForHash` with a payment hash you control.
2. **Wait for payment:** Subscribe to events via `SubscribeEvents` and watch for a
`PaymentClaimable` event matching your payment hash.
2. **Wait for payment:** Subscribe via `SubscribeEvents`. Save the payment ID from the matching
`PaymentClaimable` event.
3. **Decide:**
- **Accept:** Call `Bolt11ClaimForHash` with the preimage corresponding to the payment hash.
- **Reject:** Call `Bolt11FailForHash` with the payment hash.
- **Accept:** Call `Bolt11ClaimForId` with the payment ID and corresponding preimage.
- **Reject:** Call `Bolt11FailForId` with the payment ID.

The payment is held in a pending state until you explicitly claim or fail it. **You must
always call one of these.** If you do neither, the HTLC will eventually time out, which
Expand Down
9 changes: 5 additions & 4 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,12 @@ Two resolution methods are supported via the `mode` field:
<network>/ # e.g., bitcoin/, regtest/, signet/
api_key # API key
ldk-server.log # Log file
ldk_node_data.sqlite # LDK Node state (channels, on-chain wallet)
ldk_server_data.sqlite # Payment and forwarding history
ldk_node_data.sqlite # LDK Node state (channels, wallet, payments)
ldk_server_data.sqlite # Forwarded-payment history
```

The mnemonic is the node's master secret, required to recover on-chain funds. On first start,
ldk-server generates a fresh 24-word BIP39 mnemonic at `<storage_dir>/keys_mnemonic` if the file
does not already exist. `ldk_node_data.sqlite` holds channel state, both are required to recover
channel funds. See [Operations - Backups](operations.md#backups) for backup guidance.
does not already exist. `ldk_node_data.sqlite` holds channel state and payment history. Both files
are required to recover channel funds. See [Operations - Backups](operations.md#backups) for backup
guidance.
4 changes: 2 additions & 2 deletions docs/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ the following config to `/etc/logrotate.d/ldk-server` (adjust the log path to ma
| File | Priority | Description |
| -------------------------------------- | ------------ | -------------------------------------------------------------------------- |
| `<storage_dir>/keys_mnemonic` | **Critical** | BIP39 mnemonic. Required to recover on-chain funds. Default for new installs. |
| `<network_dir>/ldk_node_data.sqlite` | **Critical** | Channel state and on-chain wallet data. Required to recover channel funds. |
| `<network_dir>/ldk_server_data.sqlite` | Nice-to-have | Payment and forwarding history |
| `<network_dir>/ldk_node_data.sqlite` | **Critical** | Channel state, on-chain wallet data, and payment history. Required to recover channel funds. |
| `<network_dir>/ldk_server_data.sqlite` | Nice-to-have | Forwarded-payment history |

### What is Reconstructable

Expand Down
Loading