1. Blockchain Links As the name implies, blockchain is a chain of blocks. Each block is divided into two parts: the block header and the block body (including transaction data). The block header includes the hash value (PrevHash) of the previous block used to implement the block link (also known as the hash value) and the random number (nonce) used to calculate the mining difficulty. The hash value of the previous block is actually the hash value of the previous block header, and the rule for calculating the random number determines which miner can obtain the right to record the block. 2. Consensus Mechanism Blockchain was born with Bitcoin and is the basic technical architecture of Bitcoin. Blockchain can be understood as a decentralized accounting system based on the Internet. Decentralized digital currency systems like Bitcoin require consistency in accounting among honest nodes without a central node, which requires blockchain to accomplish. Therefore, the core of blockchain technology is a consensus mechanism for reaching consensus on the legitimacy of transactions between individuals who have no trust in each other without central control. There are currently four main types of blockchain consensus mechanisms: PoW, PoS, DPoS, and distributed consensus algorithm. 3. Unlocking script Scripts are an important technology for realizing automatic verification and automatic execution of contracts on the blockchain. Strictly speaking, each output of each transaction does not point to an address, but to a script. The script is like a set of rules that constrain how the recipient can spend the assets locked in this output. The legitimacy verification of transactions also relies on scripts. Currently, it relies on two types of scripts: locking scripts and unlocking scripts. The locking script is a condition added to the output transaction, implemented through a scripting language, and located at the output of the transaction. The unlocking script corresponds to the locking script. Only when the conditions required by the locking script are met can the assets corresponding to this script be spent. It is located at the input of the transaction. Many flexible conditions can be expressed through the scripting language. The script is interpreted through a "virtual machine" similar to our programming field, which runs distributedly on every node in the blockchain network. 4. Trading Rules The transaction of blockchain is the basic unit of blocks and the actual valid content recorded by blockchain. A blockchain transaction can be a transfer or other matters such as the deployment of smart contracts. In the case of Bitcoin, a transaction is a payment transfer. The transaction rules are as follows: 1) The input and output of the transaction cannot be empty. 2) For each input of the transaction, if its corresponding UTXO output can be found in the current transaction pool, the transaction is rejected. This is because the current transaction pool is a transaction that is not recorded in the blockchain, and each input of the transaction should come from a confirmed UTXO. If it is found in the current transaction pool, it is a double-spending transaction. 3) For each input in a transaction, the corresponding output must be UTXO. 4) The unlocking script of each input must be verified together with the locking script of the corresponding output to verify the compliance of the transaction. 5. Transaction Priority The priority of blockchain transactions is determined by the blockchain protocol rules. For Bitcoin, the priority of transactions to be included in the block is determined by the time the transaction is broadcast to the network and the size of the transaction. As the time of transaction broadcast to the network increases, the chain age of the transaction increases, the priority of the transaction is increased, and it will eventually be included in the block. For Ethereum, the priority of the transaction is also related to the transaction fee that the publisher of the transaction is willing to pay. The higher the transaction fee the publisher is willing to pay, the higher the priority of the transaction to be included in the block. 6. Merkle Proof The original application of Merkle proofs is the Bitcoin system, which was described and created by Satoshi Nakamoto in 2009. The Bitcoin blockchain uses Merkle proofs to store transactions in each block, making it impossible to tamper with transactions and making it easy to verify whether a transaction is included in a specific block. 7.RLP RLP (Recursive Length Prefix) is a major encoding method for object serialization in Ethereum. Its purpose is to encode sequences of arbitrarily nested binary data. |
<<: In the 5G era, what is the way out for the three major operators that are crying poor?
On the occasion of the Mid-Autumn Festival and Na...
VMISS recently added a second node in Japan, Toky...
Introduction Simple is beautiful. In the world of...
In the previous article, "IoT operating syst...
On August 6, Huawei's online seminar (Huawei ...
As the main theme of today's IT industry, clo...
DesiVPS is an Indian VPS hosting provider headqua...
The State Council Information Office held a press...
With the continuous development of industrial int...
Hello everyone, I am Zhibeijun. It is the last da...
2020 is a year full of "dangers" and &q...
【51CTO.com Quick Translation】 Project management ...
To achieve load balancing or server migration, we...
After the arrival of the 5G era, wireless broadba...
The article "Why Shenzhen has more 5G base s...