Closed tnull closed 3 weeks ago
I see the source of the confusion here. Below I explain how I intended the spec to be read.
Section 3.1
lightning payments and 3.2 onchain payments
both describe state-changes.
If a client chooses to pay over lightning the rules in section 3.1
apply.
If a client chooses to pay on-chain the rules in section 3.2
apply.
3.1 Lightning payments
If the client paid with Lightning and the LSP failed to open the channel. In that case the LSP should refuse the payment and set the state to CANCELLED.
If the channel failed to open or the order expired or shortly before the payment times out:
MUST reject the payment.
MUST set the payment.state to CANCELLED.
3.2 Onchain payments
If the client paid onchain and the LSP failed to open the channel.
The LSP should refund the payment on refund_onchaiN_address
and set the state to REFUNDED
.
refund_onchain_address <LSPS0.onchain_address> Address where the LSP will send the funds if the order fails.
Client MAY omit this field.
LSP MUST disable on-chain payments if the client omits this field.
The LSP can only use the refund_onchain_address
if the client provided it.
Therefore, the LSP will not provide the onchain
payment method if the client failed to provide the field.
A client that intends to pay with Lightning can omit the refund_onchain_address
.
I see the source of the confusion here. Below I explain how I intended the spec to be read.
Yeah, in the latest spec call we discussed this for a while and also discovered that refund_onchain_address
is actually never mirrored back like all the other fields in create_order
response, which we read as a spec bug. We decided to add it (although in the payment: onchain
sub-dictionary) to fix this oversight, and clarify the expected behavior around failure handling in a few places. I believe @SeverinAlexB is working on a PR for this currently.
The current LSPS1 spec states in regards to
refund_onchain_address
:and
So, AFAICT the LSP is currently required to fulfill any refunds to the
refund_onchain_address
, even if it doesn't support on-chain payments in the first place.We need to clarify:
create_order
response is mandatory, or if the LSP is allowed to omit it if it doesn't support onchain payments.refund_onchain_address