Introducing our Lightning Network

Introducing Chain Lightning™, Divi’s Lightning Network Protocol

Bitcoin’s lightning network receives massive hype daily. Lightning teams have spent years creating an amazing technology designed to overcome Bitcoin's limitations as a payment protocol. One by one, problems have been solved with ingenious solutions. However, it seems that it may never really work to make Bitcoin used by ordinary people for payments, at least not without massive changes to the blockchain itself, which is what they're trying to avoid. That’s okay and good news for us, because they’re building something that can work amazingly well for Divi’s blockchain, as I’ll try my best to articulate in this article.

Here at Divi we’ve been diligently working on our own implementation that we’re currently calling Chain Lightning. As of this writing (April 10th 2019) our LND (Lightning Network Daemon) is working and we’re in testing. We have the same codebase as Bitcoin so it’s a natural fit for us, and we’re lucky that our blockchain developer, Yuri, has already done this. He’ll probably be the first person in history to implement two different lightning networks!

Bitcoin’s lightning network is now live. It was recently announced that it had $5 million in active payment channels, which had doubled in a single month. There are multiple wallets that already allow for lightning payments. Some are adding features that are barely in alpha stage. Everyone is excited, and it’s certainly the beginning of something great. If you take the time to research lightning network, you’ll find it’s not so different from learning about blockchain for the first time. In many ways, Lightning Network is as revolutionary as blockchain itself. Think of it like 2009 for off-chain payment channels.

A lot has been said about Bitcoin’s Lightning Network. Either it’s an answer to all Bitcoin’s problems or it’s a fool’s errand, depending on what you read. The truth is probably somewhere in the middle. It still has a lot of unsolved problems and very serious limitations. Some of these are highly technical, and many coding geniuses are hard at work 24/7 on these. Other problems are based on Bitcoin’s very nature itself, and we think that many of these can be solved in unique ways by Divi, because our protocol is different.

So in this article I’m going to list some of Lightning's problems we're solving, and also look a bit into the future and speculate a bit on problems we THINK we can solve, and what that might mean for us.

Divi-Chain-Lightning-Network-Logo-3---1800px-1

One Click Lightning Nodes

Over six months ago we launched the world’s first one-click masternode setup, called MOCCI. Lightning Nodes are very similar, in that they’re difficult to set up, so we intend to have a single-click solution for Lighting Nodes too.

Settlement Limitations

Because Bitcoin’s blocks are added every 10 minutes, and the size is only 1 MB, and they’re already pretty full of standard transactions, Bitcoin has a serious scaling problem if a lot of people want to exit their Lightning channels at the same time. It’s like when everyone in a city flushes their toilet at the same time right after the Superbowl halftime starts… it can cause a sh-t explosion as the system backs up or collapses. Bitcoin’s system can only handle around 280,000 transactions PER DAY, so it’s easy to see the scalability problem if the system gets a lot of users trying to settle their Lightning transactions onto the blockchain. The challenge for Lightning then is to keep people in the channels rather than using the blockchain.

Bitcoin is trying to address this with “Splicing”, which allows multiple operations to happen within a single transaction, and to be able to pull coins out of a payment channel without shutting that channel down. However, it still requires an on-chain transaction to be posted, so it really doesn’t solve the scaling problem yet.

Our Solution: Divi solves this with 60 second blocks of 2MB each. That makes us able to have 20 times more transactions. It makes splicing a lot faster and easier. With Bitcoin, users have to wait an hour to fully confirm any use of the blockchain. Divi is 6 minutes.

Fees

Bitcoin’s Lightning Network has a contradiction issue that also results in a scaling problem. Their Lightning Network is supposed to be free or nearly so, but those who set up nodes to facilitate the channels need to be paid. EVERY node in a payment channel path gets a fee. Right now, everyone is just excited about LN and no one is really thinking much about making money off of fees. But at some point when Lightning Nodes are processing millions of payments, someone has to pay for all this data transmission, and without fees, it may become financially unsustainable.

