Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: n0nce on January 30, 2022, 04:05:33 AM



Title: Testing C-Lightning v0.10.2 Offers! [BOLT12]
Post by: n0nce on January 30, 2022, 04:05:33 AM
Has anyone of our Lightning node operators here tried BOLT12 Offers (https://bolt12.org/) yet?
I love this disclaimer: DO NOT GET AN OFFER TATTOO UNTIL SPEC IS FULLY RATIFIED!

If anyone wants to try it, I declare this the topic for that.. ;D

Quote from: myself lol
Short setup instruction:
[1] Edit your config file (if you followed my guide it's ~/.lightning/bitcoin/lightningd.conf).
Code:
vim lightningd.conf

[2] Add the following line anywhere really.
Code:
experimental-offers

[3] Restart Lightning
Code:
sudo service lightningd restart

Then go into RTL and toggle it on in Node Config >> Experimental >> Offers.
Now you can create an offer in Lightning >> Transactions >> Offers.

https://i.postimg.cc/rsSbN1Ts/image.png
Super easy with one click!

You can even export them and get a nice PDF looking something like what is shown in RTL's release files (https://github.com/Ride-The-Lightning/RTL/releases/tag/v0.12.0).
https://i.postimg.cc/N03pCKpH/image.png

(this is just an example from testnet and from RTL devs, not sure if the node is up or not - will post a real mainnet offer once I get more channels in place etc.)
https://user-images.githubusercontent.com/39208279/147711716-a91002e3-c8ba-46df-bafd-10448e9a91ed.png


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: Rath_ on January 30, 2022, 04:53:40 PM
Has anyone of our Lightning node operators here tried BOLT12 Offers (https://bolt12.org/) yet?

I actually enabled them a couple of days ago, but I didn't have a chance to test them out. I would appreciate if someone could try paying my offer. I will send the coins back.

Code:
lno1pgqpgrjjv96xsgzmddjhjum9dej9683qw0dq55jnjrpks4uyrcsg78fgjf6uwm4l5lk0me5hcm9lfu34kn6lqsywstlx90t55dk5z99fsq8lryq7ws67mx4xwkrwpelezux560yv302w9lslsjqas75y52yertt2t4r4y27amw9j284thc0s4p6m58h6y

https://i.imgur.com/76daUt0.jpg



Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: darkv0rt3x on February 02, 2022, 11:57:10 PM
Code:
lno1pqp3w80cpgdyymmvwscnyt25v4ehg6twvuk5y6t5vdhkjmj5v9kxk9qwgde8jur5xq6xudrjddxk74s7yrl0wa743fffmup287exw6gwpjgrxanm24wvr33cgjaj6dyc0z0eruzqaechkpmf2q0lqduptf7slqh5wq7g0n28k9d8plz27e24el60dhmedszgrkn020flxqvtuchxeq8hpvnd96344hah992ua2a30qhr69q

https://i.ibb.co/M8qJncf/image.png

If I receive any payment of this amount, I will return it!


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: Rath_ on February 03, 2022, 09:55:58 AM
If I receive any payment of this amount, I will return it!

Paid. I also received the 10 satoshis which you sent me yesterday through my offer. Feel free to deduct them from the refund payment.


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: darkv0rt3x on February 03, 2022, 09:51:38 PM
If I receive any payment of this amount, I will return it!

Paid. I also received the 10 satoshis which you sent me yesterday through my offer. Feel free to deduct them from the refund payment.

Reply to me with a new BOLT12 offer of a fixed amount of 1515 sats (forget the 10 sats).


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: Rath_ on February 04, 2022, 12:46:52 AM
Reply to me with a new BOLT12 offer of a fixed amount of 1515 sats (forget the 10 sats).

I will disable it once you pay it. Here you go:

Code:
lno1pqp3w80cpg09getdwphhyctj0ysx7enxv4ezqen0wgsxgctjddmrqun5xdupgrjjv96xsgzmddjhjum9dej9683qw0dq55jnjrpks4uyrcsg78fgjf6uwm4l5lk0me5hcm9lfu34kn6lqsqs6jevw9z0nhhr2pxvu6fpzaxvk0al52um3pp4j4c7shn5rhy6nueka0aug8h5lcudj0egp090mulku0kxes4998wtwfvsxf7ycgndw

Why don't you reuse my previous offer, though? I made sure that anyone can request an invoice with any amount using it.


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: WhyFhy on February 04, 2022, 04:27:25 AM

 I find it fascinating how someone so new to the community has contributed so much , you also tread like you've been here 10 years!  Keep up the good work!

@microlancer


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: darkv0rt3x on February 04, 2022, 10:23:36 PM
Reply to me with a new BOLT12 offer of a fixed amount of 1515 sats (forget the 10 sats).

I will disable it once you pay it. Here you go:

Code:
lno1pqp3w80cpg09getdwphhyctj0ysx7enxv4ezqen0wgsxgctjddmrqun5xdupgrjjv96xsgzmddjhjum9dej9683qw0dq55jnjrpks4uyrcsg78fgjf6uwm4l5lk0me5hcm9lfu34kn6lqsqs6jevw9z0nhhr2pxvu6fpzaxvk0al52um3pp4j4c7shn5rhy6nueka0aug8h5lcudj0egp090mulku0kxes4998wtwfvsxf7ycgndw

Why don't you reuse my previous offer, though? I made sure that anyone can request an invoice with any amount using it.

Indeed. I don't know why I didn't think of it. lol


Edited;
Payment returned!


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: n0nce on February 20, 2022, 11:49:37 AM
Finally I got around to generating an offer as well, looks like you guys are having fun! :D
https://i.postimg.cc/qqDq7zM4/image.png
Code:
lno1pgyhgetnwss8getnws2q2m3sde3k283q2lpjlt6ze9es9je8c5xdxzcry7yz5flpwcnq84lxx2pcvu5v36hlqsyt78v7gcwx7az9aanft87whfedvey8gvm68f9uygrypnwe5r4578el5tlxznasdp8rjql9ulavwyadpxnmaeh9v0l4xc5lvq3qqrurq

Of course will also send anything right back; preferably using one of your offer codes posted in here (that's what they're made for; reusability & statically receiving sats without interaction from the 'receiver' :)).


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: Rath_ on February 24, 2022, 10:14:57 PM
Code:
lno1pgyhgetnwss8getnws2q2m3sde3k283q2lpjlt6ze9es9je8c5xdxzcry7yz5flpwcnq84lxx2pcvu5v36hlqsyt78v7gcwx7az9aanft87whfedvey8gvm68f9uygrypnwe5r4578el5tlxznasdp8rjql9ulavwyadpxnmaeh9v0l4xc5lvq3qqrurq

Of course will also send anything right back; preferably using one of your offer codes posted in here (that's what they're made for; reusability & statically receiving sats without interaction from the 'receiver' :)).

Your offer seems to be working fine as my node can fetch an invoice, but I can't find a route to you. I have already tried sending as little as 1 satoshi with no luck.


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: n0nce on February 24, 2022, 10:30:18 PM
Your offer seems to be working fine as my node can fetch an invoice, but I can't find a route to you. I have already tried sending as little as 1 satoshi with no luck.
Hey Rath, thanks a lot for trying! It's really good to know that I'm apparently unreachable or at least not well reachable. I just opened a new channel with good inbound liquidity; maybe retry tomorrow or whenever that's locked in, if you wish.

Edit: @Rath_ got the new channel on-chain now!


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: Rath_ on February 25, 2022, 08:50:37 AM
Hey Rath, thanks a lot for trying! It's really good to know that I'm apparently unreachable or at least not well reachable. I just opened a new channel with good inbound liquidity; maybe retry tomorrow or whenever that's locked in, if you wish.

Edit: @Rath_ got the new channel on-chain now!

I was able to send 1 satoshi through your offer, but 100 and 1000 satoshi payments still fail. Well... if you're interested, we can open a dual-funded channel ;) It seems that either my or your node is underconnected or lacks liquidity.


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: n0nce on February 25, 2022, 10:18:49 AM
I was able to send 1 satoshi through your offer, but 100 and 1000 satoshi payments still fail. Well... if you're interested, we can open a dual-funded channel ;) It seems that either my or your node is underconnected or lacks liquidity.
Wow, that's a little bit anticlimactic. ;D Yes, we can. I will PM you later!


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: BlackHatCoiner on August 25, 2022, 12:35:37 PM
https://i.ibb.co/sshbnBd/canvas.png
Code:
lno1pqpsrp4qpgj5ymrpvd45sct5gdhkjmn9wgsxsetjv5hzq3mfd4kk2grndakk2grnv968xts5zpxxjemgw3hxjmn8yptx7un5v4upugxdxggs23m9gyepslcgugtmyr3uu605nhl4zxw62kt6ts8c5tr6tmcyqdl8f49namw5l3ep2e5rcf56c8dajx02l7r5k62wkxn920s499vwcgc3j2qx0ylkzyuhdvphemrts6ew8lghmk9gs787lr26xmuu4nns

Someone help me test it. Thanks. Once I receive the hundred sats, I return them back.


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: Rath_ on August 25, 2022, 12:41:34 PM
Someone help me test it. Thanks. Once I receive the hundred sats, I return them back.

Paid. You can send back the coins either via keysend or my offer which I posted in my first post. Is your offer a single-use one?


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: BlackHatCoiner on August 25, 2022, 12:55:19 PM
You can send back the coins either via keysend
Don't know what's that yet, so I sent them via offer. Thanks.

Is your offer a single-use one?
No.

Can you send me more than 100 sats with the given offer or do I have to generate another one?

Edit: Sent you 150 sats with keysend. You can send them back if you want.


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: n0nce on August 25, 2022, 02:54:20 PM
Someone help me test it. Thanks. Once I receive the hundred sats, I return them back.
Worked fine for me! :)

Can you send me more than 100 sats with the given offer or do I have to generate another one?
This offer is fixed to 100 sats. So you would have to generate one with higher amount or without amount, so the sender can specify.

https://i.postimg.cc/0NyqmHSR/image.png


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: BlackHatCoiner on August 25, 2022, 03:07:53 PM
Received and sent back with keysend!


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: n0nce on August 25, 2022, 03:29:34 PM
Received and sent back with keysend!
Great, I think this was my first keysend transfer actually! It feels unfamiliar doing Lightning transfers without invoices / interaction, but also super practical and cool!
Now we just have to let people know that they can use this e.g. to easily receive donations privately. So much better than needing to set up or even develop a dynamic website that has a connection to your node and fetches a new invoice every time.
Not to speak of increased security by not having to expose the node more to the internet.


Title: Re: Testing C-Lightning v0.10.2 Offers!
Post by: BlackHatCoiner on August 25, 2022, 04:53:10 PM
Great, I think this was my first keysend transfer actually! It feels unfamiliar doing Lightning transfers without invoices / interaction, but also super practical and cool!
It does come with some drawbacks (https://github.com/lightning/blips/blob/master/blip-0003.md#keysend-drawbacks), even though I understand none of them. "Inability for the payee to specify their preferred min_final_cltv_expiry"; why is true for keysend and not for invoice? "Loss of being able to use the preimage and invoice signature as proof-of-payment"; again, which part is different and I don't get the pre-image? Isn't it a core part of Lightning to get the pre-image? Isn't there a payment hash involved?

One drawback I expected to see but didn't is privacy. To send with keysend, you need to reveal your node's public key. With invoices, that's not necessary.


Title: Re: Testing C-Lightning v0.10.2 Offers! [BOLT12]
Post by: Rath_ on August 26, 2022, 08:12:31 PM
To send with keysend, you need to reveal your node's public key. With invoices, that's not necessary.

Do you need to, though? At what point do you have to reveal it as the sender?

"Loss of being able to use the preimage and invoice signature as proof-of-payment"; again, which part is different and I don't get the pre-image? Isn't it a core part of Lightning to get the pre-image? Isn't there a payment hash involved?

A payment secret and its hash are involved in the process in both cases. Here's the difference:

1) Invoice: A payee generates a payment secret and makes a hash of it. They put the hash in an invoice.
2) Keysend: A payer generates a payment secret and makes a hash of it. They construct an onion routing packet which includes encrypted routing instructions for each hop. The payee learns the secret once they decrypt their instructions.

