Subject: Re: [bitcoin-dev] What Lightning Is

From: Anthony Towns <[email-masked]>
Date: Tue, 11 Aug 2015 05:19:01 +0800

On Tue, Aug 11, 2015 at 05:02:40AM +0800, Anthony Towns wrote:
> On Sun, Aug 09, 2015 at 06:44:08PM -0400, Gavin Andresen via bitcoin-dev wrote:
> > I'd love to see somebody write up a higher-level description of what the
> > user experience is like, what communication happens underneath, and what
> > new pieces of infrastructure need to get built to make it all work.
> > 
> > A use-case to start with:
> > 
> > A customer starts with eleven on-chain bitcoin. They want to pay for a nice
> > cup of tea.

Sigh, kanzure on irc points out I misread this -- I read "on-channel"
not "on-chain".

In that case, I think the answer is "the customer doesn't pay for tea
via lightning". They have to setup a channel with someone first, and
to do that, they'll need a "sufficiently confirmed" anchor transaction,
and I don't think zero confirmations would be enough for that.

So:

 -1 "Oh, how did that guy pay for tea with his phone? That's cool!"
    "Scan the QR code, yeah, where the lightning logo is"
    "Cool, I'll try it tomorrow"

 0 go home, "open a lightning channel", sleep, look forward to getting
   tea tomorrow

For step 0, I guess it's:

 0.1 "Choose a hub to connect to" (could be randomly selected)
 0.2 "Choose an amount to fund the channel" (0.5 btc would be a lot)
 0.3 "Are you sure?"
 0.4 [wait briefly while counterparty signs]
 0.5 [wait for 10 confirmations?]

I don't think it's at all clear how 0.1 works in practice yet -- routing
has barely been spitballed, and without knowing how routing works, it's
hard to say who to connect to.

Hard to say how much to put in in step 0.2 too -- if it takes a while to
refresh funds in a channel (you have to do a blockchain txn eg), then
that you should put more in; if you have multiple channels for whatever
reason, maybe you can put less in each.

The "Are you sure?" might require some legal T&Cs in practice.

You need to have some realtime communication with your channel
counterpary when creating the anchor; but that should be fairly quick.
You also need to establish some random numbers and keys, but those could
be done in advance.

I think you (or your counterparty) will want to wait for a few
confirmations before your channel is actually usable. So I think it'll
take over an hour for a channel to be "open" in even the best case.

Cheers,
aj