Lightning Network: Solution to Bitcoin scalability problem

If you’re new to Bitcoin, then I recommend reading my blog Friendly Beginner’s guide to Bitcoins. In this post I wanted to write about the Bitcoin scalability issue and Lightning Network. If you do a quick google search, you will find that Bitcoin decentralised network can do a maximum transaction of 7 transaction per second whereas Visa centralised network can do 47,000 transaction per second. As more people are experimenting with Bitcoin there is/will be increase daily transaction volume and network fee(you check hourly transaction volume and network fee updates here). So how a decentralised trust-less open network like Bitcoin will scale? What is the road map of the community to the Scaling issue and rising network fees?

Existing Scenario:

Let’s see how transactions are done in bitcoin. In Bitcoin, when a transaction takes place it is broadcasted to the blockchain. Before transactions is validated by the nodes in the network by achieving consensus on the Blockchain, each node in the network must know every single transaction that has occurred globally. This puts a lot of load on the blockchain nodes to verify each transaction happening in real-time globally.

As a part of scalability solution, SegWit was proposed and implemented in 2017. SegWit helps to optimise the Bitcoin transaction speed and fix transaction malleability. However at a time of unprecedented surge of interest in bitcoin, exchanges like Coinbase, Blockchain.info are stalling SegWit implementation and has contributed to the Mempool being inundated with request. (Recently Brian Armstrong has confirmed that Coinbase will be implementing Segwit, Batching of transaction.) Although SegWit can alleviate the scalability and network fee problem, its not a proper 100% fix.

Work around:

Before I go into lightning network, I wanted to share some ways to circumvent high network fees. Bitcoin is fairly Anti-fragile as a ecosystem and you can try the below two ways to avoid paying high network fees.

a. Batching your Bitcoin payment can save upto 80% of the fees. Here is an excellent blog by David A. Harding .

b. Using Segwit enabled wallet can reduce the transaction fees. Hardware wallet like Trezor supports segwit by default and also enables users to select low fees(One caveat is that low fees transactions takes longer confirmation time).

Is there a Bitcoin Civil War?

Many click bait articles describe the Scaling divide as a Civil war. Although its tempting to see this divide through political lens, the divide is primarily a philosophical divide on how to scale Bitcoin and its future. There is two major outlook on how to scale Bitcoin. One is the off-scaling and the other is on-scaling.

5774303d1ad43.jpg

The term “on-chain scaling” is frequently used to exclusively refer to increasing the blockchain capacity by means of bigger blocks. If you are using “on-chain scaling” logic, you need to increase the block size to nearly 8GB to match visa transaction per second. However increasing block size will lead to centralisation of mining as only few actors will be able to afford to mine (which will lead to more centralisation problems and ecosystem will become more susceptible to different forms of attacks) and lose the decentralisation aspect of Bitcoin .

The term “off-chain scaling” refers to approaches that increase the utility of the network without touching the blockchain. It was the preferred approach to the scaling problem by the core developers since as early as 2010 (see post from Hal Finney below). Lighting network is “off-chain scaling” decentralised proposal where transfer of value(including micro-payments) occurs off-blockchain between untrusted parties.

DTBvSiNW4AAlg9m.jpg-large.jpeg

Lightning Network:

Lightning Network builds an additional layer on top of the Bitcoin network that enables instant off-chain transfer of the ownership of the Bitcoin. The transaction inside the lighting network are not broadcasted to the bitcoin network as long the channel is open(in order to reduce the load on the blockchain).

In some sense, Lightning Network is kind of smart contract where participants sign a contract the transactional balance in the multi-signature account.

Lightning Network utilises bi-directional payments channels that consist of multi-signature address. Meaning Bitcoin will be held in a multi-signature address where transaction will use a multi-sign address as their input and point at two different address as their output.

shutterstock_175229378-e1503589862779

Is Lightning network transaction same as Bitcoin transaction? Yes. Let’s get back to some basics. When transact with Bitcoin, you are not transferring any coins over the network. Technically you are using your private keys to digitally sign your transaction on the Blockchain. Likewise in Lightning network you use a double-signed message to transact which is eventually broadcasted to the bitcoin network when the channel closes.

How does it work?

