Gitopia is developed using the Cosmos SDK framework. The Cosmos SDK is a modular framework that simplifies the process of building custom, secure, scalable, and interoperable blockchain applications quickly.
Gitopia is a source code collaboration platform and there will be a lot of user interactions/transactions as we scale. We don’t want our users to wait for confirmations every time they perform an action or deal with pending transactions. This requirement alone meant that we couldn’t use many of the available blockchains to build Gitopia.
With Cosmos SDK, blockchains can maintain sovereignty, process transactions quickly, and communicate with other blockchains in the ecosystem, making it optimal for a variety of Gitopia’s main use cases. The other reasons for using the Cosmos SDK are as follows –
- Tendermint Consensus: The default consensus engine available within the SDK is Tendermint Core. Tendermint is the most (and only) mature BFT consensus engine in existence. It is widely used across the industry and is considered the gold standard consensus engine for building Proof-of-Stake systems.
- Open-source and Modular: The SDK is open source and designed to make it easy to build blockchains out of composable modules. As the ecosystem of open-source SDK modules grows, it will become increasingly easier to build complex decentralized platforms with it.
- Security: The SDK is inspired by capabilities-based security and informed by years of wrestling with blockchain state machines. This makes the Cosmos SDK a very secure environment to build blockchains. Access control firewalls your blockchain application against malicious modules.
- Interoperability: Blockchains built with Cosmos SDK can communicate tokens & value with other blockchains in Cosmos with the IBC module.
The Gitopia main chain uses Tendermint as its consensus algorithm. Tendermint is a Byzantine Fault Tolerant (BFT) consensus algorithm developed by Jae Kwon in 2014 to address Proof of Work’s speed, scalability, and environmental concerns.
Baked into Tendermint’s consensus algorithm is the fundamental concept of Byzantine Fault Tolerance (BFT). In order to understand BFT, it’s necessary to have an overview of what it’s solving: the Byzantine Generals Problem.
Byzantine Generals Problem
A long time ago, a handful of generals and their armies were trying to attack a city. To defeat the city, all the generals needed to attack simultaneously — any less than full participation would mean the generals would lose. The issue is that none of the generals could reliably know when to attack the city. They were all secluded to each side of the city, and communications between them were impossible to synchronize. Messages could be lost, corrupted, or forged.
The challenge that faced the generals is compounded exponentially when more people or messages are factored in. Tendermint’s BFT Proof-of-Stake allows one hundred validators to quickly and securely confirm their ledgers against each other. In other words, all validators know when to attack the city.
A BFT Proof-of-Stake algorithm overcomes the Byzantine Generals Problem by using a partially synchronous network model. Basically, this means that the generals surrounding the city — or the validators voting on a block — don’t need to act at a preset time. Blocks are not voted on a schedule or predetermined size.
Tendermint achieves this by first randomly assigning validators the right to propose a block. Then, after blocks are proposed, validators vote in a multi-round deterministic process. Meaning, the first step is fairly indiscriminate, and the second follows a prescribed order.
With Tendermint, validators are rotated on a deterministic weighted round-robin format. Thus, the more stake a validator has, the more times they may be elected as a leader.
Image source: https://v1.cosmos.network/assets
The Gitopia main chain uses Tendermint in its public Proof of Stake context. This works in the following method as described by the original Tendermint whitepaper:
“Validators are users with accounts that have coins locked in a bond deposit by posting a bond transaction. We say that a validator has voting power equal to the amount of the bonded coins.”
In such a system, the validator set is open and permissionless, which means that anyone who owns some of the staking tokens in the system can bond their coins and become a validator. In the Gitopia ecosystem, this staking token is known as LORE. The limited resource of LORE tokens acts as a Sybil prevention mechanism. A single actor cannot create multiple validator nodes in order to increase their voting power, as their voting power is determined by the total number of LORE tokens owned, not the number of validator nodes they control. Because all that determines a validator’s voting power is their bonded stake and not reputation or real-world identity, validators can choose to be anonymous or public.
Cosmos SDK modules
The Cosmos SDK can be thought of as the Ruby-on-Rails of blockchain development. It comes with a core that provides the basic functionalities every blockchain application needs, like a boilerplate implementation of the Application Blockchain Interface (ABCI) to communicate with the underlying consensus engine, a multistore to persist state, a server to form a full-node and interfaces to handle queries.
On top of this core, the Cosmos SDK enables developers to build modules that implement the business logic of their applications. In other words, SDK modules implement the bulk of the logic of applications, while the core does the wiring and enables modules to be composed together.
This means that the Cosmos-SDK is packaged with batteries included, offering you a set of universal modules that you can simply plug into your application-specific blockchain. In addition, you get features like tokens, governance, interoperability, and staking pre-built. As the Cosmos network develops, the ecosystem of SDK modules will expand, making it increasingly easier to develop complex blockchain applications.
Building a blockchain from scratch is not recommended since it is difficult to make sure that no potential bugs or vulnerabilities exist in the blockchain that you have developed. Cosmos SDK has a large community of open source developers that continuously modifies and improves the source code and ensures that vulnerabilities are found quickly and fixed. This makes blockchains built on Cosmos SDK more secure and stable.
Cosmos SDK is inspired by capabilities-based security. Capabilities constrain the security boundaries between modules, enabling developers to better reason about the composability of modules and limit the scope of malicious or unexpected interactions.
Some other important benefits an application-specific blockchain built using Cosmos SDK can bring in terms of security are:
- Developers can choose proven programming languages like Golang when building their application-specific blockchains instead of smart contract programming languages that are often more immature.
- Developers are not constrained by the cryptographic functions made available by the underlying virtual machines. Instead, they can use their own custom cryptography and rely on well-audited crypto libraries.
- Developers do not have to worry about potential bugs or exploitable mechanisms in the underlying virtual machine, making it easier to reason about the security of the application.
Image source: https://v1.cosmos.network/assets
The blockchain ecosystem is generally seen as a divided ecosystem of siloed decentralized networks that are unable to communicate or exchange data with each other, resorting to tribalism and competition instead of cooperation.
Inter Blockchain Communication (IBC) allows heterogeneous blockchains to transfer tokens and data to each other, meaning that blockchains with different applications and validator sets are interoperable. For example, it allows public and private blockchains to transfer tokens to each other. Currently, no other blockchain framework enables this level of interoperability.
Gitopia will be integrated with the Cosmos IBC layer (Inter-Blockchain Communication) in order to establish interoperability between Gitopia’s application layer and various other blockchains that are interoperable with the Cosmos IBC.
Gitopia has a tremendous amount of utility in the open decentralized cryptocurrency ecosystem, as nearly all networks in the ecosystem reserve a certain portion of tokens to incentivize community-based development. Gitopia offers these decentralized networks the ability to use Gitopia’s decentralized repository management to establish transparency and provability of code contributions from community-based developers who are incentivized with network reserves. In addition, the IBC also offers a cross-chain payment channel (which is secured by the Cosmos Hub) that these networks can utilize to fund bounties/issues/proposals on Gitopia.