Comment by almkglor on 02/12/2017 at 16:25 UTC

2 upvotes, 0 direct replies (showing 0)

View submission: Okay, question about bidirectional channels via Lightning Network...

The video you are watching may be obsolete. Lightning does not use locktime transactions in the manner you describe; such locktime transactions have the problems you point out.

Lightning uses Poon-Dryja payment channels, which are more complicated but have more reasonably requirements on time, as well as not imposing a maximum number of state transitions.

Each state's transaction is a "revocable" transaction. I'll try to break it down below:

Each state transaction has two versions, one for Alice, the other for Bob. Alice's version encumbers her output, but not Bob's output. Bob's version encumbers his output, but not Alice's. The two transactions are symmetrical.

On Alice's version, Alice's output is revocable, and uses a hashlocked, relative-timelocked output. The hashlock means, if Bob knows a particular secret, Bob can show that secret and his signature to get that output. The relative timelock means, after some time that the state transaction is confirmed (2-3 days, depends on your channel's setting), Alice can get the funds if Bob hasn't revealed the secret yet.

Alice's transaction is initially in an "unrevoked" state. What that means is that the secret above is known only to Alice. This means that in the unrevoked state, Alice's output is completely hers (Bob can't claim it because he doesn't know the secret, Alice just has to wait out the timelock).

When a new state is created and the existing Alice's transaction has to be replaced by a new Alice's transaction, Alice makes it "revoked" by simply sending the secret to Bob. So if Alice tries to use her older state transaction where she has more money on the channel, Bob has a few days to claim Alice's output (since he now knows the secret). Since the other output is entirely Bob's, and Alice's output is revoked and can be claimed earlier by Bob, it simply means that Bob gets the entire channel outputs if Alice tries to use old state and Bob gets online within the few day's window.

Bob's version of the transaction is symmetrical, so you can swap Alice<->Bob in the above description.

In case, both Alice and Bob agree to close the channel, they can simply create an amicable bilateral close transaction that allocates the channel in the correct split, with not encumberances. This has the major advantage that neither side has to wait for the few days needed to unencumber their output.

Poon-Dryja channels like what I describe have the advantage of requiring less trust than the timelocked versions.

Replies

There's nothing here!