Contents

Blockchain Glassory

Abstract Contract

An abstract contract is only used as a base/parent contract and cannot be instantiated. It typically contains at least one abstract function (i.e., a function marked as virtual).

Address

On Ethereum, an address is made of 20 bytes (160 bits or 40 hex characters) and is a more convenient and shorter version of an account's public key.

An example of an address is: 0x71C7656EC7ab88b098defB751B7401B5f6d8976F

Algorithmic Stablecoin

An algorithmic stablecoin mantains it's price stability by manipulating the supply of coins to adjust it's price. It does this using a smart contract/code.

Assert

assert is a Solidity function that is used for error handling. If the condition passed to an assert function returns false than the transaction will fail and the state of the contract will revert. assert is typically used to check for conditions that should never be false.

Async/Await

In JavaScript, the async and await keywords are used for asynchronous programming.The async keyword is used to define that a function will return a Promise. await will pause code execution until a Promise is resolved or rejected.

Block

In typical blockchain networks (such as Bitcoin or Ethereum) a block is a place where blockchain data (like transactions) is stored. In the Bitcoin blockchain network blocks contain the following properties.

  • Magic Number
  • Block Number
  • Block Size
  • Transaction Count
  • Transaction Data
  • Version
  • Previous Block Hash
  • Hash Merkle Root
  • Timestamp
  • Bits/Difficulty
  • Nonce
  • Block Reward
  • ...

Bytecode

Bytecode is program code that has been compiled from source code into a lower level language that can be understood by an interpreter.

Bytes

In Solidity, the bytes type represents an array of bytes. It is useful for storing characters as raw data. The bytes type must be stored in memory, calldata or storage.

bytes myRawData = "hello world";

Call

In the context of smart contracts, a call is a free operation that reads information from a smart contract. Calls do not require transactions and cannot modify the state of a smart contract.

Calldata

In Solidity, calldata is a read-only, non-persistent storage location that is used for function parameters. It behaves similarly to memory but it cannot be modified.

Centralization

Centralization refers to concentratin of control of an activity by an single organization or entity. Entities like banks, governments and most corporations are centrally controlled.

Coin

A coin is the native cryptocurrency of a blockchain network. For example, Ether is the native coin on Ethereum.

Conditional Operators

Solidity has the following conditional operators.

  • <
  • <=
  • >
  • >=
  • ==
  • !=

Constructor

In Solidity, a contract constructor is called one time when the contract is deployed. This constructor is used to initialize values or accept initial values required by the contract.

contract Constructor {
  uint count;
  constructor (uint startingCount) {
    count = startingCount;
  }
}

Crypto Collateralized

A crypto-collateralized stablecoin is a coin that holds other cryptocurrencies as reserve assets. Due to the volatility of cryptocurrencies they typically hold excess amounts in reserve.

Cryptocurrency

Cryptocurrencies are a form of decentralized digital money/currency. Cryptocurrencies don't have a central issuing or regulating authority, instead they use a decentralized system to record transactions and issue new units.

DApp

DApp stands for "Decentralized Application" and is an application that runs on a blockchain and utilizes the blockchain as it's single source of truth.

Data Types

In Solidity, data types are seperated into value types and reference types. The common value types are as follows.

  • uint
  • int
  • bool
  • address
  • bytes

Decentralization

Decentralization refers to the transfer of control of an activity or decision making to a distributed network. For example, the Bitcoin network is decentralized as it is not controlled by a central entity but by the participants in the network.

Digital Signature

In the context of blockchain networks, a digital signature is attached to a message or transaction to prove that the sending user has adequate permissions. To create a digital signature you require the private key (a.k.a. signing key) associated with the public key of the sender of the transaction.

Dynamic-Sized Array

A dynamic-sized array is an data structure that allows elements to be removed or added and can change it's size. In Solidity, dynamic-sized arrays can only be defined in storage and have access to methods such as .push() and .pop().

uint[] dynamicArray;

Endogenous

Endogenous refers to originating inside the system. In the context of stabelcoins, endogenous reserve assets exist inside of the protocol.

Enum

In Solidity, enum's are a type that allow you to restrict a variable to a predefined list of values. enum stands for enumeration and can be defined as follows.

enum Sizes {
  SMALL,  // 0
  MEDIUM, // 1
  LARGE   // 2
}

Each value in an enum is encoded with a uint value starting from 0.

ERC-20 Token

ERC-20 represents a standard for fungible tokens on Ethereum. Contracts that represent an ERC-20 token must implement specified functionality that allow for uniform usage/behavior of these tokens.

