Payment channels are a means designed so that cryptocurrency users can carry out instant and low-cost transactions without negatively affecting the blockchain.
This need is motivated by the limitations of cryptocurrencies such as Bitcoin, and most of the cryptocurrencies in the system, in terms of their scalability in transactions per second and the total space of the blockchain. In this way, a payment channel allows many people to carry out a large number of transactions in the background, but only two transactions are recorded on the main blockchain.
Of course, when opening a payment channel, nodes must lock up user coins so that they cannot be used outside the channel for the life of the channel. This comes at a huge cost that makes it unattractive to keep pay channels open. But for this reason, payment channels are still a very effective way of providing great scalability to cryptocurrencies.
1) One-way: The simplest payment channel system is the one-way channel system. In this system, user A can make a payment B. A new user C can join the channel, and make a payment to D. In this way, the chain of payments in the channel can continue to expand.
These payments are controlled and secured by multi-signature transactions, so for them to be made, the parties involved must sign in accordance with the data shown in the inputs and outputs of the transaction. As the channel grows, the signatures in the system also grow and everyone must sign for the funds to be released.
Additionally, a LockTime of 50 blocks is applied, to prevent users from being able to use the money immediately, but on the contrary, the money will only be available after 50 blocks have been confirmed. At this point, you can view the LockTime as a check that is only valid after a certain date, before that date it's just worthless paper. The LockTime can be adjusted however the parties wish.
In this way, all participants can be sure that the payment has been made, but they will only receive the money after the additional conditions of the negotiation of that payment are met. For example, A paid B to fix a computer, and B has approximately 500 minutes to fix the computer. Otherwise, A can still intervene in the transaction, change its value, and get his money back.
2) Bidirectional: Bidirectional payment channels are actually two one-way channels working together. Thanks to this, A and B can send payments bidirectionally, without the need to close a previous channel and open a new channel for payment operations. The basic operation is maintained, with the exception that bidirectional channels are perfect for carrying out more dynamic operations between two users or entities.
1) They offer the ability to make payments instantly between the parties participating in the payment channel. But it also allows you to schedule payments, and make them more secure under certain conditions.
2) You can make micropayments, even send a few cryptos.
3) It allows transaction fees to be lowered, thanks to the fact that the payment of the on-chain confirmation fee is made among all the channel participants.
4) Enables the ability for businesses to receive payments in cryptocurrencies, leaving behind on-chain confirmation times, but without sacrificing security.
5) Under current payment channel specifications it is very difficult (if not impossible) to steal funds. This is because payment channel implementations use the multi-signature address scheme, where actions are only carried out if they carry signatures from all participants.
1) There is a limit to the number of transactions we can make with a payment channel
2) Funds to spend on a payment channel must be placed in advance. This means that if the channel runs out of money, it will be necessary to open a new one to carry out more operations.
3) There are still some security problems concerning the payment channels. Cases such as vulnerabilities in client and node codes for this type of system. Or even, vulnerabilities in the operating structure itself.