The Ultimate Guide to Ethereum: Understanding Smart Contracts, How to Use Ether, and Its Impact on the Modern Economy. This guide is perfect for those still unclear about Ethereum’s purpose.
What sets Ether apart from Bitcoin?
Ether ranks as the second most popular cryptocurrency.
Bitcoin serves as a convenient way to store and transfer funds.
However, the range of actions that can be performed with money is much broader: money can be lent, deposited, invested, and grown, among other things.
Smart contracts in Ethereum enable all these activities and provide a foundation for a new economy, free from governments and banks.
Let’s quickly understand what a smart contract is.
What is a smart contract
A smart contract serves as an alternative to traditional legal agreements. In conventional contracts, the legal system of the country where the agreement is made acts as a third party to enforce the contract.
Smart contracts function in much the same way but in a digital format. They exist within the Ethereum system, and their execution is guaranteed by computer software, underpinned by a robust mathematical framework.
Here are two straightforward examples of smart contracts.
Johnis raising money for a hoverboard on Kickstarter
Imagine a scenario where John’s company is raising $10 on Kickstarter for creating a hoverboard from «Back to the Future».
The terms of the deal are simple:
- Participants contribute $10 each.
- The funds are locked on Kickstarter.
- If 100% of the target amount is raised, Kickstarter transfers the money to the project creators.
- If the target amount isn’t raised within the set period, the funds are returned to the participants.
In this scenario, the crowdfunding platform Kickstarter acts as the third party, and we must trust it to either forward our contributed $10 to the hoverboard creators or refund it to us.
This agreement could be executed through a smart contract.
John could simply write a program in the specialized language Solidity, outlining the conditions. Once fulfilled, the contract is executed, and the transaction occurs: the funds either go to John or are returned to the contributors.
The granddaddy of smart contracts: the soda machine
Imagine a soda vending machine in a college cafeteria.
You insert coins, select your beverage, and the machine automatically dispenses your choice. This is the execution of a straightforward contract: I give you money, you give me soda, with no third-party involvement.
This means you’ve irreversibly received your soda — the machine can’t chase after you to take back the drink (assuming the machine is functioning properly).
How exactly etherium is building a new economy
To build a full-fledged economy, there’s a need for a mechanism to create contracts and a third party trusted by both sides of the deal.
However, the essence of cryptocurrency is that people don’t want to trust banks or governments.
Enter Ethereum, providing a self-sufficient technical layer that executes its functions clearly and impartially, regardless of trust. In Bitcoin, creating smart contracts is more challenging.
Currently, the global economic network is comprised of the economies of individual countries: the USA, Japan, China, the EU, and so on. Cryptocurrencies enable the disconnection of the economy from national boundaries. Ethereum represents an economy without a country. — Ryan Sean Adams, an Ethereum advocate and founder of Bankless.
Now to the practical aspect: how to use Ether and when it might be necessary.
How to use etherium
In Ethereum, there are two types of accounts: wallets and smart contracts. Both can execute transactions, store coins, and receive Ether.
The key difference lies in who controls the coins on a smart contract’s balance—it’s not a person, but an algorithm.
A traditional wallet is operated by a set of public and private keys, whereas a smart contract is controlled by the hash of its own code. This makes smart contracts immutable—altering even a single character in the contract’s code would irreversibly change its hash, leading to its rejection by the blockchain.
It’s important not to confuse the two: Ethereum and Ether are different entities.
Bitcoin can conceptually be divided into two components:
- BTC — as a monetary asset, a unit of currency
- The Bitcoin blockchain — the system that processes BTC transactions
In analogy with Ethereum:
- Ether is the cryptocurrency.
- Ethereum is the blockchain system.
It’s crucial to understand that Ether and Ethereum are not synonyms.
As an example from the traditional economic system,
Consider transferring the US dollar to Finland via a bank transfer. The primary system for interbank transactions is called SWIFT. Through it, a bank in Finland receives information about the transfer.
In the context of this example, USD can be replaced with Ether, and the SWIFT system along with the banks — with Ethereum.
How to make a transaction in Ethereum?
In Ethereum, you can do three things:
- Transfer ETH to another user.
- Create a smart contract and record it on the blockchain.
- Execute a smart contract.
A smart contract is just code that can be executed by making a transaction to its address.
When you transfer Ether, the information about your transaction is recorded on the Ethereum blockchain by a miner. When you add or execute smart contract code, the program’s code is executed upon block addition.
A fee is required for each operation.
This fee goes as a reward to the miners, whose computers are involved in adding blocks and executing smart contract code.
The unit of reward in Ethereum is called gas.
What is gas?
Gas is the unit of payment for transaction fees in Ethereum.
The price of gas in Ethereum is measured in gwei, which are fractions of Ether. One gwei equals 0.000000001 ETH.
While the cost of transferring Ether is straightforward, the cost of recording or executing a smart contract depends on its complexity—the more operations it requires, the more gas is needed for its execution.
In Ethereum, you set the fee amount for a transaction yourself. When you queue a transaction, you specify:
- The recipient’s address.
- The amount of ETH to be transferred (can be 0).
- The maximum amount of gas you’re willing to spend on the operation.
- Your bid price per gas in units of Gwei.
In the official Ethereum wallet, you set the amount of Ether to send, the destination, and the gas price. The fee is calculated based on the amount of gas multiplied by its cost in gwei.
Typically, the wallet interface includes a slider that allows you to set the gas price within a range from 1 to 60 Gwei.
For example, calculating the fee for an ETH transfer that costs 21,000 gas:
If you set the price at 1 gas = 40 Gwei, you will pay a transfer fee of 0.00084 ETH.
Why put the commission higher?
Setting a higher fee matters because the amount of gas affects the execution speed—the higher the cost, the quicker the transaction will be processed.
Miners typically sort all transactions by fee and prioritize those with higher fees for execution. If you set the price too low, the transaction might get stuck and not be processed for a long time.
Another risk with smart contracts is that the provided gas might not be sufficient for its execution. In such cases, a miner will execute part of the contract up to the point where the gas runs out. The miner will receive payment for the work done, but the transaction will not be fully executed.
So, it’s advisable not to skimp on the gas fee.
How do you calculate the optimal price for gas?
To avoid overpaying for gas, you can use services that calculate the optimal price, such as ETH Gas Station. These services display the estimated execution speed in minutes based on the set price.
Where to buy ETH?
To buy ETH, you can use the same methods as for purchasing any other cryptocurrency: through exchanges, at a currency exchange office, or by trading with friends.
At a Currency Exchange Office:
You can buy ETH almost instantly, which is convenient as it requires minimal thought and waiting.
Downsides:
- You’ll have to purchase at the exchange office’s rate, which is often less favorable than what’s available on exchanges.
- You’ll need to pay a fee to the exchange office.
On an Exchange:
On major exchanges, you have the flexibility to set a specific price for your transactions. Say you’re aiming to purchase ETH at a price of $3900 per unit.
You can place a limit order to buy Ether at your specified price of $3900. This order will automatically execute when there’s a matching sell order available. However, it might require some patience until a seller willing to accept your price comes along.
At exchanges like Bybit and Binance, apart from ETH, you can engage in trading a wide array of cryptocurrencies, offering you the opportunity to diversify your portfolio and explore various trading strategies.
Where to store ETH?
Storing it is typical — in cryptocurrency wallets.
There are three types of wallets for storing Ether:
- Device Wallet: A software application on your phone, tablet, or computer. Funds are stored directly on the device, so if the smartphone breaks or gets lost, recovering the assets is not possible.
- Cold Wallet: A physical device like a USB drive that stores your Ether. It’s the most secure storage method, but there’s a risk of losing it or forgetting the password.
- Online Wallet: You register on a website, and the wallet is accessible via the internet. Passwords can be recovered, but the service you trust has access to your funds, necessitating a high level of trust in the service.
How does the Ethereum blockchain differ from the bitcoin blockchain?
Discussing the Ethereum blockchain itself, it stores similar information to the Bitcoin blockchain, but the format differs:
- In Bitcoin, a transaction history is stored (wallet A transferred 10 Bitcoins to wallet B).
- In Ethereum, it’s a state history (wallet A currently has 1 Ether, wallet B has 10 Ether, wallet C has 0.5 Ether).
Speaking strictly technically, Ethereum is a transactional state machine, with states changing through the creation of new transactions.
Mining Differences Are Minimal
- In Bitcoin, new blocks appear every 10 minutes, while in Ethereum, they appear every 15 seconds. In both networks, miners compete to solve a mathematical problem to add a block, but only one miner receives the reward.
Bitcoin Emission: How New Coins Are Generated
- Bitcoin enthusiasts criticize Ethereum for not having a predefined total amount of ETH.
- In Bitcoin:
- The maximum number of BTC is capped at 21 million.
- The reward for mining a block halves every four years.
- This system might lead to a future where Bitcoin network participants are motivated only by transaction fees and the value of BTC itself, as the block rewards will significantly decrease.
In Ethereum, there is no clear mechanism for defining the number of coins in the system and the block reward. Instead, it uses a Minimum Necessary Issuance (MNI). Ethereum automatically adjusts the block reward to a level needed to ensure network security, making the coin supply not fixed but minimally necessary.