Xud: Switch to "hodl invoice"

Created on 31 Jan 2019  路  6Comments  路  Source: ExchangeUnion/xud

https://github.com/lightningnetwork/lnd/pull/2022/ will be the new standard and our https://github.com/lightningnetwork/lnd/pull/1820 won't get merged. Hence we should switch at some point. We'll definitely wait for 2022 to be in master tho.

P1 in progress lightning swaps

Most helpful comment

Here's a quick overview of what needs to happen for xud to support hold invoices:

  • We need to start using invoices which we're not currently. We'd still generate the hash and preimage and call AddHoldInvoice with the has. I'm thinking we can actually send the swap request packet and call AddHoldInvoice in parallel to eliminate an extra step of waiting.
  • After the invoice is created call SubscribeSingleInvoice to be notified when someone tries to pay it.
  • Call CancelInvoice and end the subscription if the swap fails or times out.
  • When someone tries to pay as reported by SubscribeSingleInvoice, do our existing resolve hash routine and call SettleInvoice once we have the preimage.
  • Lnd needs to be built with the invoicesrpc flag to enable the hold invoices functionality.

All 6 comments

Still not merged, moving to next milestone.

Merged.

I think we can tackle this one

I will take a look at this before our call to get an idea of how big a lift this change will be for us.

Here's a quick overview of what needs to happen for xud to support hold invoices:

  • We need to start using invoices which we're not currently. We'd still generate the hash and preimage and call AddHoldInvoice with the has. I'm thinking we can actually send the swap request packet and call AddHoldInvoice in parallel to eliminate an extra step of waiting.
  • After the invoice is created call SubscribeSingleInvoice to be notified when someone tries to pay it.
  • Call CancelInvoice and end the subscription if the swap fails or times out.
  • When someone tries to pay as reported by SubscribeSingleInvoice, do our existing resolve hash routine and call SettleInvoice once we have the preimage.
  • Lnd needs to be built with the invoicesrpc flag to enable the hold invoices functionality.

You can work with an official release now: https://github.com/lightningnetwork/lnd/releases/tag/v0.6-beta @sangaman 鈿★笍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moshababo picture moshababo  路  5Comments

kilrau picture kilrau  路  4Comments

raladev picture raladev  路  4Comments

offerm picture offerm  路  6Comments

erkarl picture erkarl  路  6Comments