Before you can understand ethereum, it helps to first understand the internet.
Today, our personal data, passwords and financial information are all largely stored on other people’s computers – in clouds and servers owned by companies like Amazon, Facebook or Google. Even this CoinDesk article is stored on a server controlled by a company that charges to hold this data should it be called upon.
This setup has a number of conveniences, as these companies deploy teams of specialists to help store and secure this data, and remove the costs that come with hosting and uptime.
But with this convenience, there is also vulnerability. As we’ve learned, a hacker or a government can gain unwelcome access to your files without your knowledge, by influencing or attacking a third-party service – meaning they can steal, leak or change important information.
Brian Behlendorf, creator of the Apache Web Server, has gone so far as to label this centralized design the “original sin” of the Internet. Some like Behlendorf argue the Internet was always meant to be decentralized, and a splintered movement has sprung up around using new tools, including blockchain technology, to help achieve this goal.
Ethereum is one of the newest technologies to join this movement.
While bitcoin aims to disrupt PayPal and online banking, ethereum has the goal of using a blockchain to replace internet third parties — those that store data, transfer mortgages and keep track of complex financial instruments.
The ‘World Computer’
In short, ethereum wants to be a ‘World Computer’ that would decentralize – and some would argue, democratize – the existing client-server model.
With ethereum, servers and clouds are replaced by thousands of so-called “nodes” run by volunteers from across the globe (thus forming a “world computer”).
The vision is that ethereum would enable this same functionality to people anywhere around the world, enabling them to compete to offer services on top of this infrastructure.
Scrolling through a typical app store, for example, you’ll see a variety of colorful squares representing everything from banking to fitness to messaging apps. These apps rely on the company (or another third-party service) to store your credit card information, purchasing history and other personal data – somewhere, generally in servers controlled by third-parties.
Your choice of apps is of course also governed by third parties, as Apple and Google maintain and curate (or in some cases, censor) the specific apps you’re able to download.
Take the example of an online document service like Evernote or Google Docs.
Ethereum, if all goes according to plan, would return control of the data in these types of services to its owner and the creative rights to its author.
The idea is that one entity will no longer have control over your notes and that no one could suddenly ban the app itself, temporarily taking all of your notebooks offline. Only the user can make changes, not any other entity.
In theory, it combines the control that people had over their information in the past with the easy-to-access information that we’re used to in the digital age. Each time you save edits, or add or delete notes, every node on the network makes the change.
It’s worth noting that the idea has been met with skepticism.
Although the apps appear to be possible, it’s unclear which blockchain applications will actually prove useful, secure, or scalable, and if they will ever be as convenient to use as the apps we use today.
Authored by Alyssa Hertig; Images by Maria Kuznetsov
The thought of using ethereum might sound intimidating, but it could be rewarding.
If the ‘unstoppable world computer’ develops according to plan, it could provide alternatives to the Facebooks and Googles that many people use everyday (as explained in “What is Ethereum?“).
Ethereum might not be as intuitive as the web as we know it today, but still, anyone with a computer or a smartphone can try the platform out as long as they own ‘ether‘ – unique pieces of code that allow updates to the blockchain’s ledger.
First, you need a place to securely store your ether (or at least a place to store your private keys). This brings us to ethereum ‘wallets’.
One caveat is that losing your private key is a much bigger deal than misplacing a password: it means losing your ether, forever.
Removing trusted parties is a two-edged sword. While intermediaries are no longer needed to verify transactions, there’s no help desk to turn to for help recovering your secret key.
With that in mind, there are plenty of options for wallets to store cryptocurrency: desktop wallets, web wallets, hardware wallets and paper wallets.
Choosing one depends on your preferences for convenience and security. Usually these two concepts are at odds with one another: the more convenient, the worse the security (and vice versa).
Desktop wallets run on your PC or laptop. One option is to download an ethereum client (a copy of the entire ethereum blockchain). There are a few ethereum clients written in different programming languages and with different performance tradeoffs.
This process can take up to a couple days, and will only increase as ethereum grows. The wallet then needs to stay in sync with the latest transactions on the blockchain.
Mobile clients, or ‘light’ clients, require less data to be downloaded to connect to the network and make transactions, so they are more suitable for download to a smart phone.
The light client option is more convenient, but not quite as safe. Full ethereum clients offer a more secure way of receiving transactions because they do not need to trust miners or nodes to send them accurate information – they validate transactions themselves.
Storing private keys on a device that is detached from the internet (a method known as ‘cold storage’) is harder to hack and is best used for storing large ether holdings.
However, the method is not as easy to use as when ether is stored on a smartphone or internet-connected computer.
Hardware wallets, which are often as small as a finger or two, arguably offer the best of both worlds. These secure devices that can often be detached from the internet, and can sign transactions without being online.
But again, this deposit-box-like system is not a good option if you want to use ether frequently or on the move.
Another cold storage option is to print or carefully handwrite a private key on a slip of paper, a ‘paper wallet’, and lock it somewhere secure like a deposit box. Online tools can generate key pairs directly on your computer – not on a website’s servers, which could leave keys vulnerable if the site is hacked.
It’s also possible to generate keys using the command line, provided you have the necessary cryptographic packages installed for your preferred language.
All that said, again, if you lose your private key, it’s gone for good.
So, best practice is to spend some extra time creating multiple copies of the private key and stashing them in different secure locations, in case one is lost or destroyed.
Obtaining ether varies by country, or at least by currency. You need to find someone either online or in-person who has ether and wants to trade.
There’s always the option of meeting in-person to buy or sell ether, especially if living in a city with frequent ethereum meetups, such as New York or Toronto.
That’s not always an option in less populated areas. Exchanges allow users to buy ether directly with dollars or bitcoin. Typically there is a sign-up process.
Buying ether with another currency might take an extra step.
Bitcoin is the most commonly used cryptocurrency, and people around the world are more likely to want to trade for it in their currency. So, if you want to buy ether for rubles, for instance, the easiest way might be to purchase bitcoin at an exchange and then trade that for ether.
Once you have ether, you can send it directly to another person (‘peer-to-peer’). It will likely cost a small transaction fee paid to miners.
What can users do once they have ether?
You may have noticed that the wallet and exchange lingo up to this point has been quite similar to bitcoin. But ethereum applications are quite different.
Users with ether can join or create smart contracts (code that automatically executes the terms of an agreement so that you don’t have to rely on a third party).
Bundles of smart contracts can be used to create decentralized applications (‘dapps’), which you can use or join.
What’s the system?
But before we go any further, it’s worth explaining a little bit about how it works. Ethereum and other cryptocurrencies have an admittedly confusing storage system.
Perhaps it’s useful to compare it to what we already know.
Notice the string of numbers on the front of your credit card? It’s necessary for banks to determine where they should send money when the card is swiped. Cryptocurrencies allow you to generate similar identification numbers that identify where to debit funds.
In this system, there are two main components that users need for identification: the public key and the private key. Usually represented as a scrambled string of numbers and letters, the two keys are linked together by cryptography.
The public key can be sent to others so that they know where to send your money. If you want people to send you ether, you need an address: a scrambled string of letters and numbers derived from the similarly scrambled public key, for people to send coins to.
To spend ether, you need to sign over the funds with your private key, which, as the name implies, is similar to a password. In the credit card analogy, it’s similar to the pin used to unlock your funds at the ATM or in a store.
So, what’s the benefit of this system? One key difference in open blockchains (such as bitcoin and ethereum) is that users can generate an identification number for their funds at any time. They don’t need to wait for a bank to approve a bank account application and present the credit card.
Authored by Alyssa Hertig
Now that we’ve covered what ethereum is, let’s dive deeper into how the platform functions under the hood.
Consider the online notebook application described in “What is Ethereum?“
Using ethereum, the app doesn’t require one entity to store and control its data. To accomplish this, ethereum borrows heavily from bitcoin’s protocol and its blockchain design, but tweaks it to support applications beyond money.
Ethereum aims to abstract away bitcoin’s design, however, so that developers can create applications or agreements that have additional steps, new rules of ownership, alternative transaction formats or different ways to transfer state.
The goal of ethereum’s ‘Turing-complete’ programming language is to allow developers to write more programs in which blockchain transactions could govern and automate specific outcomes.
This flexibility is perhaps ethereum’s primary innovation, as explained in the guide “How Ethereum Smart Contracts Work“.
The ethereum blockchain
The structure of the ethereum blockchain is very similar to bitcoin’s, in that it is a shared record of the entire transaction history. Every node on the network stores a copy of this history.
The big difference with ethereum is that its nodes store the most recent state of each smart contract, in addition to all of the ether transactions. (This is much more complicated than described, but the text below should help you get your feet wet.)
For each ethereum application, the network needs to keep track of the ‘state’, or the current information of all of these applications, including each user’s balance, all the smart contract code and where it’s all stored.
Bitcoin uses unspent transaction outputs to track who has how much bitcoin.
While it sounds more complex, the idea is fairly simple. Every time a bitcoin transaction is made, the network ‘breaks’ the total amount as if it was paper money, issuing back bitcoins in a way that makes the data behave similarly to physical coins or change.
To make future transactions, the bitcoin network must add up all your pieces of change, which are classed as either ‘spent’ or ‘unspent’.
Ethereum, on the other hand, uses accounts.
Like bank account funds, ether tokens appear in a wallet, and can be ported (so to speak) to another account. Funds are always somewhere, yet don’t have what you might call a continued relationship.
What is the ethereum virtual machine?
With ethereum, every time a program is used, a network of thousands of computers processes it.
Contracts written in a smart contract-specific programming languages are compiled into ‘bytecode’, which a feature called the ‘ethereum virtual machine’ (EVM) can read and execute.
All the nodes execute this contract using their EVMs.
Remember that every node in the network holds a copy of the transaction and smart contract history of the network, in addition to keeping track of the current ‘state’. Every time a user performs some action, all of the nodes on the network need to come to agreement that this change took place.
The goal here is for the network of miners and nodes to take responsibility for transferring the shift from state to state, rather than some authority such as PayPal or a bank. Bitcoin miners validate the shift of ownership of bitcoins from one person to another. The EVM executes a contract with whatever rules the developer initially programmed.
Actual computation on the EVM is achieved through a stack-based bytecode language (the ones and zeroes that a machine can read), but developers can write smart contracts in high-level languages such as Solidity and Serpent that are easier for humans to read and write.
As explained in our guide “How Ethereum Mining Works“, miners are the ones that are preventing bad behavior – like ensuring that no one is spending their money more than once and rejecting smart contracts that haven’t been paid for.
There are a few thousand ethereum nodes out there, and every node is compiling and executing the same code.
But, you might be thinking, isn’t that much more expensive than a normal computation? Yes, it is. That’s why the network might only be used only for particular use cases.
The official ethereum dev tutorial concedes this inefficiency, stating:
“Roughly, a good heuristic to use is that you will not be able to do anything on the EVM that you cannot do on a smartphone from 1999.”
Authored by Alyssa Hertig; images by Maria Kuznetsov
Internet users don’t have sole control over the data they share on today’s websites.
Ethereum is unique in that it attempts to wield the blockchain as a way to correct what its designers believe is a problematic part of the internet’s design.
It’s like a “decentralized appstore” where anyone can publish their unstoppable apps (dapps), which unlike today’s apps (think Gmail or Uber) don’t require a middleman to function or to manage a user’s information.
Dapps connect users and providers directly.
One example is to use this design for a decentralized Twitter that’s resistant to censorship. Once you publish a message to the blockchain, it can’t be erased, not even by the company that created the microblogging system.
There isn’t one definition of a dapp, though, as it’s a newer concept.
A couple of main characteristics are that they’re open source and don’t have a central point of failure.
With this new technology out in the wild, ethereum advocates might feel electrified by the thought of decentralizing “all the things.” But the types of applications that users can build with the computing platform might be somewhat narrow.
The ethereum white paper splits dapps into three types: apps that manage money, apps where money is involved (but also requires another piece), and apps in the “other” category, which includes voting and governance systems.
In the first type of app, a user may need to exchange ether as a way to settle a contract with another user, using the network’s distributed computer nodes as a way to facilitate the distribution of this data.
The second type of app mixes money with information from outside the blockchain.
For example, a crop insurance application that’s dependent on an outside weather feed. (Say a farmer buys a derivative that automatically pays out if there’s a drought that impacts his work.)
To execute, these smart contracts rely on so-called “oracles” that relay up-to-date information about the outside world. (Though, it’s worth noting that some developers are skeptical that this use case can be done in a decentralized way.)
If bitcoin can do away with financial authorities, is it possible to do the same for companies and other types of organizations?
Decentralized autonomous organizations are one particularly ambitious breed of dapp (this is explained further in ‘What is a DAO?‘).
The goal is form a leaderless company, program rules at the beginning about how members can vote and how to release company funds and then… let it go.
Authored by Alyssa Hertig; images by Maria Kuznetsov
Like many ideas in the blockchain industry, a general confusion shrouds so called ‘smart contracts’.
A new technology made possible by public blockchains, smart contracts are difficult to understand because the term partly confuses the core interaction described.
While a standard contract outlines the terms of a relationship (usually one enforceable by law), a smart contract enforces a relationship with cryptographic code.
Put differently, smart contracts are programs that execute exactly as they are set up to by their creators.
First conceived in 1993, the idea was originally described by computer scientist and cryptographer Nick Szabo as a kind of digital vending machine. In his famous example, he described how users could input data or value, and receive a finite item from a machine, in this case a real-world snack or a soft drink.
In a simple example, ethereum users can send 10 ether to a friend on a certain date using a smart contract (See our guide “What is Ether?“).
In this case, the user would create a contract, and push the data to that contract so that it could execute the desired command.
Ethereum is a platform that’s built specifically for creating smart contracts.
But these new tools aren’t intended to be used in isolation. It is believed that they can also form the building blocks for ‘decentralized applications’ (See: “What is a Dapp?“) and even whole decentralized autonomous companies (See: “What is a DAO?‘)
How smart contracts work
It’s worth noting that bitcoin was the first to support basic smart contracts in the sense that the network can transfer value from one person to another. The network of nodes will only validate transactions if certain conditions are met.
But, bitcoin is limited to the currency use case.
By contrast, ethereum replaces bitcoin’s more restrictive language (a scripting language of a hundred or so scripts) and replaces it with a language that allows developers to write their own programs.
Ethereum allows developers to program their own smart contracts, or ‘autonomous agents’, as the ethereum white paper calls them. The language is ‘Turing-complete’, meaning it supports a broader set of computational instructions.
Smart contracts can:
- Function as ‘multi-signature’ accounts, so that funds are spent only when a required percentage of people agree
- Manage agreements between users, say, if one buys insurance from the other
- Provide utility to other contracts (similar to how a software library works)
- Store information about an application, such as domain registration information or membership records.
Strength in numbers
Extrapolating that last point, smart contracts are likely to need assistance from other smart contracts.
When someone places a simple bet on the temperature on a hot summer day, it might trigger a sequence of contracts under the hood.
One contract would use outside data to determine the weather, and another contract could settle the bet based on the information it received from the first contract when the conditions are met.
Running each contract requires ether transaction fees, which depend on the amount of computational power required.
As explained in our guide “How Ethereum Works“, ethereum runs smart contract code when a user or another contract sends it a message with enough transaction fees.
The Ethereum Virtual Machine then executes smart contracts in ‘bytecode’, or a series of ones and zeroes that can be read and interpreted by the network.
Authored by Alyssa Hertig; images by Maria Kuznetsov