Transferring fund to LN requires a confirmed transaction on the Blockchain. Let’s take an example of Alice & Bob where they transfer 1 BTC each other .
1. Both Alice & Bob transfer 1 BTC into a shared multisig address.
2. A “Balance Sheet” is created where 1 BTC is paid by Alice -> Bob and 1 BTC is paid by Bob -> Alice.
3. In the above transaction, Alice signs the transaction and gives to Bob and vice-versa.
4. Either Alice or Bob can sign their counterparts payout transaction and broadcast it to the blockchain at anytime.
5. Now Alice will update the “Balance Sheet”as 0.5 BTC to Alice and 1.5 to Bob and send the payout transaction to Bob to sign and vice-versa.
6. To ensure neither Alice or Bob revert to the old transaction, each will create an ‘anti-cheat’ transaction. This will invalidate the old “Balance Sheet”.
7. Alice and Bob can consensually close the channel and broadcast the transaction to the blockchain. Or if one of them becomes malicious, either party may immediately close out the channel and broadcast the most recent “Balance Sheet” to the blockchain.

Note: You can’t spend more than what is available in the open channel.

How to transfer to a new third party via Lightning Network?

Now imagine a scenario where Alice have to pay .1 BTC to Dave. However, Alice & Dave don’t have an open channel in Lightning so how do they transact? Opening a payment channel with everyone can be tedious and transferring via Blockchain may incur more network fees. Here Lightning Network makes use of existing payment channels using the idea of ‘Six degree of separation’ to make these types of transaction possible.

We already know Alice has an open payment channel with Bob. Suppose Bob has an open payment channel with Charlie who has an open payment with Dave, Lightning Network makes use these existing payment channel to make these transaction.

Alice -> 0.1.01 BTC -> Bob -> 0.101 BTC -> 0.101 BTC Charlie -> 0.101 Dave

What would happen if the transaction is failed from Bob to Charlie? These payments has to work either completely or the entire transaction will be reverted back.

Things you should know before you put your funds in Lightning Network:

  1. Lightning network is a “Hot Wallet” which means your wallet is constantly connected to the internet.
  2. Before you transfer your funds to the lightning network, make sure you keep a enough portion of your Bitcoins in cold storage. As your funds will be ‘locked up’ in the channel to enable to your day-to-day transactions.

What does Lightning Network mean to Bitcoin?

Lightning Network potentially opens a lot of new use cases for Bitcoin.

  1. Instant transaction: Yay! Its possible to pay for your coffee in milliseconds to seconds.
  2. Lower fees: Low network fees or nearly fee-free transactions.
  3. Micro-payments: You can pay literally in satoshi or one tenth of a dollar for your the service which you use. This can potentially open new avenues of services in the economy.
  4. Financial Smart contracts: By moving the transactions off the blockchain, it is possible to implement complex time-sensitive financial smart contract.
  5. Cross-chain payment: Alice has Bitcoin, Bob has Litecoin & Bitcoin and Charlie has only Litecoin. Alice can pay Charlie without understanding litecoin consensus rules.

Recommended
1. https://www.youtube.com/watch?v=rrr_zPmEiME

2. https://lightning.network/lightning-network-paper.pdf

Bitcoin donations are accepted :

1LfRFcXacYdeB9efsn4B7F6Gh2RfWWq8WL

screenshot_20180111-214222_015800933409217051024.jpg

Advertisements

Friendly Beginner’s guide to Bitcoins

Unless you live in a Bubble, Its impossible that you already haven’t seen the headlines about Bitcoin or Bitcoin Bubble. Bitcoin continues to garner the attention(both positive and negative) of the mainstream media especially this year. If you are unaware of the intricacies of the world of Bitcoin, this post will help you understand few fundamentals.

15191808baf43c64b30038caeccdb313-buzz-lightyear-meme-maker

What is a Bitcoin?

Before we begin, we need to understand that there is Bitcoin and there is bitcoin. Bitcoin is the software protocol and bitcoin is the your distributed decentralised peer to peer crypto-currency. Both are often used interchangeably, here we shall focus on the currency angle.

