How does Ethereum work?
I. 2a – How is ether transferred?
Imagine sending someone (e.g. your friend Gemma) an email that reads ‘1 ether’. You would:
- Log into your email account
- Enter Gemma’s email address
- Type ‘1 ether’ into the body of the email
- Hit send
- Gemma would receive a message reading ‘1 ether’
An ether transfer works in a similar way, but instead of email accounts you and Gemma each have ‘wallets’. If you were sending 1 ether to Gemma, she would receive 1 ether in her wallet, rather than an email in her inbox.
From a user’s perspective, wallets function like email accounts, but they are much more secure. Each wallet has a public address used to send and receive ether (like your email address), and a ‘private key’ used to access your funds (like your password).
An ether wallet public address (also known as a ‘public key’ or ‘wallet address’) is comprised of a string of 42 letters (A-F) and numbers (0-9), which always start with the characters ‘0x’. Public addresses are case-sensitive. Here’s an example of an ether wallet address:
Users of the blockchain can transfer funds to your wallet by entering your public address, and if you transfer ether to somewhere else it will be recorded on the blockchain as having been sent from your wallet address.
Private keys are comparable to your password. They are what enable you to access the ether you have received, and send ether to other wallets. But private keys are much, much more secure than email passwords. Private keys take the form of a 64 character long string of letters (a-f) and numbers (0-9). Here’s an example of one:
So, if you wanted to make a payment to Gemma, you would first need to have your wallet’s private key to gain access to your ether wallet and the funds held within it. You can then choose to send funds from your wallet to Gemma’s through entering her wallet’s public address.
The transaction will then be publicly recorded on the blockchain as a transfer of one ether from your wallet to Gemma’s.
II. 2b – Can you have less than one ether?
Yes you can. Ether is divisible, and can be broken up into fractions of up to 19 decimal places. The smallest fraction of an ether that you can store on a wallet, or to transfer to others is 0.000000000000000001 ETH (well under a hundred billionth of an ether). This is known as a ‘gwei’.
The divisibility of ether works just the same as regular currency. In the UK, the currency is pounds, but you can get 50p, 20p, 10p, 5p, 2p, and 1p pieces.
III. 2c – What are ‘smart contracts’?
On a fundamental level, ‘smart contracts’ are virtual ‘if-then’ contracts: a set of code that automatically executes an action when certain conditions are met. Think of a vending machine; a vending machine is programmed to give you a bag of sweets that costs £1 automatically once you have inserted £1 and selected the bag of sweets. This is what is meant by an ‘if-then’ contract: if you pay the right amount and select what you want, then the machine will give it to you. If you don’t, it won’t.
Smart contracts are what we referred to in section 1b as the ‘decentralised applications’ supported by the Ethereum blockchain. The possibilities for what can be created are virtually endless, as the functionality of a smart contract is only limited by the complexity of the code it was written with. Anything can be coded as a smart contract, from the creation of a democratic voting network for shareholders of a company, to decentralised gambling and casino games, to simple exchanges of goods and services.
Let’s consider an exchange that’s a little more complicated than a vending machine. In the physical world, if I wanted to sell my used PS4 to Bob for £180, I would tell Bob ‘If you give me £180, then my PS4 is yours’. If Bob followed up on my offer, and gave me £180, I would be personally responsible for handing my physical PS4 over.
Two scenarios are now possible: one where I hand over the PS4 and the deal is complete, and another where I refuse, and Bob chases me up for his money and possibly seeks legal action. The only way to avoid the latter situation is to employ a middleman who would hold the PS4 on escrow for Bob if he pays the £180 on time, or returns it back to me if he does not. However, just like how the banks can act fraudulently with your funds, the middleman can’t necessarily be fully trusted with Bob’s funds here, even if Bob makes the payment on time.
Smart contracts on the Ethereum blockchain get rid of the need for middlemen. Here is a simplified version of how a smart contract might work: a contract can be created where Bob will agree to put £180 worth of ether into escrow. The contract will operate on the basis that if I give the PS4 by a specifically agreed time, then the ether in escrow will go to me, and if I don’t, then the ether in escrow is refunded to Bob. All of this happens instantaneously.
Ultimately, smart contracts ensure that no two parties can be in the possession of both sides of the transaction (in this case, the PS4 and the £180) at the same time. The transaction happens instantly and without the need to place trust in a third party.
The Ethereum blockchain removes the possibility for smart contracts to be fraudulently manipulated. Just like how it records the history of ether transactions, the blockchain records the ‘state’ of all smart contracts, and makes the information publicly available. In other words, the blockchain records whether smart contracts have been executed or are yet to execute, so that there can be no disagreements about what has happened.
To give one further example of how smart contracts can be useful, have you ever seen a Kickstarter campaign that promised a great idea, but you never felt like you could invest into it because you had no idea who was behind the project and whether they would actually carry it out? A smart contract could address this issue. For instance, a contract could operate by keeping all donated funds in escrow, and the money can only be used on the condition that a certain goal of a project is reached by a specific deadline. If the goal is reached, then the funds held in escrow can go towards the project, and if it doesn’t, everyone automatically gets their money back immediately.
Smart contracts usually transact using ether, but it’s possible you may have heard before that different cryptocurrencies also exist on the Ethereum blockchain (don’t worry if this is news to you). These are known as ERC-20 tokens.
IV. 2d – What are ERC20 tokens?
Cryptocurrencies that exist on the Ethereum blockchain that adhere to ERC-20 standards are known as ‘ERC-20 tokens’. ERC-20 stands for Ethereum Request for Comment-20, although the 20 has no significant meaning. The standard was created to provide users with an easier way of storing, using, and transferring cryptocurrencies created on the Ethereum blockchain.
ERC-20 tokens are their own cryptocurrencies, separate from ether, and they are often used to fulfill a particular purpose. For example, one ERC-20 token might be used specifically as points in a loyalty program, and another might function as a discounting platform (like Groupon). Think of these tokens as cryptocurrencies with a specific purpose; whereas you might use bitcoin or ether to pay for a wide variety of things, you’re more likely to find an ERC-20 token specifically designed for betting on eSports or transacting with lower fees on a specific platform.
Almost anything can be created as an ERC-20 token, by anyone, which is why more than 10,000 exist at present.
V. 2e – What is ether mining?
Mining is the process that verifies the legitimacy of ether transactions and adds them to the Ethereum blockchain in the form of new blocks.
Remember the football players from the game in section 1c of our blockchain 101 guide, who kept score of the game without the need for a referee? They are the miners: the users of the blockchain who verify transactions without a central authority calling the shots.
When it comes to ether, mining involves computers competing to solve mathematical equations in a process known as ‘hashing’.
To imagine how mining works, it is best to envision a situation where multiple people are working on solving 5 by 5 rubik’s cube, where the first person to complete the cube is rewarded with £100.
With mining, instead of solving a rubik’s cube, miners are working on verifying ether transactions, grouping them into blocks, and adding them to the blockchain. Once this process is complete, instead of £100, the successful miner is awarded with a set amount of ether as a ‘block reward’. This reward is what encourages more people to participate in ether mining, which is what keeps the blockchain decentralised.
The mathematics behind mining are complicated, and it is not necessary to understand them fully in order to use and spend ether – just as you don’t have to be able to build a computer in order to use one, or understand investment banking to have a debit account.
If you’re interested in learning how to mine ether, you can do so on our designated ‘Mining’ pages. For now we’re going to move on to how you can buy, store, and invest ether.