Our Solution: Divi solves this problem because we have two types of fees. Our chain lightning payments CAN be done for free, because we have a second class of transactions that generate fees. These are our metadata fees. We are implementing Namecoin’s ability to store any arbitrary data on our blockchain, and there will be fees for that. If a user wants to connect his Divi or BTC account to his email address so people can use that as a send-to address, it might cost 50 cents or a dollar in DIVI. Also, our nodes, both stakers and masternodes, are paid in minted coins. They don’t need transaction fees to make enough money. Both of these factors create a situation where Divi’s Lightning Network is financially scalable.

Account Names

Believe it or not, Lightning Node endpoint address are even worse than Bitcoin’s already awful system. When it comes to usability, they’ve gone backwards! Check it out:

Bitcoin Samples Address:
1TZjB2Fkz6FzHtqDsxJEdWVeeFQfSttK9X

Lightning Samples Address: lnbc1pwr8whppp5dj72rpekxzuw5u4898exvjypgzfzf28h67ny0dxjr9jh6g9j6qcsdqu2askcmr9wssx7e3q2dshgmmndp5scqzysxqrrss25ssxus52hvr9fnwsjtvgk376euns37pgnqhu2ss0gegtesmhl2jn2xer0hm4ngqry8s04qtdfpqtsyf3vjr0rs4ahgs7lpxj6u2xycqt7z9zw

Divi’s ability to store metadata connected to addresses allow us to solve this by allowing people to name these endpoint addresses with HRAs (Human Readable Addresses.)

Lightning Made Easy anyone?

Lightning Channel Funding

As if Bitcoin wasn’t confusing enough, now they’ve made it much worse with Lightning! How could it be worse than it already is? Well basically when you’re using the Lightning Network, it’s very much like having a second cryptocurrency. You have to first send Bitcoin to your Lightning Network Channel, and then it’s stuck there in various channels, until you pull it out again. From a user interface perspective it’s a mess because you have to think in terms of two different coins, or even two different wallets.

Divi’s system can hide all of this so users don’t need to know which coins are in lightning and which aren’t. This won’t work well with Bitcoin because it takes far too long to swap coins between the two systems. But Divi’s smaller blocktime we think will make it manageable.

Power users will be able to see what’s going on under the hood if they want, but for people who just want to use crypto to buy stuff, they don't need to see any details, or know which types of nodes are being used.

Lightning Node Funding

A dirty secret about the Lightning Network that no one seems to talk about is that every single node in the payment channel you’re using must have the entire amount of your transaction just sitting there unused. A payment channel consists of 2-20 hops, as the payment is transferred from one user to another. If you’re sending 5 BTC, every node in the path needs 5 BTC. This can make it difficult to find a path for larger transactions, forcing users to not use the Lightning Network but instead use Bitcoin’s slow system. Definitely not ideal for mass adoption. And while all these nodes have their BTC sitting there in Lightning, they can’t do anything else with it. It just sits, and because the fees are small, they’re probably going to lose money. Again, it creates a financial sustainability challenge.

Divi’s Idea: The solution that we're working on would probably be pretty obvious to many masternode fans. What if we could just use our Masternodes to fund the lightning network. After all, there’s already millions of dollars sitting there in the nodes anyway, doing nothing but being allocated as proof of stake. Can we use these funds for the payment channels simultaneously? If we can do it, then much bigger payments can go through our lightning network. The path the big payments would find could be through our diamond nodes. This has the added bonus, which is difficult to overstate the importance of for mass adoption, of needing only a single solution for almost all transactions for all users.

It's a difficult problem and will take a serious overhaul of the way DIVI allocations to masternodes are handled, as well as a way to rebalance the channels dynamically. This is BIG if we succeed. If not, the other solution is to make sure that the metadata fees are enough of an incentive for people to want to set up Lightning Nodes. Since the Masternode minting rates are reducing over time, this incentive will grow. Either way, it's better than Bitcoin's system.

Lighting Nodes Must be Online to Receive a Transaction