giphy2

  1. Distributed: Bitcoin ledger is shared and consensus driven ledger which can be synchronised and replicated by anyone in the globe. The earliest example of distributed ledger can be found in Yap island in Micronesia. People, in Yap island, use ‘Rai stone‘ as store of value and currency. Since the stone is too large to carry around, the ownership of the stone was recorded by consensus-driven oral verification.800px-Yap_Stone_Money.jpg
    a.Rai Stone
    Bitcoiners believe whoever holds the ledger holds the power. (Typically Bankers who own the ledger can potentially falsify ledger or deny service.) By distributing the ledger, Bitcoin guarantees transparency and distributes the power of governance.
  2. Decentralised: When it comes to Bitcoin there is no central bank or reserve bank to issue currency. So where does the money come from? Bitcoin software protocol issues new bitcoins based on mining and totally there can only be 21 million Bitcoins available by 2140. Bitcoin is designed as a deflationary currency as opposed to fiat currency issued by central banks which can be inflated.
  3. Peer-to-peer: Bitcoin is paid peer-to-peer like cash. You may not appreciate this design unless you are aware that every time you swipe your debit/credit card you pay a tiny amount to visa/master-card and your bank .(Usually the merchant will bear the cost . The duopoly(visa/master-card) earns more than 40 billion USD as interchange fees.)
  4. Crypto-currency: Anything digital(images, audios, videos) can be copied or multiplied. Unlike other digital stuff, Bitcoin is scarce and prevents double spending. This is achieved by miners who put every transaction through hashing algorithm when adding it to the blockchain.

Where do I hold Bitcoins?

“If you don’t own your private keys, you don’t own your Bitcoin”

You hold your Bitcoins in your Bitcoin wallet. Technically, you hold your private keys in your wallet which will digitally sign your transaction. Some prefer to hold their Bitcoin in exchanges. However it is prudent to hold your bitcoins in your wallet rather than exchanges because it gives control over your private keys.

Is Bitcoin a digital gold?

“Bitcoin is scarcer than Gold”

giphy1

Because of the demand and supply dynamics in the pricing of Bitcoin, many compare Bitcoin to gold. But its important to notice that Bitcoin is scarcer than Gold. Each year more gold is is pulled out of the ground than the year before. [1]

goldcore5_13-07-12

b. Inflationary Gold production
Bitcoin provides for a maximum of 21 million units by 2140 and cuts the supply (called Halving) every four years. Currently the supply is 4% annually and in 2020 that will be cut to 2% annually.

But…but…What is the intrinsic value of Bitcoin?

tenor-3

Many incumbents of Financial industry have decried Bitcoin as “Ponzi scheme” or “Fraud”. Others have questioned the intrinsic value of Bitcoin. Where does Bitcoin get its value? What is its utility?

Bitcoin pricing may resemble the Paradox of utility. (Although water is useful for survival, it is valued less than diamond). Bitcoin’s value comes from its intrinsic scarcity, immutability and security. (There can only be 21 million Bitcoins and no-one can print more bitcoins like fiat-currency. Bitcoins cannot be double spent as all transactions are recorded and verified across the blockchain)

Bitcoin is closer to commodities like gold when examining the price from a demand and supply perspective. As many Bitcoiners hold bitcoin as a store of values and others hold it in the hopes that it will appreciate in time(to speculate).

What’s with the Volatility bruh?

Bitcoin price tend to be extremely volatile and easily swing 20-30% in a trading day. If you ask a Bitcoiner, they would recommend to HoDL(hold) your coins irrespective of the price swing. This volatility can be attributed to its thinly traded market. Bitcoin total market capitalisation is only 2% of global gold market capitalisation.

tenor

If you examine Bitcoin market closer, you will notice the volatility in Bitcoin has reduced considerably over the years.

Bitcoin_Daily_Percent_Price_Change

c. Bitcoin Daily Percent Price change in 2013 Vs 2017

As Bitcoin gains more mainstream adaption, the market will become more liquid. Therefore the market capital will increase as more the people will chose to buy and sell, many Bitcoiners expect volatility to reduce over time.

Should I buy in an All-time high Bull market?

“The best time to plant a tree is 20 years ago. The second best time is now.”

At the time of writing, Bitcoin was trading at $16000. (I can’t help posting DBZ Vegeta meme 🙂 ).

giphy

Should I buy a full bitcoin? Answer is NO! Even though Gold bars are priced at $13,862, you can still buy gold as small coins. Like wise You don’t have to buy a full Bitcoin. You can buy a fraction of it.

