Let's observe direct unidirectional lightning channel between Alice and Bob.
How does this start technically:
- They first create a 2-2 address C.
- They agree on the funds Alice will put into C, say 1BTC.
Bob makes a "conditional refund 2-2 transaction" that has 3 conditions:
a) if Alice put 1BTC into address C
b) if nLock time passed between the time she put money in
c) in no transaction was made from C and put on blockchain
then Alice gets 1BTC back from this address. He signs that transaction and sends to Alice. Alice can sign and broadcast this transaction after nLock time to retrieve her 1BTC if a) b) and c) are fulfilled.
- Alice now puts 1BTC into 2-2 address C.
EDIT: Can you confirm each step.
For example: Is step 2 needed, or can Bob in step 3 just say if nLock time passed and no transaction was put on blockchain from C, whoever put money in C gets its money back in full amount.