Introduction To Cosmos Network
This article is a script, that I wrote for the purpose of creating following video, that introduces Cosmos Network and some of its features:
Hopefully as time passess I will find more time to refine it into more readable form. Until that happens I present it to you “as is”.
Because we are getting close to the main-net launch of Cosmos Network and many people might want to quickly grasp the basics behind. I wanted to explain best to my knowledge what Cosmos is, what it is not and how you as developer, consumer or service provider can benefit from it.
Please note, that I am not associated with the project, It’s not a financial advice, I was not paid to this, nor can I guarantee that anything presented here is 100% accurate or will not be changed in the future though I believe the general idea behind should remain the same.
So, what IS Cosmos?
Cosmos is NOT a blockchain, its NOT a coin nor another dApp / Smart-contract platform. In my opinion It’s a set of tools you as a developer can use for FREE to build your own independent, fast, scalable product or platform that is using blockchain and PoS or PoA consensus behind it’s guts.
So, if you came here because you heard about launch and want to simply buy “cosmos” I have to disappoint you because not only its free for developers to use those tools, not only they are free to have their own economy but there are dozen projects using tools provided by Cosmos/Tendermint team already (or more then 36 to be precise: https://forum.cosmos.network/t/list-of-projects-in-cosmos-tendermint-ecosystem/243) Thus if you are green, there are quite few concepts you need to understand first even if all you are really interested in is the market and speculation.
Cosmos Network has 3 main building blocks those are Zones, Hubs and Bridges.
So, what is a zone and how can I create it? — Zones are the hearth of the product/platform you are building they are the blockchain based application utilizing state machine or even virtual machine that is observing the blockchain and performing actions based on its state.
If you are web developer familiar with npm modules, then cosmos-sdk might be already close to your hearth because its using similar approach where you can create and reuse modules to develop and plug in any new functionality your blockchain application might need.
If you need governance on your chain you import governance, if you need virtual machine compatible with etherum you will plug in EVM and be able to support smart contacts on your blockchain, if you want multisig feature you will import multisig and it’s all up so your desire and imagination how you will implement or reuse all those components available for you.
Behind its gust as you might already have guessed Cosmos-SDK is using Tendermint. Although there will be many more consensus engines available for cosmos in the future, that is the one that will be most commonly used post launch. Tendermint is how cosmos solves Vertical scalability is a superior to any currently known and proved by audits byzantine fault tolerance consensus engine allowing for the replication of the state machines in any programming langue with lightning fast transaction speeds, secure gossip protocols and is 100% opensource, so you can verify those claims yourself.
All that implies that after you have created your first blockchain application you will need so called validators and delegators securing your chain by economic means or authorities in case your blockchain is a private one.
Validator is a full node that will commit new blocks to your blockchain by broadcasting his signed votes upon that, and each vote will have voting power associated with the stake delegated to that validator by the delegators — that is owners of some native coin that you will be probably selling in your ICO. Of course, in a case where your blockchain is a private one you will have authorities vouching for the security of your chain and you will not use on-chain economic means to do so.
Purpose of delegaton is an economic accountability, so people can vouch with their own coins (that they most likely bought in your ICO) upon which validators are secure, and most likely not malicious. In case where delegator is wrong and validator turns out to be malicious good chunk of his staked coins will be permanently destroyed. But in case he is right, he will be receiving fee or block rewards.
Of course, all that logic and how you secure you chain and what incentives you will offer to your validators and delegators is fully up to you, as the above might or might not be the best model for your particular blockchain application use case.
It’s now worth to mention yet another Tendermint feature, that is instant finality, so the second more then 2/3’th’s of the validators agree upon new bock it becomes instantly final. Because in the before mentioned model we introduced accountability so forks in cosmos never happen which is perfect for financial applications because you no longer need to wait for multiple blocks to be certain (like in case of Ethereum and PoW) that that transaction really happened and that there is no fork and that someone didn’t double spend his coins.
I hope it’s now a little clearer what the zone is, so we can have a look at Hubs and find out what are they all about.
In the roam of internet of blockchains you probably want your zones to communicate and interact with other zones, but if you wanted to connect every one to every other you would end up with number of routes growing in quadratic peace which would be quite hard to manage especially if you want for those zones to use for example some governance module to accept and trust those other zones that are being interconnected.
To solve this issue, we can introduce a Hub. Hub is nothing else then a specialized zone named in fancy way, which purpose is to route the traffic and allow zones connected to it to communicate in more manageable way where number of routes when new ones are added grows in linear not quadratic pace.
There are many reasons why you as developer of the new project in cosmos ecosystem might want to create your own hub and not plug your zone to the existing ones.
For example, If the scope of what you are building is truly vast and your application requires Horizontal scalability — that is ease of plugging-in more zones into your system without requiring permission from some foreign hub whose governance must approve of that action first.
Second reasons might be economic one. Cosmos allows you to whitelist any coin you like as the fee coin in the network, but if your own zones are using different set of fee coins to pay for transactions and relaying Inter Blockchain Communication packets, then you would have to manage multiple coins or agree to use same ones in your system. Of course, foreign hub might whitelist coin used natively in your system but that requires permission from its governance.
Third reason might be simply politics or requirement of some not available features, or you might want to be fully independent and not relaying upon any other chain but you might still want economic potential that being connected to cosmos offers you.
Whatever the reason is I hope you are starting to see that wheater you are building a single zone or whole hub and multiple dApp zones connected to it, you are fully the owner of your own creation, not forced to use any particular coin or foreign token for your system to operate and that even connecting to other chain is fully optional and up to your needs as developer.
Its worth to mention that cosmos (hopefully not so long post launch) will offer so called shared security, that means it will be possible to have the same validator set committing new blocks for many different independent zones. To simplify the idea, you can think about it as running more than one blockchain application on the same hardware by the same validator set. In spite of appearances implications of that are vast for the whole cosmos economy. Although running a validator node is incomparably less costly then running a mining rig operation in the PoW it requires to run or rent hardware and have a knowledge how to protect yourself from hackers, DDOS attacks and downtime. In general.
That means its not so cheap for new startup to have their own independent validator sets for every single zone they would want to build or to have that many community members to run so many validator nodes for their application to be truly fault tolerant and decentralized. In such case they might want to either have their own hub that is used to provide shared security to all their zones, or they might want to use shared security of some foreign hub and pay a toll/fees to that hub for that service.
In cosmos we will most likely see three different types of companies and organizations using it.
1. Huge — those will build their own hubs and zones fully utilizing economic potential that gives
2. Medium — they will simply build their own zones and plug into existing hubs
3. Small — they will just write a contracts upon those zones that will have Virtual Machines that the Huge or the medium sized organization have provided to them.
Either way I strongly believe shared security will be among major reasons why we will see rapid boost in numbers of any of those companies.
I think now we can try to understand a little better why Cosmos Network and applications build on it can scale almost infinitely.
The simplest way of scaling blockchain is Vertical scaling, that means optimizing your consensus and propagating your blocks faster, upgrading your hardware and specializing it, etc… Ether way there are certain fundamental limits preventing that particular solutions to be anywhere close to “almost infinite” without all the nodes in the network being aware of the full state of the chain. If network connection speed of some validator cannot surpass some X GB/s that simply means he cannot propagate blocks or commit votes to other validators that are bigger then X GB and be able to do so faster then within that 1 second. Same story if the complexity of the computations that the validator needs to perform exceeds his computational or other I/O limits. And of course, cost of the hardware grows exponentially quite quickly along required computational power or networking capabilities most likely quickly surpassing incentives to run such bulky validation nodes o begin with.
There is really no reason why a cosmos zone couldn’t be able to run at 1 million TPS if we used only 4 validators (that is minimum required for a single fault tolerance) with 10Gbits connection speed between them (that’s the AWS EC2 instance limitation), and we use let’s say 300 bytes per transaction.
But who would really want to have such centralized solution as root of the whole network design, even if we top that up to 21 validators as some other currently valued at 10 billion $ crypto projects offer — that could be nothing more than a single zone cosmos, decentralization of such systems is questionable and I would say ridiculous at such market valuation… because why not buy yourself just a harddrive run centralized database, and convince ppl, that they can just trust you…
Either way its worth to note that the more validators your zone has the slower your blockchain application is going to be because you need to propagate your votes to more and more nodes, but at the same time it becomes more decentralized and fault tolerant. In case of BFT if you have 4 validators then only 1 can fail before your whole network halts, but if you have 100 then it will operate even if 33 of them would go offline. There is of course some golden balance where we can assume that decentralization gets a little better while transaction speed remains fairly decent. Thank to Cosmos its up to you as a developer to decide where that sweat spot really is in regard to your particular blockchain use-case.
Second solution is Horizontal scaling or sharding as other prefer to call it. In cosmos case it means that you can duplicate your zone as many times as you need so if single one gets saturated with tractions and fees start to raise rendering it unusable you can simply copy paste the code with close to no change and have another one with its own separate validator set plugged into the same hub and even interoperating with the first zone or any other. If a single zone that requires horizontal scaling is not throttling the network or computation power of its current validators then you would be able to use shared security and have both running on the same validator set otherwise it will require another one but on the up-side it will be more decentralized. Shared security is obviously not the ultimate solution here, but in some cases, it can be used as a part of the horizontal scaling.
Please note that even without Horizontal scaling a single zone or hub based on Tendermint could push even two up to three orders of magnitude more transactions per second then current top proof of work blockchains. To imagine how big that number is, lets say even with only 1000 TPS and 1/3’th of transaction costs on Ethereum blockchain, so let’s say 1 cent per transaction. Tendermint would generate 24h*3600s/h*1000TPS*0.01$ = 864k$ per day of revenues in fees alone not including block rewards that would be awarded to the delegators in the network. That means person owning 1/10’th of a single % of stake would be earning 864$ a day or almost 27k$ a month. If the project raised 16m$ in ICO — like cosmos hub did, the person that invested in it would and spent just 16k$ while post launch receiving 27k$ a month in revenues. So even if a single Tendermint Zone or Hub tops up and will ever require Horizontal scaling, then I don’t think that anyone would be sad about it and that there would be a shortage of people wishing to become a validator of such parallel zone and earning even a fraction of % cut of those fee rewards.
There are some fundamental tradeoffs of fault tolerant consensus protocols that we simply can’t jump over. Tendermint for example prioritizes Safety and Finality over liveness, what that means is that in in the case where more than 1/3’th of the whole world gets suddenly disconnected from internet the Tendermint Consensus would sooner stop then cause 2 irreversible forks to appear.
With all the above some may argue that up to 500 validators in the network per every single zone or hub to achieve decent transaction speeds might not be enough for the system to be truly decentralized, but what’s important, is that a single hub in cosmos will not consist and connect to a single zone, but to hundreds or even thousands of them, and that cosmos will not consist of a single separate hubs but huge interconnected collections of them. What that means is that the second we move few steps away from that picture of cosmos hub and zones, we will notice that they can form a whole galaxy of independent byzantine fault tolerant blockchains, communicating with one another, where all of them can have their own validator sets if needed or even unique consensus engines.
Imagine that as star being a hub and zones being a planets circulating around it. If a single planet dies, it does not cause its sun to collapse neither a single star dying does not cause the galaxy to collapse. So, the whole system together is decentralized, and can survive not only validators going offline, becoming malicious but even whole zones or hubs turning off would not cause it’s end. All that is not even the beginning of our journey we still stand way too close to the picture to see the whole cosmos, those galaxies can form clusters and interact with other such huge astral collections of objects, polkadot for example is one of those huge astronomical networks that cosmos will be able to connected to as well.
I think that it now becomes clearer that even if a single group of interest manages to reach and dominate a single cosmos solar system, that it would be far beyond their reach to disturb the big scope of things.
Last thing that we need to understand is how cosmos can interact with existing blockchains that have for example proof of work consensus and how can coins move from one chain to another.
Cosmos allows you to transfer coins from within its own ecosystem to the legacy blockchains like Ethereum, EOS or NEO. Or from those legacy blockchains into Web3 of Cosmos.
If you for example wanted to move Ethereum coin into cosmos you would do so via so called PEG Zone, and PEG-contract. First you would send your Ether coins or tokens to the PEG-Contract where they would be locked, then PEG-Zone would read the state of Ethereum blockchain and after it assured that your coins arrived and there were no forks in Ethereum in meantime, then PEG-Zone would issue exactly the same amount of cosmos-Ether within it. So once your coins are within cosmos you would be able to move them fast and freely thanks to Instant Finality and Inter Blockchain Communication protocol.
If you wanted to move cosmos-Ether back to its root-chain, you would send it back to the PEG-zone and after that happens, PEG-zone would trigger the unlock of your coins on the main chain so you can move them back to your wallet or anywhere you want.
If you wanted to move origin cosmos coin like Photon or Atom to the legacy blockchain like Ethereum, you would use similar logic as before. You would send atoms to the PEG-zone where they would be locked then the peg-zone would initiate a creation of the ERC20 Atom on the Ethereum blockchain using contract deployed in there so then you would be able to move it around as any other token
All that allows you do tricks like move bitcoins into cosmos network them move them from the cosmos ecosystem to the Ethereum and you would end up with real ERC20 bitcoin. Thanks to that forkdelta, DDEX or any other decentralized exchange would be finally able to have trading pair against bitcoin or any other such token that has true pegged value behind it and can be retrieved back for a real bitcoin or any other coin.
Of course, that is not how you really should use cosmos, because why would pay premium for using slow Ethereum based exchanges to trade pegged bitcoins there if you can use incomparably faster cosmos decentralized exchanges, but that’s of course up to everyone to decide on their own.
Now we can compile all what we have learned today and start to understand why thank to cosmos it will be finally possible for crypto to reach mass adoption. Some people might think that the reason why crypto is not as popular as it should be, is because of the lack of scaling, slow transaction speeds, lack of instant finality and uncertainty whether transactions arrived or not due to forks, or huge costs preventing us to have on-chain micropayments. But let me assure you that none of those is really the reason why we don’t see all of those new ICO’s and new or legacy blockchains succeed in the real world.
If you think about it for a while you will realize that the main limiting factor and Achilles foot are all those coins and tokens themselves. Currently to use some blockchain based product on Ethereum network you not only need to understand what Ethereum and GAS is to begin with, how to create a wallet, how to buy Ethereum on the exchange, then you have to buy some funny tokens you are forced to use with the product you are interested in, then right after that you will learn that you not only need that token but also Ethereum to be able to move, spend and use that token you just bough… so if you still wonder why are not all those dApps mass adapted yet, then I don’t know if I can help you.
Believe me or not, Cosmos and Web3 solves all the above issues. But if so, then what do investors would by in cosmos ICO’s ? The legacy blockchain ICO would sell you most likely some utility token that that you can spend for some on-chain service. The future project within cosmos ecosystem would most likely not sell you any coin that you would be spending in some on-chain service, what would they do is most likely offer you a governance and staking coin. Implication of that small change are so vast in my opinion that they can totally change how crypto is seen today.
You might want ask what coin would be the then used to pay for that bloody service on that “new fancy cosmos project” — my answer is — any coin, that you already have that the service provider wants to accept. Then you might ask me what coin do I need to have to spend my coin in that service — and I would answer, that you already have it, why not pay fees in the same coin you transfer? Or any other coin that cosmos zones and hubs are capable to whitelist as fee coin — and those are literally all of them. Another question you might have is what if service providers in that project does not accept my coins, then maybe you have a wrong one?… ok I am joking here. But really you either convince them or become a service provider yourself and show everyone that ppl are interested in using your unknown coin so eventually more people like you appear in the network and free market fills that demand hole. Finally, you might ask how are the people that bought the ICO want to make any money if the token is not used in the service? and that I have already answered — governance and fee rewards, and to understand how insane amount of cash a single zone can generate check that at the beginning of the article where I explain what Tendermint is and calculate exactly that.
And all that is just a peak of the iceberg, from just the user perspective, ease with which people will have access to dApps will change forever, Web3.0 paradigm finally allows people to become both consumers and producers in the vast interconnected economy. Imagine downloading dApp from the android store on your mobile, being able to share some resources that your mobile offers (that way you become a service provider) then you can earn some “points” that you can later spend in the same or in the totally different third-party dApp on the same phone. And those dApps can run on blockchain, are fast, scalable and don’t require from you any knowledge how they work, and that they are using crypto behind their guts, there is no longer a need for any coin swaps burning your time and money so greedy miners can get even more rich.
And that’s it, cosmos is not about becoming a huge single chain ruling over every other crypto and becoming the world currency with some ultimate coin that you can buy and be rich the next day, it’s about connecting all those unique and specialized chains and projects together forming ecosystem where everyone benefits from everyone else’s presence with the philosophy of all for one and one for all.