ERC-721 Token

ERC-721 represents a standard for non-fungible tokens (NFTs) on Ethereum. Contracts that represent an ERC-721 token must implement specified functionality that allow for uniform usage/behavior of these tokens.

Ether Units

Solidity provides built-in keywords that make working with amounts of Ether easier.

  • wei: the smallest unit of ether.
  • gwei: equal to 1,000,000,000 wei or 10e9 wei.
  • ether: equal to 1,000,000,000,000,000,000 wei or 10e18 wei.

Event

Events are emitted by smart contracts and stored in transaction logs. They are useful for tramsitting information from a smart contract to outside of the blockchain network. Clients sitting outside of the blockchain can query event data or listen for specific events to occur.

EVM

EVM stands for Ethereum Virtual Machine. The EVM is a computation engine that runs on Ethereum nodes such as miners. The EVM allows for the execution of smart contracts and is the foundation for Ethereum's entire operating structure.

Exogenous

Exogenous refers to originating outside the system. In the context of stabelcoins, exogenous reserve assets exist outside of the protocol.

External

In Solidity, external is a visibility modifier than can be used to mark functions as only callable from outside of the contract itself. external functions can only be called from outside of the blockchain or from another smart contract.

Fiat Collateralized

Fiat-Collateralized Stablecoins are coins that hold fiat currency (such as USD, CAD, EUR, etc.) as reserve assets. They are typically audited regularly and must hold at least $1 for each coin minted.

Fiat Currency

Fiat currency is government-issued currency that is not backed by a commodity such as gold. The US Dollar, Canadian Dollar, Euro and various other currencies are all examples of fiat currency.

Fixed-Sized Array

A fixed-sized array is a data structure whose size is determined when it is created/allocated and cannot change.

uint[5] fixedArray = [1, 2, 3, 4, 5]

Full Node

A full node is a node on a blockchain network that stores the entire history of the blockchain. In the context of Bitcoin, all miner nodes are full nodes.

Fungible

Fungible refers to the ability to replace or to be replaced by another identical item. ERC-20 tokens are fungible tokens.

Gas

In the context of Ethereum, gas is a fee required to execute transactions or smart contracts. Gas is paid in Ether and is denoted in gwei.

Genesis Block

On the Bitcoin blockchain, the Genesis Block is the first block ever created. It contains special information about the blockchain network as a whole.

Global Keywords

In Solidity, there are various global keywords that give you information about the current block, transaction and more. The following is a subset of these global keywords.

  • block
  • msg
  • tx

Hash Function

Hash Functions are known as "one-way" functions that have no known inverse. They are the foundation of modern internet security and cryptography. Hash functions have the following properties.

  • Fast to compute.
  • Generate a uniform output (a.k.a digest).
  • No known inverse.
  • Determinstic.
  • Very rare hash collisions.

Inheritance

In Solidity, inheritance refers to when a contract derives/uses the functionality from another contract. Inheritance is a way of reusing/extending functionality.

Interface

In Solidity, interfaces are used to declare the functionality that deriving/implementing contracts must override. Interfaces are used to view different contracts through the same type. They have the following properties.

  • May not have any function with implementation.
  • All defined functions must be marked as external.
  • May not have a constructor.
  • May not have state variables.
  • May define enums and structs.
interface Numeric {
  function add(uint x) external returns (uint);  
  function subtract(uint x) external returns (uint);  
}

Internal

In Solidity, internal is a visibility modifier than can be used to mark functions and variables as only accessible from within the contract or any derived contracts. internal functions can only be called from the contract they are defined in.

Layer 1

Layer 1 refers to the base blockchain network such as Ethereum or Bitcoin and it's underlying infrastructure. Layer 1 networks can validate transactions independently.

Layer 2

Layer 2 refers to a protocol that relies on an integration with an existing Layer 1 blockchain network (e.g. Polygon, Bitcoin Lightning Network). Layer 2 networks are typically faster or provide scalability solutions but may lack decentralization and security.

Ledger

A ledger is simply a collection or store of financial accounts or information. A blockchain is said to be a decentralized, distributed ledger of verifiable transactions.

Library

In Solidity, a library is a collection of reusable utility functions. Libraries contain functions that are called by other contracts and can be deployed independently to save on gas and avoid repeated code.

library Math {
  function pow(uint a, uint b) public view returns (uint) {
      return a ** b;
  }
}

Logical Operators

