As I found out explaining the lightning channel should start with explaining the unidirectional payment between two parties.
Alice wants to send money to Bob during nLock period (let’s say 30 days).
-
Alice puts 1 BTC from here address A into shared 2-2 address C she shares with Bob, and this transaction is put on the blockchain.
-
This address C on the blockchain contains a smart contract that returns* the funds to Alice after nLock period if a 2-2 transaction from it is not submitted to the blockchain within nLock period. For this transaction to be successful both Alice and Bob must sign it and it should be broadcasted.
*By returning the funds to Alice means that the address A that put the funds to it has now control over the funds?
-
Alice now pays Bob several times during following weeks. Each time she sends Bob a 2-2 transaction (with input as output from C) with her signature but with updates to the outputs: 0.9Alice-0.1Bob, 0.8Alice-0.2Bob, 0.6Alice-0.4Bob.
-
Each time he recieves a 2-2 transaction Bob can sign it and close the channel. Or he can wait for more transactions and sign it at the end of nLock period with latest transaction he received from Alice.
-
If he doesn’t send transaction to the blockchain he looses funds as 1BTC is return to Alice. He doesn’t have obligation towards Alice to close the channel prior to nLock, so Alice’s funds are effectively locked for that period.
Is this how lightning network unidirectional channel between two parties works?