So does that mean I should invest in Bitcoins? Maybe. Maybe not. Bitcoin was name the worst investment in 2014. Following this year’s rally, Bitcoin is named as the best bet for the year 2018. Let us see some of Bear and Bull Scenarios. (I will discuss this in detail in later posts)

Bear Scenario:

  1. Gresham’s Law: “Bad money drives out good”. ICO (Initial Coin offering) will drive investors away from Bitcoin.
  2. Its not a bullet proof investment even for Bitcoin maximalists. Bitcoin advocates like Wences Casares argue that you should not invest more than 1% of your portfolio in Bitcoins as there is a 20% chance it could be a failure.
  3. Speculation supersedes utility which may lead to Bitcoin to crash.

Bull Scenario:

  1. More Mainstream investors are coming.
  2. Lightning Network.
  3. Schnorr Signature .
  4. Metcalfe’s Law: Value of a network is equal to the square of the number of connected users of the system (n2). Don’t underestimate network effect and Bitcoin’s network effect in particular.

    It would be Stupid to invest in an All-Time high volatile market like Bitcoin. And it would be equally Stupid to stay away from possibly the best performing asset of the decade. So choose your stupidity wisely.

Recommended Reading:

The Denationalization of Money – F.A. Hayek (1976)
The Age of Cryptocurrency – Paul Vigna and Michael J . Casey (2015)
Digital Gold – Nathaniel Popper (2015)

Bitcoin donations are accepted.

1LfRFcXacYdeB9efsn4B7F6Gh2RfWWq8WL

28 Principles to Live by on 28th Birthday

Principles are internal Operating System based on which we function in the real world. Inspired by Ray Dalio’s Principles, I wanted to explicitly write down and share the principles which I believe in. Although this is primarily a self- conversation, I hope that you will find something useful.

1.Read More, No TV:
“The man who does not read has no advantage over the man who cannot read.” — Mark Twain.

Having spent my childhood frivolously in front of television, I guarantee that TV adds no value to your life. Dump the TV , cut your cable subscription and subscribe to your local library. Reading will enrich you and open many avenues in life. Read at least one hour a day no matter what.

2. Embrace the inner Contrarian:
“Vox Populi, Vox Dei” — Latin Proverb or “Crowd is untruth” — Søren Kierkegaard.

The so called conventional wisdom has made us believe that there is wisdom to the crowds. I’m sure every culture has some variation of the quote”Vox Populi, Vox Dei”. However if you closely examine history, you will notice that there is no wisdom to the crowds. Only Manias and bubbles exists in crowds. Embrace the your inner Contrarian (with a capital c) and go against it.

3.Addition by Subtraction:
“Good habits are the key to all success. Bad habits are the unlocked door to failure.”

Adding a new feature to an App is great but bug fixing is crucial. Likewise, fix a bad habit or characteristic to become better and stronger. Improve via negativa.

4.Remove the Toxic and Negative people:
“Stay away from negative people they have a problem for every solution” — Albert Einstein

Life is short. Remove the toxic and negative people from your circle.

5.Seek Community:
“No man is an Island” — John Donne

This one took me a while to realise. Even contrarians need a community. Find your community, seek deep meaning, nurture &add value to them.

6.Compete with yourself:
“To be a champion, compete; to be a great champion, compete with the best; but to be the greatest champion, compete with yourself.” — Matshona Dhilwayo

I know its a cliché. But you will never find someone with identical experiences, memories, circumstances and memories as yours. You are the best person to compete with. Be the best version of yourself!

7. Self-regulate your online hours:
“Today, spend a little time cultivating relationships offline. Never forget that everybody isn’t on social media.” — Germany Kent

Internet is a double-edged sword. Unless you are careful, you will never know whether you are consuming the internet or the internet is consuming you. Don’t take break to go offline. When you find break, go online.

8. Fitness:
“Your body has rights over you, so take care of it” — Prophet Muhammad.

Especially in today’s time, Fitness is of paramount importance. Because your physical well being correlates with your mental well being.

9. Journal:
“Don’t trust your memory, jot it all down” — Earl Schoaaff

This one is a work in progress for me. Keep a journal and document your life in words and not just via social media.

10. Learn to think in Numbers:
“Mathematics is the language in which God has written the universe” — Galileo

