Title Text

 

Ethereum, DeFi, NFT & Metaverse

 

 

David Stancel

 

 

  • Ethereum
  • Decentralized Finance
  • Metaverse and NFTs

Content

About me


Contact:
david@coinstory.tech

Ethereum

 

Ethereum

 

Ethereum is a network of computers all over the world that follow a set of rules called the Ethereum protocol. The Ethereum network acts as the foundation for communities, applications, organizations and digital assets that anyone can build and use.
 

You can create an Ethereum account from anywhere, at any time, and explore a world of apps or build your own. The core innovation is that you can do all this without trusting a central authority that could change the rules or restrict your access.

Daily Active Addresses in 2022

  • 1 ether is 1 quintillion wei (1 x 1018 or 1,000,000,000,000,000,000).
     
  • Externally Owned Accounts (EOAs) - have a private key;
     
  • Contract account has smart contract code, which a simple EOA can’t have. Furthermore, a contract account does not have a private key. Instead, it is owned (and controlled) by the logic of its smart contract code: the software program recorded on the Ethereum blockchain at the contract account’s creation and executed by the EVM.

    • have an address, just like EOAs. Contracts can send and receive ether, just like EOAs. However, when a transaction destination is a contract address, it causes that contract to run in the EVM, using the transaction, and the transaction’s data, as its input

  • LLL - A functional (declarative) programming language, with Lisp-like syntax. It was the first high- level language for Ethereum smart contracts but is rarely used today.
  • Serpent - A procedural (imperative) programming language with a syntax similar to Python. Can also be used to write functional (declarative) code, though it is not entirely free of side effects.
  • Solidity - A procedural (imperative) programming language with a syntax similar to JavaScript, C++ or Java. The most popular and frequently used language for Ethereum smart contracts.
  • Vyper  - A more recently developed language, similar to Serpent and again with Python-like syntax. Intended to get closer to a pure-functional Python-like language than Serpent, but not to replace Serpent.
  • Bamboo  - A newly developed language, influenced by Erlang, with explicit state transitions and without iterative flows (loops). Intended to reduce side effects and increase auditability. Very new and yet to be widely adopted.

Languages

Currently, there are 5 main implementations of the Ethereum Execution layer, written in 5 different languages:

  • Reth, written in Rust

  • Geth, written in Go

  • Nethermind, written in C#. NET

  • Besu, written in Java

  • Erigon, written in Go,

 

Clients

Explorers

www.etherscan.io

 

www.dappradar.com

Wallets


MetaMask.io - is a browser extension wallet that runs in your browser (Chrome, Firefox, Opera or Brave Browser). It is easy to use and convenient for testing, as it is able to connect to a variety of Ethereum nodes and test blockchains. MetaMask is a web-based wallet. Supported by Trezor or Ledger.
 


MyEtherWallet (MEW) is a web-based wallet that runs in any browser. It has multiple sophisticated features we will explore in many of our examples.


  • Mobile: Argent, Dharma,

Scaling Solutions

 

  • State Channels
  • Plasma (cash)
  • Raiden
  • Optimistic Rollups
  • ZK Rollups

Layer 2s

  • Arbitrum
  • Optimism
  • Boba Network
  • StarkNet
  • Matic

....

  • Cardano
  • Polkadot
  • Cosmos
  • Avalanche
  • Dfinity
  • Near
  • Solana
  • Binance Smart Chain
  • Tezos
  • Tron

ETH "Killers"

 

  • Beacon Chain start - December 2020
     
  • The Merge - September 2022
     
  • Staking Unlock - March 2023
     
  • The Surge - December 2023 (?)

    . . .

Ethereum 2.0

  • Cryptography: https://en.wikipedia.org/wiki/Cryptography
  • Trapdoor Function: https://en.wikipedia.org/wiki/Trapdoor_function
  • Prime Factorization: https://en.wikipedia.org/wiki/Integer_factorization
  • Discrete Logarithm: https://en.wikipedia.org/wiki/Discrete_logarithm
  • Elliptic Curve Cryptography: https://en.wikipedia.org/wiki/ Elliptic_curve_cryptography

 

Cryptography

BTC vs ETH

 

  • Turing Completeness
     
  • UTXO model vs Account model
     
  • Monetary Model
     
  • TX fees vs Gas (cost x price)
     
  • Block Size vs Gas limit
     
  • PoW vs PoS
     

