2

from my understanding lightning network is a side chain that keeps track all the transactions in the network and just send the sum of the transaction to each of their respective recipients. form that logic, there should still be a transaction data appear in blockchain info with a lot of inputs and a lot of outputs in the actual blockchain right representing all the transaction appear in the lightning netowork? if so can you give me an example of that by the tx_hash or link please? thanks

3

I am sorry to write so but your understanding that the lightning network is a side chain is wrong. Thus there is not transaction with many inputs and outputs that represents the payments tat go on in the lightning network.

A payment channel is encoded as a 2-2 multisig wallet. you have one key and I have one key. The capacity of the channel are the funds sent to this multisig wallet with the funding transaction. The balance in this payment channel is encoded by a commitment transaction which spends this funding transaction. This transaction has one input (the funding tx) and two outputs (one for the amount of funds that you own and one for the amounts of funds that I own). (There can and will be more outputs but those exist only temporarily while this channel is being used to rout a payment.)

The commitment transaction only hits the chain if the channel is closed and in the best case still has two outputs. Meanwhile on this channel literally million of payments could have taken place (between the peers of the channel, and to route payments through this channel for other nodes of the network) non of those payments will be seen in the blockchain.

The key observation of the lightning network is the revocable sequence maturity contract (RSMC) which is the protocol that allows to invalidate or revoke old commitment transaction by creating a strong incentive (I should better say penalty) to not publish an outdate commitment transaction.

since all the commitment transactions in the history of the payment channel are spending the fundingding transaction (creating massive double spends) and since double spends will not be accepted by the bitcoin network you can see that the blockchain will not save old channel state. This is exactly the reason who scaling through this offchain protocol is achieved.

  • No problem! i am pleased and thankful that you would answer my question in that depth of explanation! but that means when the channel is closed , The net transaction result by the peers in the channel will still be published in the blockchain right? – nicholas___ Aug 1 at 13:39
  • 1
    yes the net transaction by these two peers (which might have come from routing in the sense that these peers never actually paid each other but moved funds from another channel to that channel. As channels have different life times I am rather confident that it will be hard to calculate back which amounts really have been transacted between whom as a net sum) – Rene Pickhardt Aug 1 at 13:43
  • Awesome, i understand it better now thanks to you! Do you by any chance have an example of a transaction that appear in blockchain info? and so does this also means as "an outsider" there will be no particular factor that differentiate this transaction from a normal transaction with 1 input and 2 outputs ? – nicholas___ Aug 1 at 13:45
  • 1
    yes from the blockchain itself you cannot reliably detect former payment channels. you can find transactions easily by looking at the gossip protocol of the lightning network. channels have a short channel id which is blockheigt - transactions index - ouptut index. Check these two transactions for example: opening of the channel: c0ac6cfe15e0d0c921362ab9fad998a8a8e16cd8d9d4159487dd69141ea2b9b0 and the channel was force closed a couple minutes later due to an implementation bug e32135315ec147bb27f771b2e15c7178ea573afd16cd4970bf814c9b18bc46e3 – Rene Pickhardt Aug 1 at 13:56
  • Amazing! Thankyou! – nicholas___ Aug 1 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.