Introduction
In the previous lesson, you have mastered the definition, origin and importance of blockchain. In this section, you will get a deeper understanding of how "blockchain" works, including understanding cryptography, consensus mechanisms, as well as other concepts and technologies.
Cryptography
Blockchain and distributed ledger technologies make extensive use of cryptography and security techniques, especially those related to authentication and privacy protection. The latest achievements in cryptography and security technologies, especially those related to identity authentication and privacy protection, are used extensively in blockchain and distributed ledger.
Encryption and decryption algorithms
Encryption and decryption algorithms are the core technology of modern cryptography and can be divided into two basic types in terms of design concepts and application scenarios: symmetric encryption and asymmetric encryption.
Symmetric Cryptography
Symmetric encryption algorithms, as the name implies, use the same key for both encryption and decryption processes. The advantage of this type of algorithm is the high efficiency of encryption and decryption (fast and small space occupation) and the high strength of encryption.
However, the disadvantage is that the participants need to hold the key in advance, and in case of leakage, the system security is broken. Also, it is difficult to distribute keys in advance in insecure message channels, which is usually achieved with the help of additional Diffie-Hellman negotiation protocols or asymmetric encryption algorithms.
Asymmetric Cryptography
Unlike symmetric encryption, the process generates two separate sets of passwords, a "public key" and a "private key".
The private key is equivalent to the password of your personal account on other websites and platforms, which will not be known by others; the public key is similar to a username that is publicly visible and is used to unlock files signed by the "private key", similar to a platform where you can find your personal page by your username, but can not log in to tamper with your information or post information on your behalf without your private key.
Blockchain, on the other hand, is composed of many "blocks", and the actions generated on each chain need to be verified and encrypted by a cryptographer with the corresponding public and private keys. Therefore, when you initiate a transaction using blockchain, you will be required to sign the data with your "private key", while others who are also on blockchain and want to read the content of the file will only need to use another key, "public key", to read the file.
Consensus Mechanisms
Blockchain data, in addition to nodes, requires a specific consensus mechanism to verify the legitimacy of the submitted data, which is a set of protocols, incentives and ideas that enable nodes across the network to agree on the state of blockchain.
Common Consensus Mechanisms
Proof of Work (PoW)
Proof of Work is one of the most common consensus mechanisms that requires miners to solve complex cryptographic puzzles in order to add blocks to the blockchain. BTC, which currently has the largest market capitalization, is a proof-of-work mechanism that has been in operation for over 13 years and has proven security. However, its high energy consumption drawback is also controversial.
Proof of Stake (PoS)
Proof of Stake is seen as a more efficient and secure alternative. Nodes or users involved in the forging process are required to lock a certain number of tokens into the network, which exist as their equity. The size of the entitlement determines the chance of selecting a node as the next verifier, the larger the entitlement, the greater the chance.
Ethereum, which has the most flourishing ecosystem and application development, officially completed The Merge in September 2022, officially moving from PoW to PoS proof of stake. PoW mining, which consumes computer power, is replaced by pledging ETH as a verifier.
Other consensus mechanisms include Delegated Proof of Stake (DPOS), Nominated Proof of Stake (NPoS), etc. Consensus mechanisms are essential to ensure the security and integrity of blockchain networks. Consensus algorithms protect the network from malicious actors and ensure that only valid and legitimate transactions are added to the blockchain.
Nodes: a Key Role to Help Maintain the Network
Unlike banks and centralized use of third parties to verify transactions, blockchain uses a network of computers scattered around to check transaction reliability, often referred to as nodes or miners.
Nodes are key players in recording, verifying, and processing all data, allowing others to use cryptocurrencies, make anonymous and secure peer-to-peer payments, and even assist DApps in executing smart contracts and more complex transactions, and they are rewarded when they function properly and keep the blockchain network in proper working condition, also known as "mining ".
Summary
-
Blockchains use asymmetric encryption for data and generate public and private keys to encrypt or decrypt the data.
-
Different blockchains have different consensus mechanisms to verify the legitimacy of the submitted data, commonly Proof of Work PoW and Proof of Benefit PoS.
-
Bitcoin blockchain has been using PoW consensus mechanism, while Ethereum blockchain switched from PoW to PoS consensus mechanism in September 2022, replacing arithmetic mining with staked ETH.
-
Nodes are important players in keeping the blockchain system operational, responsible for recording, verifying, and processing all data.
Disclaimers
-
Crypto investment involves significant risks. Please proceed with caution. The course shall not be considered investment or financial advice.