Blockchain
“An open and distributed ledger, which can record transactions between two parties in a permanent way.”
Open
The blockchain is designed so that all that is required to open an account is a private key and public key (generated using the blockchain’s selected algorithm) and a connection to at least one node of the blockchain network. This enables anyone to join the network with some level of anonymity.
Distributed
Each node in the blockchain network is responsible for storing and maintaining its own copy of the distributed ledger. This ensures the decentralization of the blockchain network since no node is vital to its operations.
Ledger
The blockchain implements a distributed ledger. Transactions are generated by any blockchain user and collected into blocks. These blocks are then used to update each node’s copy of the digital ledger.
Transactions
The original blockchains (like Bitcoin) were designed to implement financial systems, where transactions were actual financial transactions and the ledger acted as an accounts book. However, blockchains can store a variety of different types of data, such as the code used on smart contract platforms.
Permanent
The structure of the blockchain is that each block is linked to the previous block. Changing one block makes the following blocks invalid, making it necessary to replace them as well. The blockchain protocol is designed to make this type of bulk replacement difficult and ideally infeasible.
Advantages and Disadvantages of Blockchain
Ledger Immutability: The blockchain’s digital ledger has built-in protections to prevent modifications to existing blocks.
Pros:
- It is difficult for an attacker to maliciously modify the history of the network.
Cons:
- All data included within the ledger must be stored forever (which has scalability impacts) and data cannot be removed from the ledger (impacts on protecting personal and sensitive data).
Distributed Ledger: Each node in the blockchain network maintains its own copy of the ledger.
Pros:
- The distributed ledger is more resilient and resistant to modification.
Cons:
- Each node in the network must be individually protected for blockchains containing sensitive data.
Decentralization: The network has no centralized authority maintaining the “official” copy of the ledger.
Pros:
- The network has no centralized authority maintaining the “official” copy of the ledger.
Cons:
- Blockchain requires a consensus algorithm capable of ensuring the synchronization of the blockchain network and resisting bad actors.
Peer-to-Peer Networking: Each node in the network is directly connected to a few peers, and data (transactions and blocks) percolate across the network by hopping over multiple peer-to-peer connections.
Pros:
- Blockchain network is resilient and does not rely upon a centralized server for communications.
Cons:
- Peer-to-peer networking is inefficient and requires significant overhead.
Decentralized vs. Distributed Systems
A decentralized system is a subset of a distributed system. The primary difference is how/where the “decision” is made and how the information is shared throughout the control nodes in the system. Decentralized means that there is no single point where the decision is made.
How Blockchain Transactions Are Done
Transactions in the blockchain are not immediately added to the distributed ledger. Instead, they are incorporated into the blockchain through the following process:
- Transaction Creation: A user initiates a transaction to be added to the distributed ledger. This transaction is digitally signed by the user using their private key, with the associated public key included for signature validation.
- Transaction Transmission: Once created, the transaction is communicated to the rest of the nodes through the blockchain’s peer-to-peer network. Each node receives the transaction from a direct neighbor and forwards it to others, ensuring that the transaction propagates throughout the entire network, and every node gets a copy.
- Validation: Each node maintains its own copy of the digital ledger and verifies the validity of incoming transactions. This includes checks to ensure the transaction doesn’t overspend the balance of an address or double-spend value. Nodes continuously perform these steps to validate transactions.
After steps 1-3, the process of block creation and confirmation happens at regular intervals:
- Verification/Block Creation: Through the blockchain consensus algorithm, one node is selected to create the next block. The selected node assembles a valid block, digitally signs it, and transmits it to the rest of the network via the peer-to-peer network.
- Confirmation: Upon receiving a block, each node verifies the block and the transactions within it. If valid, the block is added to the node’s copy of the distributed ledger. The node then repeats the process starting from step 4. A transaction is considered “trusted” after enough subsequent blocks have been added to the chain.
Types of Blockchains
1. Public Blockchain
- Definition: Public blockchains are open, permissionless networks where anyone can join, participate in transaction verification, and engage in mining operations. These blockchains are fully decentralized, providing equal footing to all participants.
- Advantages:
- Trust and Security: The proof-of-work mechanism ensures nodes do not need to trust each other, reducing fraud risk.
- Transparency: All nodes have transparent access to the ledger.
- Security: The extensive network size makes it difficult for hackers to alter the blockchain.
- Disadvantages:
- Transaction Processing Speed: Lower due to extensive network size and verification processes, impacting scalability.
- Energy Consumption: High due to complex computations.
- Use Cases:
- Transparent voting systems for governments.
- Fundraising activities for organizations.
- Auditable chains of custody and notarization processes.
2. Private Blockchain
- Definition: Private blockchains operate within restricted environments controlled by a single entity, often called permissioned or enterprise blockchains. They offer a more controlled and smaller network compared to public blockchains.
- Advantages:
- Transactional Speed: Faster verifications due to smaller networks.
- Scalability: Easier to scale according to organizational needs.
- Privacy and Control: Enhanced privacy and data control.
- Disadvantages:
- Trust Building: Fewer participants can make trust harder to establish.
- Security: Lower due to limited nodes.
- Centralization: Contradicts the decentralized ethos of blockchain.
- Use Cases:
- Supply chain management.
- Asset ownership tracking.
- Internal voting mechanisms within organizations.
3. Hybrid Blockchain
- Definition: Hybrid blockchains combine features of both private and public blockchains, allowing a private system to coexist with a public one. This setup offers a flexible approach to data access and transparency.
- Advantages:
- Security: Operates within a closed ecosystem, protected from external attacks.
- Privacy and Efficiency: Ensures privacy while facilitating interactions with third parties.
- Disadvantages:
- Transparency: Not fully transparent due to the ability to shield information.
- System Upgrades: Can be challenging.
- User Incentives: Lack of incentives for user contribution.
- Use Cases:
- Real estate management.
- Retail sector process streamlining.
- Compliance and data security in regulated markets.
4. Consortium Blockchain
- Definition: Consortium blockchains are governed by a group of organizations rather than a single entity, combining elements of both private and public blockchains.
- Advantages:
- Security, Scalability, and Efficiency: More secure and efficient than public blockchains.
- Controlled Access: Important for financial applications.
- Balanced Power Dynamics: Mitigates risks of single-entity control.
- Disadvantages:
- Transparency: Less transparent than public blockchains.
- Regulatory Hurdles: Consortium rules can hinder functionality.
- Use Cases:
- Banking and payments.
- Research data sharing.
- Supply chain management, especially for food and medicine tracking.
Additional Blockchain Classifications
1. Private Blockchain
A type of blockchain where the network is restricted to specific participants. It introduces centralization and has a single point of failure, offering enhanced privacy and control.
2. Permissioned Blockchain
A permissioned blockchain provides different levels of access and power on the blockchain to different users. This means that a fraction of the blockchain’s users will control the majority of the power.
Features:
- Ensures only authorized entities can validate transactions and create blocks, offering more control and privacy.
Use Cases:
- Enterprise solutions requiring fine-grained access control, such as interbank settlements and supply chain management.
Examples: Ripple, Hyperledger Fabric.
3. Tokenized Blockchain
Definition: Utilizes tokens as a core component of its operation, representing assets, rights, or access permissions.
Features: Tokens can be used for various purposes, including value transfer, governance, and access control.
Use Cases: Cryptocurrencies, digital assets, initial coin offerings (ICOs).
Examples: Ethereum (with ERC-20 tokens), Binance Smart Chain (with BEP-20 tokens).
4. Tokenless Blockchain
Definition: Does not rely on tokens for operation. These blockchains focus on recording transactions and data verification without the need for a native cryptocurrency, often used in enterprise data management.
Features: Primarily used for data integrity and verification without the need for a token-based incentive mechanism.
Use Cases: Enterprise data management, supply chain tracking.
Examples: Hyperledger Fabric.
Cryptocurrency
Cryptocurrency, sometimes referred to as crypto-currency or simply crypto, is a form of digital or virtual currency that relies on cryptographic techniques to secure and verify transactions. Unlike traditional currencies issued by governments or financial institutions, cryptocurrencies operate on decentralized networks based on blockchain technology.
What is Cryptocurrency? Cryptocurrency is a digital payment system that operates independently of banks for transaction verification. It is designed to work as a medium of exchange through a peer-to-peer network that enables anyone to send and receive payments anywhere in the world. Unlike physical money, cryptocurrency transactions are recorded digitally on a public ledger known as the blockchain. This ledger is maintained by a network of computers, or nodes, that verify and secure each transaction through complex cryptographic methods.
CeFi (Centralized Finance)
Definition: Centralized finance refers to traditional financial systems where a single authority, such as a bank or other financial institution, is responsible for maintaining the integrity and correctness of the accounts ledger.
Characteristics:
- Central Authority: Banks and financial institutions act as intermediaries, managing the flow of money, maintaining ledgers, and resolving disputes.
- Trust-Based: Users must trust the financial institution to handle transactions accurately and honestly.
- Limited Transparency: Users have little visibility into the system’s inner workings and rely on the institution’s reports and statements.
Decentralized Finance (DeFi)
Definition: Decentralized finance refers to the implementation of financial systems on top of blockchain platforms, eliminating the need for a central authority to manage the ledger and execute transactions.
Characteristics:
- Smart Contracts: Key functionalities are implemented as code (smart contracts) that run on the blockchain. These contracts are Turing-complete and can execute complex business logic.
- Immutability: Smart contracts and their interactions are recorded on the blockchain, ensuring they are tamper-proof and transparent. All nodes in the network have access to the ledger, making the system resistant to fraud and manipulation.
- Interoperability: DeFi systems are designed to work together across different platforms and services, often not tightly tied to specific infrastructure layers.
What Is a DApp?
A decentralized application (DApp) is a type of distributed, open-source software application that operates on a peer-to-peer (P2P) blockchain network instead of a single computer. Unlike traditional apps that run on centralized servers, these DApps have a traditional web frontend (hosted on a traditional webserver or a decentralized storage service) and a backend implemented as a smart contract. The use of smart contracts to implement functionality enables the creation of fully-decentralized programs that are resistant to modification and have code that is publicly available and can be subjected to security audits (since a copy of the code is stored on the digital ledger).
Key Characteristics of DApps:
- Open Source: The codebase is available to all users for evaluation and changes require consensus from the majority of users.
- Decentralized Storage: Data is stored on decentralized blocks, ensuring there is no single point of failure.
- Cryptographic Support: Data blocks are validated and proven true using cryptographic methods.
How DApps Work:
- Smart Contracts: The core functionality of DApps is implemented through smart contracts, which are self-executing contracts with the terms of the agreement directly written into code. These contracts run on blockchain networks like Ethereum.
- Distributed Ledger: DApps use blockchain technology, a decentralized and distributed ledger that stores and validates information across multiple nodes.
- Token-Based Access: DApps are often accessed and validated using cryptographic tokens.
Coin
A coin or cryptocoin is a unit of value on a tokenized blockchain that is designed to act like digital money. Bitcoin is an example of this, where Bitcoin can be used in the same ways as fiat money.
The Origin of Bitcoin
The first blockchain-like protocols were developed by cryptographers in the 1980s. The Bitcoin Whitepaper was published by the unknown Satoshi Nakamoto in 2008.
In the context of digital currencies, “double-spending” refers to a scenario where an individual attempts to spend the same unit of currency twice. This is a problem because digital information can be easily replicated, making it difficult to prevent someone from using the same digital coin or token in two separate transactions.
In traditional fiat currency systems, this issue is solved by a central authority, such as a bank, which keeps track of transactions and ensures that the same unit of currency can’t be spent twice. However, in decentralized systems like Bitcoin, there is no central authority to verify transactions.
The key innovation of the Bitcoin Whitepaper was to solve the double-spending problem through a decentralized network, using a peer-to-peer system and a public ledger called the blockchain. This allows for secure, transparent, and tamper-proof transactions without the need for a central authority.
The creation of Bitcoin, the first blockchain, marked a significant innovation. While many components used by Satoshi Nakamoto to develop Bitcoin existed previously, their combination into a blockchain was highly innovative.
A public blockchain, being completely decentralized, has several key properties:
- Easy Account Creation: Decentralized blockchains facilitate easy account creation. For a public blockchain, generating a valid private/public key pair and the associated blockchain address is all that is needed. This enables users to generate and receive transactions on the blockchain.
- Distributed Ledger Storage: Every node in the blockchain network can maintain its own copy of the distributed ledger. This ensures that every node can view all transactions and blocks added to the ledger.
- Decentralized Validation: The blockchain operates without relying on a central node or group of nodes to validate transactions before they are added to the digital ledger. Each node independently validates transactions, ensuring it can identify invalid ones by having sufficient insight into transactions and blocks.
- Decentralized Block Creation: Any node in the blockchain network can participate in the consensus and block creation process. This decentralization is crucial as control over block creation equates to control over the contents of the distributed ledger.
- Governance: Public blockchains typically have open governance mechanisms, allowing users and nodes to have input. In case of disputes, nodes can reject decisions by refusing to update or follow a fork in the blockchain software. This governance model is exemplified by the Ethereum Classic blockchain, which originated from a split with Ethereum due to such a dispute.
Token
A token carries value but is not an actual currency. The tokens used in amusement parks, laundromats, etc. are a good example of this as are financial instruments such as securities. They represent value but are not more limited in their uses (often labeled as “not redeemable for cash”).
Non-Fungible Token (NFT)
NFT stands for non-fungible token, a type of digital asset that represents ownership or proof of authenticity of a unique item or piece of content, often using blockchain technology. Unlike cryptocurrencies such as Bitcoin or Ethereum, which are fungible and can be exchanged on a one-to-one basis, NFTs are unique and cannot be exchanged on a like-for-like basis.
Key Characteristics of NFTs:
- Uniqueness: Each NFT has a distinct identifier that makes it unique from any other token.
- Ownership: Ownership of NFTs is verifiable and traceable on the blockchain, providing clear proof of ownership.
- Interoperability: NFTs can be traded across different platforms and marketplaces that support the blockchain standard they are built on, most commonly Ethereum’s ERC-721 and ERC-1155 standards.
- Indivisibility: Unlike cryptocurrencies, NFTs cannot be divided into smaller units. You own the whole NFT or none at all.
Fungible Tokens (FT)
Fungible Tokens are digital assets that are interchangeable with one another. Each token is identical in value and function, meaning that one token can be exchanged for another of the same type without any difference in worth or utility. For example, one Bitcoin is equal to another Bitcoin.
Smart Contracts
A smart contract is a digital agreement signed and stored on a blockchain network that executes automatically when its specific terms and conditions are met and they are written in languages like Solidity. Once deployed on a blockchain, smart contracts are immutable and visible to all participants. First introduced on the Ethereum network, smart contracts can operate on any supporting blockchain.
Traditional Exchange
- Lots of paperwork
- Communication with many parties (Title, Insurance, Buyer’s Agent, Banks, Association, Seller’s Agent)
- Escrow services to hold fees
- Commissions (6-7%) to agents and brokers
- Long time to listing and closing
- Private transactions
- Information kept in county records, vulnerable to loss/modification
Smart Contract Exchange
- No paperwork; contract rules in place
- Peer-to-peer transactions
- Contract stores digital assets in escrow
- No commissions, only a small transaction fee (~0.01%)
- Nearly instantaneous deal closure
- Public verification of transactions
- Information recorded on a blockchain, immutable
A Decentralized Exchange (DAX)
A decentralized exchange (or DEX) is a peer-to-peer marketplace where transactions occur directly between crypto traders. DEXs fulfill one of crypto’s core possibilities: fostering financial transactions that aren’t officiated by banks, brokers, or any other intermediary. Many popular DEXs, like Uniswap and SushiSwap, run on the Ethereum blockchain.
Smart Contract Use Cases and Platforms
- Edgeless: A Smart Contract powered Casino.
- VOICE: NFT marketplace.
- EOS.IO: A blockchain protocol powered by the native cryptocurrency EOS. It is a smart contract platform that claims to eliminate transaction fees and also conduct millions of transactions per second, much faster than Bitcoin and similar protocols.
- Cent: A social network where you can earn money by posting.
- DAI: A stable cryptocurrency that holds value at $1 USD.
- Decentraland: A virtual world owned and built by its users.
- Augur: The world’s most accessible, no-limit betting exchange.
- Ethereum Name Service: User-friendly names for cryptocurrency addresses, decentralized websites, and more.
- Gods Unchained: A competitive collectible card game.
- Dharma: The easiest way to earn interest on your cryptocurrency.
- Gitcoin: A network of incentivized open-source developers.
Cryptocurrency Wallets
A cryptocurrency wallet is designed to store the private and public keys and the addresses associated with a particular account. This enables the wallet to sign transactions on the user’s behalf (with the private key) and to identify any transactions sent to the user (with the address). While a wallet doesn’t contain any actual money (cryptocurrency is digital money like a number in a bank account), it has the power to make transactions on a user’s behalf.
Cryptocurrency wallets come in a number of different form factors. Some are software-based or webpages and fully connected to the blockchain network. Others may be portable electronic devices that can store keys and generate transactions but need to be connected to a computer for the transactions to be transmitted to the blockchain network. Some wallets are purely physical (like a piece of paper) and only serve to store the account’s keys and addresses.
Types of Crypto Wallets
Hot Wallets
- Software Wallets:
- Desktop Wallets: (e.g., Electrum)
- Mobile Wallets: (e.g., Mycelium)
- Web Wallets: (e.g., MetaMask)
Cold Wallets
- Paper Wallet:
- Physical document with printed private and public keys.
- Example: Printed QR codes.
- Hardware Wallet:
- Physical device storing private keys offline.
- Example: Ledger Nano S, Trezor.
- Brain Wallet:
- Passphrase-based private key.
- Example: “correct horse battery staple.”
By Determinism
- Non-Deterministic Wallets:
- Independently generated keys.
- Separate backups required.
- Deterministic Wallets:
- Single seed phrase for all keys.
- Simplified key management.
- Hierarchical Deterministic (HD) Wallets:
- Tree-like structure of keys.
- Enhanced security and privacy.
- Example: BIP32, BIP44 wallets.
Cryptocurrency Mining
Cryptocurrency mining is a process which verifies and secures transactions on a blockchain but also serves as the mechanism by which new coins or tokens are introduced into circulation.
Mining Process:
- Collect Transactions:
- Miners gather unconfirmed transactions from the mempool and assemble them into a candidate block.
- Each transaction includes details like sender and receiver addresses, amounts, and transaction fees.
- Create Block Header:
- The block header includes the previous block’s hash, a Merkle root (hash of all transactions in the block), a timestamp, the target difficulty, and a nonce (a random number that miners adjust).
- Hash Calculation:
- Miners repeatedly hash the block header with different nonce values.
- They aim to produce a hash that is less than the network’s current difficulty target.
- Difficulty Target:
- The difficulty target adjusts periodically (e.g., every 2016 blocks in Bitcoin) to ensure that new blocks are added to the blockchain at a consistent rate (approximately every 10 minutes for Bitcoin).
- Solution Discovery:
- The first miner to find a valid hash broadcasts the new block to the network.
- Other nodes verify the block’s validity and add it to their copy of the blockchain.
- Block Reward:
- Initially, the block reward was 50 BTC per block.
- Due to halving events, it has decreased over time: 25 BTC, 12.5 BTC, and currently 6.25 BTC (as of 2020).
- The block reward will continue to halve approximately every four years until the maximum supply of 21 million BTC is reached.
Types of Crypto Mining:
1. Solo Mining:
- An individual miner attempts to mine blocks independently.
- Rewards are not shared, but the probability of finding a block is lower compared to pool mining.
2. Pool Mining:
- Miners join forces and combine their computational power to increase the chances of solving the cryptographic puzzle.
- Rewards are distributed among pool members based on the amount of computational power they contribute.
3. Cloud Mining:
- Miners lease computational power from remote data centers.
- Users pay for mining contracts and receive a share of the rewards based on their investment.
Common Blockchain Terms
- Address: A unique string of characters used to identify a wallet on a blockchain. Addresses are used to send and receive cryptocurrencies and tokens.
- Block: A data structure that records transactions. Blocks are linked together to form a blockchain. Each block typically contains a header, a timestamp, transaction data, and a reference to the previous block.
- Blockchain: A distributed ledger technology that records transactions across a network of computers in a way that ensures the security, transparency, and immutability of the data.
- Consensus Mechanism: A protocol used by blockchain networks to achieve agreement on a single data value or a single state of the network among distributed processes or systems. Common examples include Proof of Work (PoW) and Proof of Stake (PoS).
- Cryptocurrency: A digital or virtual currency that uses cryptography for security. Cryptocurrencies operate on decentralized networks based on blockchain technology.
- Decentralization: The distribution of authority, control, and functions across a network rather than being centralized in a single entity.
- Hash: A function that converts input data of any size into a fixed-size string of characters, which typically appears random. Hash functions are used in blockchain to secure data.
- Hashrate: The computational power used by miners to solve cryptographic puzzles. It is often measured in hashes per second (H/s).
- Mining: The process by which new blocks are added to a blockchain. Miners use computational power to solve complex cryptographic puzzles, and the first to solve it gets to add the next block and receive the associated reward.
- Node: A computer connected to a blockchain network. Nodes store and share a copy of the blockchain and participate in the network’s consensus process.
- Proof of Work (PoW): A consensus mechanism that requires participants to perform computational work to create new blocks. It is used by Bitcoin and several other cryptocurrencies.
- Proof of Stake (PoS): A consensus mechanism where participants create new blocks and validate transactions based on the number of coins they hold and are willing to “stake” as collateral.
- Smart Contract: Self-executing contracts with the terms of the agreement directly written into code. Smart contracts automatically enforce and execute the terms when predefined conditions are met.
- Transaction: The transfer of value between blockchain addresses. Transactions are included in blocks and recorded on the blockchain.
- Wallet: A software application or hardware device used to store, send, and receive cryptocurrencies. Wallets manage private and public keys for blockchain addresses.
- Genesis Block: The first block in a blockchain, also known as block 0. It is the foundation upon which all subsequent blocks are added.
- Fork: A split in a blockchain that creates two separate chains. Forks can be soft (backward-compatible) or hard (non-backward-compatible), often resulting from changes in the protocol.
- Block Reward: The incentive given to miners for successfully adding a new block to the blockchain. It typically includes newly minted cryptocurrency and transaction fees.
- Mempool: A collection of all pending transactions waiting to be confirmed by the network. Transactions in the mempool are picked up by miners and included in the next block.
- Difficulty: A measure of how hard it is to find a valid hash for a new block. Difficulty adjusts periodically to ensure blocks are mined at a consistent rate.
- Nonce: A number that miners change to vary the input of the hash function. Miners increment the nonce to find a hash that meets the network’s difficulty requirement.
- Merkle Tree: A data structure used to efficiently summarize and verify the integrity of large sets of data. It is used in blockchains to organize and verify transactions within a block.
- Double-Spending: The risk that a digital currency can be spent twice. Blockchain technology prevents double-spending by ensuring each transaction is recorded and validated by the network.
- Immutable: The property of blockchain that makes data irreversible and tamper-proof once it has been added to the chain.
- Gas: A fee required to conduct a transaction or execute a smart contract on the Ethereum network. It compensates miners for the computational resources used.
- Ledger: A record-keeping system that tracks all transactions. In blockchain, the ledger is decentralized and maintained by all nodes in the network.
- Cryptographic Puzzle: A complex problem that miners must solve to create a new block. Solving these puzzles requires significant computational resources.
- 51% Attack: A situation where a single entity or group controls more than 50% of the network’s mining hashrate, enabling them to manipulate the blockchain by preventing new transactions or reversing transactions.
- Private Key: A secret number used to sign transactions and provide proof of ownership. It must be kept secure, as anyone with access to the private key can control the associated cryptocurrency.
- Public Key: A number derived from the private key that can be shared publicly. It is used to receive transactions and verify digital signatures.