Introduction to the Stellar network
Explore the unique features of the Stellar network
Last updated
Explore the unique features of the Stellar network
Last updated
In a previous article, we saw an introduction to blockchain technology. Except for some examples, we remained network-agnostic. In this article, we will see an introduction to a specific network.
Stellar is a public, open-source, decentralized blockchain network designed to facilitate payments (especially cross-border payments) efficiently and affordably.
To give you an idea of how much faster and cheaper it is to operate on Stellar compared to other networks, let's look at some comparative tables:
Block closure time:
Bitcoin: 10 minutes
Ethereum: 10 seconds
Stellar: 6 seconds
Average transaction fee:
Bitcoin: $1.5-2 (can reach tens of dollars)
Ethereum: $2.5
Stellar: 0.0002 XLM -> $0.000022
There are times when the network is more congested, and these fees can be significantly higher, and this happens on all networks.
Lastly, but not least, is the electrical consumption. Networks like Bitcoin that use proof of work as a consensus mechanism require enormous amounts of electricity to operate:
Electrical consumption (per transaction, 2023):
Bitcoin: 1449 kWh
Ethereum: 0.0147 kWh (PoS) - 107.75 kWh (PoW)
VISA: 0.00092 kWh
Stellar: 0.00022 kWh
Since Ethereum switched from proof of work to proof of stake, it has reduced its consumption by over 99%, going from an average of 107.75 kWh per transaction in 2021 to 14 Wh in 2023.
Applications: It is a developer-friendly network, providing many resources for application development, not only in the form of documentation but also by funding projects through initiatives like the Stellar Community Fund.
Tokenization: It is also characterized by the ease with which assets can be issued; in Stellar, it is as simple as making a regular payment.
Anchors: In the Stellar ecosystem, there are services called anchors that enable the link between the network and the traditional financial world. For example, you could use an anchor to deposit dollars, pesos, or any other fiat currency and obtain their equivalent in assets on the network. They also handle the tokenization of traditional assets.
Decentralized Exchange: Stellar natively includes a decentralized exchange, allowing users to trade and convert assets through buy and sell offers. The network automatically handles the conversion if the path involves intermediate conversions with other assets.
Liquidity Pools: The liquidity pools work in conjunction with the decentralized exchange. Unlike other networks where liquidity pools are implemented as separate applications or with smart contracts, in Stellar, they are natively incorporated into the protocol.
Stellar Consensus Protocol: This is the consensus mechanism. It is quite complex, so a detailed explanation exceeds the scope of this article, but very briefly: each validator node has a list of nodes it trusts, called a quorum set. Since each node in that set has nodes on its list that are not necessarily the same as those other nodes in the set have, these quorum sets overlap. When a sufficient number of nodes in overlapping groups agree on the validity of the block, it is added to the blockchain. Anyone can set up a node and participate in the consensus, but they must be part of the trust list of a node already participating in the consensus. This whole block validation process is carried out by sending messages, which is one of the keys to the efficiency of this consensus mechanism (it is by no means required to know the internal mechanism of this protocol to operate or work with the network).
Stellar Core: This is the software that runs on the nodes that constitute the network. It is responsible for maintaining the ledger, applying the consensus mechanism, and processing transactions. If you want to run a node, this is the program you would use. It is not necessary to use the network or develop on Stellar.
Horizon: This is the API that exposes access to the network to be consumed programmatically. You can query the network to obtain the balance of an account or information about a transaction and also send transactions. We can interact with Horizon using a browser, Postman, or any HTTP client, but when developing applications, we interact through the SDKs.
SDKs: Available in many languages, including JavaScript, C#, Python, PHP, Java, and more.
Stellar also has several networks:
PUBNET (also known as mainnet): This is the production network.
TESTNET: The staging environment, it has all the functionality of the pubnet, but only non-valuable assets exist. The ledger is reset every few months, so if you have a test environment, you will need to create all accounts again. It also has a bot (called friendbot) that funds all the accounts you need with XLM to operate.
FUTURENET: Another test network where preliminary versions of features to be later incorporated into the production network are included.
Each network has its native asset used to pay fees (i.e., the commission charged by the network for sending transactions). Just as Bitcoin has Bitcoin and Ethereum has Ether (ETH), Stellar has Lumens (code XLM). All transactions sent to the network pay a commission in XLM, both those added to a block and those that fail, as the network had to dedicate resources to process that transaction, so to avoid spam, the network always charges a commission (or fee). The minimum that can be paid for a transaction is one ten-thousandth of a lumen or 100 stroops, with a stroop being one millionth of a Lumen.
All accounts must maintain a minimum balance, currently 1 Lumen, which they cannot move. This will be discussed further in another article. Additionally, the Lumen is the only asset that does not require establishing a trustline.
Unlike other protocols, the Lumen is not received as a reward for validating transactions. Instead, when the network went into production, 100 billion Lumens were created, which were then reduced to 50 billion in circulation, and no more will be issued. Of these 50 billion, 20 billion are in the market, and 30 billion are reserved by the Stellar Development Foundation for the development and promotion of the network.
When building an application on Stellar that will consume third-party services (or implement services that can be consumed by third parties), you will likely need to adhere to certain standards that clarify how this interaction should be carried out. This is where the Stellar Ecosystem Proposals (SEPs) come into play.
SEPs are public, open-source documents that define standards for building infrastructure on the Stellar network that can interoperate. Examples include:
SEP 1: Defines the structure of TOML files to expose information about a node, asset, etc.
SEP 6: Defines how anchors and wallets interact so that the user can consume the anchor's services without leaving the wallet.
SEP 9: Specifies the fields that applications must use to request (or send) information related to processes such as KYC.
Core Advancement Proposals (CAPs) are documents dealing with changes to the core protocol of the Stellar network. Both SEPs and CAPs are freely available on GitHub.
Soroban is the platform for smart contracts on Stellar. Its development began in 2022. So far, contracts are written in the Rust programming language, then compiled to WebAssembly to be executed in a virtual machine that is part of the network's infrastructure. To develop contracts, in addition to Rust, you need to download the Soroban CLI.