More Than a Cryptocurrency
Ethereum is a system based on blockchain technology that enables easy design and use of decentralized applications, contracts, and tokens. The creators of Ethereum saw the invention of Bitcoin, liked the idea of cryptocurrency, and loved the idea of the blockchain. They created Ethereum to give developers all the tools they need to create decentralized anything:
Ethereum does this by building what is essentially the ultimate abstract foundational layer: a blockchain with a built-in Turing-complete programming language, allowing anyone to write smart contracts and decentralized applications where they can create their own arbitrary rules for ownership, transaction formats and state transition functions.
If Bitcoin is the spreadsheet, then Ethereum is the macro.
How Does Ethereum Work?
The secret sauce to Ethereum is the smart contract. Smart contracts are little programs on the blockchain that fulfill given tasks. They are public and immutable because of the blockchain. Everyone can see them, there is no hidden code, and they can’t be changed. Crypto is all about working in a system without trust, and smart contracts facilitate that well.
Ethereum has gone through great lengths to keep smart contracts simple, but not simplistic. For instance, smart contracts can read information from the blockchain, outside sources and store information. All three of these aspects come into play for hedging bets.
Alice and Bob have differing views on Bitcoin and want to speculate on its price in a week. They agree to terms, create a smart contract, and send $1000 worth of Ether (the cryptocurrency of Ethereum. When you buy or trade ETH, it’s Ether, not Ethereum). Then the smart contract waits for a week. It reads the price of Bitcoin, determines if Bob or Alice is a better trader, and then redistributes Ether based on the immutable terms of the contract. Easy, fully transparent, automated, and trustless.
Smart contracts can also be used to create entirely new cryptos called tokens. These tokens can then be used as currencies, reward systems, or even distributing code art.
How do Smart Contracts Actually Work?
Smart Contracts are triggered when they are sent a message or transfer of ETH. As such, the miner that works on the triggering message will also work through the contract. After, any nodes that validate the block, also validate the smart contract.
Smart contracts could be used by bad actors to attack the Ethereum blockchain. For example, Smart contracts could be written to contain infinite loops (a program that, for all intents and purposes, stalls out a computer). The attacker then sends uses this to force nodes into infinite loops.
Theoretically, this could be done many times over and crash the entire network (no nodes would be free to work on actual transactions). To prevent this from happening, Ethereum transaction fees are designed a little differently than Bitcoin’s.
Ethereum transactions, smart contracts executions, and any other computation or data transfer all cost ‘gas’. Different actions cost a different amount of gas depending on their computationally difficulty. The gas cost is the resource cost the network will expend when filling the transaction.
The sender sets two properties when making a transfer: the gas limit and the gas price. The gas limit regulates the amount of effort the miner can exert, and the gas price is how much Ether the sender is willing to spend. For example, Alice sends Bob some Ether. She gets to note how much gas a node is allowed to use on the transaction, as well as how much she is willing to pay for gas (the more you pay for gas, the quicker your transaction will be processed).
Then, miners get to see roughly how much gas the transaction will use and at what price. If the miner knows their setup can’t turn a profit on the transaction fee, then they won’t work on it.
However, let’s say an attacker still tricks a miner into an infinite loop contract. The miner starts working and loops and loops. Eventually the gas limit of the transfer is reached. If the contract is not fully executed by the time the gas limit is reached, everything is reverted. However, the miner gets to keep the fee. This essentially means that unless an attacker has an infinite amount of Ether to spend, a miner won’t get caught in an infinite loop.
Ethereum Similarities to Bitcoin
Ethereum shares some of the same blockchain mechanics as Bitcoin. The main similarity is that both Bitcoin and Ether are mined, or use a proof of work system. However, Bitcoin uses SHA-256 for hashing work and Ethereum uses it’s own protocol called Ethash (though Ethereum will be moving to a Proof of Stake system by 2021).
Ethash is used to solve some perceived shortcomings of the SHA-256 Proof of Work method. As SHA-256 is purely mixing bits, miners have been able to develop Application Specific Integrated Circuits (ASIC) that are boss at bit bashing. Each ASIC is about 10,000 times better than a normal desktop at hashing. This means only people with ASICs can profitably mine Bitcoin. Ethereum wants to keep mining at the desktop level (so anyone can join!), and included some elements into Ethash that limit ASIC development.
Also similar to Bitcoin, miners get a reward for mining a block. ETH miners get 2 ETH as a block reward in addition to transaction fees. This seems a lot less than Bitcoin’s 12.5 BTC per block, but this is because an Ethereum block is mined every 15 seconds compared to Bitcoin’s 10min generation rate.
Additionally, the block reward for Ethereum does not decrease with time. This would result in an infinite supply of ETH over an eternity, but the Ethereum community reasons that this will not happen. When people transfer ETH to a bad address, forget their private key, or die (and take their keys with them), some ETH is lost. As adoption increases, the creators believe the constant generation of ETH will offset the constant loss.
Further, although ETH and BTC are both cryptocurrencies, Ethereum does not view itself as a competitor to Bitcoin:
Ethereum would never be possible without Bitcoin—both the technology and the currency—and we see ourselves not as a competing currency but as complementary within the digital ecosystem. Ether is to be treated as “crypto-fuel”, a token whose purpose is to pay for computation, and is not intended to be used as or considered a currency, asset, share or anything else.
Ethereum, The Crypto That Can Be Anything
The creators of Ethereum see the potential of the blockchain and decentralized applications. To enable developers to create, Ethereum offers an impressive decentralization toolkit. While crude smart contracts are possible on the Bitcoin Blockchain, Ethereum was built with a complete package in mind. If you can create logic around it, it can be decentralized on Ethereum. Whether that be a cool new token, a decentralized corporation, or kitties.