Bitcoin Lightning Network Simply Explained
For most people interested in development of cryptocurrency economy and other blockchain-based systems, the top most Lightning Network is a "second layer" payment protocol that operates on top of a blockchain (most commonly Bitcoin). It features a peer-to-peer system for making micropayments of digital cryptocurrency through a network of bidirectional payment channels without delegating custody of funds. Routing through an idealized mesh network of payment channels.
Lightning is a decentralized network using smart contract functionality in the blockchain to enable instant payments across a network of participants. It works by using real Bitcoin/blockchain transactions and using its native smart-contract scripting language, it is possible to create a secure network of participants which are able to transact at high volume and high speed.
The specification for the commercial varieties of the lightning network is available on Github, and its largest contributor is Rusty Russell of Blockstream. On March 20, 2018 Lightning Network nodes faced a Distributed Denial of Service (DDoS) attack that sent around 200 nodes offline, down from around 1,050 to 870. The exploit used as many node connections as possible to prevent any new connections.
To be able to construct secure transfers using a network of channels across multiple hops to the final destination requires an additional construction, a Hashed Timelock Contract (HTLC).
Lightning Network Work
As we made very simple steps for all,
1. Customer and Merchant creates the Payment processors/channel.
2. As the transaction completes the Balance sheet is produces which is stored in the payment processor blockchain.
3. New transaction begins the new balance sheet is produced but the previous balance sheet is disappeared.
4. If other customer is added then no need to create another payment/channel, it can excess through first customer payment/channel only. This is advantage which reduced lot of time.
5. Transaction time is 7sec major advantage in blockchain.
Due to the nature of the Lightning Network's dispute mechanism which requires all users to watch the blockchain constantly for fraud, the concept of a "watchtower" has been developed, where trust can be outsourced to watchtower nodes to monitor for fraud.
The primary risks relate to timelock expiration. Additionally, for core nodes and possibly some merchants to be able to route funds, the keys must be held online for lower latency. However, end-users and nodes are able to keep their private keys firewalled off in cold storage.
Transactions for the Future
Instant Payments: Lightning-fast blockchain payments without worrying about block confirmation times. Security is enforced by blockchain smart-contracts without creating a on-blockchain transaction for individual payments. Payment speed measured in milliseconds to seconds.
Scalability: Capable of millions to billions of transactions per second across the network. Capacity blows away legacy payment rails by many orders of magnitude. Attaching payment per action/click is now possible without custodians.
Low Cost: By transacting and settling off-blockchain, the Lightning Network allows for exceptionally low fees, which allows for emerging use cases such as instant micropayments.
Cross Blockchains: Cross-chain atomic swaps can occur off-chain instantly with heterogeneous blockchain consensus rules. So long as the chains can support the same cryptographic hash function, it is possible to make transactions across blockchains without trust in 3rd party custodians.