In Solidity, the logical operators and, or and not are implemented using the following symbols.

  • && = and
  • || = or
  • ! = not

Logs

Ethereum smart contracts can emit events, these events are stored in transaction receipts in a special area known as logs. Logs give you information about what happened during smart contract execution.

Mapping

In Solidity, the reference data type known as mapping allows you to store key-value pairs. Mappings can only be stored in contract storage and are useful for quickly accessing associated data.

Masternode

Masternodes are special nodes that only exist on certain blockchain networks. They are typically full nodes, require heaver equipment than normal nodes and may facilitate special operations such as voting. Providers of masternodes typically need to provide a stake and are compensated for their services.

Memory

In Solidity, memory is a temporary, mutable storage location that is typically used for holding reference data types. memory is a cheaper storage location than contract storage.

Metamask

Metamask is a browser extension and mobile application that provides a cryptocurrency wallet and makes it simple to interact with DApp's and send/receive Ethereum and other cryptocurrencies.

You can download it from here.

Miner

A miner is a special node on a blockchain network that is responsible for validating incoming transactions and assembling them into blocks. Miners compete/race to be the first to submit a valid block to the network. Upon submitting a valid block, miners are compensated by receiving that block's reward (if any) and the sum of all transaction fees.

Mining Difficulty

The mining difficulty is represented by a field known as bits. The number of bits states the number of 0's that the hash of each block must start with to be accepted as valid. Miners must find a valid nonce that when added to a block make it's hash start with the number of bits zeros.

Modifier

In Solidity, a modifier is used to modify the behavior of a function, typically to check repetitive preconditions. Modifiers must include at least one _, which represents a call to the modified function. See below for an example of a modifier.

modifier onlyOwner {
  require(msg.sender == owner);
  _;
}

Node

A node is any machine that is connected to a blockchain network. Nodes may be full nodes (store the entire blockchain) or partial nodes (store part of the blockchain).

Non-Fungible

Non-Fungible refers to something that is unique and cannot be replaced. Non-Fungible tokens (NFTs) are unique tokens that cannot be interchanged and all have their own unique id.

Nonce

A nonce is a special number that is added to the contents of a block by miners. The nonce is used to make the hash of a block start with a certain number of zeros, it provides the proof of work for a block.

Oracle

An oracle is an entity that provides off-chain data to the blockchain for use in smart contracts. Chainlink provides one of the most popular decentralized oracle networks.

Payable

In Solidity, the payable modifier can be added to a function or a constructor to indicate that Ether can be received when sending a transaction that invokes that function. If Ether is sent to a non-payable function and no fallback function is defined the transaction will revert.

Pragma Line

In Solidity, the pragma line is placed at the beginning of a code file to indicate the solidity compiler version(s) that can be used for this contract.

pragma solidity >=0.7.0 <0.9.0;

Private

In Solidity, the private visibility modifer is used to mark a function or variable as only accessible from within the contract it is defined in. Private functions and variables cannot be accessed from any dervied contracts, outside the blockchain or any location other than the contract they are defined in.

Note: even if something is marked as private it's value can still be read from outside of the blockchain. This is because everything on the blockchain is publicly available and transparent.

Private Key

The private key of an account acts as the password for that account. Any person with access to the private key can send/sign transactions and access the funds associated with that private keys account. Private keys should be stored in a secure location (ideally multiple secure locations) and should never be shared online or with other people.

Promise

In JavaScript, a Promise is a proxy for a value that is not yet known. Promises can be resolved or rejected. If a promise resolves it usually returns a value. If a promise is rejected it usually means an error occurred. Promises can be handled using the .then(), .catch() and .finally() methods or can be awaited using the await keyword.

Proof of Stake

Proof of stake is part of a consensus mechanism used by a blockchain network. In proof of stake blockchain networks validators are selected to verify the next set of transactions. Validators must provide a stake/collateral that can be slashed if they act with malicious intent.

Proof of Work

Proof of work is a part of a consensus mechanism used by a blockchain network. In proof of work blockchain networks miners compete to find a valid proof of work for blocks they assemble based on recent transactions. The proof of work involves finding a special value (the nonce) that when added to a block makes the hash of that block start with a certain number of zeros.

Provider

A blockchain provider is any company/service that provides nodes that can be used to interact with the blockchain.

Public

In Solidity, public is a visibility modifer that can be used to mark variables and functions as accessible from within or outside of the contract. Any variable or function marked as public can be accessed from any location.

Public Key

