Resolves a name like `alice@example.com` to a BOLT 12 offer over DoH
and pays it. DNSSEC is validated locally, as required by BIP-353.
Self-resolution only for now; peer-based resolution via BLIP-32 will
follow. Exposes a `PayHumanReadableAddress` gRPC endpoint and a
`lndk-cli pay-hrn` command.
Validate that offer_amount is non-zero when parsing bolt12 offers,
rejecting malformed offers early per the BOLT 12 specification. Also
update CLI help text to note the amount requirement.
Closes#251.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit adds an integration test for checking the pay offer
feature using 3 available blinded paths, which nodes support onion messages
and are connected to more channels.
The current approach uses random peers. These random peers may be
temporary connections, so that if someone tries to pay and offer, the
selected peers may not be connected anymore, and the payment will fail.
Instead of choosing random peers, this commit will select public
open channels, creating long-lived offers. It tries to choose three
different channels at most. In order for these channels to be valid, the node
has to have onion support, and the node has to be connect to more public
channels. This new logic is only for creating offers.
The current logic of choosing random peers is better for outgoing payments
and remains as such.
Mine and confirm channel to LND one by one instead of batching to
ensure all channels are open when creating the blinded path and
then closing channels.
LND force close channels when wallet is not in sync with the
blockchain.
This commit adds a test whenever that checkouts that whenever is a network condition error when tryingto pay an offer after fetching the invoice, we will return the latest error of the payment.
Before this commit we used the first blinded path offered in the
invoice to send the payment. If it failed because network dynamics
we would fail the payment for the end user.
With this commit if we fail to send the payment through the route
we will try with a new one until we don't have options to do the
payment.
This commit upgrades all tonic related crates to the latest
version. Also uses latest own organization tonic_lnd fork.
Finally, fixes all breaking changes of these versions.
To test out when peers are not connected we need the graph to sync
with the node addresses to then be connected. The method added
waits for 100s for an specific node to appear in the LND graph.
Finally, as we need more freedom when using `connect_network` we
add a boolean flag ti announce or not the ldk1 <-> ldk2 connection.
Whenver an offer message arrives we verify that is from a offer
generated from the lndk keys. Then we create an invoice on LND
side to finally respond the newly generated Invoice through
an oniont message.
For given invoice we add a Nonce and Hmac to authenticate in case
of any error.
Finally, we add a simple integration test of generating an offer
andh then paying it.
Implements BOLT12 offer creation API with OfferCreator trait, handler methods,
and appropriate tests. This allows nodes to create and share BOLT12 offers.
Because the CI resources are very limited, the time that LND takes to be
up, running and ready to serve increases making the integration tests to
fail. Because of this reason the sleep time is increased.
This commit adds a integration test for checking that when a LND node is
not available the reconnection wrapper will keep trying to reconnect
making possible to use the same handler for trying to pay an offer.
When the LND is broken the first pay offer will fail whereas when the
reconnection succeed the second attempt of pay a offer will finish.
It was also necessary to abstract how LND arguments are generated in order
to restart LND node using previous arguments.
This commit changes `test_lndk_send_invoice_request` to
`test_lndk_get_invoice`. Main difference is that we now wait to
receive the invoice back when sneding an invoice request.
Also, adds a helper function `get_invoice_with_retry` to retry
in case of failure because there is a race condition between
the internal graph and when wecall get_invoice.
As Itest has specific dependencies, main
package does not require all of them neither
downloading bitcoin core. This commits
creates a cfg flag and feature to separate
on build time and dependencies.
This commit introduces a parameter in the RPC to allow users to modify
the timeout when receiving an invoice from the offer creator.
Additionally, it adds a configuration parameter for the server to set
up a default value if no parameter is used.
The default timeout value is also decreased from 100 seconds to 20
seconds.
LNDK verifies that the version of LND running alongside it is compatible with LNDK.
If users need to bypass this version check for any reason, they can use the skip-version-check option.
Instead of tracking the offers we're paying, we move to instead track active
payments by PaymentId through their lifecycle.
This makes it easier for us to track whether we've already received an invoice
for the payment or not. If we have, we ignore the second invoice so we don't
try to pay it again.
As a byproduct, this change also allows us to pay the same offer multiple at
once, which we didn't allow for before.
This commit Arc-ifies the reference to OffersHandler, which is necessary
because once we set up the grpc server, we'll need a second thread-safe
reference to it.