bitcoin-dev-project / bitcoin-dev-project/sim-ln

Feature: Invoice-Based Payments

Open
#27 0 comments 0 reactions 0 assignees View on GitHub
feature Medium Priority
Dominant language
Rust
Stars
80
Forks
40
Avg merge
18h 49m
Merged PRs (30d)
2

Description

At present, SimLN only uses keysend payments. This has the following implications:
* All nodes need to support the keysend feature bit
* We have no coverage for MPP payments
* We do not require execution on the destination node (because we do not have to create an invoice)

We support two types of activity generation, which will have slightly different requirements for updating to invoice-based payments:
* Defined: provide a list of payment flows (send X from A to B)
* Random: provide list of nodes (A / B / C) and send payments between them

For defined activities, we don't need to have execution permissions on the destination node (because we can just send a keysend payment). For random activities, we enforce that we have execution on all nodes because every listed node needs to _send_ payments.

This means that:
* To use invoice-based payments for defined activites, we'll need to validate that the destination node is one we have execution permissions on (ie, it's in our list of `nodes`).
* To use invoice-based payments for random activities, we just need to switch over to using them (because we already validate that we have execution on all receiving nodes).

Suggested order for implementation:
* Update random activity execution to use invoice-based payments
* Add option to use invoice-based payments for defined activities:
* Add new action "type" for invoice-based (leave keysend as default)
* Update validation to enforce:
* Keysend feature bit if using keysend
* Execution perms on receiving node if using invoice-based
* Update sim-file to assume use of keysend, and add an optional tag to incidate that invoice-based in desired

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.