L3 Ethereum Wallets

Ethereum [Wallets]

 

A Blockchain Wallet is Software you use to communicate with your record of accounts and the blockchain. Including Spending or Receiving Tokens.

 

Wallets are often attached to the main client software.

 

 

  1. The Ethereum Client
  2. The Ethereum Virtual Machine
  3. Storing Application Data
  4. Node Software
  5. Wallet Software
  6. Mining Ethereum
  7. GHOST Protocol

 

 

The Ethereum Client

 

The Clients purpose is to allow everyone to verify that the protocol is unambiguous

There are multiple Ethereum clients and implementations across Operating Systems

 

The Client lets you download a copy of the entire Ethereum Blockchain.

 

 

Geth _> The most commonly used Ethereum Client

 

Solidity _> High Level Programming Language for Writing Smart Contracts on Ethereum

 

 

The Ethereum Virtual Machine [EVM]

 

The EVM is a sandboxed runtime environment for Smart Contracts1

 

 

EVM code:

This is a Stack Based Bytecode Language used to Write Ethereum Smart Contracts

 

Components:

  • Stack (resets)
  • Memory (resets)
  • Storage (persistent)

 

Word Size (32bytes)

 

Paradigm _> Stack-Orientated Programming Model

 

Instruction Set _> Minimal, 256-bit words (Basic Data Type), Standard Operators

 

Global Variables _> Can only access the hashes of the most recent 256 Blocks2

 

 

Writing your own Contract:

(this will be covered in detail in Course 5)

 

  1. Connect and Download the Blockchain

 

  1. Get the most recent Blockchain State and most updated Solidity versioning

 

  1. Write the Contract Creation Code

 

  1. Compile with the Solidity Command Line Compiler

 

  1. Make sure everything works on your Testnet and Calculate the Cost

 

  1. Contract Creation Code is Sent to an Empty Address and Executed

 

  1. The Output of this is Stored as the Contract Code

 

  1. This completed “Message/Transaction” is Broadcasted it to the Chain

 

 

Storing Data

 

Operations:

Message Calls _> Call another Contract, Depth Limit of 1024, (Loops preferred to Recursion)

 

Code Libraries _> Contracts can dynamically load code from other addresses

 

Logs _> Indexed Data Structure, accessible outside the blockchain, contracts can’t access it

 

Events _> Can use to implement blockchain explorer functionality

 

Removing Data _> Contract Self-Destruct Operation, storage/code removed from the state

 

 

Values:

Identifiers restricted to ASCII Character Set

String Variables are able to store UTF-8 encoded data

 

 

 

Structure:

 

Stack _> Where the Computations are Performed

 

  • 1024 Elements
  • 256-bit Words
  • Can only Move 1 element at a time from the top 16 elements
  • Can move Stack elements to storage or Memory

 

 

Storage _> The Persistent Memory

 

  • Key-value store that maps 256-bit words to 256-bit words called storage
  • Contracts can’t read/write to storage outside of their own
  • Encapsulated

 

 

Memory _> The Temporary Memory

 

  • Linear
  • Read limited to a width of 256 bits
  • Write limited to a width of 8 and 256 bits
  • Expanded by a word(256-bit) when accessing a previously untouched memory word
  • Cost of expanding Memory is Scored Quadratically
  • In each Message Call the Memory is Refreshed (a new clean instance is obtained)

 

 

Node Software

 

Mining Nodes

Miners have Control over the order of received transactions3

Miners can partially control block hashes and influence timestamps

 

Client Nodes

Static/Trusted/Boot Nodes _> Are peers that you set so that you always want to connect to

 

Full Nodes _> Full copy of the Ethereum Blockchain

 

Archive Nodes _> Can keep contract storage and code indefinitely

 

 

 

 

 

 

 

Wallet Software

 

All Ethereum based tokens work in every eth wallet automatically, but won’t appear unless the user configures their wallet to listen for the particular token contract by watching the Token Address.

 

  1. Your Private Signing Key is what you use to unlock and sign over funds (Eth/Tokens)
  2. Your Public Account Key is your address that anyone can use to send you funds.

 

 

