taproot-assets icon indicating copy to clipboard operation
taproot-assets copied to clipboard

[feature]: Allow end users to receive Taproot Assets without running their own RFQ oracle

Open Liongrass opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe.

I believe end-users should not have to run their own RFQ service or oracle to be able to receive Taproot Assets payments over Lightning channels. As of now, they can send assets to their edge node and beyond if the edge node has RFQ set up, but they cannot receive payments.

Set Up

In this testing setup we used three nodes using a Taproot Asset and Bitcoin:

Hannah <--> Leo <--> Charlie USD <--> Edge Node <-> BTC

Hannah's RFQ configuration: taproot-assets.experimental.rfq.skipacceptquotepricecheck=true

Leo's RFQ configuration: taproot-assets.experimental.rfq.priceoracleaddress=use_mock_price_oracle_service_promise_to_not_use_on_mainnet taproot-assets.experimental.rfq.mockoraclesatsperasset=1

Situation A: Charlie creates a sat-denominated invoice, and Hannah pays it from their node. Her node requests a quote from Leo, she confirms to send the asset, the payment succeeds.

Situation B: Hannah requests to be paid in a Taproot Asset. Leo pays the invoice, but he is unable to complete the payment: Asking peer 03e347d089c071c27680e26299223e80a740cf3e3fc4b4237fa219bb67121a670b for quote to sell assets to pay for invoice over 50000 msats; waiting up to 60s [litcli] peer 03e347d089c071c27680e26299223e80a740cf3e3fc4b4237fa219bb67121a670b rejected the quote, code: 1, error message: price oracle unavailable

Situation C: Hannah requests to be paid in a Taproot Asset. Charlie has sats and pays the invoice, but Leo's node is unable to forward it through the desired channel. The full logs are attached. Excerpt 2024-08-08_lnd.log :

2024-08-08 23:25:43.623 [DBG] RFQS: Handling incoming HTLC, incoming channel ID: 3158705591608868864, outgoing channel ID: 2665057856057245696 (incoming amount: 51000 mSAT, outgoing amount: 50000 mSAT)
2024-08-08 23:25:43.623 [TRC] RFQS: Have inbound policy: false: (interface {}) <nil>

2024-08-08 23:25:43.623 [TRC] RFQS: Have outbound policy: false: (interface {}) <nil>

2024-08-08 23:25:43.623 [DBG] RFQS: Failed to find a policy for the HTLC. Resuming.
2024-08-08 23:25:43.623 [TRC] RRPC: Resolving intercepted packet incoming_circuit_key:{chan_id:3158705591608868864}  action:RESUME
2024-08-08 23:25:43.625 [TRC] HSWC: Committing fresh circuits: ([]models.CircuitKey) (len=1 cap=1) {
 (models.CircuitKey) (Chan ID=2872826:483:0, HTLC ID=0)

Describe the solution you'd like If Leo's node identifies itself as an edge node, it should not request a quote from Hannah's node when paying an invoice. It should pay the invoice as if it was a forwarded payment, using the quote requested by Hannah's node at the time of invoice creation. The hop hint is still present in the invoice and should be honored.

Describe alternatives you've considered

Additional context

Liongrass avatar Aug 08 '24 23:08 Liongrass