Ethereum & Smart Contracts | Web3 Explained

Zachary Bloss
CodeX
Published in
7 min readJul 6, 2022

So far in the Web3 Explained series we have learned the basics of what a blockchain is, who uses them, and how they are secured. In the most recent article, we touched on the concept of rewarding Miners and Validators with cryptocurrency as a form of payment for their work. Some blockchain projects, like Bitcoin, exist to provide a decentralized store of value without government interference. Think of these projects as “digital dollars” that compete with Fiat currency. Other blockchain projects exist to provide a platform for programs to be written and executed on. In this article, we will learn about Ethereum, a blockchain technology that is a decentralized store of value, a global transaction system, and a platform to build applications on top of.

Fiat currency — pronounced just like the car company, Fiat currency is any money declared by a governing body, typically not backed by a commodity like gold or silver.

two gold coins, bitcoin on the left and ethereum on the right.
source: https://unsplash.com/photos/fx9JkS10u3g?utm_source=unsplash&utm_medium=referral&utm_content=creditShareLink

Ethereum Quick History

While Ethereum is not even a decade old, it is the leading blockchain technology in Web3. I want to give you a high-level view at the successes and failures in the Ethereum project so far. Don’t worry if the terms and acronyms are foreign concepts, I will explain them all further along in this series.

  • 2013 — a developer named Vitalik Buterin began working on a blockchain project inspired by Bitcoin’s success. Rather than copying Bitcoin exactly, Vitalik aimed to create a blockchain that was more general purpose rather just than a store of value.
  • 2015 — Ethereum launched, creating 72 Million Ether (ETH) tokens (Ethereum’s native cryptocurrency) which were distributed to early investors.
  • 2016 — A security flaw in a Smart Contract led to a hack in The DAO, resulting in $60 Million worth of ETH tokens being lost. These funds were recovered weeks later via a Fork in the blockchain.
  • 2017 — A collectible game called CryptoKitties (very similar to Tamagotchi’s) launched with massive success, demonstrating Ethereum’s potential to host decentralized applications (often shorted to dApps) on the blockchain. At their peak, CryptoKitties were selling for $200,000.
  • 2018 — The year of “ICO Summer”. Initial Coin Offerings (ICOs) are similar to Initial Public Offerings (IPOs) where the stock of a company becomes available to purchase for the first time, except ICOs are for cryptocurrencies instead of stocks. In 2018 alone, there were 3,804 ICOs which raised over $11.5B.
  • 2020 — This was the year of “DeFi Summer”. DeFi, or Decentralized Finance, provides the same services as Centralized Finance (think banks, brokerages, etc.) like borrowing, lending, and investing but with Smart Contracts instead of a middleman. At the time of writing, there is over $40B currently locked up in DeFi on Ethereum.
  • 2021 — The year of “NFT Mania”, when pictures of cartoon monkeys were selling for millions. Non-Fungible Tokens, NFTs, are Smart Contracts that represent some digital asset. At the time of writing, a popular NFT project called Bored Ape Yacht Club, which features avatar-style pictures of 10,000 cartoon apes has a market cap of $1.02B.
Bored Ape Yacht Club #2805
Bored Ape Yacht Club #2805: https://opensea.io/assets/ethereum/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/2805

Smart Contracts

All of the organizations and applications above were built onto the Ethereum blockchain. In the first article of this series, I told you that blockchains are simply a set of transactions connected together into a chain and distributed amongst the public. While this is much more accurate for Bitcoin, this does hold true for Ethereum as well (I didn’t lie this time!), however Ethereum also provides something called the Ethereum Virtual Machine (EVM). We won’t get into the nitty-gritty of what the EVM is doing, but the short story is it allows everyone in the world to write programs or applications and execute them on Ethereum itself. This means instead of building a website, developing a mobile app, or maintaining desktop software, developers can deploy their program onto Ethereum itself making it accessible to anyone in the world. We call these programs Smart Contracts.

Number of verified smart contracts deployed on the Ethereum Blockchain by date.

Example Time

Let’s revisit our summer trip example from Blockchains | Web3 Explained. In this example, we had a few friends who needed to transfer funds to each other to ultimately pay the host of the AirBnb for their summer trip. While we did utilize the transparency of blockchain technology to prove who paid their fair share, this still gives Dave or Sally the opportunity to be malicious and keep the funds.

source: https://medium.com/codex/blockchains-web3-explained-cc1e8e5a2e20