If you cannot think in Numbers, you are putting yourself in disadvantage. World of computers have chipped away our mathematical acumen. Slowly and steadily regain your Math skills and apply in daily life.

11. Make ONE big move every year:
Our comfort zone is a place where you keep yourself in a self-illusion and nothing can grow there but your potentiality can grow only when you can think and grow out of that zone.” — Rashedur Ryan Rahman

Making one big move every year is surprisingly a easy move comparatively. The Hardest part is convincing yourself to the task. Once you walk past it, it open many new doors.

12. Think big, Start small:
“Think big thoughts but relish small pleasures.” — H. Jackson Brown. Jr

Another cliché here. But think about it. If you have a Big daunting goal, having many small milestones will help you reinforce positive feedback and help you achieve it.

13. Its okay to change your POV. 
The Man Who Views the World at 50 the Same as He Did at 20 Has Wasted 30 Years of His Life.” — Muhammed Ali

Don’t be intransigent. Its okay to change your point of view in the light of new evidence. Willingness to change is a sign of a sound person.

14. Be Open-Minded:
“A mind is like a parachute. It doesn’t work if it is not open.” — Frank Zappa

Having an Open-Mind, opens you to many possibilities. With Possibilities comes opportunities.

15. Trends are over-rated mostly:
Everything popular is wrong” — Oscar Wilde

Popularity isn’t proof. If something is trendy its either over-valued or over-sold, so be wary of trends generally.

16. Don’t heed to other’s opinions:
Yeah, well, you know, that’s just, like, your opinion, man. — Jeffery “The Dude” Lebowski

You have a Super-power, if you don’t care what other people think.

17. Be curious:
Be curious not Judgemental .” — Walt Whitman

Go wherever your mind takes you. Follow your curiousity.

18. Protect your attention: 
It takes discipline not to let social media steal your time.” — Alex Ohanian

First of all Attention on any given day is of finite supply. And studies have proved it again and again. Secondly and most importantly the Attention economy is slowly eating our attention like parasites eating our brain. So learn to guard you attention.

19. Know your Weakness:
“Every weakness contains within itself a strength.” — Shusaku Endo

Knowing what you don’t know and knowing your weakness will help you stay out of troubles almost all the time.

20. Take intelligent risks:
“Never was anything great achieved without danger.” ―Niccolo Machiavelli

Most of the seemingly risk free choices are often the riskiest. First understand what is risk. The word “risk” derives from the early Italian risicare, which means “to dare”. So Analysis, Understand and daringly, place your bets.

21. Avoid Thinking Traps:
“I don’t want the cheese, I Just want to get out of the trap” -anon

There are certain thinking traps you need to avoid like “Group traps”, “Burning Issue traps”, “Status-quo traps”.

22. Have Low Time Preference:
Don’t put off for tomorrow what you should do today. — Aesop fable “The Ant and the Grasshopper

From Aesop fables “The Ant and the Grasshopper” to Stanford Marshmellow experiment , it shows the importance of having low time preference or delayed gratification. Learn self-control.

23. Always invest in yourself:
“You will never go broke from investing in yourself” — anon

If you are not ready to invest in yourself, no one else will. You are the best investment you will ever make in your life.

24. It is okay to Start over:
“Isn’t it nice to think that tomorrow is a new day with no mistakes in it yet?”
― L.M. Montgomery

Its okay to Start over as long as you don’t stop.

25. Don’t be afraid to make a decision:
“Don’t be afraid to make decisions in life.” — Arnold Schwarzenegger

Most decisions in life are reversibile. So don’t hold back, make a decision. If it works you will be happy. If it doesn’t work you will be wise.

26. Have Skin in the game: 
Never ask the doctor what you should do. Ask him what he would do if he were in your place. You would be surprised at the difference” — Nicholas Taleb

Don’t give or take advice unless he or she who giving advice has skin in the game. From Economist to Teachers are selling opinions with no skin in the game. If you give advice, ask yourself “If I were in his/her position, would I do the same thing?”

27. Be obsessive:
“You become what you think about all day long.” — Ralph Waldo Emerson

Be obsessive. Run it in loop until you make it.

28. You’re the most important person in your life:
“Be yourself; everyone else is already taken.” — Oscar Wilde

Be yourself. You’re the most important person in your life. The only person you should try to make happy and impress is your own self.