Frankly, I don't understand, how channels of indefinite duration could be created without SegWit or SIGHASH_NOINPUT or another possible patch, which makes txid independent on signatures. Explanation appreciated.
You could have both sides put down a deposit agreeing to fix any mutation of the transaction.
Step 1HA1 is Alice's hash lock and HB1 is Bob's hash lock.
TX1:
0) Pays 3x: (Alice + HA1 after 1 week) or (Bob after 2 weeks) or (2 of 2 Alice + Bob)
1) Pays x: (HB1 + Alice) or (2 of 2 Alice + Bob)
2) Pays x: (HA1 + Bob) or (2 of 2 Alice + Bob)
3) Pays 3x: (Bob + HB1 after 1 week) or (Alice after 2 weeks) or (2 of 2 Alice + Bob)
4) Pays Alice's change: (Alice)
5) Pays Bob's change: (Bob)
Alice and Bob create TX1, sign the transaction and broadcast it.
Abort after step 1Alice can wait a week and then reclaim output 0. This automatically gives Bob HA1, which allows him claim output 2.
Likewise, Bob can wait a week and then reclaim output 3. This automatically gives Alice HB1, which allows her claim output 1.
This is a full refund all parties.
If Alice refuses to claim output 0, then Bob can claim it after 2 weeks (and output 3), which gives him 6x and Alice nothing.
Therefore both parties are incentivized to comply with the abort at this stage.
Step 2Alice and Bob create the initial channel state transaction. This supports a channel close that gives x to Alice and x to Bob and spends outputs 1 and 2.
The initial state transaction is actually different for Bob and Alice due to the way Lightning works. The trick is that only Alice has both signatures for her version and only Bob has both signatures for his version.
Step 2aAlice signs Bob's version of the transaction and sends the signature to Bob.
Abort after step 2aIf Bob broadcasts his initial state transaction, then that counts as him closing the channel. Alice gets her x refund and then can reclaim output 0 (after 1 week).
If he doesn't broadcast it, then she can just follow the same abort procedure from step 1.
Bob can abort using the procedure from step 1.
Step 2bBob signs Alice's version of the transaction and sends the signature to Alice.
Abort after step 2b Alice can simply close the channel so that both get x each from outputs 1 and 2.
Once the channel is closed, she can then claim output 0 safely.
Likewise, Bob gets x when the channel is closed (he can close it himself too) and then claims output 3 safely.
This gives both parties a full refund.
Step 3Alice and Bob create a transaction which sends outputs 0 and 3 back to them. This requires both outputs to be 2 of 2 signed (so 2 signatures each).
This transaction is broadcast. If either party refuses to sign, then it counts as an abort after step 2b.
Once step 3 is finished, they now have established an initial lightning channel state with unlimited duration.
It is important that neither reveal their hash lock as that allows the other to spend the funding output.