We can use a smart contract to solve this problem and provide a better user experience. AirBnb could write a smart contract that accepts payments for a given date, and once the payment amount has been deposited the funds get automatically transferred to the AirBnb Host. Most AirBnb’s use some sort of digital keypad lock or a numeric lock box for keys to the home. To take it one step further into the future, the code to the keypad lock could be sent cryptographically back to Zach, Joe, Dave, and Sally at the same time that funds are transferred to the Host all done via a smart contract.

A figured showing 4 orange stick figures stacked vertically each sending $100 to a smart contract, represented by a scroll. The scroll then has a $400 payment going to a different orange stick figure
Our summer trip example, but this time facilitated via a Smart Contract instead of a 3rd-party.

This sounds really cool, but why would someone go this route instead of just letting AirBnb handle all of this? The short answer, is AirBnb is no longer needed to facilitate this transaction. When all is said and done, payment is either made or it’s not. If our crew of friends send the funds to the smart contract, they will receive the key to the property 100% of the time because the transaction is written in code and not reliant on a 3rd-party (AirBnb) acting accordingly. If insufficient funds are deposited, those funds are returned to the appropriate sender without Zach, Joe, Dave, or Sally spending an hour on a call with customer support. Furthermore, the Host also benefits as they no longer need to pay servicing or processing fees.

This is a crucial switch in the thought process of consumers as we enter the age of Web3.

ETH

Many people wonder why digital money, like Bitcoin (BTC) and Ether (ETH), has any value. After all, it’s just digital money, couldn’t someone just make more? First, I send them this chart from the Federal Reserve of the United States showing them how they “make more” money all the time. The value of BTC is the easiest to understand: There is a limited supply, the difficulty to mine new BTC only gets exponentially harder, giving it both limited supply and high demand.

ETH is a different and much more interesting scenario. The gist is ETH is not just money, it is also the fuel needed to execute a transaction on the Ethereum Blockchain. Remember when I said that smart contracts can be deployed on the blockchain and used by anyone in the world? Well, executing that smart contract takes some computational resources, however large or small. To fund, or power, the transaction you must also send along some, usually, small amount of Ether to the smart contract. We call this small amount of Ether Gas. A portion of these gas fees are paid to Miners (and soon Validators) to reward them for their work and the rest is destroyed, or burned, permanently.

Example Time, again…

Let’s revisit our summer trip example quickly one more time. We can’t actually send US Dollars on the Ethereum blockchain. Instead, we need to send ETH to the smart contract. Once we have sent enough ETH to the smart contract, it will burn a small amount to see if conditions have been met to send funds to the Host and to transfer the code to the keypad to us. Assuming the conditions have been met, the Host receives 0.4 ETH (Ether is currently hovering around $1000 / ETH at the time of writing).

Our summer trip example powered by a smart contract that replaces the USD currency with the more accurate Ethereum cryptocurrency.

Why does ETH have value? It’s not as straight forward as other cryptocurrencies like BTC, but it’s a combination of the following:

  1. There is some limited supply of it.
  2. People purchase it to use in Smart Contracts.
  3. People purchase it to hold in hopes that the price rises.

Gas Fees

I mentioned earlier that Ethereum has never gone down or crashed. This is due in part because of Gas Fees. Gas Fees are paid to Miners and Validators as an incentive to execute and verify a transaction, and they can only process so many transactions per second. In times of extremely high usage, the gas required to have your transaction processed will increase as the Miners and Validators will seek higher returns from their work. This can result in some pretty dramatic gas fees like the spikes you see below.

The Gas fees above are denoted in a unit called Wei. Wei is technically the smallest unit of measurement in Ethereum and it’s value is 1 ETH = 10¹⁸ Wei.

Conclusion

In this article we did a deep dive on Ethereum and Smart Contracts. We covered a brief history of the Ethereum project and learned what makes it different from other blockchain technologies. Laying a solid foundation of what smart contracts are is important as the revolutionary work being done in Web3 is rooted in them. In the next article I will cover how to create a Web3 wallet. Web3 wallets are essential to buy, sell, and store cryptocurrencies. Wallets are also required to use your crypto in DeFi, NFTs, and smart contracts in general. You have learned the basics, now it is time to get hands on in the world of Web3.

Socials

Twitter: https://twitter.com/altozachmo

LinkedIn: https://www.linkedin.com/in/zachary-bloss/

ETH / BTC / DOGE / LTC / SOL — block-ops.eth

Block-Ops.xyz: https://block-ops.xyz

--

--

Zachary Bloss
CodeX
Writer for

Ethereum Developer, block-ops.xyz, block-ops.eth, MLOps Architect, ex-Staff Data Scientist