-
Notifications
You must be signed in to change notification settings - Fork 7
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
RGB payment workflow scenarious #25
Comments
The LN workflow is not completely clear to me.
Isn't the sender computing the route in the regular LN process? The receiver can include routing hints about private channels in the invoice to ease path finding, but IIRC the sender is the one constructing the onion. Moreover there is a liquidity issue: If Bob is the one opening a channel towards Alice or a hub, then all of his liquidity over LN will be outwards and he won't be able to receive a payment over LN unless someone opens a inbound channel or he performs some kind of rebalancing over the channel. I guess a reasonable initial workflow for a Alice -> Bob LN transaction (I tend to think about Alice as an exchange) can be:
For plain LN it's possible to include a first commitment transaction directly during channel creation, which would greatly reduce human interactivity; I would expect the same to be possible for RGB as well. |
It is, however the payee can provide routing hints and include them into LN invoice, so I put emphasize on this part here, especially b/c Bob (payee) needs to make sure that the route for the payment indeed exists
Good point
This will work |
I'm not sure Bob can ensure a path exists. He can provide a possible path, but whether that path contains enough liquidity has to be tested by trying to pay. Even if Bob was able to fake a payment trial to test for liquidity on the path, nobody can ensure that the situation of middleman channels will not change during the time needed for the "human" interaction between Alice and Bob. |
Note: look how this scenarios can be combined with LNURL |
Tradeoff comparison table for different RGB invoicing options:
|
Results of analytical call with @giacomozucco regarding this issue:
|
Scenarious
Design criteria:
Scenario details
Onchain payment, Alice -> Bob; Bob is a bitcoiner, but first-time RGB user:
1.1. Bob derives new master subkeys at
m/82'/0'/...
1.2a. Bob wallet generates an address with
m/82'/0'/0/N
encoded as normal bitcoin address1.3a. Bob sends to this address bitcoin payment (also from some other wallet) from his other output
1.4a. Bob generates payment invoice with blinded newly-created UTXO
-- if Bob do not need to keep privacy of his UTXO --
1.2b. Bob creates PSBT spending to the new address
1.3b. Bob makes PSBT-based RGB invoice
1.4b. Alice does the payment; tx includes (a) Alice change, (b) Bob tokens, (c) single-use-seal witness
1.5b. If single-use-seal witness happens to Bob's token output Bob will get tweaking factor from PSBT sent alongside consignment
1.6. Alice sends consignment to Bob; Bob awaits transaction mining and merges consignment to his stash
Onchain payment, Alice -> Bob; Bob is new to bitcoin
2.1. Bob creates seed and derives a new master subkeys at
m/82'/0'/...
2.2. Bob wallet generates an address with
m/82'/0'/0/N
encoded as normal bitcoin address2.3. Bob sends miniscript-based RGB invoice
2.4. Alice creates transaction paying some satoshis to Bob's output
2.5. If single-use-seal witness happens to Bob's token output Bob will get tweaking factor from PSBT sent alongside consignment
2.6. Alice sends consignment to Bob; Bob awaits transaction mining and merges consignment to his stash
Onchain payment, Alice -> Bob; Bob already has RGB tokens
3.1. Bob creates UTXO-based invoice with blinded output, which scriptPubkey contains public key derived from
m/82'/0'/...
... the rest is proceeded as usual ...
LN payment
4.1. Bob needs to ask Alice to establish a channel with him (Alice can be a payment hub/exchange)
4.2. (optionally) Bob computes route (normal LN process) to Alice providing her with routing hints
4.3. Bob generates LN RGB invoice - an extension to LN invoices with additional info on asset type
... payment proceed as usual for LN invoices ...
Bob needs to receive non-interactive, "anyone can pay" or repeated payments onchain (LN non-interactive and recurrent payments follow LN rules)
5.1. Bob derives a new master subkey branch under
m/82'/0'/...
5.2. Bob shares his miniscript-based RGB invoice containing xpubkey information
5.3. Alice does recurrent or non-interactive payments, allocating some satoshis for Bob's outputs in witness transactions. Consignment with all required information are sent to Bitforst server provided by Bob as a part of the invoice
Formats
Invoices
Data structures
The text was updated successfully, but these errors were encountered: