Re: instant web payments via the lightning network

Well consider yourself lucky Andrew, because it's written in TypeScript!

I'm looking forward to integrating with whatever shakes out of the W3C
payments standard, but I still think even with it, WebLN has a place in
applications. I spoke to this a bit in an issue Rene had posted on the
repo[1] but I'll reiterate a bit here.

1. Web payments are structured around more traditional large one-time
payments for things like physical goods. One of the things I like so much
about Lightning is the idea of more passive, thoughtless micro payments. I
don't think that the standard or client implementations will make that a
first class use case.
2. The spec considers creating new payment methods "out of scope"[2], which
says to me that it'll be a long while before chrome extensions (e.g. Joule)
can add a payment method to the browser. So it'll be at the whims of the
browser vendors to implement Lightning (which I find unlikely), or someone
will need to fork a browser that has it built in.
3. Lightning has more going for it than just payments. Invoices to receive
payments and proof of identity (by providing an invoice or a signed
message) are interesting tools that come with running a node that I think
can make for interesting user experiences. I don't see anything like that
making it into a W3C spec any time soon.

All that said, I'm looking to build on top of these standards, and not
consider WebLN a full-on replacement for these. I plan on making Joule work
with W3C payments when they provide a way for me to add a payment method,
and I'm looking into some ways of using 402 response codes to indicate
gated content.

[1] https://github.com/wbobeirne/webln/issues/1
[2] https://w3c.github.io/payment-request/#goals

On Thu, Mar 28, 2019 at 4:32 AM Andrew Bransford Brown <andrewbb@gmail.com>
wrote:

> I do not trust anything written in JavaScript.
>
> On Thu, Mar 28, 2019 at 2:23 PM Melvin Carvalho <melvincarvalho@gmail.com>
> wrote:
>
>> This new work looks promising
>>
>> https://github.com/wbobeirne/webln
>>
>> cc wboberine -- tl;dr some of us are hoping to try and get some
>> standardization work going in the w3c payments group around the lightning
>> network -- any interest?
>>
>> On Mon, 4 Mar 2019 at 11:52, Andrew Bransford Brown <andrewbb@gmail.com>
>> wrote:
>>
>>> Good idea.
>>>
>>> On Mon, Mar 4, 2019 at 3:16 PM Melvin Carvalho <melvincarvalho@gmail.com>
>>> wrote:
>>>
>>>>
>>>>
>>>> On Sat, 19 Jan 2019 at 18:44, Melvin Carvalho <melvincarvalho@gmail.com>
>>>> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Sat, 19 Jan 2019 at 18:30, Melvin Carvalho <
>>>>> melvincarvalho@gmail.com> wrote:
>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, 17 Jan 2019 at 18:24, Michael Bumann <hello@michaelbumann.com>
>>>>>> wrote:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>>>>>>> On Monday, January 14, 2019 11:50 AM, Melvin Carvalho <
>>>>>>> melvincarvalho@gmail.com> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Mon, 14 Jan 2019 at 11:30, Michael Bumann <
>>>>>>> hello@michaelbumann.com> wrote:
>>>>>>>
>>>>>>>> Hi Melvin,
>>>>>>>>
>>>>>>>> yeah, I've been experimenting with the Bitcoin lightning network
>>>>>>>> for a while and I am pretty excited about the state and how easy it is to
>>>>>>>> build on top of it.
>>>>>>>>
>>>>>>>
>>>>>>> Hi, Great!
>>>>>>>
>>>>>>> Funnily enough I was just reading your page, and realized it was you
>>>>>>> :
>>>>>>>
>>>>>>> Tim did actually a while back ask me to interact with this group
>>>>>>> regarding http 402.  Some work has been done on that, including by me, and
>>>>>>> it would be great to compare notes at some point.  Or maybe flesh out use
>>>>>>> cases.
>>>>>>>
>>>>>>>
>>>>>>> I got a bit lost in the different efforts around this topic. And
>>>>>>> some seemed to me rather complicated (e.g. including standards for
>>>>>>> providing invoice/shipping details)
>>>>>>>
>>>>>>> I'd love to see and online equivalent of handing a coin to the
>>>>>>> newspaper person and getting some content in return.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> Did you see/use lightning browser extension "joule"[1]?  It brings
>>>>>>>> lightning payments to the browser - and there has been some discussion
>>>>>>>> around supporting web payment standards - maybe somebody familiar can help?
>>>>>>>>
>>>>>>>
>>>>>>> I have it installed, but dont fully understand the fine details.
>>>>>>> When my casa node arrives I'll be able to try it out with my own node.  But
>>>>>>> I might set up a raspblitz while I wait.
>>>>>>>
>>>>>>>
>>>>>>> Let me know if you want to set it up on a server. I am happy to help,
>>>>>>>
>>>>>>>
>>>>>>> I was lead to your blog post from :
>>>>>>>
>>>>>>> https://github.com/wbobeirne/joule-extension/issues/46
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> I am wondering how to make it easier for content providers to
>>>>>>>> integrate LN payments and also experimented with lightning payments for API
>>>>>>>> requests [2].
>>>>>>>>
>>>>>>>
>>>>>>> I have written in the past working code for pay walls, with a dance
>>>>>>> around http 402, and in fact that's my current use case.
>>>>>>>
>>>>>>> Do you think some areas of this work flow would benefit from
>>>>>>> standardization?
>>>>>>>
>>>>>>>
>>>>>>> as mentioned above I am not super aware of the current
>>>>>>> standardization efforts and I ignored it because of simplicity with my
>>>>>>> experiments.
>>>>>>> I think also joule ignored it for that reason.
>>>>>>>
>>>>>>> But yeah this must use some standard. Does anyone know how this
>>>>>>> could fit into the current efforts?
>>>>>>>
>>>>>>
>>>>>> How about this simple pay wall user story for proof of concept?
>>>>>>
>>>>>> User Story
>>>>>> <#m_4118734686060785173_m_3731727939658195170_m_6562303847656748069_m_1728713327420995450_m_-5517546107507471064_m_8143054714546802283_user-story>
>>>>>>
>>>>>> As a teacher, Alice wishes to make her educational notes available to
>>>>>> fellow teachers. Having put a great deal of effort into it, she would wish
>>>>>> to get access to different notes from other teachers in return, or put up a
>>>>>> pay wall for new teachers that have not yet prepared notes. Alice will set
>>>>>> the price of access, and a license indicating it is not to be shared
>>>>>> further. Bob, having obtained some credits on Alice's system purchases the
>>>>>> notes, and starts working on his own presentations, which he would like to
>>>>>> share in a similar way
>>>>>>
>>>>>>
>>>>>> Process
>>>>>> <#m_4118734686060785173_m_3731727939658195170_m_6562303847656748069_m_1728713327420995450_m_-5517546107507471064_m_8143054714546802283_process>
>>>>>> Bob's attempts to access the URI, and receives a response, HTTP 402 -
>>>>>> Payment Required.
>>>>>>
>>>>>> Also returned is a lightning network invoice in an HTTP header.
>>>>>>
>>>>>> Bob pays the invoice, then Alice allows access to the article
>>>>>>
>>>>>
>>>>>
>>>>> Request
>>>>>
>>>>> HTTP GET paywall.org/article.html
>>>>>
>>>>> Response
>>>>>
>>>>> HTP 402
>>>>> X-Lightning-Invoice : ln74894yiy...
>>>>> Updates-Via : wss://paywall.org
>>>>>
>>>>> Maybe another header for the type of paywall?  ie lightning mainnet.
>>>>> The updates-via can be used to tell the user agent that the page is ready
>>>>> to refresh.
>>>>>
>>>>
>>>> Someone (aka basti) pointed me to the following doc saying X- headers
>>>> are no longer a best practice
>>>>
>>>> https://tools.ietf.org/html/rfc6648
>>>>
>>>> So perhaps we can standardize around the ln- prefix for example
>>>>
>>>> ln-invoice
>>>> ln-grpc
>>>> ln-foo
>>>> ln-bar
>>>>
>>>> etc. ?
>>>>
>>>>
>>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> With solid it's possible to access control content, and give back a
>>>>>>> 4xx.  We dont yet return 402s but I've custom hacked a server to do that.
>>>>>>> I'm not quite sure how a server will be able to know to send a 402.
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> [1]https://lightningjoule.com/
>>>>>>>> [2]
>>>>>>>> http://michaelbumann.com/post/180389589277/bitcoin-lightning-machine-to-machine-api-payments
>>>>>>>> [2] https://github.com/bumi/ln-markdown-to-pdf
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>>>>>>>> On Saturday, January 12, 2019 6:04 PM, Melvin Carvalho <
>>>>>>>> melvincarvalho@gmail.com> wrote:
>>>>>>>>
>>>>>>>> > I am curious if any of this group is interested in the lightning
>>>>>>>> network [1].
>>>>>>>> >
>>>>>>>> > For those that are unaware, it is a system built on top of block
>>>>>>>> chains that allow zero cost instant payments in a zero trust environment.
>>>>>>>> >
>>>>>>>> > There has been lots of innovation already this year, and it seems
>>>>>>>> to be growing fast.  One service that impressed me is a custodial service
>>>>>>>> built on top of twitter that allows you to add a tip jar based on your
>>>>>>>> twitter account.
>>>>>>>> >
>>>>>>>> > https://tippin.me/
>>>>>>>> >
>>>>>>>> > This is a really easy way for non technical people to experience
>>>>>>>> web payments and bitcoin in the browser, without the overhead of a high
>>>>>>>> technical barrier to entry, or downloading a wallet.
>>>>>>>> >
>>>>>>>> > Additionally I have added this to my sollid profile using the the
>>>>>>>> foaf : tipjar predicate that has been around for about a decade but never
>>>>>>>> really used.  The I have added it looks as follows :
>>>>>>>> >
>>>>>>>> > In turtle :
>>>>>>>> >
>>>>>>>> > </#me> <http://xmlns.com/foaf/0.1/tipjar> <
>>>>>>>> https://tippin.me/@melvincarvalho> .
>>>>>>>> >
>>>>>>>> > In RDFa :
>>>>>>>> >
>>>>>>>> > <a target="_blank" rel="http://xmlns.com/foaf/0.1/tipjar" href="
>>>>>>>> https://tippin.me/@melvincarvalho">
>>>>>>>> https://tippin.me/@melvincarvalho</a>
>>>>>>>> >
>>>>>>>> > There are also new solutions such as a mobile wallet that
>>>>>>>> receives payments (blue wallet), decentralized apps (Lapps) and ability to
>>>>>>>> run your own node eg on a raspberry pi.
>>>>>>>> >
>>>>>>>> > If anyone is playing around in this space would love to hear from
>>>>>>>> you, or if you'd like to get started and have, say a tippin me account, I'd
>>>>>>>> be happy to send some satoshis (the unit of currency) to play around with.
>>>>>>>> >
>>>>>>>> > I think this brings forth an exciting new era of instant payments
>>>>>>>> in the browser.  Would love to hear from anyone else that is interested in
>>>>>>>> this tech.
>>>>>>>> >
>>>>>>>> > [1] http://lightning.network
>>>>>>>>
>>>>>>>
>>>>>>>

Received on Thursday, 28 March 2019 20:47:36 UTC