Gas is Ethereum’s unit for measuring the computational and storage resources required to perform actions on the Ethereum blockchain. In contrast to Bitcoin, whose transaction fees only take into account the size of a transaction in kilobytes, Ethereum must account for every computational step performed by transactions and smart contract code execution.

• Adding two numbers costs 3 gas
• Calculating a Keccak256 hash costs 30 gas + 6 gas for each 256 bits of data being hashed
• Sending a transaction costs 21,000 gas

Gas is a crucial component of Ethereum, and serves a dual role: as a buffer between the (volatile) price of Ethereum and the reward to miners for the work they do, and as a defense against denial of service attacks.

Gas

Gas Costs

Represents the units of gas required to run each operation. The gas cost of each operation on the Ethereum blockchain was predetermined in the yellow paper.

 

For instance, the gas cost of running an “addition” operation is 3 gas, and will remain 3 gas regardless of the USD value of ether. This clarification provides further insight into why we use gas instead of directly associating ether with the cost of running an operation.

 

Whereas the amount of gas needed to run a single operation cannot be easily changed by the network, the price of gas in ether can easily respond to the volatility of ether or to network traffic.

Gas Price

Is the value of a unit of gas in ether. Gas price is measured in “Gwei.” One Gwei is 1 billion Wei, and a Wei is the smallest unit of ether.

Sites such as ethgasstation.info post the average gas price on the network, but users may be willing to set a higher gas price on their transaction to be prioritized by miners.

 

Miners keep the gas (or, more exactly, the ether one pays that represents gas) that a user attaches to a transaction.

 

They will prioritize, therefore, a transaction that has a higher gas price associated with it over other transactions with a lower gas price.

Gas Limit

Gas Limit is the maximum amount of gas one is willing to spend on a particular transaction. The gas limit can be, and typically is, greater than the actual amount of gas the transaction requires.

 

If a user specifies a gas limit that is too low (i.e. the operations within the transaction collectively require more gas than the user attaches to the transaction), then a miner will complete the transaction until the gas is used up.

 

At that point, the miner would keep the fees (as they spent time and energy on executing as many of the operations as they could), the transaction would fail, and the blockchain would keep a record of the transaction as “failed.” Gas limits exist to protect users and miners both from losing funds (for users) and energy (for miners) from faulty codes or malicious attacks.

Gas Limit History

Gas Limit History II.

Smart Contracts

Smart Contracts II

Smart Contracts III

  • Self-executable pieces of software
     
  • Run on a decentralized network
     
  • Unstoppable
     
  • Virtually any kind of applications
     
  •  But with a slightly different design logic
     
  • Better naming: "Persistent Scripts"

 

A DApp is composed of at least:
 

• Smart contracts on a blockchain

 • A web front-end user-interface.

 

In addition, many DApps include other decentralized components:
 

• A decentralized (P2P) storage protocol and platform.

- Costs of Storage at Filecoin: https://filstats.com/​

• A decentralized (P2P) messaging protocol and platform


     

Decentralized apps

Costs of Storage

Web 3.0

ICOs

Total Value Locked in DeFi on the Ethereum Blockchain from August 2017 to April 2022

DeFi Data:

https://defillama.com/

  • Completely Transparent

    • Blockchain

    • Open-Source 

  • Eliminates Middlemen

  • Trust-minimizing

  • Open and permissionless

  • Composable

  • Allows unprecedented automatization

    • algorithmic finance

    • programmable money

  • Allows things that have not been possible before

    • Stablecoin with no counterparty risk

    • Flash loans

Advantages

  • Smart Contract Risk
    • Buggy code --> loss of $ 
  • Design flaws
    • Within a dapp
    • When interacting with other dapps
    • Unintended Consequences
  • Legal risks
    • Who is held accountable?
    • Accessing Dapps via Interface vs. Raw contract
    • Fitting into existing legal framework vs. rethinking the legacy frameworks

Risks

  • Token Function
    • Used for Governance vs collateral vs currency
       
  • Properly aligns incentives across stakeholders
     
  • The mechanism to maintain scarcity
    • disinflationary vs deflationary vs burned
       
  • The mechanism to generate value
     
  • The mechanism to generate network effects