The end goal is the same: the payment hash is used by all intermediary hops. The payee reveals the secret first. There is no security risk here - the payer can't steal any funds even if they generate the secret. I can elaborate on that if you are interested :)

The reason why the payment secret can't be used as a proof-of-payment in the latter case is that the person who tries to use it as a proof is also the person who generated it. Not a convincing proof, right?


Title: Re: Testing C-Lightning v0.10.2 Offers! [BOLT12]
Post by: n0nce on August 27, 2022, 08:52:31 PM
To send with keysend, you need to reveal your node's public key. With invoices, that's not necessary.
Do you need to, though? At what point do you have to reveal it as the sender?
The receiver needs to reveal it! :D The only reason I know BlackHatCoiner's public key is because we considered opening a channel. There's no way to do keysend without revealing node ID.
Meaning if I just want to receive donations non-interactively for instance, people will know how many channels I have, with whom and how large.
In my opinion, spontaneous keysend payments are practical to transact with direct peers whose node ID you already know, but for anything else I prefer BOLT12 offers.


Title: Re: Testing C-Lightning v0.10.2 Offers! [BOLT12]
Post by: Rath_ on August 30, 2022, 08:32:16 AM
The receiver needs to reveal it! :D The only reason I know BlackHatCoiner's public key is because we considered opening a channel. There's no way to do keysend without revealing node ID.

The receiver needs to reveal their node id in an invoice (https://github.com/lightning/bolts/blob/master/11-payment-encoding.md#tagged-fields) as well. If the node id is not provided directly, it is recovered from a signature which proves that the invoice has not been modified by any malicious third-party.

Also, it looks like c-lightning doesn't support blinded paths for BOLT 12 offers yet. Run the following command:

lightning-cli decode [any BOLT12 offer]

You will see that your node id is encoded in the offer.