What is Lightning and what do you need it for?
The Lightning Network (“Lightning” for short) is a second-layer technology that is built on the Bitcoin blockchain and enables faster transactions with little to no fees.
Bitcoin is based on so-called blockchain technology. The blockchain ensures that all transactions are documented in a forgery-proof manner. A transaction is therefore only considered confirmed when it has been saved in a block. As a rule, however, a new block is only calculated every ~10 minutes, which immortalizes current transactions on the blockchain. For example, if you want to buy something with Bitcoin in a store, it would be impractical to have to wait 10 minutes until the transaction is confirmed. Bitcoin can also incur relatively high transaction fees. That's why the Lightning Network was created.
The Lightning Network
Lightning (named after the speed of lightning ⚡️) uses the Bitcoin network as a basic infrastructure and, based on this, creates its own network, consisting of countless payment channels (“channels”). A payment channel works in a similar way to a credit account with a retailer (e.g. Amazon). To do this, you have to create such a channel once using a Bitcoin transaction and can then use it until the credit on it is used up or the channel is closed. Transactions that are processed via a channel are, on the one hand, extremely fast (almost instant) and, on the other hand, very cheap.
It is also not necessary to set up a separate channel for each store, but it is sufficient to use existing channels from other users. Here is an example:
Store XY allows payment via Bitcoin via Lightning. Alice has an existing Lightning channel to store XY. Her friend Bob also wants to pay there with Bitcoin, but does not have a direct channel to shop XY open, but a channel to Alice. Bob can still pay at Shop XY via the channel to Alice. This creates a huge network of payment channels which can be used worldwide to process cheap and immediate payment transactions.
Lightning wallets usually create and close channels for users, so that Bitcoin payments can be easily carried out via Lightning.
Lightning Network Risks
The Lightning Network has now been tested millions of times and is generally considered to be very secure. However, in exceptional cases, there is a risk of transactions failing or channels being closed unilaterally and spontaneously, which can sometimes result in loss of the Bitcoin balance on them. We therefore recommend using the Lightning Network for smaller (possibly recurring) payments.