EOS.IO - How EOS Works
By Nicholas Brown.
Introduction To EOS: What Is EOS?
EOS.IO (often referred to as 'EOS') is a consensus-driven decentralized app (dApp) platform developed by Block.one, which uses EOS tokens to fund and facilitate various network operations. It is essentially an operating system that runs apps on decentralized infrastructure, which is distributed around the world. The network utilizes distributed ledger technology (blockchain in this case) to store and confirm transactions and it executes smart contracts on its blockchain. Its symbol on cryptocurrency exchanges is EOS.
EOS.IO is an open-source community project, meaning that developers can submit improvements to the core developers (Block.one) and is maintained by Block.one with the help of the open-source community via GitHub. The EOS.IO source code is released under an MIT license, which means it can be modified and redistributed provided that the terms in the license are met.
EOS.IO was first released on January 31, 2018, and the official network (main network) was launched in June 2018.
The EOS Token
The EOS token is a digital currency that can be sent between EOS account holders to pay for the usage of RAM, CPUs, and the network. EOS tokens can also be used for other things such as paying for goods or services (for example: a glazed donut), similarly to a fiat currency. In contrast to fiat currency (eg. US Dollar), EOS tokens are not represented by physical bank notes (eg. dollar bills) and the price of EOS tokens is set by demand and supply.
Like fiat currencies, EOS tokens are not backed by a physical commodity such as gold. However, EOS token distribution is handled differently from that of fiat currencies. Fiat currencies are issued by central banks, and the first EOS tokens were distributed via an ICO. However, inflation funds the EOS network by generating tokens to pay block producers (discussed below) among other things. This is why EOS transactions are free.
The design of EOS was partially inspired by Bitcoin, which also uses blockchain technology that produces blocks containing transactions signed with the sender's private key. A key difference between EOS and Bitcoin is the consensus algorithm. Bitcoin uses a Proof-of-Work (PoW) consensus algorithm while EOS uses a Byzantine Fault-Tolerant Delegated Proof-of-Stake (BFT-DPoS) algorithm. The Proof-of-Work algorithm works by having miners solve blocks (mine blocks) in exchange for a reward (Bitcoins, which incentivize mining).
Mining is energy-intensive due to high computational power requirements. However, it is a strong deterrent against excessive inflation. The energy usage of mining is ever-increasing due to its competitive nature, leading to the pursuit of *-PoS alternatives such as EOS.
The EOS Initial Coin Offering (ICO)EOS tokens were distributed between June 2017 and June 2018 as part of an Initial Coin Offering (ICO) held by Block.one. The ICO raised about $4hub billion dollars.
EOS tokens are stored in EOS accounts which are secured by two pairs of cryptographic keys, each containing one private key and one public key. There is an owner key pair and an active key pair. 4 keys in all. The owner key pair can be used to change the active keys (and even the owner keys). The active keys are used for day-to-day activities such as staking, voting and transferring tokens. Your owner key should be locked away and only your active key should be imported into wallets.
The ability to change your EOS account keys is useful in the event that they are stolen. While an EOS account has a private key for signing transactions as well as a public key, the public key is not what you send your tokens to.
It's your account name, which is a 12-digit string (a word or combination of letters and numerals ranging from 1-5). This means you can remember EOS account names, instead of having to read through a long cryptographic key every time.
What this means is you can see your friend's name in your transaction history instead of a hash. To be fair, you can create an address book in your Bitcoin wallet app and put your friends' names in it.
An example of an EOS account name is: eosnewyorkio
An example of a Bitcoin wallet address is: 1ACpw9mkiAvvXAVdLViAS348Ady6pJvK8z
An example of an EOS private key is: 5Jsb2z1dqijd62DQXCxgAq3xNMqP9bsGmBMDwKLwxQHWKkSPMfQ
An example of an EOS public key is: EOS6edSJZmNKYkAxvdK23ttzj9HYunxiYHfx5Q7XsjSiMrQz4iHDj
How To Send Tokens
You can send funds (EOS tokens in this case) to a friend via the following steps:
- If you owe the person a certain amount in USD, divide the USD amount by the USD price of EOS to determine how many EOS tokens that works out to.
- Enter the number of tokens to send in your wallet app.
- Enter the 12-digit account name of the person you are sending the tokens to or scan their QR code (usually by clicking 'scan').
- Click send!
Your friend should receive the tokens in a matter of seconds (it has been averaging less than 2 seconds for me). Your wallet app should have a transaction list containing the transaction ID. You can copy and paste this ID in an EOS block explorer to confirm that the transaction has been sent. Your wallet app may also just let you click the transaction and automatically bring it up for you in a block explorer for your convenience.
The transaction will become irreversible in a moment. If your friend wants to refund you, just have them follow the same process and just send the same amount back to your account.
EOS Basics: Securing Your EOS Wallet
Two of the gravest threats to your wallet/account is the theft and loss of your EOS tokens. You must ensure that you:
- Never send anyone your wallet file (if any) or private keys. It is never necessary.
- Never visit websites that you don't trust, or which are likely to contain malware.
- Always make a copy of your wallet file or keys (backup) to a secure location off your computer such as a USB thumb drive.
- Ensure the backup drive above is never used for anything else or shared with anyone. Stow it away safely.
- Don't use wallet apps that you haven't researched/confirmed to be trustworthy.
- Don't store most of your tokens on exchanges. Use a hardware or desktop wallet that gives you exclusive possession of your keys.
- Bonus (although not required): Stake most of your tokens so it takes 3 days to unstake/release them. That may give you time to save them from thieves.
Activities on the EOS.IO blockchain are 'actions', and there are different types of actions. If you are sending funds (EOS tokens or other tokens on the EOS network) to someone, that action is called a 'transfer'. Examples of actions on EOS.IO include, but are not limited to:
- 'transfer' (send tokens).
- 'voteproducer' (vote for block producers).
- 'delegatebw' (staking network resources).
- 'undelegatebw' (unstaking network resources).
EOS Block Production
EOS blocks are created by block producers (BPs) every 0.5 seconds. At any given moment, there are 21 block producers on EOS, which generate 6 blocks each. This means that 126 blocks are produced per round. Block production is a fundamental part of how EOS works, as transactions are placed in blocks, which have to be verified and signed by block producers. Only one BP is authorized to produce a block at any point in time and if a block producer doesn't produce blocks in a 24-hour period, they are omitted from the block production process until they notify the EOS chain of their intention to continue block production.
The following displays the current head block in the form of a JSON object (two seconds behind as I don't want to send too many requests to the server), which is the latest block on the EOS.IO blockchain. Every two seconds you'll see it change to the latest one. JSON is a data format used across most of the web.Blockchain data obtained with thanks from EOS Nation.
Voting For Block ProducersOn the EOS network, it is EOS token holders that vote for block producers and the number of tokens they have staked is what determines the weight of their vote. EOS also has a referendum system for users to vote on changes themselves, making the EOS network democratic in nature.
Staking EOS Tokens
Some or all of an account's EOS tokens can be staked by the owner and used to vote for block producers, and for EOS referendums. Staking is a 3-day contract (it takes 3 days to unstake EOS tokens) that reserves a portion of the system resources on the EOS network for your account. Such resources include NET bandwidth, CPU bandwidth, and RAM on the other hand can be purchased using EOS tokens. These resources are provided by block producers.
EOS Development: EOS.IO Smart ContractsAn EOS smart contract is a digitally-enforced set of rules encoded on the blockchain that is autonomously enforced. EOS dApps utilize smart contracts. EOS.IO smart contracts are executed without having to pay or involve an intermediary. As is the case with a traditional contract, a smart contract may enforce penalties or carry out obligations encoded in the contract.
Therefore, an EOS smart contract can do something automatically if certain conditions are met. How does this differ from electronic services that already do all that without a blockchain or smart contracts? For example: A customer submitting an order in an online store and the store's software generates the invoice and shipping label automatically.
There are multiple reasons: including security, data loss, transparency, and real-time collaboration with businesses outside of your own. Smart contracts are a fundamental part of how EOS works, but most notably how dApps work on the EOS network.
EOS smart contracts (or smart contracts on any other platform) may also play a role in physical activities such as collaboration between logistics networks (for example: Courier A may contract the services of Courier B to pick up the slack if they don't have enough delivery vans (a busy day, if you will).
While it's obvious that this is possible without a blockchain or smart contract, it wouldn't necessarily be economical, quick, or reliable without a blockchain. Smart contracts on blockchains help companies to instantly collaborate on a shared network without having to provide access to their own internal datacenters or other facilities.
A rough example I made up is: If a UPS package is delayed due to a lack of vans, UPS could use a smart contract to instantly submit an order to whichever courier has the lowest bid posted on the blockchain to intercept that package and deliver it to the customer. No human would ever have to place such an order themselves. Doing this between only two couriers may not need a blockchain, but a bidding system involving many couriers calls for either a blockchain with smart contracts, or a potentially expensive intermediary.
Real-World EOS Smart Contract Examples
There are many dApps on the EOS network powered by smart contracts and they include, but are not limited to:
- Decentralized Exchanges (DEX).
- Email dApps.
- Social Networks (more like Twitter).
- Instant Messaging dApps.
- Job Networks/Freelancing Platforms.
- Card Games.
Don't be fooled by the term 'dApp'. An email dApp is just an email app that happens to run on a decentralized platform (such as EOS, or the email dApp could have its own platform). One example of an email dApp with users is dmail. dmail is an encrypted email app that operates on the EOS.IO blockchain.
dmail is on-chain email in that it operates on the EOS blockchain and your email address in this case is your EOS account name, rather than something like 'firstname.lastname@example.org'. This means that dmail addresses are significantly shorter than email addresses (they're only 12 digits).
However, they are limited to the EOS blockchain at the time this article was written. This means that you must have an EOS account in order to use dmail. dmail uses 'MAIL' tokens to disincentivize spam, as sending a dmail will cost you a token. dmail tokens were distributed for free to early adopters for free to get them started, and 1,000 tokens each is enough for them to email each other.
If someone replied to you on dmail, you receive a token back from them, so a back-and-fourth conversation with someone costs you nothing. However, if a spammer wants to send out 10,000 emails. They would need 10,000 of the MAIL tokens, which complicates matters for them. Like other activities on the EOS.IO blockchain, dmails are sent via 'actions', and those actions are categorized as 'transfers' since it operates by sending tokens.
Decentralized Exchanges (DEX)
A decentralized exchange (DEX) runs independently of a corporation. However, a corporation may be involved in the development or maintenance of its source code or binaries.
One example of a decentralized exchange running on the EOS blockchain is EOSDAQ. You can submit an order to this DEX without having to manually create an account and deposit funds, and then submitting your order separately. If using the exchange in an EOS wallet app such as EOS Lynx, you can do everything with a few clicks and an EOS smart contract will handle the order's execution.
For example: You can swing by EOSDAQ without ever signing up for an account, and submit an order immediately. This is done using smart contracts. If the order is fulfilled, the EOS-based token you purchased will be sent to your wallet automatically.
You don't have to store any funds on a DEX (at least not that one). This is especially important considering that storing large portions of your funds on an exchange is a dangerous practice, even with two-factor authentication.
Using Blockchains To Build Trust (With the help of immutability)
Despite not requiring identification, which poses the risk of an unscrupulous account holder simply creating a new account if they've been caught scamming someone. An upcoming EOS account holder can build trust among other users whom have never even interacted with them by consistently staying true to their word.
How? All of that account's activity is on the EOS.IO blockchain and can be proven by anyone by pulling up their account in an EOS block explorer. They can even contact the account holders that interacted with them for feedback on what their experience with them was like.
One could also see if reputable account holders have been consistently interacting with the upcoming account. This could serve as a good sign that the upcoming account holder has integrity. This could incentivize good people to stick with one account and build a reputation.
EOS Transaction Capacity/EOS TPS Rating
The transaction capacity of EOS, typically measured in transactions per second (tps) is in the range of 3,000 to just under 4,000 tps. As is the case with other platforms, EOS has been receiving updates and may exceed that transaction capacity in the future.
EOS 2.0 has been announced and is capable of reducing execution times significantly as well as improving the overall network performance of EOS, thanks to the EOS VM/JIT compiler.
EOS vs Layer 2 Scaling Solutions
A key selling point of EOS.IO is its scalability. EOS is capable of achieving a throughput of thousands of transactions per second (TPS). Mined cryptocurrencies such as Bitcoin and Ethereum typically achieve less than 15 TPS.
EOS uses rapid block production, a proof-of-stake consensus algorithm, and few block producers to achieve this high throughput and low latency. Layer 2 scaling solutions don't scale on the main chain as EOS.IO does. Some layer 2 solutions lock tokens on the main chain (for example: Ethereum's blockchain) and then settle transactions rapidly on their own 'side' chains.
This is done using smart contracts. Once these layer 2 solutions have completed settlement, they update the state of the main chain (eventually).
Layer 2 scaling solutions usually use their own sidechain for settlement or state channels. EOS.IO has been touted as a possible scaling solution by its creators due to its high transaction capacity.
The Lightning Network uses state channels and is one of the most popular alternatives to EOS due to its impressively high transaction capacity. One reason for layer 2 scaling solutions is to help existing blockchain networks scale to higher transaction capacities without modifying their own consensus algorithms.