CryptoEconomics Evaluation

  • artificial shortage
    • buyback and burn (Binance)
  • profit-sharing (securities!)
  • running the platform infrastructure
    • receiving fees (Renprotocol)
  • network effect (Ethereum)
  • decentralized governance (Decred, MakerDAO)
  • ownership rights (NFTs, STOs)
  • PoS with slashing (Cosmos)
  • forced token utility
    • In-app currency (Celsius -- hard to do)

 

Things that accrue value

Uniswap

Uniswap is a fully decentralized on-chain protocol for token exchange on Ethereum that uses liquidity pools (AMM) instead of order books. Anyone can quickly swap between ETH and any ERC20 token or earn fees by supplying any amount of liquidity. And anyone can create a market (i.e., liquidity pool) by supplying an equal value of ETH and an ERC20 token.

 

Uniswap allows only one market per ERC20 token. The market creator sets the exchange rate, which shifts through trading due to Uniswap’s “constant product market maker” mechanism. When trading reduces one side of the pair’s liquidity relative to the other, the price changes. This creates arbitrage opportunities, encouraging more trading.

Uniswap II.

Uniswap III.

 

  • Fiat-backed (Tether - USDT)
     
  • Crypto-backed (Dai)
     
  • Algorithmic (TerraUSD - UST)

Stablecoins

Stablecoins Market 

Dai - How

 

  • First, ETH is turned into “wrapped ETH” (WETH), which is simply an ERC20 wrapping around ETH. This “tokenizes” ETH so it can be used like any other ERC20 token.
     
  • Next, WETH is turned into “pooled ETH” (PETH), which means it joins a large pool of Ethereum that is the collateral for all Dai created.
     
  • Once you have PETH, you can create a “collateralized debt position” (CDP), which locks up your PETH and allows you to draw Dai against your collateral, which is PETH.As you draw out Dai, the ratio of debt in the CDP increases. There is a debt limit that sets a maximum amount of Dai you can draw against your CDP. Once you have Dai, you can spend or trade it freely like any other ERC20 token.

Dai - Why

  • You need a loan, and have an asset (ETH) to use as collateral for your loan
     
  • You believe ETH is going up in value. You can use your CDP to buy ETH on margin — you lock up your ETH in a CDP, draw Dai against it, use the Dai to buy more ETH on an exchange, and then use that ETH to further increase the size of your CDP.--> without any third-party or centralized authority
     
  • The demand for Dai drives the price above $1 USD. When this occurs, you can create Dai then immediately sell it on an exchange for greater than $1 USD. This is essentially free money, and is one of the mechanisms the Maker system uses to keep Dai pegged to $1 USD. Dai being worth over $1 USD encourages more Dai to be created.

Dai - Peg Mechanism

  • If Dai < $1 USD, CDP owners can pay down their debt at a cheaper price!
    • fe. CDP with $1000 in ETH --> draw out 500 Dai to close the position --> pay back 500 Dai (paying debt destroys Dai).
       
  • If Dai < $1 USD, then buy cheaper DAI (fe 0.99 USD) --> pay off debt with a 1% discount == free money — $500 loan (500 Dai) --> 500 Dai for $495 (0.99 * 500 = 495, a 1% discount)
  • --> demand for Dai increases its price, until it approaches $1 USD.
    If Dai stays below $1, CDP owners continue to pay down debt and remove Dai from the system.

     
  • --> When Dai goes above $1 USD, Dai is created to feed the demand. It is this push and pull, creation and destruction, supply and demand which ensures that Dai always matches the $1 USD peg.

Value accrued in MKR

Dai - Taking a loan

1. Deposit ETH to Metamask

2. Wrap ETH --> WETH (via Dai.makerdao.com)

3.Exchange it for PETH (pool eth), used for collateral

4. Create CDP (the loan)

5. Lock your PETH collateral

6. Mint new DAI (max. 60% of collateral)

7. Exchange DAI for ETH at Oasis DEX

8. Send ETH to any exchange and get EUR, BTC etc.

Dai - Repaing a loan

1. Get some ETH

2. Exchange it for DAI (which you owe) and MKR (for governance fee) on Oasis DEX

3. Return DAI to the smart contract and pay the fee in MKR

4. You cancel CDP smart contract

5. Unlock your PETH

6. Exchange PETH for WETH

7. Unwrap WETH --> ETH

8. You have your ETH back

