Digital Assets — Terminology and Concept
Some basics:
Blockchain — a database that is distributed across millions of computers and secured with cryptography. Blockchain is made up of a string of blocks. Each block has many transactions. Each block will have a hash of the previous block stored inside it. The hash takes the entire contents of the block to get a big hash number. All data on a public blockchain can be read by anyone unless you encrypt it with your key.
Ethereum blockchain — added a programming layer on top of the blockchain database. Apps can be written and run on this network of millions of computers. The source code of these apps is open for all to see. All data on the blockchain is also open for all to see unless encrypted. Ethereum now uses proof of stake, unlike bitcoin which uses proof of work for consensus (i.e. agreeing on when to add a block to the chain).
Proof of Work — miners have to solve a computationally difficult puzzle to find nonce and once verified will get a fixed amount of bitcoins + transaction fee that was pledged for the transaction. Electricity cost is expensive and a limiting factor for miners.
Proof of Stake — miners pledge an amount of ether and the more they pledge the more chance they have of winning the random selection to validate a transaction. Upon verification, if the validation was done incorrectly, the miner will lose their pledged ether or otherwise earn the transaction fee that was pledged. Unlike bitcoin, miners don’t earn new ether each time. Ether also has no end limit like bitcoins.
Other networks using PoS consensys — Avalance, Binance Smart Chain, Terra, Algorand, Hedera and Solana.
Crypto exchange — exchange houses where currency (fiat or crypto) can be traded. They often issue digital wallets too. Many cryptocurrencies that one sees are just tokens that were created via smart contracts on the Ethereum platform. e.g Coinbase
Digital Wallet — used to store cryptocurrency with the use of a private key. E.g. Metamask, a completely private digital wallet only on your device. Compared with Coinbase — which is an exchange but also holds crypto wallets on behalf of the user.
A wallet allows you to store your private key securely. The private key allows you to read from the blockchain and access your crypto assets. A private key and a public key are created when an Ethereum account is first created. An Ethereum wallet is a storage method for your account’s private keys, which is required to access any crypto assets stored on the blockchain. A wallet does not store balances or off-blockchain data — it only stores and protects keys used to access crypto assets.
E.g Coinbase or My Ether Wallet (hot wallets i.e stored online on a server). An example of a cold wallet is Guarda (stored offline).
Exodus, Metamask, and Mist are examples of on-device wallets (or cold wallets). Usually, a wallet is for each cryptocurrency but Exodus was the first to allow multiple cryptocurrencies in the same wallet. Jaxx, Coinomi, Bread (brd) are also examples of cold wallets on mobile devices.
Hardware wallets — e.g Ledger Nano, Trazer series, Keepkey
ETHAddress — a software to generate Ethereum keys and allow you to paper print them for offline storage
Wyre — embedded in the MetaMask browser extension, and conducts “know your customer” ID checks.
Gemini — cryptocurrency broker similar to Coinbase
dApps — apps developed to run on the blockchain through the use of smart contracts. Apps running on top of the Ethereum blockchain. A version of them is smart contracts that auto-execute when trigger conditions are met. Another version of them is cryptocurrency. In reality, bitcoin can be considered a specialized dApp too.
Tether — stablecoin. Issued by Circle
USD coin — stablecoin. Issued by Circle
Terra — smaller stablecoin that had a market run. Called algorithmic stablecoin since it had an automated process to support its peg. It could be 1–1 exchanged for Luna (another cryptocurrency) and the algorithm would automatically generate a Luna (using smart contracts) where more Luna was created when terra holder was redeemed.
Dai — innovative stablecoin. The collateral, usually ether, is stored on the chain itself using a smart contract. New Dai tokens are only generated when additional collateral is deposited. Therefore, there is no risk of stablecoin falling.
Diem — (formerly Libra) — a stablecoin backed by Facebook. The original idea was to be backed by a basket of currencies. Now pegged 1–1 with global currencies like USD or Euro. Yet to launch.
Solana — competitor network to Ethereum — speed in 400 ms for completing a transaction, 1/20th cheaper and can hand visa-scale volumes.
Cardano — is similar to Ethereum and can store lines of programming code.
SushiSwap — an exchange founded on Ethereum
Lisk is an alternative to Ethereum but focuses on accessibility and increasing overall blockchain acceptance.
Some applications, like 1inch, scan exchanges on several blockchains in order to find the best execution prices for various crypto transactions. “Multi-chain” blockchains, like Polkadot and Cosmos, act like bridges between different blockchain networks, making it possible to work across them.
Decentraland, a virtual-reality platform built on the Ethereum blockchain, also known as a “metaverse”, where virtual shops sell digital collectibles and tokens.
DAO — decentralized autonomous organization. They are organizations that can run completely autonomously on the Ethereum blockchain with all rules enforced through smart contracts.
Token — digital representation of assets. NFT is a unique token. Tokens are smart contracts that govern how we can transfer funds from one account to another.
UniSwap — as opposed to centralized exchange like Coinbase where you have to deposit assets to trade on our behalf, decentralized exchange executes the transaction through smart contracts. UniSwap is a popular decentralized exchange for swapping Ethereum-based tokens.
Flash loans — given for a very short period of time for lenders to capitalize on arbitrage opportunities between token trading platforms. Time can be as short as the time taken for a block to be verified i.e. about 10 mins for bitcoin and 13 seconds for Ethereum. E.g., lending protocols are Aave and Compound.
CBDC — think of it as a digital currency that is deposited as an e-wallet directly by the central bank to consumers. Money held on a CBDC app or website will be equivalent to a deposit at the central bank. Only works if people have a smartphone. Central bank wallet apps may not sound revolutionary, but the idea of a central bank providing digital money directly to citizens is radical. If citizens can convert bank deposits into central-bank money with a simple swipe, this could pull deposits out of the banking system and onto the central bank’s balance sheet, disintermediating the banks. Think of it similar to CDC vouchers in Singapore. Doesn’t need to be on blockchain to be called CBDC.
FedNow system — a real-time payment system for America due to enter into use in 2023.
Flipside — crypto analytics firm
Foundation — a platform for digital artwork to create NFT and buy/sell NFT. Issues ERC721 tokens
OpenSea — are open to all; creating an NFT on them is free. Issues ERC1155 tokens. Free version of foundation
Solidity — a programming language similar to JavaScript used to write smart contracts. Other less popular languages are mutan, viper and serpent.
ReMIX — an IDE used to use solidity to write smart contracts. Browser based
Node — any server on the network where a copy of the blockchain data is stored. Full node — has the full copy of blockchain data. Lightweight node — only has the latest blocks of blockchain data.
Nonce — (number used once) unique number that a miner is trying to find. This number will allow the hash function of a block’s content to reach the target desired value e.g. 19 leading zeros for bitcoin.
ERC-725 standard — in Ethereum, everything is based on accounts. Your account has a public + private key. One can stake a claim to link your real-life identity with an Ethereum account. A smart contract that does that claim is following ERC-725 standard.
Smart contract — a set of rules that must be followed to properly register a transaction in a block. They run on EVM — which is a virtual machine that runs on top of the OS of a node. To participate in Ethereum, every node must have EVM installed, and runtime installed. You cannot directly access blockchain data. Smart contracts run on EVM and upon their execution, one can access the blockchain data. Every smart contract runs on every node. The smart contract code lives on the blockchain as well.
In order to interact with the Ethereum blockchain, you need an account or an address. The Ethereum address is a truncated version of your public key. Your private key is stored in the wallet. When smart contracts are deployed in the blockchain, they get an address. That address is used to invoke functions of that smart contract.
In Ethereum, you have to pay a little each time to access the data on the blockchain using smart contracts. Smart contracts are the only way to interact (read or write data) with the blockchain data on Ethereum. Remember smart contracts run on all EVMs of all nodes from supercomputers to Raspberry Pi running as a node.
Infura — an infrastructure service that runs an EVM and allows clients to connect it using an API. Allows you to connect to multiple public test blockchains like Ropsten, Kovan etc. You can connect your local Truffle to these remote Infura to test your code after testing locally with Ganache.
Infura is a hosted Ethereum node cluster that lets your users run your application without requiring them to set up their own Ethereum node or wallet.
ICO — proposal for a new cryptocurrency or blockchain-based business, basically asking investors to invest in a new type of cryptocurrency
Ropsten, Kovan, Rinkeby — providers of public test blockchain to test out your smart contracts before deploying them to real-world blockchain (public blockchain is also called main-net).
Bytecode — the end result of compiling smart contract code to run on EVM
Hyperledger Fabric is a third-generation blockchain targeted at enterprise deployment. Bitcoin was the first generation, and Ethereum was the second generation which added a programming layer.
Omer blocks — also called uncle block. Valid blocks but ones that a miner finds after another miner has already found the first block. They may have found another nonce or the same nonce that solves the hash. They get discounted rewards up to 6 uncle blocks. These blocks don’t stay on the main chain.
Etherscan.io — real life website that peeks into real life Ethereum blockchain. You can see the public transactions inside a block
Gas — transaction fee you pay when touching the public block chain. They are expressed in price units called wei
Blockchain clients — allows your machine to connect to a live public blockchain and become a full or lightweight node. It is written in several different languages. Also allows you to become a miner and mine for ether.
The next step after a blockchain client is to setup a development/test blockchain network to test out your smart contract before deployment. Some examples that do that are
After that, you need an IDE to write the solidity code (*.sol) language
Think of it in this way, the IDE is used to write the smart contract in solidity language (similar to JavaScript). The IDE compiles that to a bytecode and runs on the JVM. For e.g. Ganache provided the local test blockchain network. Truffle is the framework that pointed the IDE to the test blockchain network and has the solidity compiler installed. Once you have developed the smart contract, to test it on a development or a test blockchain, you use Ganache + Truffle etc. For public test blockchain, you can configure Truffle to point to remote test blockchain servers or Infura. The blockchain client software allowed you to become a node in the first place on the main public blockchain.
Many IDE’s e.g. Remix have the full lifecycle support. Note that Truffle can also provide a test blockchain embedded but recommends Ganache (from the same provider as Truffle also).
To summarize:
- Solidity code writer and IDE — for e.g. Visual Studio with solidity extension. Has a compiler to compile to bytecode
- Local Test Blockchain network — Ganache. You can delete and regenerate data at will. Not possible on public test blockchain networks.
- Public Test Blockchain network — Ropsten or Rinkeby or Kovan or Gorli
- Framework — Truffle, to provide the config files that allow the IDE to connect to Ganache / public test blockchain / live blockchain and manage deployment. Also has the solidity compiler to compile when putting it on the blockchain.
- Geth — live public blockchain to allow client to become a node. If you don’t want to use Geth, use a managed service like Infura which runs node clusters and provides access to the blockchain (both test and public).
Gas Fees — you pay gas fees only when you write data to blockchain. When you first deploy your smart code (and write to the blockchain), you pay fees and get an address to that smart contract. You don’t pay gas fees again when you are reading that smart contract if all its variables are in memory.
Token — a token is implemented through a smart contract that implements a standard (Popular one is called ERC 20) that allow you to buy/sell and transfer ownership. Another token standard is called ERC 721 (used for NFTs). ERC 20 standard says at least 6 functions must be implemented by that token smart contract to be compatible with various wallets.
Gas cost — cost of a single transaction in units of wei
Gas price — max price per gas unit the transaction originator is willing to pay for the transaction
Gas limit — or gas budget. Total number of gas units the transaction owner is willing to pay. i.e. gas price *(gas cost * no. of transactions) = transaction cost must be > gas limit for transaction to be executed on the block chain
Faucet — a hypothetical tap to fill free ether on public test blockchain. Concept used in Ropsten
Below is the summary of how smart contracts are working
- all modifications are happening on “addresses” inside blockchain data. These addresses belong to account holders.
- Incase of tokens — the account addresses get credited/debited with tokens (nothing but state variables) whose value is stored on blockchain
- In case of supply chain — the account addresses (in this case manufacturers, suppliers, customers) gets updated with product information