Most people who rave about Lightning don’t seem to like to talk about this problem, and it’s a serious one. The problem is that if you want to send a transaction to someone, they have to have their endpoint ONLINE to be able to complete the channel. So they’re making these phone apps that work with Lightning, but the person on the other side needs to be connected at the time of transaction. This is really a HUGE limitation of Lightning Network. It’s not user friendly at all and eliminates many great use cases. It certainly doesn’t work for sending to people in other time zones, or subscriptions, or so many things. As far as I can see it also doesn’t even seem to have a proposed solution yet.

Divi is perfectly positioned to solve this. Our SmartWallet should be able to see whether the receiver’s Lightning Endpoint is online, and if not, choose another payment method, such as the InstantSend we inherited from PIVX/DASH. Ordinary users don’t need to know which method was chosen. They just hit send and we do the rest in the background. Bitcoin can never do this because it has no fast send option. Does that make Bitcoin useless? Of course not. I think Bitcoin will always be the most valuable crypto because it will be used as a store of value.

Another potential solution is something called WATCHTOWERS, which is proposed for Bitcoin's Lightning Network. With Bitcoin, it's not yet clear how this would work, and who those Watchtowers would be. A vastly simplified explanation of what Watchtowers would do, is that they monitor transactions to make sure they complete correctly, so if an Endpoint is offline, they could sort of guard those funds until they come back online, perhaps within a specific time period. With Bitcoin, it's not clear who those watchtowers would be and what mischief they might cause. But with Divi, our tiered node structure could allow us to assign the watchtower job to a specific tier to handle as part of their routine tasks.

Atomic Swaps

Most Lightning Network enthusiasts seem to be Bitcoin “maximalists” who are under the mistaken belief that the world only needs one cryptocurrency: Bitcoin. More realistic crypto fans know that people are diverse, have different needs, and want choice. I believe that “branded money” will be a big thing.

Lighting is built using HTLCs, also known as Atomic Swaps, and they can be done across compatible blockchains. Divi’s wallet will be multi-coin, and with a built in DEX and partners, users will be able to send Bitcoin to a friend and have it come out on the other side as a different coin, all automatically and done in the background.

Conclusion

Lightning is revolutionary, and we love it. It will greatly improve Bitcoin and will have many applications. But it also has severe limitations based upon the inherent nature of Bitcoin’s blockchain itself. The slow blocktime, user-unfriendliness, "flat" node structure, and lack of a fast send option make it difficult or impossible to ever make it ready for mass adoption. But that’s all great for Divi. While they're trying to fit a square peg into a round hole because they don't want to change Bitcoin's core protocol, I think Divi will be able to bring Lightning to the masses first, in a user-friendly and massively scalable way.

More Information about Lighting

LN Facts

Lightning Network Varieties: There are three main companies producing Lightning Networks for Bitcoin, using different languages such as C, Golang, etc. However, they’re all compatible and can share routes, etc, because the protocol is the same, as defined by BOLT.

BOLT: These are the protocol details that all LN creators are adhering to in order to insure compatibility: https://github.com/lightningnetwork/lightning-rfc

History of the Lightning Network: https://bitcoinmagazine.com/articles/history-lightning-brainstorm-beta

Detailed article about LN challenges and proposed solutions: https://blog.theabacus.io/lightning-network-2-0-b878b9bb356e

Wallet of Satoshi UX Runthrough: https://www.youtube.com/watch?v=7JTxwhe6Pnk

Light vs Full Node Wallets Rundown: https://www.youtube.com/watch?v=z-ZRQmYHVGU

Original Lightning Network Whitepaper: https://lightning.network/lightning-network-paper.pdf

Great Andreas Antonopoulos videos about Lightning:

Misconceptions about LN: https://www.youtube.com/watch?v=c4TjfaLgzj4
Bitcoin’s LN Explained: https://www.youtube.com/watch?v=Z7Q0AwbKZX8
Great explanation of Onion routing: https://www.youtube.com/watch?v=D-nKuInDq6g