We are living in the era of cryptocurrencies right now. In our hands, we have a technology that can potentially change the world economy. Cryptocurrencies are a form of digital currencies which utilizes encryption techniques to generate new currency and to transfer funds from one account to another.
At the heart of the most cryptocurrencies lies the blockchain technology (we will get into it in a bit) which gives them their decentralized nature. What does that mean?
To put it simply, nobody “owns” cryptocurrencies, the way the Federal Reserve owns money. There is no single entity which is at the heart and center of cryptocurrency who can alter the price according to their whims.
So, if you are new to this crazy world and are feeling intimidated, then we have the perfect starting point for you. In this guide, we are going to show the top 3 cryptocurrencies. Now, remember, these coins may not be the top 3 most valuable, but they are definitely 3 of the most important coins to know about if you are starting out:
- Bitcoin: The one that started it all.
- Litecoin: The silver to Bitcoin’s gold.
- Ethereum: The next evolution of cryptocurrencies.
First up we have the one that started it all…Bitcoin.
2008 was an interesting year in many regards when it comes to international economics. Firstly, we had the 2007-2008 financial crisis, which was considered the worst financial disaster since the Great Depression. Secondly, an anonymous person/group by the name of “Satoshi Nakamoto” released a whitepaper titled “Bitcoin: A Peer-to-Peer Electronic Cash System.” That whitepaper introduced the whole world to the concept of Bitcoin and ushered in the blockchain technology.
The Blockchain Technology
Bitcoin introduced the whole world to the blockchain technology. So, what exactly is it?
A blockchain is a time-stamped series of immutable record of data that is managed by a cluster of computers not owned by any single entity. Each of these blocks of data (i.e. block) are secured and bound to each other using cryptographic principles (i.e. chain). Ok, so what does that mean in simple terms?
Imagine a universal ledger that anyone can download and write into. Anybody who has a copy of that ledger can:
- Check the records that have been logged into the ledger.
- Check the time at which those records were logged.
- Cannot tamper with any of the previously made entries because the ledger is immutable. This property of “immutability” is one of the most important features of the blockchain and it gains it through cryptographic hash functions.
That is what Bitcoin gave to us, the first proper implementation of a technology which can act as an immutable and transparent ledger. This innovation gives us a system which is completely incorruptible and free from human corruption since each and every transaction made into the blockchain can be checked.
Deconstructing The Blockchain
Before deconstructing the blockchain, we must acquaint ourselves with the term “Data Structures.” Data Structures is a specialized way of storing data. Today we are going to be focussing on 3 data structures which are pivotal for our understanding of the blockchain. They are:
- Linked Lists.
Hash simply means to take in an input string of any length and give out an output string of a fixed length. This function is extremely important in data storage situations. Imagine compressing huge amounts of data into one small string. The following features of hash functions are particularly useful:
- Deterministic: No matter how many times you parse a string through a hash function you will always get the same result. Meaning string “A” always gives you hash H(A) all the time.
- Collision Resistance: It is infeasible for two different inputs to have the same Hash. Meaning H(A) and H(B) which are the hashes for two different strings A and B, it is infeasible for H(A) to be equal to H(B). (Note the use of the word “infeasible” rather than “impossible”.)
- The Avalanche Effect: This is one of the most important features of the hash function. In fact, the blockchain obtains its immutability thanks to this feature. So what is this “Avalanche Effect”?If there is even a small change done to the input, the output hash drastically changes.
Right now, we are going to show you how the hash function operates. For this example, we are going to be using the SHA-256 hash function, the same that is used by Bitcoin. SHA-256 always gives a 256-bit output.
Suppose the input is “Hi”. Let’s see what we get when we parse it through a SHA-256 hash function.
H(Hi) = C01A4CFA25CB895CDD0BB25181BA9C1622E93895A6DE6F533A7299F70D6B0CFB
No matter how many times you parse “Hi” through the SHA-256 hash function, you will always get this result. Now let’s do a fun experiment. Let’s test the avalanche effect. We will not do anything drastic, let’s just change “Hi” to “hi”.
H(hi) = 98EA6E4F216F2FB4B69FFF9B3A44842C38686CA685F3F55DC48C5D3FB1107BE4
Do you see that? Do you see how drastic the change is? All we did was change the “H” from uppercase to lowercase, and see how different the two hashes are.
The next important data structure is the “pointer.” Let’s look at the following code:
If you have even the slightest bit of programming knowledge, then you must have seen that code. We just assigned the value “10” to “a”. “a” in this case is a variable. A variable is a storage location that can store value. However, what if we assign addresses of other variables instead of values? Eg.
int b = 10;
a = &b;
In the example above, the variable a is a pointer which holds the address of b. Think of them as road signs which point you towards your destination.
Finally, the last data structure that you should be aware of is Linked Lists. It won’t be an exaggeration to say that linked lists are the most important data structures out there. Here is what it looks like:
Linked Lists is a sequence of blocks which contains data. Each block is connected or “linked” to the next one via a pointer. The last node of the linked list contains a null pointer, meaning a pointer that points at nothing. Does that structure look familiar to you? That is the exact structure of the blockchain…with a little difference.
Think of the blockchain as a linked list with hash pointers instead of normal pointers. In a hash pointer not only does each pointer point towards the preceding block, it also contains the hash of all the data present inside the previous block.
So, how is that useful?
Remember, the avalanche effect? Remember how we told you that this is how Blockchain gains its immutability? Take note of the diagram above and imagine this scenario. A hacker breaks into block 1 and tries to change some data. This is what will happen next:
- Block 2 contains the hash of block 1’s data. Since block 1’s data gets changed, the hash of the data inside Block 2 gets changed drastically, because of the avalanche effect. This change in hash changes the data in Block 2 which means….
- The hash of the data in Block 2 which is inside Block 3 changes, which in turn changes the overall data in Block 3 and so on and so forth till the last block and freeze up the whole chain, which is an impossibility. Hence, the chain attains immutability.
This, in essence, is the heart and soul of Bitcoin. In order to understand how Bitcoin, Litecoin, Ethereum or most of the cryptocurrencies out there work, it is important for you to know how the blockchain functions. Up next let’s understand how the transactions system in Bitcoin works.
Suppose Alice were to send a dollar to Bob, it works in a pretty straightforward way. Alice simply takes the money out of her wallet and gives it to Bob. However, it doesn’t work that simply when it comes to Bitcoins. Since you don’t physically bitcoins, the transaction happens in a different way. There are two main features that you need to know:
- There are participants in the ecosystem called “miners” who validate these transactions by putting the data inside the blocks that they have mined. Once a miner discovers a block, they have the right to collect a “transaction fee” by putting transactions within this block. We will get more into mining a little later.
- Bitcoin transactions are transparent, meaning that you can trace each and every single bitcoin to see where all it has been. Fiat transactions, on the other hand, are not transparent at all. In fact, open your wallet right now and take out all the change. Do you remember where you got each and every coin from?
Transactions made in Bitcoin or any cryptocurrency for that matter has the following properties:
- Irreversible: All the transactions made using Bitcoin are irreversible. Once the miner has put it inside the block, it’s done, you can’t do anything to alter.
- Pseudo Anonymous: When you send Bitcoin, you do not actually send it to a person, you send it to their address. Hence, if you check the blockchain, it won’t look like “Alice sent 1 BTC to Bob”. Instead, it will look like “*Alice’s public address* sent 1 BTC to *Bob’s public address.”
- Permissionless: The ultimate ideal of Bitcoin is freedom. Anyone anywhere can use it. All that you need to do is to download the Bitcoin software client and you are good to go.
Alright, so let’s dissect a simple transaction between Alice and Bob and see how it works. Every transaction has two sides:
In order to actually send bitcoin, Alice needs to retrieve the unspent bitcoins or the “change” that she has leftover from her previous transactions. We call these unspent bitcoins UTXO or unspent transaction output. Imagine that she has done 3 transactions prior to this one labeled TX(0), TX(1), and TX(2) respectively. Suppose that the change that she has left over from these three is enough to cover the bitcoins needed for her transaction with Bob.
So, her TX(Input) = TX(0) + TX(1) + TX(2).
The output part of the transaction is pretty straightforward. Bob will get the amount of Bitcoins that he is owed and Alice gets back the remaining Bitcoin as change. So the transaction looks like this:
TX(Input) = TX(Output) + Change + TX Fees.
TX Fees is the fees that are taken by the miners to validate this transaction.
The “Change” goes back to Alice and she can use it as UTXO for her subsequent transactions.
There are some rules that these transactions should follow:
- TX(Input) should always be greater than or equal to TX(Output) + TX Fees. If this condition isn’t met then the miners simply invalidate the transaction.
- Alice sends the Bitcoin’s to Bob’s public address. Bob, however, can’t just obtain the Bitcoins straightaway. He must prove that he is indeed who says he is. The way he can do that is by unlocking the funds using his private key.
- Alice also must prove who she is by validating her identity. Only after validation by the miners can her transactions go through. The way she does this is by signing off her transactions with her private key. Anyone decode her signature using her public key(which is publicly available). This proof is called “Signature data.” This very important information. Please keep this in mind when we talk about segwit.
Since we have already touched on the topics of public and private keys. Let’s get into the cryptography behind bitcoin.
Cryptography Behind Bitcoin
Alright, so till now we have talked about how the blockchain works and what the mechanisms behind the transactions are. Right now, let’s delve into the cryptography behind it. Since all the transactions are done online, there are always fears about them being hackable. Satoshi Nakamoto incorporated the concept of Digital Signatures to make the transactions more secure.
Conceptually speaking, digital signatures are not really that different from real-life signatures c. Let’s look at some of the features that a good signature should have:
- The signature should be able to prove, beyond a shadow of a doubt, that it was indeed you who signed the document.
- No one should be able to forge your signature.
- If you have signed on a piece of paper, then you shouldn’t be able to take it back and nor can you claim that it was done by someone else and not you.
That’s all the features that a good signature should have. However, real-life signatures are hardly perfect and are bound to have some shortcomings. This is where cryptography comes up with the solution of “digital signatures” which is done via the use of “keys.” Earlier we used to use Symmetric Cryptography, however, it had a lot of shortcomings.
- Use of the same key: Cryptography has two parts to it, Encryption and Decryption. As the name suggests, in symmetric cryptography, both of these processes are done by using the same key. This can be an extremely cumbersome process since the key must be always be shared between the encrypter and decrypter in a secured manner. If anyone gets hold of the key, all of your data will get compromised.
- Not scalable: Another huge problem is the lack of scalability. Suppose an encrypter builds a relationship with multiple decrypters, the encrypter will have to share and take care of multiple unique keys.
A solution was required, and in 1970, a British mathematician named James Ellis provided that.
Ellis’s idea was quite simple and elegant. What if encryption and decryption were inverse operations based on 2 different keys instead of one shared key. His idea was to turn the table around and to make sure that the decryptor is not a “passive party” in the whole decryption process.
In his vision, the encryptor locks the message in a box via a padlock, while the decryptor unlocks the padlock with a key that only they possess.
Thus, the seeds of asymmetric cryptography were sown. All cryptocurrencies use asymmetric cryptography.
What is Asymmetric Cryptography?
In asymmetric cryptography, two keys are used: public key and private key. The public key encrypts the data and the private key decrypts it. The public key is mathematically derived from the private key so hence they cancel each other out. One thing to keep in mind. Your public key is the one that you are going to be sharing with everyone, you should NEVER share your private key.
The public key is further hashed twice to generate the public address. It first goes through SHA-256 to give a 256-bit output hash, and then that hash is run through RIPEMD-160 which gives a 160-bit output hash. So, the final output is a 160-bit hash. That is where you will be receiving your Bitcoins.
There are two popularly used modes of asymmetric cryptography. They are:
- The Rivest-Shamir-Adleman algorithm aka the RSA.
- The Elliptical Curve Cryptography.
Cryptocurrencies like Bitcoin, Litecoin, and Ethereum use the Elliptical Curve Cryptography aka ECC.
So, why was ECC used over RSA? ECC offers the same level of security as the RSA and consumes far lesser bits. Consider this, A 256 bit key in ECC provides the same level of security as a 3072 bit key in RSA. Similarly, a 384 bit key in ECC provides the same level of security as 7680 bit key in RSA.
Basic Script Introduction
In order to know how transactions work behind the scenes, one must know a little bit about the Bitcoin script. Behind every little transaction, there is some code working in the background. This code is called Bitcoin Scripting Language or just Bitcoin Script for short.
Bitcoin script deserves a whole new topic of its own, but here we are going to do the briefest of overview. The only thing that you need to know are:
- The script is reverse polish in nature. Meaning 3+4 is represented as 34+.
- The script execution follows the stack-based protocol. According to Wikibooks, stacks “can be logically thought of as linear structure represented by a real physical stack or pile, a structure where insertion and deletion of items take place at one end called top of the stack.”
Back to the topic now.
So far, you know about UTXOs and the public and private keys, you must have gained a fair idea of how transactions work in the ecosystem. The entire thing comes down to a game of locking and unlocking these UTXOs via the keys. Let’s bring back Alice and Bob again.
Imagine Alice is sending some Bitcoins to Bob. Bob’s public address is open knowledge, so she sends the bitcoins to that address. The UTXO is locked by Bob’s public key and can only be unlocked via Bob’s signature.
Alice’s part of the transaction aka scriptPubKey locking mechanism looks like this in script notation:
OP_DUP OP_HASH160 <Bob’s public address> OP_EQUALVERIFY OP_CHECKSIG.
On the other hand, Bob’s unlocking script aka scriptSig looks like this:
<Bob’s signature> <Bob’s public key>
In the codes given above:
OP_DUP= Duplicates the topmost element of the stack.
OP_HASH160 = Hashes the topmost element of the stack and pushes it back in.
OP_EQUALVERIFY = Checks whether the top two elements of the stack are equal or not.
OP_CHECKSIG = Checks to see if the signature of the receiver is correct or not.
Now, how does the unlocking process happen?
Bob, combines his unlocking script with Alice’s locking script. The resultant combined string looks like this:
<Bob’s signature> <Bob’s public key> OP_DUP OP_HASH160 <Bob’s public address> OP_EQUALVERIFY OP_CHECKSIG.
Now, let’s check how the execution of the unlocking process works.
Step 1: <Bob’s signature> and <Bob’s public key> get pushed into the stack.
Stack: <Bob’s signature><Bob’s public key>
Step 2: OP_DUP duplicates the last element in the stack aka <Bob’s public key> and pushes the duplicate onto the stack.
Stack: <Bob’s signature><Bob’s public key><Bob’s public key>
Step 3: OP_HASH160 pops out the last element aka <Bob’s public key> and hashes it through SHA-256 and MDI-160 to generate Bob’s public address and pushes it back.
Stack: <Bob’s signature><Bob’s public key><Bob’s public address>
Step 4: Now the next element aka <Bob’s public address> gets pushed onto the stack.
Stack: <Bob’s signature><Bob’s public key><Bob’s public address><Bob’s public address>
Step 5: OP_EQUALVERIFY now pops out the last two elements and checks whether they are equal or not. In this case, the last two elements are <Bob’s public address> which shows that they are equal.
Stack: <Bob’s signature><Bob’s public key>
Step 6: OP_CHECKSIG now pops out all the elements, which are Bob’s signature and public address and see if they are valid or not.
If they are, then Bob gets his due payment.
What are Bitcoin Wallets?
So, how do you generate the public and private keys? For this, you need to know what wallets are. A wallet is a software program that you can use to store your cryptocurrencies, public and private keys. Using a wallet, you can send and receive your cryptocurrency. Wallets are usually classified into two categories:
- Hot Wallet.
- Cold Wallet.
Hot wallets are wallets that are directly connected to the internet. Exchange wallets, phone wallets, etc. are examples of hot wallets. While they are extremely simple to use and give access to your funds readily, they are extremely risky. Since they are connected to the net, they are vulnerable to hacks.
Which is why, for long-term holding, we recommend that you use a cold wallet. Cold wallets are wallets that store your money offline. Examples of cold wallets are paper wallers and hardware wallets.
Trezor and Ledger Nano S are good examples of hardware wallet and they can be bought online. Paper wallets, on the other hand, are the most secure and safe option out there. The reason why they are called “paper wallets” is because you have the option to print out the private and public keys and store them with you on a piece of a paper.
Walletgenerator lets you create your own bitcoin paper wallet and it is extremely straightforward. You can check out this video to learn how to create your own paper wallet via walletgenerator. The best part is that you can use the website to create wallets for both Bitcoin AND Litecoin. When you are done creating your wallet you will get something like this:
The public address is where people will send you your bitcoins. The private key is what will allow you to unlock your bitcoins. Under NO circumstances should you share your private key with anyone.
What is Bitcoin Mining?
Alright, now that we have discussed many basic concepts of bitcoin, we should now familiarize ourselves with one of its pillars, mining. Mining is a process that Bitcoin uses to get create more bitcoins. The people who participate in this process are called “miners.”
This section is extremely important because this is pretty much the backbone of Bitcoin. Before Bitcoin, there were several attempts to create a decentralized cryptocurrency however, they all failed.
They all failed because they were unable to answer one of the biggest issues in a decentralized peer-to-peer network system, the Byzantine General’s Problem.
What is the Byzantine General’s Problem?
In order to get anything done in a peer-to-peer network, all the nodes should be able to come to a consensus. The thing is though, for this system to work, it lays a lot of emphasis on people to act in the best interest of the overall network. However, as we know already, people aren’t really trustworthy when it comes to acting in an ethical manner. This is where the Byzantine General’s problem comes in.
Imagine this situation.
There is an army surrounding a well-fortified castle. The only way that they can win is if they attack the castle together as a unit. However, they are are facing a big problem. The army is far apart from each other and the generals can’t really directly communicate and coordinate the attack and some of the generals are corrupt.
The only thing that they can do is to send a messenger from general to general. However, a lot of things could happen to the messenger. The corrupt generals can intercept the messenger and change the message. So, what can the generals do to make sure that they launch a coordinated attack without relying on the ethics of each individual general? How can they come to a consensus in a trustless way to do what needs to be done?
That’s the Byzantine General’s Problem and Satoshi Nakamoto solved this problem by using the Proof-of-Work (POW) consensus mechanism.
What is Proof-of-Work?
Let’s check how POW works with context to our example given above. Suppose a general wants to communicate with another general. How do you think it will go down?
- A “nonce” is added to the original message. The nonce is a random hexadecimal value.
- This new message is then hashed. Suppose the generals agree beforehand that they will only send messages, which when hashed begins with 4 “0”s.
- If the hashed does not give the desired number of 0s, the nonce is changed and the message is hashed again. This process keeps repeating until the desired hash is received.
- The entire process is extremely time-consuming and takes up a lot of computational power.
Now when they finally get the hashed value, the messenger is given the original message and the nonce and told to communicate with the other generals. So what does happen if someone does try to intercept the message? Well, remember the avalanche effect of the hash functions? The message will change drastically and since it won’t start with the required number of “0”s anymore, people will realize that the message has been tampered with.
So, to put POW in the context of crypto mining:
- The miners try to solve cryptographic puzzles to add a block to the blockchain.
- The process requires a lot of effort and computational power.
- The miners then present their block to the bitcoin network.
- The network then checks the authenticity of the block by simply checking the hash, if it is correct then it gets appended to the blockchain.
- So, discovering the required nonce and hash should be difficult, however checking whether it is valid or not should be simple. That is the essence of proof-of-work.
Now, you are probably wondering, why should the miners sacrifice their time and resources to mine bitcoins? Well, turns out that they have a pretty healthy economic incentive:
- When you discover a block, you receive a block reward of 12.5 bitcoins. The reward halves every 210,000 blocks.
- Once you have mined a block, you become the temporary dictator of the block. You are the one responsible for putting transactions inside the block and are hence entitled to transaction fees.
There is only a limited number of bitcoins out there, 21 million to be exact. So, what is stopping these miners from mining out all the bitcoins at once? Turns out that bitcoin mining gets progressively harder over time. This feature is called “difficulty”, and the difficulty of mining keeps on increasing as you keep on mining.
This is why it is pretty much impossible nowadays for solo miners to mine Bitcoins using just their computers. Miners have now joined forces and created “mining pools” to pool their computational power together and mine as a group. These pools use ASICs (Application-Specific Integrated Circuits) specifically created for mining to mine bitcoins. We will talk more about pools later.
Bitcoin Core and Segwit
The version of Bitcoin that we are most familiar with is the one implemented by Bitcoin Core. As Wikipedia puts it, “Bitcoin Core is an implementation of bitcoin. Initially, the software was published by Satoshi Nakamoto under the name “Bitcoin”, and later renamed to “Bitcoin Core” to distinguish it from the network.” Recently they had to change up their main protocol by adding Segwit (Segregated Witness) because of Bitcoin’s scalability issues.
We will touch on these scalability issues later but, long story short, Bitcoin transactions had become extremely slow and were incurring a lot of transaction fees. This is the reason why segwit was implemented.
What is Segwit?
Remember the signature data that we were including in our transactions to verify the validity? Turns out that it was doing more bad than good.
- Firstly, signature data is extremely bulky. Each block in the bitcoin blockchain is only 1 MB big, so it can take in a limited amount of transactions. The signature data takes up 65% of the transaction’s face and serves no other purpose other than verification.
- Secondly, the signature data can be tampered with before it enters the blockchain, which causes “transaction malleability” and is a huge security concern.
The idea behind Segwit was to employ a sidechain which runs parallel to the blockchain and to put the signature data inside the sidechain. So, a sort of extension block which runs on the side chain will cling on to the block in the main chain to store the signature data. It was thought that this would solve the scalability problem, but not everyone in the Bitcoin community agreed. In fact, a pretty sizeable chunk forked off from the Bitcoin Core protocol create their own cryptocurrency called “Bitcoin Cash” which implemented a larger block size instead of segwit.
Despite all of that Bitcoin still remains the undisputed king of cryptocurrencies. It is regarded as the gold standard of the Crypto world. However, it has a lot of issues. Mainly, because of various scalability problems, Bitcoin is regarded as a great store of value instead of a mode of everyday payment.
To solve this issue, a new coin was created. This coin positioned itself as the “silver” to Bitcoin’s “gold.” This coin was called Litecoin.
Before we get into what Litecoin is, we need to know why it was needed in the first place. While Bitcoin was conceived as a “digital currency”, truth be told, it wasn’t doing a good job at that. The main problem that Bitcoin was facing (and still facing) was “scalability.” Back when Satoshi Nakamoto created Bitcoin, he was forced to impose a 1 MB limit on the Bitcoin blocks. He envisioned that Bitcoin blocks may get filled with spam transactions and that would lead to DoS (Denial of Service) attacks.
While the block limit may have worked, unfortunately, this led to a problem. Bitcoin became popular! And as a result, it just didn’t have the provisions required to keep up with the increasing demand. Check out this graph (via Blockchain.info):
That graph shows the increasing amount of transactions per month since 2009 and as you can see, the increase has been pretty drastic. However, the problem is that miners have struggled to keep up. In Bitcoin, as we have already mentioned, transactions go through only when the miners physically put the transaction details inside individual blocks. However, with so many transactions, this process becomes extremely slow. Bitcoin can barely manage 7 transactions per second. The median confirmation time for each transaction went to as much as 13 mins.
The other problem that Bitcoin users were facing was bloated transaction fees. Because transactions were processed on a first-come-first-serve basis, users usually pay higher transactions fees than usual, to incentivize miners to prioritize their transaction over others. Most of the time, normal users needs to wait for a new block to be mined before their transaction can go through, and this is where we face another roadblock. Bitcoin has a block production time of 10 mins. This further adds to the delay.
Because of these issues, people soon realized that while Bitcoin can make for an excellent store-of-value, it becomes increasingly impractical to use especially for microtransactions. However, that’s not the only problem that bitcoin faces. Turns out that bitcoin mining is extremely wasteful and harmful.
The Problems with POW Mining
#1 Energy Wastage
The biggest problem of Proof-of-work is the energy wastage. This is how much energy Bitcoin has consumed over the last few months. As you can see, Bitcoin has a voracious appetite:
In December 2017, research showed that Bitcoin consumes more energy than 159 individual countries. That is a pretty crazy statistic!
As we have already told you, Bitcoin uses ASICs for mining. The problem with that is ASICs are expensive, and pools with more money tend to have more ASICs and, consequently, more mining power. In fact, check out the hashrate distribution chart for Bitcoin via Blockchain.info.
As you can see, 3 pools BTC.com, AntPool, and SlushPool alone own more than 50% of the network’s hashrate aka mining power. This completely defeats the purpose of decentralization, plus, there is one more big issue. Individual users simply can’t compete with big money pools.
Now, that we know the two biggest issues with Bitcoin, let’s get acquainted with Litecoin.
Charlie Lee and Litecoin
Ex-Google employee Charlie Lee had a vision to create a lighter version of Bitcoin. Something that was going to be silver to Bitcoin’s gold. He wanted a cryptocurrency which could be used as a means of payment for micro and more everyday transactions. This is why, on October 7, 2011, Litecoin was created was forked from the original Bitcoin Core protocol and went officially live on October 13, 2011.
Litecoin vs Bitcoin
Let’s begin with some of the fundamental differences between Litecoin and Bitcoin:
- Bitcoin has an overall cap of 21 million coins while Litecoin has an overall cap of 84 million.
- Bitcoin has block production time of 10 mins while Litecoin has block production time of 2.5 mins.
- In Bitcoin, the block reward is halved every 210,000th block. In Litecoin the reward is halved every 840,000th block.
- Bitcoin uses SHA-256 hashing algorithm while Litecoin uses Scrypt.
- When it comes to overall approach and outlook, Bitcoin is more like a long-term store-of-value while Litecoin is something that you can use for everyday purchases.
Scrypt – Litecoin Mining
Litecoin uses the scrypt algorithm for mining. Scrypt does use the SHA-256 algorithm, but it is a lot more serialized than Bitcoin’s SHA-256 which is parallelized. What does that mean?
Suppose you have two problems to solve X and Y. In Bitcoin mining, it would be possible to do both of them at once. However, in Litecoin, you will have to do X first and then Y. If you try to do both of them at once then the memory required becomes a little too much to handle. This property is called being “memory-hard.”Running 2 memory hard processes in parallel requires 2 times as expensive as running 2 parallelizable processes. This discourages large-scale ASIC mining because, pound-for-pound, memory is way more expensive to produce than hashing chips.
Litecoin has been deliberately designed this way to promote GPU mining and to make the system more decentralized. However, companies like Zeus and Flower Technology have managed to create Scrypt ASICs.
Innovation and Litecoin
Litecoin has, time and again, taken the risks necessary to constantly innovate on their platform. In fact, many people have said that Litecoin acts as a perfect guinea pig for Bitcoin to see what all innovations they can bring to the table. Let’s look at some of these innovations.
Litecoin activated Segwit before Bitcoin, back on 10th May 2017. Here is the tweet that shows Charlie Lee’s announcement:
The lightning network, conceptualized by Joseph Poon and Tadge Dryja, has been long touted as the solution to all of Bitcoin’s scalability issues, and Litecoin has been one of the many projects that are working on it. So what is the lightning network? Let’s give you a brief overview first.
Two people, let’s say, Alice and Charlie, open a state channel between them and exchange as many coins as they want between them OFF THE BLOCKCHAIN. When they are done making the transfers, the final state of the transaction is put on the main blockchain.
Before we start, let’s understand what state channels mean. A state channel is a two-way communication channel between participants which enables them to conduct interactions, which would normally occur on the blockchain, off the blockchain.
Ok, now let’s go into the details.
The lightning network is based on HTLCs aka Hashed Timelock Contracts. Let’s see how it works. Imagine Alice wants to send some bitcoins to Charlie, and they both have Bob in common.
- Alice opens a channel with Bob and Bob opens a channel with Charlie.
- Alice declares that she wants to pay Charlie 0.01 LTC.
- Charlie declares a random string S and generates its hash H and hands it to Alice.
- Alice sends Bob the hash H and they open a multi-sig channel between them. The conditions of the channel are:a) Bob gets the 0.1 LTC if and only if he can show Alice the string S from which the H is derived.b) There is an nLocktime of 2 days wherein, if Bob cannot produce the string then Alice gets a refund of 0.01 LTC.
- Bob then shows the hash H to Charlie, proving that he has interacted with Alice and they proceed to open a multi-sig channel between them with the following conditions:a) Charlie gets 0.01 LTC if and only he shows Bob the String S from which the hash H has been derived.b) There is an nLocktime of 1 day (less than the locktime of the Bob-Alice channel) wherein if Charlie can’t produce the string then Bob gets a refund of 0.01 LTC.
- If Charlie produces the string S then Bob sends him the 0.01 LTC.
- Similarly, Bob shows Alice the string S and gets the 0.01 LTC from her.
Charlie Lee tweeted on 1st September 2017 that he did the first ever Litecoin Lightning Network payment.
#3 Atomic Swaps
Another truly exciting Litecoin innovation are Atomic Swaps. This is another brilliant innovation that is based on HTLCs. Atomic Swap enables cross-chain exchange of coins without the need of a third-party. Meaning, if Alice had 1 BTC and Bob 100 LTC, they can simply do an atomic swap without going through an exchange.
Litecoin has already done atomic swaps with Decred and Vertcoin.
So, till now we have met the ultimate Store of Value, Bitcoin. Then we had the constantly innovating Litecoin which gives us a mode of payment for everyday transactions. The next project, i.e. Ethereum, has taken the Blockchain game to a whole new level. They single-handedly ushered in a multi-billion dollar industry with their ICOs AND they brought in the era of the second generation blockchains.
Bitcoin, in every sense of the word, disrupted the world’s financial system. For the first time, we had a system which provided a decentralized currency not owned by one single entity. The way they achieved that was by utilizing the blockchain technology. The blockchain is basically an open ledger, anyone can access all the information and transaction by merely consulting the blockchain.
However, people weren’t convinced that the blockchain technology was limited to mere currency. One of those people who wanted to explore the other areas of blockchain application was Bitcoin Magazine co-founder, Vitalik Buterin. In late 2013, Buterin presented a paper which had outlined what was going to go on to become Ethereum. He raised the point that Bitcoin was in need of a scripting language which could be used to create decentralized applications. His proposal was shut down.
Buterin then moved on to create a different platform called Ethereum. Eventually, proper development of Ethereum began in early 2014 through a Swiss company, Ethereum Switzerland GmbH (EthSuisse). Ethereum held its ICO between 20th July- 2nd September 2014 and raised ~$18.4 million.
Ethereum is planning to be the ultimate software platform of the future. A supercomputer where developers all over the world can code and develop their own decentralized applications (Dapps). Before we continue any further, it is important for us to know what smart contracts are.
What are Smart Contracts?
Smart contracts are pretty much the bread and butter of Ethereum. They are automated and self-enforcing contracts which allows you to exchange value in a transparent and credible way while avoiding third parties. These transactions can be traced and are irreversible. Smart Contracts were conceptualized by Nick Szabo and, according to him, the first known form of the smart contract was the vending machine.
Let’s look at how the vending machine works and then we can draw our parallels with the smart contracts.
- First, the customer will put in the required amount of money needed to buy the product from the vending machine.
- Then you choose the product which you can buy for less than or equal to the amount of money that you have put in.
- The machine gives you that product.
Now, if you go through the steps you will notice two things in particular which display the very essence of smart contracts:
- Each and every step needs to be accounted for. You can’t jump on to the next step without completing the preceding step.
- Secondly, you(the buyer) are interacting directly with the seller(vending machine) without any middleman in between.
So, now that we know what smart contracts are, what are some of the properties that we find desirable in our smart contracts? The following three properties are absolutely critical for smart contracts to have:
We have already talked about determinism before (while discussing hash functions.) A program is deemed deterministic IF it gives the same output to the same input every single time. Having said that, there may be moments when the program acts in an indeterministic manner:
- If the program calls an indeterministic function in the middle of execution
- The data source that the program is using is indeterministic in nature
- When a program calls another program aka dynamic calling.
Smart contracts must take the necessary steps to terminate executing in a given time limit. In other words, there must be a way to externally “kill” the contract when necessary. The steps that can be taken to ensure this are:
- Turing Incompleteness: A Turing incomplete contract is incapable of making jumps and/or loops. This ensures that the contract can’t enter an endless loop.
- Step/Fee meter: A contract can keep track of the number of steps that it has taken to make sure they don’t exceed a particular step limit. Or, they can also use a fee meter. In a fee meter, a prepaid fee is paid to execute the contract, and each step of the program takes a particular amount of fee to execute. Once the fee has been utilized, the contract stops executing.
- Timer: The contract has a pre-determined timer and it executes for the duration of the timer. Once the time-limit exceeds, the contract stops executing.
In Ethereum, anyone and everyone can create a smart contract, however, this freedom comes with a price. Since there is no barrier to entry, anyone can knowingly, or unknowingly, upload a bug or virus with these contracts. This is why it is necessary to have a mechanism that isolates these smart contracts in a sandbox that keeps the entire ecosystem safe from the infected smart contract.
Keeping all this in mind, Ethereum gives their developers the Ethereum Virtual Machine (EVM) which presents an ecosystem for the users to create their smart contract. The language that is used to code these contracts is called “Solidity” which is a Turing Complete program.
Now, remember, we said earlier that “Turing Incompleteness” is one of the ways that contracts can assure that they are terminable So, what is it that Ethereum uses to make sure that their contracts terminate? They use a Fee meter called “Gas”, and that’s what we are going to get into next.
What is Ethereum Gas?
Gas is the lifeblood of the Ethereum ecosystem. It is the unit that measures the amount of computational effort that it takes to execute certain operations. Every single thing in Ethereum, be it a transaction, smart contract, or even an ICO takes a certain amount of gas. In fact, gas is what is used to calculate the amount of ether you will need to pay to the network to execute an operation.
Let’s look at an analogy to better understand how gas works. Suppose you need to fill up gas before you go to work, what are you going to do?
- Go to the gas station and specify how much gas you want to fill up in your car.
- Fill up the tank with the specified amount of gas.
- Pay the amount of money you owe.
In the analogy, the car is the operation that you want to execute, like a transaction or smart contrast. The gas station is an Ethereum miner, the gas is Ethereum gas, and the money that you pay is the miner fee. The smallest unit of gas measurement is “wei”.
So, as you may have inferred by now, to get an operation done in Ethereum, the person initiating the transaction or the smart contract must specify a gas limit before they submit it to the miners. If a gas limit has not been specified, the miners will not execute the operation. Now when submitting a gas limit, the following two cases will occur:
- The gas limit is too low
- The gas limit is too high
If the gas limit is too low, the miners will immediately stop all operations. However, the contract initiator must pay for the number of computations that have taken place till then.
If the gas limit is too high, the contract will be executed and the leftover gas will be refunded immediately.
So, in theory, it should make sense to always submit contracts or transactions with a bloated gas limit right? Unfortunately, it doesn’t work like that in reality. Miners in Ethereum are limited by a 6,700,000 gas limit per block, and each and every transaction in Ethereum has a gas limit of 21,000. So, now consider the following two transaction scenarios that a miner may face:
- Executing a simple transaction with a gas limit of 48,000.
- Executing two simple transactions with gas limits of 21,000 each.
Obviously, the miner will choose the second scenario because it makes more sense to them economically.
How does Ethereum Mining Work?
Ethereum, like Bitcoin, has been using POW for mining purposes, but all that is going to change soon. Because of the limitation of POW mining, as has already been discussed, they are looking to move onto Proof-of-Stake(POS). The main draw of POS is that it makes mining a purely virtual process. Now, there are many different kinds of proof-of-stake execution, however, the general idea goes like this.
- POS uses “validators” instead of miners.
- Validators lock up a certain amount of Ether as stake.
- Once they find a block which they think can be added to the chain, they place bets on it.
- If the block gets appended, they receive a reward which is proportionate to their bets.
Since no hardware or extensive computation is needed, the process is not wasteful. However, having said that, general POS suffers from one major issue. It is called the “Nothing at Stake Problem.”
Consider this scenario.
Suppose you are watching a football match between two equally matched teams. Suppose the betting price for both the teams is similar (say $5 a piece) and the profits that you get from one of the winning teams is pretty high (say $20). It is in your interest to put a bet on both the teams and pocket whatever profit you make.
Let’s use the same logic here. What is there to stop a malicious validator to bet on multiple blocks hoping to cash in one of them? In the worst case scenario, a bunch of malicious validators can bet on multiple blocks and cause the entire system to hardfork. Something needed to be done in order to stop these kinds of attacks.
Enter the Casper Protocol
What is the Casper Protocol?
Casper is the name of the POS protocol that will be used by Ethereum. Casper uses the same principles that most of the other POS protocols use….with one major difference. Casper has introduced a punishment mechanism to stop malicious validators from taking advantage of the system. In Casper, if a validator attempts to act in a malicious manner, their stake gets completely slashed off. Now, remember, this stake that they have to put up is pretty significant, so it makes no sense economically for validators to act in a malicious manner.
It must also be noted that Casper is not just one project. It is a combination of two different projects that is being undertaken currently by the Ethereum dev team.
- Casper the Friendly Finality Gadget (FFG)
- Casper the Friendly GHOST: Correct-by-Construction (CBC)
Casper FFG is also known as “Vitalik’s Casper” because the main man behind it is Ethereum co-founder Vitalik Buterin. Casper FFG is not a full-blown POS protocol, but rather a hybrid POW/POS one. Casper has a proof-of-stake layer running on top of the normal POW protocol and the way it is going to work is like this:
- New blocks are still mined using POW.
- Every 50th block is finalized by POS. Finality means that once a particular operation has been done, it will forever be etched in history and nothing can revert that operation
The second project is called Casper CBC aka “Vlad’s Casper” because the person behind it is Vlad Zamfir, the poster child of Casper. To understand how Correct-by-Construction works, let’s compare a normal protocol to a CBC protocol.
- Formally specify the protocol
- Define the properties of the protocol must satisfy
- Prove that protocol is fulfilling the properties beyond any reasonable doubt
- Formally but partially specify the protocol
- Define properties that the protocol must satisfy
- Derive the protocol in a way that it satisfies all the properties that it was stated to specify
So, what are the advantages of the Casper protocol over the traditional POW that is used by Bitcoin?
- Malicious validators don’t have any incentive to game the system thanks to the slashing protocol.
- POS is far less wasteful and uses fewer resources than POW.
- POW mining was getting increasingly centralized.
- Doing a 51% attack on POS will cost much more than POW.
- Since in POS, validators need to actually stake their own money in the system, it is in their best interest to always work for the best of the system (i.e. Ethereum) to make sure that the value of their investment rises.
- POS system is far more likely to scale as opposed to POW.
Ethereum and ICOs
Alright, now that you have a fair idea of what Ethereum is and how it works, now we can talk about the single biggest reason that has propelled Ethereum to becoming a household name: ICOs. Initial Crowd Offerings or ICOs are the cryptocurrency version of crowdfunding. Before we get into what ICOs are and why they are revolutionary, it is important to understand the concept of tokens.
Ethereum gives you a platform where one can create their own Dapps or Decentralized Applications. Tokens are the native currency of those particular Dapps which lets you gain access to them as well as take part in any transaction within those Dapps. Remember when you used to go (or still go) to those Video Game arcades? Before you can use any of the arcade machines you need to buy some arcade coins right? In this analogy, the video game arcades are the Dapps while the arcade coins that you buy are the tokens of that particular Dapp. In fact, Ether is the token of the Ethereum blockchain.
So, now that you have a fair idea of how tokens work, let’s go back to ICOs. The reason why ICOs are considered revolutionary is because of two reasons:
- It provides the simplest way for developers to gain funding for the project. In an ICO anyone can present a whitepaper and gain millions of dollars worth of funding even without a working product, which was unheard of.
- Secondly, anyone who is interested in the project can become a part of it by purchasing the tokens.
How Does an ICO work?
- The developer team declares the number of tokens that they are releasing to the public and the amount that they are keeping for themselves for future development.
- After that, it is a simple matter of people, who are interested in the project, to buy a certain amount of tokens in exchange for Ether.
The recently concluded year-long ICO of EOS broke all the records by collecting $4 billion worth of Ether. ICOs have come under heavy criticism as some of them turn out to be nothing more than desperate cash grabs, however, they remain as popular as ever. In the first 5 months of 2018, ICOs have raised as much as $7.7 billion USD. When you consider the fact that ICOs raised a total of $6.3 billion in the entirety of 2017 alone, that is a pretty scary statistic!
Having said that, securities are a real concern with ICOs. As this report by Reuters states, more than 10% of the money raised by ICOs have been stolen by hackers. In fact, one of the most important hacks to date is the DAO hack which ripped apart the Ethereum community.
The DAO Hack: Ethereum vs Ethereum
DAO stands for Decentralized Autonomous Organization and it is the next evolution of management. Imagine an organization that is not owned by anyone and can grow on its own by utilizing its own funds. In essence, it is a sentient management system. One of the most famous (and infamous) examples of DAO was The DAO. The DAO was one of the earliest ICOs that took place on the Ethereum platform.
The DAO ICO raised $150 million and was thought to be the new generation’s hedge fund. In fact, TechCrunch called it “a paradigm shift in the very idea of economic organization. It offers complete transparency, total shareholder control, unprecedented flexibility and autonomous governance.”
However, a hacker exploited a vulnerability in the smart contract and siphoned away $50 million worth of Ether. Now the community was torn into two. They had two options:
- Do nothing and accept the situation for what it is.
- Fork from the original protocol.
Some of the most influential people in the community like Vitalik himself supported the idea of the fork, and hence Ethereum got split into two version in July 2016. The original protocol stayed on as Ethereum Classic(ETC) while the new forked protocol was called Ethereum (ETH).
The Future of Ethereum
Ethereum was planned to be released in four stages. The idea was to not rush things at once and to make sure that enough time and respect was given to each and every stage. The stages were named thus:
Currently, we are in the Metropolis stage.
Before we go any further, it is important for us to define certain terms:
Zk-SNARKS: “Zero-Knowledge Succinct Non-interactive Argument of Knowledge” or Zk-SNARKS is a privacy protocol that is used by ZCash. Zk-Snarks is based on zero-knowledge proofs which works something like this: There are two parties: the prover and the verifier. The prover can prove that they are party to a certain information to the verifier, without revealing the information itself. Ethereum is looking to implement Zk-SNARKS in their protocol.
Abstraction: This means that anyone can use any system or protocol without completely knowing the ins and outs and all the technical details. Eg. When you are using your laptop, all you need to know is that by switching on the power button you are going switch on the laptop. There is no need for you to know which circuits get triggered when you press the button nor do you need to know how electricity flows within the laptop. Similarly, when you change the channels of your TV with the remote, all that you need to know is that the channel will change when you press a button. That, in a nutshell, is what abstraction means, making a complex technology accessible to the masses by removing the complexities.
Sharding: Ethereum, like most other cryptocurrencies, has scalability on the top of their list. One of the most exciting ways that they are looking to implement scalability is “sharding.” In sharding, you break down a huge database into smaller and more manageable chunks called “shards.” The way blockchains are designed right now, all the nodes are forced to work on the same issue at the same time, which is a highly inefficient mechanism. However, via shard implementation, the nodes can be distributed among various shards and you can parallelize the tasks.
Ok so now that we know these terms, let’s examine what all Ethereum will be gaining during the Metropolis and Serenity stages.
Metropolis is planning to bring in the following changes:
- Initiating the march towards full POS implementation by bringing in Casper FFG.
- Sowing the seeds for privacy by implementing Zk-SNARKS.
- Beefing up the smart contracts by implementing the “revert” function for them to go back to the previous state without wasting any gas and the “returndata” opcode which will enable contracts to return variable sized values.
- Increasing the amount of abstraction on individual accounts to make Ethereum more mass-friendly.
As you may have already figured out by now, Metropolis is bringing in a lot of significant changes at the same time. As such, it will be impossible to usher all of them in at once without giving them the required development time. Because of this, Metropolis is going to be further split into two more phases which will be introduced via hard forks:
The Byzantium hardfork took place on October 16, 2017, at 5:22 UTC.
Ethereum, quite like Bitcoin, is struggling with scalability issues. As of right now, Ethereum manages 25 transactions per second, which more than 3 times that of Bitcoin, but is still measly compared to other payment solutions. Scalability becomes all the more problematic when you consider that Ethereum is easily the most popular cryptocurrency out there, mainly because of the ICO craze.
Ethereum, as of right now, has 17,788 nodes while Bitcoin has 9927 nodes. Because of critical operations like ICOs, it is all the more important for Ethereum to act in an efficient manner. This issue was brought at the forefront during the Cryptokitties debacle.
Cryptokitties was one of the most well-known examples of Ethereum biting more than they could chew. It was a simple game where users could trade and collect virtual kittens. It became extremely popular, so much so that at one point in time, it was the third highest gas consuming smart contract. The demand for these kitties rose up so high that they ended up clogging the Ethereum blockchain. The number of unconfirmed transactions on Ethereum rose up by a significant amount:
The worst consequence of this transaction delay was that the SophiaTX ICO was postponed by 48 hours.
Ethereum is actively looking into scalability solutions. We have already looked into sharding, let’s look into two more solutions that Ethereum is looking to implement:
#1 Raiden Network
Quite like Bitcoin, Ethereum is not practical for microtransactions. The Raiden network, quite like the lightning network, takes these transactions off the blockchain and removes miner involvement altogether. Raiden will be structured like a mesh on top of the Ethereum main chain.
Raiden was conceptualized by Brainbot technology.
Like the lightning network, it takes these transactions off the blockchain and removes any third party whatsoever. All of the factors happen because:
Heiko Hees, founder/CEO Brainbot technology said about Raiden, “Basically all blockchain-based applications that want to scale to real-world usage will benefit from Raiden. It can be used for applications like asset trading in gaming or finance, retail payments, micropayments for content (think the next YouTube or Spotify where creators are directly paid for every second consumed). But it’s also suitable as an infrastructure for cheaper, faster and more secure correspondent banking.”
The following are the features of the Raiden Network:
- API is easy to use
- Can be operated by RDN, which is an ERC20 token.
- Enables fast and simple transfer of money and is extremely helpful for microtransactions
- Decreases load on the Ethereum blockchain
Plasma is the most exciting scalability solution that Ethereum is working on right now. If properly implemented, it can scale Ethereum up to 1 million transactions per second, and no, that’s not a typo. Plasma has been conceptualized by two of the brightest minds in the crypto-community, Ethereum co-founder Vitalik Buterin and the co-creator of Lightning Network, Joseph Poon.
So, what is Plasma?
Plasma is, in essence, blockchains built on top of blockchains. It is a series of contracts that run on top of the root chain (eg. the main ethereum blockchain). If you are looking for visual cues, then think of the Ethereum blockchain as the root and trunk of a tree (root chain) and the plasma blockchain as the branches and leaves that grow out of it (child chains).
The following image from the Plasma whitepaper will give you a good idea of the architecture.
The root chain is like the universal absolute ground truth, while the child chains work around it doing their own computations and periodically feeding state information to the root chain. The core philosophy behind Plasma is that the root chain should be as devoid and free from activity and calculations as possible while the child chains periodically feed the root chain with information. Only when some dispute needs to be resolved with the child chains, only then the root chain comes into play.
Think of a company. The company has a CEO, Alice, who needs to do her daily tasks to take care of the company. However as the company grows and gets more contracts, it becomes increasingly difficult for her to do everything on her own. This is the state of the Ethereum blockchain right now.
She then eventually hires Bob to delegate some of her tasks. She doesn’t intervene with anything that he does. Only when he is done completing the tasks, he hands over the finished product to Alice so that she can update her records with the project status.
Think of Ethereum as Alice and the child chain as Bob. The child chain does its own calculations and may have its own mechanism, and Ethereum doesn’t intervene with anything going on inside whatsoever. When the child chain is done with its “project” it updates Ethereum by sending a hash of the final result.
Currently one of the projects running on top of Ethereum, OmiseGO, is working diligently to make Plasma a reality.
There you have it. If you are new in this space then the knowledge of these cryptocurrencies should be enough to get you started. Bitcoin, Litecoin, and Ethereum are three wonderful projects who have all been revolutionary in their own sense. Bitcoin started the cryptocurrency revolution. Litecoin gave users an option to use cryptocurrencies for everyday purposes to increase adoption. Ethereum brought forward the second generation of blockchain technology and showed the whole world the true scope of the blockchain. It is impossible to tell what future lies ahead for all these three projects. However, it is safe to say, that they have shown us the true possibility of all that can be achieved by cryptocurrencies.