Block chain transaction execution method and block chain node
By using hashing algorithms and multi-layer verification mode to verify the legitimacy of new blocks in the blockchain network, the problem of incomplete verification of legitimacy of new blocks in the existing technology is solved, and the security and reliability of blockchain are improved , ensure the integrity and traceability of transaction data.
Patent Information
- Application Number
- CN202410914441.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-11-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The legality verification of new blocks in the existing technology is not comprehensive enough, resulting in insufficient security and stability of blockchain.
By introducing a hash algorithm into the blockchain network to verify the legitimacy of the new block, and adopting a multi-layer verification model, including format verification, code verification, consensus rule verification and integrity verification, we ensure the correctness of each node for the new block. and security.
Improve the efficiency and accuracy of new block verification, enhance the reliability and security of blockchain, prevent forgery, attacks and illegal transactions, and ensure the integrity and traceability of transaction data.
Smart Images

Figure CN118921160A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and more specifically, to a blockchain transaction execution method and a blockchain node. Background Art
[0002] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. In the blockchain system, data blocks are combined into a chain data structure in a sequential manner according to time order, and cryptography is used to ensure that data blocks cannot be tampered with or forged. When blockchain nodes execute multiple transactions in a block, they can speed up transaction execution by executing transactions in parallel.
[0003] The document with the prior art publication number CN113743941B provides a method for executing transactions in a blockchain, a blockchain and a master node. When the master node in the blockchain pre-executes a transaction, the conflict between transactions is considered, and the order of transaction submission is determined according to the order of pre-execution conflict detection of each transaction, so that when the master node does not do evil, the world state of the slave node when executing the transaction is consistent with the world state when the master node pre-executes the transaction, thereby avoiding the need for each slave node to re-execute the transaction due to changes in the world state when executing the transaction, thereby improving the transaction execution speed.
[0004] Although the above-mentioned prior art solutions can achieve relevant beneficial effects through the structure of the prior art, when a new block is formed, the legitimacy verification of the new block is also of great significance to the security and stability of the blockchain. In view of this, we propose a blockchain transaction execution method and a blockchain node. Summary of the invention
[0005] 1. Technical issues to be solved
[0006] The purpose of this application is to provide a blockchain transaction execution method and a blockchain node, which solves the technical problem of incomplete legitimacy verification of new blocks in the prior art and achieves the technical effect of improving the efficiency and accuracy of new block verification.
[0007] 2. Technical solution
[0008] The present application provides a blockchain transaction execution method, comprising the following steps:
[0009] The user sends a transaction request to the seller through the blockchain wallet;
[0010] Other nodes on the blockchain receive the transaction request from the user and record it;
[0011] After receiving the transaction request from the user, the seller uses the blockchain wallet to confirm the transaction request;
[0012] After the seller confirms the transaction request, the transaction information is packaged to generate a new block;
[0013] The new block is added to the broadcast queue and broadcast to all nodes of the blockchain network. Each node verifies the legitimacy of the new block through a hash algorithm.
[0014] When the new block passes the legitimacy verification, all nodes accept the new block and add the new block to the blockchain network to form a blockchain.
[0015] By adopting the above technical solution, the nodes in the blockchain network are distributed all over the place and do not require any centralized organization to control and manage them, thus avoiding the risk of single point failure and improving the reliability and security of the system.
[0016] As an optional solution of the technical solution of this application document, the blockchain wallet is a unit in the blockchain network used to manage user assets, create and manage smart contracts, track transaction history, and send and receive transaction requests.
[0017] As an optional solution to the technical solution of this application document, other nodes on the blockchain receive transaction requests from users and record them in their databases. Each database is an independent database and can be shared in the entire blockchain network. Each database has a unique hash identifier.
[0018] By adopting the above technical solution, each database has a unique hash identifier, which can ensure the uniqueness, traceability and non-tamperability of all databases.
[0019] As an optional solution of the technical solution of this application document, the new block includes at least a hash value and metadata of the previous block; the hash value of the previous block is used to track the historical order of transactions on the blockchain; the metadata includes transaction summary, transaction details, random numbers and consensus parameters.
[0020] As an optional solution of the technical solution of this application document, the transaction summary includes a list of hash values of a group of transactions, addresses of both parties to the transaction, specific content of the transaction and a timestamp of the transaction.
[0021] The transaction details include the transaction parties, transaction amount, transaction type and transaction time.
[0022] The random number is used to generate the header of the new block.
[0023] By adopting the above technical solution, the transaction summary includes a set of transaction hash value lists, addresses of both parties to the transaction, specific content of the transaction and timestamp of the transaction. The transaction summary enables each node to see all transaction records that have occurred. Valve operators can track actions on the blockchain based on the information packaged in the transaction summary and develop and upgrade applications in a targeted manner, which helps maintain the visibility and readability of the blockchain.
[0024] Transaction details include the two parties, transaction amount, transaction type and transaction time. Transaction details are packaged into a separate transaction hash value array and attached to the back of the new block. Packing transaction details into the transaction hash value array effectively ensures the integrity, reliability and traceability of transaction data. Each new block carries a certain number of confirmed transaction hash values, so each item in the transaction hash value array cannot be tampered with. At the same time, the transaction hash value is also a unique identifier that uniquely identifies a transaction. Therefore, even if a new block is lost, it will not affect the readability and traceability of the transaction record. The blockchain system uses random numbers to achieve security and predictability.
[0025] The new block contains all the information of the transaction and is encrypted. When you need to obtain the information of the new block, you need to decrypt it with the corresponding private key.
[0026] As an optional solution of the technical solution of this application document, the node's verification of the new block includes format verification, code verification, consensus rule verification and integrity verification;
[0027] Format verification is when a node checks whether the format of a new block is correct;
[0028] Code verification is when a node checks whether the transaction code has logical loopholes or is likely to be attacked;
[0029] Consensus rule verification is that nodes check whether transactions comply with relevant consensus rules according to the consensus mechanism;
[0030] Integrity verification is a node checking the Merkle Tree root hash of the previous block to confirm whether the Merkle Tree root hash of the current block is within its expected range; if it is not within the expected range, it indicates that a certain link in the transaction may be wrong and needs to be re-verified.
[0031] By adopting the above technical solutions, when the format is wrong, the new block may be a forgery or a trap designed by the attacker, which will cause the verification to fail; code verification can effectively prevent attackers from using smart contracts to achieve malicious behaviors such as double payments and airdrops, thereby improving the security of blockchain transactions; consensus rule verification can effectively prevent illegal transactions, duplicate transactions, and unauthorized transactions.
[0032] As an optional solution of the technical solution of this application document, when some nodes fail to verify the new block, the nodes affected by the fork are determined by comparing the consensus hash values of the new and old chains and each node, and the affected nodes are isolated from the blockchain network.
[0033] By adopting the above technical solution, when some nodes fail to verify the new block, the nodes affected by the fork are determined by comparing the consensus hash values of the new and old chains and each node, and the affected nodes are isolated from the blockchain network to avoid further expansion of the impact range, and the management personnel are notified for inspection.
[0034] The present application also discloses a blockchain node, including a transaction request unit, a transaction execution unit, and an isolation unit;
[0035] The transaction receiving and sending unit is used to receive transaction requests submitted by users and review the transaction requests to ensure that the transactions comply with the regulations of the blockchain. Then, the transactions that comply with the regulations are packaged into new blocks and added to the blockchain through the consensus algorithm.
[0036] The transaction execution unit is used to call smart contracts to execute transactions and ensure that the transaction results meet expectations;
[0037] The isolation unit is used to isolate the affected nodes from the blockchain network when a new block fork event occurs.
[0038] As an optional solution of the technical solution of this application document, it also includes a data storage unit;
[0039] The data storage unit is used to save all historical data of transactions.
[0040] The present application also discloses a blockchain node, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the above-mentioned transaction execution method is implemented.
[0041] 3. Beneficial effects
[0042] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0043] 1. Each new block of this application contains the hash value of the previous new block, so the subsequent new block cannot tamper with any previous new block, improving the security and reliability of transactions.
[0044] 2. The metadata of this application includes transaction summary, transaction details, random numbers and consensus parameters. The transaction summary enables each node to see all transaction records that have occurred. The valve operator tracks the actions on the blockchain based on the information packaged in the transaction summary, and develops and upgrades the application in a targeted manner, which helps to maintain the visibility and readability of the blockchain; the transaction details are packaged into a separate array of transaction hash values and attached to the back of the new block. The transaction details are packaged into the array of transaction hash values to effectively ensure the integrity, reliability and traceability of the transaction data. Each new block carries a certain number of confirmed transaction hash values, so each item in the transaction hash value array cannot be tampered with. At the same time, the transaction hash value is also a unique identifier that uniquely identifies a transaction. Therefore, even if a new block is lost, it will not affect the readability and traceability of the transaction record.
[0045] 3. When some nodes fail to verify the new block, this application determines the nodes affected by the fork by comparing the consensus hash values of the new and old chains and each node, and isolates the affected nodes from the blockchain network to avoid further expansion of the impact, and notifies the management staff for inspection.
[0046] 4. This application sets up multiple verification modes for new blocks: including format verification, code verification, consensus rule verification and integrity verification; nodes with effective format verification check whether the format of the new block is correct. When the format is wrong, the new block may be forged or a trap designed by an attacker, which will cause the verification to fail; code verification checks whether the transaction code has logical loopholes or whether it is likely to be attacked. Code verification can effectively prevent attackers from using smart contracts to implement malicious behaviors such as double payments and airdrops, thereby improving the security of blockchain transactions; consensus rule verification is that the node checks whether the transaction complies with the relevant consensus rules according to the consensus mechanism. Consensus rule verification can effectively prevent illegal transactions, duplicate transactions and unauthorized transactions, etc.; the node confirms whether the Merkle Tree root hash of the current block is within its expected range by checking the Merkle Tree root hash of the previous block; if it is not within the expected range, it indicates that a certain link in the transaction may be wrong and needs to be re-verified. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a flow chart of a blockchain transaction execution method disclosed in a preferred embodiment of the present application. DETAILED DESCRIPTION
[0048] The present application is further described in detail below in conjunction with the accompanying drawings.
[0049] Reference Figure 1 , this embodiment discloses a blockchain transaction execution method, comprising the following steps:
[0050] Users place orders on the trading platform and send transaction requests to sellers through blockchain wallets. Blockchain wallets are part of the blockchain network and are used to manage user assets, create and manage smart contracts, track transaction history, and send and receive transaction requests. Transaction requests include the recipient's public key and product information such as product number, name, quantity, and price.
[0051] Other nodes on the blockchain receive the transaction request from the user and record it in their database. Each database is an independent database and can be shared in the entire blockchain network. Each database has a unique hash identifier, which is used to ensure the uniqueness, traceability and immutability of all databases. After the seller receives the transaction request from the user, he uses the blockchain wallet to confirm the transaction request.
[0052] After the seller confirms that the transaction request is correct, the transaction information is packaged and a new block is generated. The new block includes at least the hash value and metadata of the previous block; the hash value of the previous block is used to track the historical order of transactions on the blockchain.
[0053] Metadata includes transaction summary, transaction details, random numbers, consensus parameters, etc.
[0054] The transaction summary includes a list of hash values of a group of transactions, the addresses of both parties to the transaction, the specific content of the transaction, the timestamp of the transaction, etc. The transaction summary enables each node to see all the transaction records that have occurred. The valve operator tracks the actions on the blockchain based on the information packaged in the transaction summary, and develops and upgrades applications in a targeted manner, which helps maintain the visibility and readability of the blockchain.
[0055] Transaction details include information such as the two parties to the transaction, the transaction amount, the transaction type, and the transaction time. The transaction details are packaged into a separate array of transaction hash values and attached to the back of the new block. The transaction details are packaged into the array of transaction hash values to effectively ensure the integrity, reliability, and traceability of transaction data. Each new block carries a certain number of confirmed transaction hash values, so each item in the transaction hash value array is tamper-proof. At the same time, the transaction hash value is also a unique identifier that uniquely identifies a transaction. Therefore, even if a new block is lost, it will not affect the readability and traceability of the transaction record.
[0056] Random numbers are used to generate the headers of new blocks, and blockchain systems often use random numbers for security and predictability.
[0057] Consensus parameters are used to determine how the blockchain system works, including consensus algorithm, maximum block size, minimum participation, etc. Consensus parameters are packaged as metadata of new blocks and broadcast to the entire network for all nodes to share and use.
[0058] It should be noted that the new block contains all the information of the transaction and has been encrypted. When you need to obtain the information of the new block, you need to decrypt it using the corresponding private key.
[0059] The new block is added to the broadcast queue and broadcast to all nodes of the blockchain network. Each node verifies the legitimacy of the new block through a hash algorithm to determine whether it complies with the blockchain protocol and consensus rules.
[0060] In the blockchain network, each node stores a complete blockchain history record, so when a node receives a new block, it will verify it, including format verification, code verification, consensus rule verification, and integrity verification;
[0061] Format verification is when a node checks whether the format of a new block is correct. This includes checking the length, version number, Merkle Tree root hash value, etc. of the new block. If the format is incorrect, the new block may be a forgery or a trap designed by an attacker, which will cause the verification to fail.
[0062] Code verification is a node checking whether there are logical loopholes in the transaction code or whether there is a possibility of being attacked. Code verification can effectively prevent attackers from using smart contracts (transaction codes) to implement malicious behaviors such as double payments and airdrops, thereby improving the security of blockchain transactions.
[0063] Consensus rule verification is a process where nodes check whether transactions comply with relevant consensus rules according to the consensus mechanism. Consensus rule verification can effectively prevent illegal transactions, duplicate transactions, and unauthorized transactions.
[0064] Integrity verification is a node checking the Merkle Tree root hash of the previous block to confirm whether the Merkle Tree root hash of the current block is within its expected range. If it is not within the expected range, it indicates that a link in the transaction may be wrong and needs to be re-verified.
[0065] Transaction completed: When the transaction is valid and complies with the blockchain rules, all nodes accept the new block and add the new block to the blockchain network. The new block is linked to the top layer of the blockchain in sequence to form a blockchain. After the new block is successfully added to the blockchain, the transaction is completed.
[0066] When some nodes fail to verify the new block (fork event), the consensus hash values of the new and old chains and each node are compared to determine which nodes are affected by the fork, and the affected nodes are isolated from the blockchain network to avoid further expansion of the impact, and the administrators are notified for inspection.
[0067] This embodiment also discloses a blockchain node, including a transaction request unit, a transaction execution unit, an isolation unit, and a data storage unit;
[0068] The transaction receiving and sending unit is used to receive transaction requests submitted by users and review the transaction requests to ensure that the transactions comply with the regulations of the blockchain. Then, the transactions that comply with the regulations are packaged into new blocks and added to the blockchain through the consensus algorithm.
[0069] The transaction execution unit is used to call smart contracts to execute transactions and ensure that the transaction results meet expectations;
[0070] Isolation unit, used to isolate the affected nodes from the blockchain network when a new block fork event occurs;
[0071] The data storage unit is used to save all historical transaction data for subsequent analysis and auditing.
[0072] This embodiment also discloses a blockchain node, including a memory and a processor, wherein executable code is stored in the memory, and when the processor executes the executable code, the above-mentioned transaction execution method is implemented.
Claims
1. Blockchain transaction execution method, Features: The following steps are involved: The user sends a transaction request to the seller through the blockchain wallet; Other nodes on the blockchain receive the transaction request from the user and record it; After receiving the transaction request from the user, the seller uses the blockchain wallet to confirm the transaction request; After the seller confirms the transaction request, the transaction information is packaged to generate a new block; The new block is added to the broadcast queue and broadcast to all nodes of the blockchain network. Each node verifies the legitimacy of the new block through a hash algorithm. When the new block passes the legitimacy verification, all nodes accept the new block and add the new block to the blockchain network to form a blockchain.
2. The blockchain transaction execution method according to claim 1, Features: The blockchain wallet is a unit in the blockchain network used to manage user assets, create and manage smart contracts, track transaction history, and send and receive transaction requests.
3. The blockchain transaction execution method according to claim 1, Features: Other nodes on the blockchain receive transaction requests from users and record them in their databases. Each database is an independent database and can be shared across the entire blockchain network. Each database has a unique hash identifier.
4. The blockchain transaction execution method according to claim 3, Features: The new block includes at least the hash value and metadata of the previous block; the hash value of the previous block is used to track the historical order of transactions on the blockchain; the metadata includes transaction summary, transaction details, random number and consensus parameters.
5. The blockchain transaction execution method according to claim 4, Features: The transaction summary includes a list of hash values of a group of transactions, addresses of both parties to the transaction, specific content of the transaction, and timestamp of the transaction; The transaction details include the transaction parties, transaction amount, transaction type and transaction time.
6. The blockchain transaction execution method according to claim 1, Features: The node's verification of the new block includes format verification, code verification, consensus rule verification and integrity verification; Format verification is when a node checks whether the format of a new block is correct; Code verification is when a node checks whether the transaction code has logical loopholes or is likely to be attacked; Consensus rule verification is that nodes check whether transactions comply with relevant consensus rules according to the consensus mechanism; Integrity verification is a node checking the Merkle Tree root hash of the previous block to confirm whether the Merkle Tree root hash of the current block is within its expected range; if it is not within the expected range, it indicates that a certain link in the transaction may be wrong and needs to be re-verified.
7. The blockchain transaction execution method according to claim 6, Features: When a node fails to verify a new block, the nodes affected by the fork are determined by comparing the consensus hash values of the new and old chains and each node, and the affected nodes are isolated from the blockchain network.
8. A blockchain node, Features: It includes a transaction request unit, a transaction execution unit and an isolation unit; The transaction receiving and sending unit is used to receive transaction requests submitted by users and review the transaction requests to ensure that the transactions comply with the regulations of the blockchain. Then, the transactions that comply with the regulations are packaged into new blocks and added to the blockchain through the consensus algorithm. The transaction execution unit is used to call smart contracts to execute transactions and ensure that the transaction results meet expectations; The isolation unit is used to isolate the affected nodes from the blockchain network when a new block fork event occurs.
9. The blockchain node according to claim 8, Features: Also included is a data storage unit; The data storage unit is used to save all historical data of transactions.
10. A blockchain node, It is characterized in that It comprises a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the transaction execution method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
A method for executing transactions in a blockchain, the blockchain, and the master node.
CN113743941B
Cited By
Distributed data compliance examination method and system
CN119316236A
A distributed data compliance review method and system
CN119316236B
Transaction execution result determination method and device and electronic equipment
CN119850213A
Transaction execution result determination method, device and electronic equipment
CN119850213B
