Payment channels network serve the same purpose as the side chains on the scalability front, but fundamentally both are very different. Just like side chains, they push the transactions off the main chain to prevent the main blockchain from being bloated. However, unlike sidechains, they don’t require a separate blockchain to function.
Payment channels use smart contracts to enable users to transact without publishing their transactions on the blockchain. The versatility of this says the user does not share the direct payment channel and route the transactions through intermediaries for a nominal fee.
How does the payment channels network work?
To understand the working of the Payment channels network, let’s assume an example of two friends Alfa and Beta. They both deposit coins in a joint address they own, which is a multi-signature address. Multi-signature addresses require both parties to sign for the funds to spend. Basically, it means funds cannot be moved out without the consent of both.
Suppose each of them has 10BTC, i.e. a total of 20 BTC on the address. Now Alfa sends 5 BTC to Beta and again sends a BTC. These transactions are available on their balance sheet, but they could have created a transaction and broadcasted it.
Alfa and Beta could have recorded hundreds of transactions but as far as the main blockchain is concerned they have performed only two operations namely – the initial and the final balances.
Apart from these two transactions all others are free and occurred off-chain.
Limitations of Payment Channel Scaling
The example discussed above needs both parties to cooperate for a transaction. Processing for payment channel network scaling with an unknown can be risky as the chances of getting cheated would increase. As it is not an ideal situation in the case of strangers.
However, some special mechanisms are developed to punish any attempt to cheat. So that the parties can directly and safely interact with each other without depending upon the trust factor.
Payment channels network is convenient for two parties that anticipate a high volume of transactions between them.
Another central challenge in PCN is the selection of routes for making a transaction.
Let’s illustrate it using diagrams
Suppose we have two nodes transacting at approximately equal rates and connected via two paths or routes. Fig (a). One path consists of transactions directly between Cluster A and Cluster B. The shortest path between both the clusters is C. i.e. the whole traffic will be diverted to the path C and the other path i.e. edge a and edge b remains underutilized.
Another limitation of the payment channel network is that it becomes imbalanced once the transaction rate is higher in one direction than another. The party making the transaction has to refill the funds through on-chain transactions once they run out of funds.
Refer to Fig (b) the imbalance channels in which all the traffic is shown on edge b while edge a has no transaction available thereby causing funds to flow in one direction and leading to the problem of imbalanced channels.