🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Blockchain 101.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Document Details

Tags

blockchain technology cryptocurrency distributed systems technology

Full Transcript

Blockchain - This is a technology that has promised to positively alter the existing paradigms of nearly all industries, including, but not limited to, theIT,finance,government,media,medical,andlawsectors,bymaking them more e cient, trustworthy, and transparent. The Growth of Blockchain With the inv...

Blockchain - This is a technology that has promised to positively alter the existing paradigms of nearly all industries, including, but not limited to, theIT,finance,government,media,medical,andlawsectors,bymaking them more e cient, trustworthy, and transparent. The Growth of Blockchain With the invention of Bitcoin in 2008, the world was introduced to a new concept that revolutionized the whole of society Progress towards maturity Around 2013, some ideas emerged regarding using blockchain technology for other applications instead of only cryptocurrencies As of the second quarter of 2023, decentralized finance (DeFi), non fungible tokens (NFTs), and tokenization in general are very popular applications of blockchain It is expected that within three years or so, DeFi will stabilize into a mature mainstream technology. Distributed systems Understanding distributed systems is essential to our understanding of blockchain, as blockchain is a distributed system at its core. A distributed system is a computing paradigm whereby two or more nodes work with each other in a coordinated fashion to achieve a common outcome. It is modeled in such a way that end users see it as a single logical platform, For example, Google’s search engine is based on a large distributed system; however, to a user, it looks like a single, coherent platform. It is composed of processes (nodes) and channels (communication channels) where nodes communicate by passing messages. A blockchain is a message passing distributed system. The history of blockchain Blockchain was introduced with the invention of Bitcoin in 2008. Its practical implementation then occurred in 2009. However, it is essential to refer to Bitcoin here because without it, the history of blockchain is not complete. Blockchain 1.0, the development in “Cryptocurrency” Blockchain 2.0, using “Smart contract” Blockchain 3.0, the development of “Decentralize” Bitcoin All previous attempts to create anonymous and decentralized digital currency were successful to some extent. But they could not solve the problem of preventing double spending in a completely trustless or permissionless environment. In 2008, a groundbreaking paper, entitled Bitcoin: A Peer-to-Peer Electronic Cash System, was written on the topic of peer-to-peer e-cash under the pseudonym of Satoshi Nakamoto. No one knows the actual identity of “Satoshi Nakamoto”. After introducing Bitcoin in 2009, Nakamoto remained active in the Bitcoin developer community until 2011, before handing over Bitcoin development to its core developers and simply disappearing. The paper introduced the term chain of blocks, later to evolve into “blockchain”, where a chronologically ordered sequence of blocks containing transactions is produced by the protocol. Layman’s definition: Blockchain is an ever-growing, secure, shared recordkeeping system in which each user of the data holds a copy of the records, which can only be updated if a majority of parties involved in a transaction agree to update. Technical definition: Blockchain is a peer-to-peer, distributed ledger that is cryptographically secure, append-only, immutable (extremely hard to change), and updateable only via consensus among peers. Characteristic of Blockchain - Decentralize, p2p, distribute, and independence - Distributed ledger, each node has its own account - Immutable, cannot reverse, delete, or modify - Consensus, voting - Openness, can be proposed the system to the public - Anonymity, only address data for reference Types of Blockchain - Public - Private, one organizer - Consortium, public+private for group Ecosystem of Blockchain Block - Block number - Timestamp - Nonce, value for hashing - Di culty target, di cult level for noncing - Previous hash - Data Chain Consensus Validation Node - Fullnode, keep all transaction - Lightweight node, keep only hash value Ledger - Public ledger - Distributed ledger - Decentralized ledger Wallet - Hot wallet, connect to the internet such as metamask - Cold wallet, o ine such as paper wallet and hardware wallet Blockchain functionality - Transaction is initiated - Transaction is validated and broadcast - Find new block (mining) - New block found - Add new block to the blockchain Properties of Blockchain - Data integrity - Data transparency - Availability Process of Blockchain 1.Create 2.Process and broadcast 3.Validate 4.Add to chain 5.Complete What is Encryption and Decryption? Encryption is the process by which a readable message is converted to an unreadable form to prevent unauthorized parties from reading it. Decryption is the process of converting an encrypted message back to its original (readable) format. The original message is called the plaintext message. The encrypted message is called the ciphertext message. What is Hashing? Hashing is the practice of transforming a given key or string of characters into another value for the purpose of security. Unlike standard encryption, hashing is always used for one-way encryption, and hashed values are very di cult to decode. What is Ethereum? Ethereum is a decentralized blockchain with smart contract functionality. Ether (abbreviation: ETH) is the native cryptocurrency of the platform. Who runs Ethereum? Ethereum is not controlled by any particular entity. It exists whenever there are connected computers running software following the Ethereum protocol and adding to the Ethereum blockchain. Anyone can use Ethereum—it's designed to be scalable, programmable, secure, and decentralized—to create any secured digital technology. Its token is designed to pay for work done supporting the blockchain, but participants can also use it to pay for tangible goods and services if accepted. Bitcoin vs. Ethereum: An Overview Ether (ETH), the native cryptocurrency of the Ethereum network, is the second most popular digital token after bitcoin (BTC). As the second-largest cryptocurrency by market capitalization (market cap), comparisons between the two are natural. Proof-of-Stake Transition Initially, Ethereum used a competitive proof-of-work (POW) validation process similar to that of Bitcoin. After several years of development, Ethereum finally switched to proof-of-stake in 2022, which uses much less processing power and energy. What Is Proof of Work (PoW)? Proof of work (PoW) is a blockchain consensus mechanism that requires significant computing e ort from a network of devices. The concept was adapted from digital tokens by Hal Finney in 2004 through the idea of "reusable proof of work" using the 160-bit secure hash algorithm 1 (SHA-1). Mining a Block When it comes to adding a new block to the chain, it’s seen as a new update to the current system. Therefore, it requires network participants’ permission. To decide to add a new block or not, Proof-of-Work (PoW), a consensus mechanism, is used. Only verified transactions get added to the network. In contrast, not all blocks are valid. Most proposed blocks are considered invalid by the network. The Blockchain protocol defines the Block validity. A Blockchain network has an arbitrary “Di culty” setting managed by the protocol, which changes how hard it is to mine a block. Here, mining means adding a new block. Miners propose the new blocks in the chain. They are externals who wish to add their block to the network. The work required to create a valid block is where the value comes from. Miners receive rewards in proportion to their share of the computation power they spend to mine a new block. By mining a valid block, the miner proves the work done. What is Proof-of-Stake (PoS) in blockchain? Therefore, unlike PoW, proof-of-stake (PoS) first stakes some coins. That means the participants (or validators) must give some of their coins as a stake. If the block they wish to forge in the network turns out to be fraudulent transactions, they’ll lose that stake. Else, they’ll get their staked coins. There are two main types of nodes in Ethereum: full nodes and light nodes. Full Nodes: They store the entire Ethereum blockchain history on their persistent memories. They validate all transactions against Ethereum's consensus rules. They also play a crucial role in propagating transactions and blocks across the network. Light Nodes: They only download the headers of blocks from the most recent part of the blockchain, providing faster synchronization times among nodes. Light nodes rely on full nodes for additional information when necessary, such as retrieving transaction data, and thus are less secure. Archive Nodes in the Ethereum network go a step beyond Full Nodes, storing not just the entire blockchain history, but also archiving all historical states. They enable rapid access to any past state without needing to reconstruct it, a feature critical for certain applications. However, their extensive storage requirements make them less common and typically maintained by organizations needing in-depth access to all past states. Thus, Archive Nodes are vital for detailed blockchain analysis and development tasks. An Ethereum client is a software application that implements the Ethereum specification and communicates over the peer-to-peer network with other Ethereum clients. Full sync A full sync downloads all blocks (including headers and block bodies) and regenerates the state of the blockchain incrementally by executing every block from genesis. Fast sync Like a full sync, a fast sync downloads all blocks (including headers, transactions, and receipts). However, instead of re-processing the historical transactions, a fast sync relies on the receipts until it reaches a recent head, when it switches to importing and processing blocks to provide a full node. Snap sync Snap syncs also verify the chain block-by-block. However, instead of starting at the genesis block, a snap sync starts at a more recent 'trusted' checkpoint that is known to be part of the true blockchain. The node saves periodic checkpoints while deleting data older than a certain age. What is an Ethereum virtual machine? The Ethereum Virtual Machine (EVM) is a computation engine which functions as a decentralized computer with abundant applications that can be implemented. What is a Computer Network? A computer network is a collection of interconnected devices that share resources and information. These devices can include computers, servers, printers, and other hardware. Networks allow for the e cient exchange of data, enabling various applications such as email, file sharing, and internet browsing. How Does a Computer Network Work? Basics building blocks of a Computer network are Nodes and Links. A Network Node can be illustrated as Equipment for Data Communication like a Modem, Router, etc., or Equipment of a Data Terminal like connecting two computers or more. Links in Computer Networks can be defined as wires or cables or free space of wireless networks. Basic Terminologies of Computer Networks - Network: A network is a collection of computers and devices that are connected together to enable communication and data exchange. - Nodes: Nodes are devices that are connected to a network. These can include computers, Servers, Printers, Routers, Switches, and other devices. - Protocol: A protocol is a set of rules and standards that govern how data is transmitted over a network. Examples of protocols include TCP/IP, HTTP, and FTP. - Topology: Network topology refers to the physical and logical arrangement of nodes on a network. The common network topologies include bus, star, ring, mesh, and tree. - Service Provider Networks: These types of Networks give permission to take Network Capacity and Functionality on lease from the Provider. Service Provider Networks include Wireless Communications, Data Carriers, etc. - IP Address: An IP address is a unique numerical identifier that is assigned to every device on a network. IP addresses are used to identify devices and enable communication between them. - DNS: The Domain Name System (DNS) is a protocol that is used to translate human-readable domain names (such as www.google.com) into IP addresses that computers can understand. - Firewall: A firewall is a security device that is used to monitor and control incoming and outgoing network tra c. Firewalls are used to protect networks from unauthorized access and other security threats. Types of Enterprise Computer Networks - LAN: A Local Area Network (LAN) is a network that covers a small area, such as an o ce or a home. LANs are typically used to connect computers and other devices within a building or a campus. - MAN: A Metropolitan Area Network covers a larger area than that covered by a LAN and a smaller area as compared to WAN. - WAN: A Wide Area Network (WAN) is a network that covers a large geographic area, such as a city, country, or even the entire world. WANs are used to connect LANs together and are typically used for long-distance communication. - Cloud Networks: Cloud Networks can be visualized with a Wide Area Network (WAN) as they can be hosted on public or private cloud service providers and cloud networks are available if there is a demand. Cloud Networks consist of Virtual Routers, Firewalls, etc. Network Devices An interconnection of multiple devices, also known as hosts, that are connected using multiple paths for the purpose of sending/receiving data or media. Computer networks can also include multiple devices/mediums which help in the communication between two di erent devices; these are known as Network devices and include things such as routers, switches, hubs, and bridges. Network Topology The Network Topology is the layout arrangement of the di erent devices in a network. Common examples include Bus, Star, Mesh, Ring, and Daisy chain. Network Protocols A protocol is a set of rules or algorithms which define the way how two entities can communicate across the network and there exists a di erent protocol defined at each layer of the OSI model. A few such protocols are TCP, IP, UDP, ARP, DHCP, FTP, and so on. Transmission Control Protocol/Internet Protocol (TCP/IP) Function: The foundational protocol suite of the internet, enabling reliable communication. Component s: TCP: Ensures data is delivered reliably and in order. IP: Routes data packets to their destination based on IP addresses. Hypertext Transfer Protocol (HTTP) and HTTPS Function: The protocols used for transmitting web pages. HTTP: Unsecured communication. HTTPS: Secured communication using SSL/TLS encryption. Simple Mail Transfer Protocol (SMTP) Function: Protocol for sending email. Components: Works with other protocols like POP3 and IMAP for email retrieval. File Transfer Protocol (FTP) Function: Protocol for transferring files between computers. Components: Includes commands for uploading, downloading, and managing files on a remote server. Dynamic Host Configuration Protocol (DHCP) Function: Automatically assigns IP addresses to devices on a network. Components: Reduces manual configuration and IP address conflicts. Domain Name System (DNS) Function: Translates human-friendly domain names into IP addresses. Components: Ensures seamless navigation on the internet. Unique Identifiers of Network Hostname: Each device in the network is associated with a unique device name known as Hostname. Type “hostname” in the command prompt(Administrator Mode) and press ‘Enter’, this displays the hostname of your machine. IP Address (Internet Protocol address): Also known as the Logical Address, the IP Address is the network address of the system across the network. To identify each device in the world-wide-web, the Internet Assigned Numbers Authority (IANA) assigns an IPV4 (Version 4) address as a unique identifier to each device on the Internet. The length of an IPv4 address is 32 bits, hence, we have 232 IP addresses available. The length of an IPv6 address is 128 bits. In Windows Type “ipconfig” in the command prompt and press ‘Enter’, this gives us the IP address of the device. For Linux, Type “ifconfig” in the terminal and press ‘Enter’ this gives us the IP address of the device. MAC Address (Media Access Control address): Also known as physical address, the MAC Address is the unique identifier of each host and is associated with its NIC (Network Interface Card). A MAC address is assigned to the NIC at the time of manufacturing. The length of the MAC address is: 12-nibble/ 6 bytes/ 48 bits Type “ipconfig/all” in the command prompt and press ‘Enter’, this gives us the MAC address. IP stands for Internet Protocol version v4 stands for Version Four (IPv4), is the most widely used system for identifying devices on a network. It uses a set of four numbers, separated by periods (like 192.168.0.1), to give each device a unique address. This address helps data find its way from one device to another over the internet. MAC address acts as your ID number. (OSI Model layer2) IP address acts as your location or address of your house. (OSI Model layer3) VLAN definition, Virtual Local Area Networks are the Logical Virtual Networks that groups network devices in it. In another definition, they are a layer 2 technology with which you can separate big networks into smaller networks. Collision Domain The collision domain consists of two words: ‘Collision,’ which means ‘to collide,’ and ‘Domain,’ which denotes an area or region. Therefore, collisions take place within a network or a portion of it. When two or more devices attempt to transmit data simultaneously on a shared network segment, a collision occurs. For instance, if a group of computers connected through a hub attempts simultaneous data transmission, a collision domain may form. Broadcast Domain Broadcast domain is a combination of two words, Broadcast and domain. The term Broadcast means “those messages that are sent to all devices in the network at once”. It is a type of one-to-all communication, while domain means area or region. All the devices in the network can reach other devices through broadcast. The Broadcast Can occur in the hub, or switch. A more technical definition of the Broadcast domain is a “group of network interface cards in which one NIC sends a Broadcast, then the other devices will receive that broadcast or message”. It takes place in the Hub, Bridge, Switch, and Router. All ports in hub and switch are in the same Broadcast domain. Each port in a router is in disparate broadcast domains. What is VLAN and why is it used? VLAN stands for Virtual LAN. A VLAN is a way of logically separating a group of computers into a separate network. This means they will only communicate with each other and not with any other devices connected to the same physical network. It's like having a private wireless network at home. NAT stands for “Network Address Translation”. It’s a way to map multiple private addresses inside a local network to a public IP address before transferring the information onto the internet. Organizations that want multiple devices to employ a single IP address use NAT, as do most home routers. If you’re connecting from your home right now, chances are your cable modem or DSL router is already providing NAT to your home. How to calculate a subnet mask with the host's formula A common, real-world question you might have when you lay out your network is, "What subnet mask do I need for my network?" To answer this question, you must know how to use the host's formula. The host's formula tells you how many hosts are allowed on a network that has a certain subnet mask. The formula to calculate the number of hosts in a subnet is as follows: 2^h – 2 Ex. 192.168.1.0/24, 32-24 = 8, → 2^8-2 = 254 hosts The h represents the number of zeros in the subnet mask in binary format. The subtraction of 2 accounts for the first IP address in a subnet, which is reserved to identify the network, and the last IP address reserved as the broadcast address. Transaction Whatistransaction? something transacted. especially an exchange or transfer of goods, services, or funds. GasFee on Ethereum This is because the Ethereum network is a decentralized blockchain with no single authority overseeing its functioning. Therefore, mechanisms have been put in place to avoid spamming the network or transactions. This mechanism charges the sender of the transaction a small fee called “gasfee”. 1 gwei = 0.000000001 ETH The gasfee will be deducted from the remaining ETH in the wallet, not from the value in transaction. Example, The remaining ETH in the wallet is 10ETH. You want to send 4 ETH to your friend. The gasfee is 0.5 ETH, pay with the transaction immediately. Then you must pay 4+0.5 = 4.5 ETH. What is MetaMask? Public blockchains like Ethereum are the next evolution of Internet databases, and MetaMask is the next evolution of the browser. MetaMask is a web browser extension and mobile app that allows you to manage your Ethereum private keys. By doing so, it serves as a wallet for Ether and other tokens, and allows you to interact with decentralized applications, or Dapps. Unlike some wallets, MetaMask keeps no information on you: not your email address, not your password, and not your Secret Recovery Phrase or other private keys. You retain all power over your crypto-identity. Once you have applied for Metamask, - can transfer the Crypto coins you have already purchased - can put it in this bag Actually, Metamask does not store the coins directly in the wallet. But Metamask acts more like a "key" for accessing a safe. Or used to confirm or show rights in various transactions, where Metamask can be called an intermediary that allows us to view information and make transactions in the account that stores cryptocurrencies on the blockchain. Centralized systems are conventional (client-server) IT systems in which there is a single authority that controls and is solely in charge of all operations on the system. Most online service providers, including Google, Amazon, eBay, Yahoo!, and Apple’s App Store, use this conventional model to deliver services. Distributed system data and computation are replicated across multiple nodes in a network in what users view as a single, coherent system. Introducing decentralization - Decentralization is a core benefit of blockchain technology - By design, blockchain is a perfect vehicle for providing a platform that does not need any intermediaries and that can function with leaders chosen over time via consensus mechanisms - This model allows anyone to compete to become the decision- making authority Decentralization - Decentralization is not a new concept. It has been used in strategy, management, and the government sector for a long time. - The basic idea of decentralization is to distribute control and authority to the peripheries of an organization instead of it being concentrated in one central body. - This structure produces several benefits for organizations, such as increased e ciency, expedited decision making, better motivation, and a reduced burden on upper management. Decentralization in practice Smart contracts - Software program that usually runs on a blockchain - Smart contracts do not necessarily need a blockchain to run; however, due to the security benefits that blockchain technology provides, blockchain has become a standard decentralized execution platform for smart contracts. - A smart contract usually contains some business logic and a limited amount of data. The business logic is executed if specific criteria are met - Actors or participants in the blockchain use these smart contracts, or they run autonomously on behalf of the network participant. Autonomous agents Software entity (artificially intelligent or traditionally programmed) that acts on the behalf of its owner to achieve some desirable goals without requiring any or minimal intervention from its owner. Decentralized organizations - DOs are software programs that run on a blockchain and are based on the model of real-life organizations with people and protocols - Once a DO is added to the blockchain in the form of a smart contract or a set of smart contracts, it becomes decentralized, and parties interact with each other based on the code defined within the DO software. Decentralized Autonomous Organizations - A decentralized autonomous organization (DAO) is also a computer program that runs on top of a blockchain, and embedded within it are governance and business logic rules. - The main di erence, however, is that DAOs are autonomous, which means that they are fully automated and contain artificially intelligent logic. Decentralized Applications All the ideas mentioned up to this point come under the broader umbrella of decentralized applications, abbreviated to DApps (pronounced Dee-App) Type 1: These run on their own dedicated blockchain, for example, standard smart contract-based DApps running on Ethereum. If required, they make use of a native token, for example, ETH on the Ethereum blockchain. For example, Ethlance is a DApp that makes use of ETH to provide a job market. Type 2: These use an existing established blockchain. That is, they make use of Type 1 blockchain and bear custom protocols and tokens, for example, smart contract-based tokenization DApps running on the Ethereum blockchain. Type 3: Use the protocols of Type 2 DApps Criteria for a DApp - Decentralized, The DApp should be fully decentralized - Opensource, It must be open source for public and transparency - Cryptographically secure, State transition and the data of the application must be cryptographically secured and stored on a blockchain to avoid any central points of failure - Incentive availability, A cryptographic token must be used by the application to provide access and incentives for those who contribute value to the applications. - Proof of value,The tokens (if applicable) must be generated by the decentralized application using consensus and an applicable cryptographic algorithm. Advantages of DApp 1. No waiting time, “Autonomous agents” 2. Privacy, no need to propose the owner of transaction or consensus node 3. Anti sensor, there is no any organization that can block the transaction 4. Perfection of data, cannot modify and argue (โต้แ้ ย้ง้ ) 5. Reliability and traceable Disadvantages of DApp 1. Maintenance, Di cult to maintenance due to the version of DApp 2. Cost of performance, “High” 3. Density of Networks 4. User experience Almost of DApp at the present is “Semi-decentralize”

Use Quizgecko on...
Browser
Browser