Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API feature request: return preImage for intraLedger settlement #3735

Closed
openoms opened this issue Dec 20, 2023 · 1 comment
Closed

API feature request: return preImage for intraLedger settlement #3735

openoms opened this issue Dec 20, 2023 · 1 comment

Comments

@openoms
Copy link
Collaborator

openoms commented Dec 20, 2023

Currently the preImage is only returned in case the invoice is paid over LN:

mutation LnInvoicePaymentSend($input: LnInvoicePaymentInput!) {
  lnInvoicePaymentSend(input: $input) {
    errors {
      message
    }
    status
    transaction {
      settlementVia {
        ... on SettlementViaLn {
          preImage
        }
        ... on SettlementViaIntraLedger {
          counterPartyUsername
          counterPartyWalletId
        }
      }
    }
  }
}

Discussed in detail in: getAlby/lightning-browser-extension#2946

If the Galoy connector doesn't reliably return preimages for WebLN it will break quite some apps that follow the current WebLN spec and possibly would force them to handle those special cases (for intraledger payments) which is clearly not how WebLN is intended to work.

Would also be required to be able to obtain a proof of payment when paying another user on the same backend.

Update with the BTCPayServer plugin:
as the BTCPayServer instance shows the receipt online (with the preImage in it's database from the invoice creation) it provides the preImage as the payment proof regardless if the payment was settled intraledger. Example of an invoice paid to the BTCPay Blink plugin from Blink:
image

@openoms
Copy link
Collaborator Author

openoms commented Jan 18, 2024

Thank you for the fix, the preimage is now returned for intraledger payments.

Opened a PR to Alby to implement this: getAlby/lightning-browser-extension#2997

@openoms openoms closed this as completed Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant