Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.33 KB

19.md

File metadata and controls

44 lines (33 loc) · 1.33 KB

LUD-19: Mutually discoverable pay and withdraw links.

author: akumaigorodski discussion: https://t.me/lnurl/12568


Merging "pay" and "withdraw" related to a same SERVICE in a WALLET

LNURL-pay may contain a withdrawLink in its JSON response and likewise LNURL-withdraw may contain a payLink in its JSON response. This is done to recognize a fact that SERVICE may want to allow both deposits and withdrawals to user account and make related links easily discoverable from each other.

When WALLET sees this it may store and show a compound item to user which would allow to both deposit and withdraw (and also to show an up-to-date SERVICE balance if LNURL-withdraw contains a balanceCheck field).

Modifications required in SERVICE JSON responses:

To the first callback of LNURL-pay:

 {
   callback: String,
   maxSendable: MilliSatoshi,
   minSendable: MilliSatoshi,
   metadata: String,
   tag: "payRequest",
+  withdrawLink: String,
 }

To the callback of LNURL-withdraw:

 {
   tag: "withdrawRequest",
   callback: String,
   k1: String,
   defaultDescription: String,
   minWithdrawable: Integer,
   maxWithdrawable: Integer,
   balanceCheck: String,
+  payLink: String,
 }

Both withdrawLink and payLink are raw URLs (not bech32-encoded).