This document includes miscellaneous topics that Liuba went over

Can we achieve a decentralized, trustless application? Bitcoin achieved a decentralized, trustless ledger of transactions, but can we use blockchains to extend the theory to general computing?

The goal is a “world computer”

  • Security
  • Storage
  • Anyone can submit programs
  • Build-in currency system; computation costs money

Ethereum uses smart contracts to build state machines
Accounts can operate on these contracts

In a sense, Ethereum is a replicated state machine on top of a shared log
Ethereum used to use proof of work, but has moved to proof of stake for consensus

Addresses map to either externally owned accounts (containing only a balance) or a contract account
Contract accounts contain balance, code, and state

Operations are transactions, which can either

  • Deploy a contract,
  • Send a message (address, method, data, value for balance)

Contracts run in a Turing-complete, low-level language that compiles to EVM bytecode
All operations cost gas and transactions will abort if there is not enough gas

ENS is a unique name service

ERC-20 is a currency standard for Ethereum, supporting issuing tokens, tracking balances, and trading

  • It allows for initial sales via auctions
  • It allows for rewarding computational problems

These financial applications are often labeled as DEFI

The DAO was a decentralized autonomous organization launched on Ethereum in 2016

  • An exploit was discovered that allowed siphoning off money from the contract
  • The exploit is a rather simple but subtle concurrency issue

Proof of Stake, as opposed to proof of work, is how Ethereum currently managed consensus

  • This system uses a verifiable random function algorithm (Ethereum uses RANDAO) to ensure fairness, which uses public-private key verification
  • A system locally generates verifiable random numbers until it finds a number that matches their address (within a range dependent on their stake)
  • This is effectively a signature
  • However, only participants with stake have probability of being selected

More details at [[PoS)](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/|Proof-of-stake (PoS)]]

How do we implement an atomic transfer between different currencies between two non-trusting groups? We use hashed timelocked contracts. A hashlock prevents an asset token from being transferred unless the contract receives a matching secret,

  1. Alice creates a random secret that hashes to and makes a contract saying “You get my asset if you provide
  2. Bob makes a contract saying “You get my asset if you provide
  3. Alice then reveals to Bob to claim his asset, and he then uses to claim her asset

We include time-locks and give Bob’s contract a shorter time, so he can get his Ethereum back if she never reveals