A blockchain accounts public key is derived from a private key and acts as the identifier for an account. Nodes on a network can validate transactions that were signed properly using an account's public key. It is safe to share your public key.

Note: a public key is a longer and less convenient form of an address.

Pure

In Solidity, a pure function is one that does not rely on any contract state to execute. However, pure functions can call other pure functions and utilize types like structs and enums.

Reference Types

In Solidity, a reference type is a type that must be stored in storage, memory or calldata. Reference types do not store data directly, instead they store a reference to the data. This allows reference types to be aliased and mutated.

Reference types consist of:

  • Arrays
  • Structs
  • Mappings

Remix

Remix is a free IDE (integrated development environment) for smart contract development. It is available in-browser or as a desktop application.

You can download it here.

Require

require is a Solidity function that is used for error handling. If the condition passed to a require function returns false than the transaction will fail and the state of the contract will revert. require is typically used to check for preconditions that should be true before executing a block of code.

Revert

revert is a Solidity function that when called causes a transaction to fail and the state of the contract to revert. revert is typically used as an alternative to require when you are dealing with complex logic.

Self Destruct

In Solidity, the selfdestruct function removes a smart contract from the blockchain and sends the balance of that contract to a provided address.

Smart Contract

A smart contract is simply code that is stored on the blockchain that runs when certain conditions are met. Smart contracts are utilized to implement purchase/sale agreements, currency exchanges, ERC-20 and ERC-721 tokens and various other decentralized applications.

Solidity

Solidity is the official programming language for Ethereum. It is used to write smart contracts for Ethereum and various other blockchain networks.

Source Code

Source code is the code that the programmers write and read.

Stack

In the context of the EVM/Solidity, the stack is an temporary internal storage location where variables are stored in 32-byte slots. It is used for small local variables and the value types of functions (i.e., the type of parameters and return values).

Storage

In Solidity, storage is a persistent location where data associated with a smart contract is held. Storage variable data is stored on the blockchain and is very expensive to read and write from.

Strings

In Solidity, the string data type is used to store UTF-8 encoded characters. Strings are not very flexible, are expensive to use and difficult to manipulate. For this reason it is preferred to use the bytes type when possible.

Struct

In Solidity, a struct is a typed collection of fields that can be treated like a custom type. Structs are useful for grouping data together.

struct Book { 
  string title;
  string author;
  uint book_id;
}

Time Units

In Solidity, there are various built in time units. These units make it easier to work with time and timestamps. The following are the valid time units in Solidity.

  • seconds
  • minutes
  • hours
  • days
  • weeks
  • years

Token

A token relies on a blockchain network and is created by a smart contract.

Transaction

In the context of blockchains, a transaction (commonly denoted "tx") represents a state changing operaton. It may represent the transfer of coins or the invocation of a smart contract.

Turing Complete

Turing Complete refers to a machine (or programming language) that, given enough time and memory along with the necessary instructions, can solve any computational problem, no matter how complex. Most modern programming languages (including Solidity) are turing complete.

Unix Epoch

The Unix epoch is the time 00:00:00 UTC on 1 January 1970.

Validator

A validator is the term used to denote a node in a proof of stake blockchain network that validates transactions and creates new blocks. Typically validators must provide a stake/collateral to ensure they act ethically.

Value Types

In Solidity, a value type is a type that holds data directly. Value types are automatically copied when assigned to parameters or variables.

View

In Solidity, a view function is one that does not mutate/modify the state of a contract but may read it. View functions can read contract state and call other view and pure functions.

Web 1.0

Web 1.0 refers to the first stage of the internet, also know as the "read-only internet". Web 1.0 focused heavily on providing information with limited focus on user experience, user generated context and web design.

Web 2.0

Web 2.0 is the era of the internet most people are very familiar with. It has a large focus on community, social media, user experience and how users interact with web pages. Web 2.0 brought the popularity of AJAX and JavaScript for designing dynamic websites. During Web 2.0 there was a large focus on front-end user interfaces and design. One of the major downsides of Web 2.0 is that data is controlled by intermediaries (e.g. Facebook, Google, Amazon etc.) and privacy is limited.

Web 3.0

Web 3.0 is an idea for a new iteration of the world-wide web which is focused heavily on backend systems, ledgers, and decentralization. Blockchains, artificial intelligence and token-based economics are prevalent in Web 3.0. Web 3.0 is focused on user immersion rather than interaction and aims to share data rather than have it be controlled by intermediaries. In Web 3.0 no one person or entity controls the internet or services provided on it, rather it is distributed and decentralized.