In the fourth quarter of 2020 and first quarter of 2021, the gaming industry had two of its largest-ever initial public offerings (IPOs) in Unity Technologies and Roblox Corporation, both of which wrapped their corporate histories and ambitions in Metaverse-related narratives.

Metaverse

Metaverse

Start in the 1970s with text-based virtual worlds known as Multi-User Dungeons. MUDs were effectively a software-based version of the role-playing game Dungeons & Dragons.

Using text-based commands that resembled human languages, players could interact with one another, explore a fictional world populated by non-playable characters and monsters, attain power-ups and knowledge, and eventually retrieve a magical chalice, defeat an evil wizard, or rescue a princess

Great leap came in 1986 with the release of the Commodore 64 online game Habitat, which was published by Lucasfilm, the production company founded by Star Wars creator George Lucas.

 

Habitat was described as “a multi-participant online virtual environment” and, in a reference to Gibson’s novel Neuromancer, “a cyberspace.”

 

“Citizens” of Habitat were in charge of the laws and expectations of their virtual world, and had to barter with each other for necessary resources and avoid being robbed or killed for their wares. This challenge led to periods of chaos, after which new rules, regulations, and authorities were established by the player community to maintain order

The 1990s saw no major “proto-Metaverse” games, but advances continued. That decade, millions of consumers took part in the first isometric 3D (also known as 2.5D) virtual worlds, which gave the illusion of three-dimensional space, but only allowed users to move across two axes.

 

Not long after, full 3D virtual worlds emerged. A number of games, such as 1994’s Web World and 1995’s Activeworlds, also empowered users to collaboratively build a visible virtual space in real time, rather than through asynchronous commands and votes

2007 - stock exchange was launched in Second Life
with the aim of helping Second Life–based companies raise capital using the platform’s Linden Dollars currency.

 

Throughout the 2010s, bands of users collaborated in Minecraft to build cities as large as Los Angeles—roughly 500 square miles.

 

One video game streamer, Aztter, constructed a stunning cyberpunk city out of an estimated 370 million Minecraft blocks, having worked an average of 16 hours per day for a year.

 

Fortnite’s social experiences -- its famous 2020 concert with Travis Scott. In that case, “players” converged on a much smaller portion of the map.

 

The title’s standard cap of 100 players per instance was halved, while many items and actions, such as building, are disabled, thereby further reducing the workload. While Epic Games can rightly say that more than 12.5 million people attended this live concert, these attendees were split across 250,000 separate copies (meaning, they watched 250,000 versions of Scott) of the event that didn’t even start at the same time. 

 

EVE Online stands apart from games like World of Warcraft and Fortnite because all users are part of one singular and persistent realm.

Over the course of an average day in 2021, over 350 million people participated in a battle royale game—just one genre of high CCU game—and billions were able to do so. In 2016, only 350 million people in the world owned the equipment needed to render a rich 3D virtual world. At its peak in 2021, Roblox had 225 million monthly users

 

Roblox and Minecraft are among the most popular games in the world, their reach is modest when considered in the broadest terms. These two supposed titans have 30–55 million daily active users, a fraction of the global internet population of 4.5–5 billion. In effect, they are still at the ICQ stage of virtual words

 

 

Microsfot Flight Simulator -the most realistic and expansive consumer-grade simulation in history. Its map is over 500,000,000 square kilometers—just like the “real” planet earth—and includes two trillion uniquely rendered trees (not two trillion copy-and-pasted trees, or two trillion trees made up of a few dozen varieties), 1.5 billion buildings, and nearly every road, mountain, city, and airport across the world.

 

Microsoft Flight Simulator aspires for every town to not just differ from one another, but to exist as they do in real life. And it doesn’t want to store 100 types of clouds and then tell a device which cloud to render and with what coloring; rather, it wants to say exactly what that cloud should look like.

What is the role of NFTs in all this?

Non-fungible tokens

Virtual and Gaming World

Metaverse sources

1. The Streaming Book  by Matthew Ball, freely online

 

2. The Metaverse Book, and Blog by Matthew Ball

 

3. Virtual Economy by L'Atelier

 

 

How to DeFi (Book


Chapter 11 @ Coinstory.tech:

Thank you!

david@coinstory.tech

Ethereum, DeFi, NFT & Metaverse (Skillmea Kurz)

By David Stancel

Ethereum, DeFi, NFT & Metaverse (Skillmea Kurz)

DeFi

  • 55