Types:

Desktop, Web, Hardware, Paper

Centralized, Decentralized, Local

 

 

Official Wallet:

Mist/Ethereum Wallet _> Desktop, Meteor Based, Browse/Use Ethereum DAPPs (Dev-Only)

https://github.com/ethereum/mist

 

++ No official wallet for Mobile Devices ++

 

 

Popular 3rd Party Wallets:

Exodus Wallet _> Desktop, Multi-Asset Desktop Wallet

https://www.exodus.io/

 

Jaxx _> Multi-Asset Desktop and Mobile Wallet by Anthony Diiorio, Co-Founder of Ethereum

https://jaxx.io/

 

Trezor _> Secure Hardware Wallet

https://trezor.io/

 

 

Mining Ethereum

 

Incentive _> Miner ether = Securing the Network = Verifying Computation

 

Functions _> Creating, Verifying, Publishing, and Propagating Blocks in the blockchain.

 

 

Mining Checklist:

  • A fully synced Ethereum client, enabled for mining
  • Min of 1 Ethereum account, to send the mining rewards to (i.e. Coinbase)

 

 

 

Block Rewards:

The only mode of issuing new ether, post launch, is from the block rewards from mining

 

Normal Block

  • 5 Ether per Block
  • Gas Expended within the block (Fees)
  • 1/32 per uncle included (Max 2 per Block)

 

Valid Uncles

  • 375 Ether (7/8 normal reward)

 

 

Protocol:

Ethash4 _> memory hard, ASIIC resistant, difficulty set to produce blocks every 12 secs

Ethash DAG _> Directed acyclic graph

 

  • Mining power scales with memory bandwidth
  • Mining difficulty adjusts every block

 

 

Hardware:

Designed for GPU Mining to be the most efficient way

1-2GB RAM per GPU

 

 

Software:

Eth++

ethminer with geth

ethminer with eth

 

 

GHOST Protocol

 

Greedy Heaviest Observed Subtree [GHOST]:

A New Policy for the selection of the main block in the tree

 

  • Miners Converge stale “side blocks” back into the main chain
  • Requires miners begin mining whichever chain the most miners are on.

 

 

Uncles

Contains old data that was orphaned off of the main chain

 

  • Stale Blocks that are designed to neutralize network lag
  • A Reward to offset the efficiency of miners with large hash power
  • Parents that are the same ancestors (6 Blocks behind the main chain Max)

 

The Convergence of History7:

All Nodes eventually adopt the same history

 

  • It maintains a security threshold of 1 against 50% attacks regardless of honest nodes suffering extreme network delays.

 

  • Which allows for high block creation rates and large block sizes without weakening and dropping below the 50% computational edge

 

 

 

 

 

 

 

 

 

 

 

Introduction to Ethereum: Assignments Pt. 5

L3 & L4: Wallets, The Future of Ethereum

For Review

Basic Computer Science (how computers work)

Turing Machines, Programming Loops

 

Written Assignments

 

  • Measure the computing resource usage (CPU time, memory, and storage) of fully synchronizing a SPV Bitcoin wallet and a light Ethereum wallet from scratch.

 

  • Research the opportunities and the security challenges introduced with making a Blockchain that is Turing Complete vs one that isn’t. Describe why you would, or why you would not want to implement it?

 

Assigned Readings

 

  1. DuPont: “Experiments in Algorithmic Governance: A history and ethnography of “The DAO,” a failed Decentralized Autonomous Organization” (2017)
    http://iqdupont.com/assets/documents/DUPONT-2017-Preprint-Algorithmic-Governance.pdf

 

  1. Solidity Wiki: “Security Considerations”

https://solidity.readthedocs.io/en/v0.4.21/security-considerations.html

 

 

Additional Supporting Material - References

  • Solidity Wiki: “Official Docs” (Current)

https://solidity.readthedocs.io/en/v0.4.21/

 

  • Ethereum wiki: “Problems” (Current)

https://github.com/ethereum/wiki/wiki/Problems