CN110602148A - Method and device for generating state tree of block and verifying data on chain - Google Patents
Method and device for generating state tree of block and verifying data on chain Download PDFInfo
- Publication number
- CN110602148A CN110602148A CN201910960376.XA CN201910960376A CN110602148A CN 110602148 A CN110602148 A CN 110602148A CN 201910960376 A CN201910960376 A CN 201910960376A CN 110602148 A CN110602148 A CN 110602148A
- Authority
- CN
- China
- Prior art keywords
- block
- account
- account data
- height
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 62
- 238000012795 verification Methods 0.000 claims abstract description 59
- 238000003860 storage Methods 0.000 claims description 54
- 238000010276 construction Methods 0.000 claims description 18
- 238000012545 processing Methods 0.000 claims description 10
- 238000013502 data validation Methods 0.000 claims description 3
- 230000008859 change Effects 0.000 abstract description 7
- 238000004904 shortening Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 15
- 238000013524 data verification Methods 0.000 description 14
- 230000008569 process Effects 0.000 description 11
- 238000005516 engineering process Methods 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 5
- 238000004590 computer program Methods 0.000 description 5
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 238000004422 calculation algorithm Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000002085 persistent effect Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/12—Applying verification of the received information
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3236—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3247—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2209/00—Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
- H04L2209/56—Financial cryptography, e.g. electronic payment or e-cash
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Business, Economics & Management (AREA)
- Finance (AREA)
- Accounting & Taxation (AREA)
- Development Economics (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Computer Hardware Design (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明公开了一种区块的状态树的生成和链上数据验证的方法及装置,其中,区块的状态树的生成方法包括:针对区块链中的任一区块,确定区块的第一账户和第一账户数据;第一账户是区块中各交易执行后账户数据发生变化的账户,第一账户数据是各交易执行后第一账户中发生变化后的账户数据;构建由各第一账户和各第一账户的第一账户数据构成的区块的状态树,并将状态树的根哈希存储在区块的区块头中,其中,状态树以键值对的方式存储。该技术方案用以精简区块链上用于构建状态树的账户数据,从而缩短用于验证的分支路径的长度,提高账户数据的存在性验证的效率。
The invention discloses a method and device for generating a state tree of a block and verifying data on the chain, wherein the method for generating a state tree of a block includes: for any block in the block chain, determine the block's The first account and the first account data; the first account is the account whose account data changes after the execution of each transaction in the block, and the first account data is the account data after the change in the first account after each transaction is executed; The state tree of the block formed by the first account and the first account data of each first account, and the root hash of the state tree is stored in the block header of the block, wherein the state tree is stored in the form of key-value pairs. This technical solution is used to simplify the account data used to construct the state tree on the blockchain, thereby shortening the length of the branch path used for verification, and improving the efficiency of the existence verification of the account data.
Description
技术领域technical field
本发明实施例涉及金融科技(Fintech)领域,尤其涉及一种区块(Block)的状态树的生成和链上数据验证的方法及装置。The embodiment of the present invention relates to the field of financial technology (Fintech), and in particular to a method and device for generating a state tree of a block and verifying data on the chain.
背景技术Background technique
随着计算机技术的发展,越来越多的技术(例如:区块链(BlockChain)、云计算或大数据)应用在金融领域,传统金融业正在逐步向金融科技转变,区块链技术也不例外,但由于金融、支付行业的安全性、实时性要求,也对区块链技术提出的更高的要求。With the development of computer technology, more and more technologies (such as blockchain (BlockChain), cloud computing or big data) are applied in the financial field. The traditional financial industry is gradually transforming into financial technology, and blockchain technology is not Exceptions, but due to the security and real-time requirements of the financial and payment industries, there are also higher requirements for blockchain technology.
以太坊(ethereum)的状态树和存储树中,若对存储树中的合约状态进行存在性验证,需要先确定合约状态在存储树中的分支路径,验证该合约状态是否存在于对应的存储树中,随后确定该存储树所对应的账户状态在状态树中的分支路径,进而验证该账户状态是否存在于对应的状态树中。In the state tree and storage tree of Ethereum, if the existence of the contract state in the storage tree is verified, it is necessary to first determine the branch path of the contract state in the storage tree, and verify whether the contract state exists in the corresponding storage tree , then determine the branch path of the account state corresponding to the storage tree in the state tree, and then verify whether the account state exists in the corresponding state tree.
但随着区块链上数据不断增长,区块链节点需要获取的用于验证的分支路径较长,获取分支路径的耗时和存在性验证的耗时都较长。However, as the data on the blockchain continues to grow, blockchain nodes need to obtain longer branch paths for verification, and it takes longer to obtain the branch paths and to verify the existence of them.
发明内容Contents of the invention
本发明实施例提供一种区块的状态树的生成和链上数据验证的方法及装置,用以精简区块链上用于构建状态树的账户数据,从而缩短用于验证的分支路径的长度,提高账户数据的存在性验证的效率。The embodiment of the present invention provides a method and device for generating a state tree of a block and verifying data on the chain, which is used to simplify the account data used to build the state tree on the block chain, thereby shortening the length of the branch path used for verification , improve the efficiency of the existence verification of account data.
第一方面,本发明实施例提供的一种区块的状态树的生成方法,包括:In the first aspect, a method for generating a state tree of a block provided by an embodiment of the present invention includes:
针对区块链中的任一区块,确定所述区块的第一账户和第一账户数据;所述第一账户是所述区块中各交易执行后账户数据发生变化的账户,所述第一账户数据是所述各交易执行后所述第一账户中发生变化后的账户数据;For any block in the block chain, determine the first account and first account data of the block; the first account is the account whose account data changes after each transaction in the block is executed, and the The first account data is the account data changed in the first account after the execution of each transaction;
构建由各第一账户和所述各第一账户的第一账户数据构成的所述区块的状态树,并将所述状态树的根哈希存储在所述区块的区块头中,其中,所述状态树以键值对的方式存储。Constructing the state tree of the block composed of each first account and the first account data of each first account, and storing the root hash of the state tree in the block header of the block, wherein , the state tree is stored in the form of key-value pairs.
上述技术方案中,在构建状态树时,仅基于当前区块交易执行过程中所修改的或新增的账户数据生成,而不会再基于原有区块对应的未发生变化的账户数据生成,该方式通过精简数据量,可以极大地减少状态树层级。In the above technical solution, when constructing the state tree, it is only generated based on the modified or newly added account data during the execution of the current block transaction, and will not be generated based on the unchanged account data corresponding to the original block. This method can greatly reduce the state tree level by streamlining the amount of data.
可选的,所述构建由各第一账户和所述各第一账户的第一账户数据构成的所述区块的状态树,包括:Optionally, the construction of the state tree of the block composed of each first account and the first account data of each first account includes:
针对任一第一账户的任一第一账户数据,将所述第一账户的标识、所述第一账户数据的标识和所述区块的块高作为key值,所述第一账户数据作为叶子节点的value值,基于MPT模式构建所述区块的状态树。For any first account data of any first account, the identifier of the first account, the identifier of the first account data, and the block height of the block are used as key values, and the first account data is used as The value of the leaf node is used to construct the state tree of the block based on the MPT mode.
上述技术方案中,直接将key值进行持久化存储,而不是将key值的哈希进行持久化存储,通过该方式,可以保障同一账户下的账户数据具有相同的压缩前缀,也就是账号标识或账户地址,有效利用Patricia Tree的优势,将状态树的层级压缩至最小,减少存储空间的同时也加快了分支路径的构建及验证效率。In the above technical solution, the key value is directly stored persistently instead of the hash of the key value. In this way, the account data under the same account can be guaranteed to have the same compressed prefix, that is, the account ID or Account address, effectively using the advantages of Patricia Tree, compresses the level of the state tree to the minimum, reduces storage space, and speeds up the construction and verification efficiency of branch paths.
可选的,所述第一账户数据包括所述各交易执行后所述第一账户中发生变化的块高记录、账户状态和/或合约状态;所述块高记录用于记录所述第一账户中的账户状态和/或合约状态发生历次变化时所在的区块的块高。Optionally, the first account data includes block height records, account status and/or contract status that have changed in the first account after the execution of each transaction; the block height records are used to record the first The block height of the block where the account status and/or contract status in the account have changed.
账户状态原本属于状态树的叶子节点中的值,合约状态原本属于存储树的叶子节点中的值,而上述技术方案中,将状态树的叶子节点中的值下移至与存储树的叶子节点中的值平级,将状态树和存储树合并为一棵树,从而扁平化账户数据的层级结构,加快了分支路径的构建及验证效率。进一步的,在落盘存储时增加key-value键值对,其中,该key中包括账户标识和账户数据标识,此时的账户数据标识对应块高记录,value值即为块高记录,该块高记录用于记录账户标识对应账户中的账户数据发生历次变化时所在的区块的块高,通过该方式,可以在验证某个账户数据时,先确定该账户数据所在状态树的区块,进而根据该区块确定用于验证的分支路径。The account state originally belonged to the value in the leaf node of the state tree, and the contract state originally belonged to the value in the leaf node of the storage tree. In the above technical solution, the value in the leaf node of the state tree is moved down to the leaf node of the storage tree The value level in , the state tree and the storage tree are merged into one tree, thereby flattening the hierarchical structure of account data, and speeding up the construction and verification efficiency of branch paths. Further, a key-value key-value pair is added when storage is placed on the disk, wherein the key includes the account ID and the account data ID, the account data ID at this time corresponds to the block height record, and the value is the block height record, the block The high record is used to record the block height of the block where the account data in the account corresponding to the account identifier has changed in the past. In this way, when verifying an account data, first determine the block of the state tree where the account data is located. Then, according to the block, a branch path for verification is determined.
可选的,所述方法还包括:Optionally, the method also includes:
接收客户端的数据获取请求;所述数据获取请求中包括第二账户的标识、第二账户数据的标识和第一块高;Receive a data acquisition request from the client; the data acquisition request includes the identifier of the second account, the identifier of the second account data, and the first block height;
根据所述第二账户的标识和所述第二账户的第一块高记录的标识,确定所述第一块高记录;根据所述第二账户的标识、所述第二账户数据的标识、所述第一块高,确定所述第二账户数据;According to the identification of the second account and the identification of the first high record of the second account, determine the first high record; according to the identification of the second account, the identification of the second account data, The first block is high, determining the second account data;
从第一区块的状态树中获取用于验证所述第一块高记录的第一分支路径;所述第一区块是所述第一块高记录中的最高块高对应的区块;Obtaining a first branch path for verifying the first high record from the state tree of the first block; the first block is a block corresponding to the highest block height in the first high record;
从第二区块的状态树中获取用于验证所述第二账户数据的第二分支路径;所述第二区块是第二块高对应的区块;所述第二块高是所述第一块高记录中低于所述第一块高的所有块高中的最高的块高;Obtain the second branch path used to verify the second account data from the state tree of the second block; the second block is the block corresponding to the second block height; the second block height is the the highest block height of all block heights lower than the first block height in the first block height record;
将所述第一块高记录、所述第一分支路径、所述第二账户数据、所述第二分支路径发送至所述客户端,以使所述客户端对所述第一块高记录和第二账户数据进行验证。sending the first high record, the first branch path, the second account data, and the second branch path to the client, so that the client can check the first high record and the second account data for verification.
上述技术方案中,区块链节点根据客户端的数据获取请求,向客户端返回两组数据,第一组是第一块高记录和用于验证第一块高记录的第一分支路径,第二组是第二账户数据和用于验证第二账户数据的第二分支路径,从而客户端可以根据该两组数据分别对第一块高记录和第二账户数据进行验证。其中,第一分支路径和第二分支路径相比于现有技术中的分支路径都较短,区块链节点在获取分支路径时所需时长较短,且客户端验证所需时长也较短,从而提高客户端验证数据的效率。In the above technical solution, the blockchain node returns two sets of data to the client according to the client’s data acquisition request, the first set is the first high record and the first branch path used to verify the first high record, the second The groups are the second account data and the second branch path for verifying the second account data, so that the client can respectively verify the first high record and the second account data according to the two sets of data. Among them, the first branch path and the second branch path are shorter than the branch path in the prior art, the time required for the blockchain node to obtain the branch path is shorter, and the time required for client verification is also shorter , so as to improve the efficiency of client verification data.
第二方面,本发明实施例提供的一种链上数据验证的方法,包括:In the second aspect, an on-chain data verification method provided by an embodiment of the present invention includes:
向区块链节点发送数据获取请求;所述数据获取请求包括第二账户的标识、第二账户数据的标识和第一块高;Send a data acquisition request to the block chain node; the data acquisition request includes the identification of the second account, the identification of the second account data and the first block height;
接收所述区块链节点返回的第一块高记录、第一分支路径、第二账户数据、第二分支路径;所述第一块高记录和所述第二账户数据是所述区块链节点根据所述第二账户的标识、所述第二账户数据的标识和所述第一块高确定的;所述第一分支路径是所述区块链节点确定的用于验证所述第一块高记录的分支路径;所述第二分支路径是所述区块链节点确定的用于验证所述第二账户数据的分支路径;Receive the first high record, the first branch path, the second account data, and the second branch path returned by the blockchain node; the first high record and the second account data are the blockchain The node is determined according to the identity of the second account, the identity of the second account data, and the first block; the first branch path is determined by the blockchain node for verifying the first A branch path recorded in the block height; the second branch path is a branch path determined by the block chain node for verifying the second account data;
根据所述第一分支路径、本地存储的第一区块的区块头中状态树的根哈希验证所述第一块高记录是否正确;所述本地存储的第一区块的区块头是从所述区块链节点上获取的,所述第一区块是区块链上是所述第一块高记录中的最高块高对应的区块;Verify whether the first high record is correct according to the first branch path, the root hash of the state tree in the block header of the first block stored locally; the block header of the first block stored locally is obtained from Acquired on the blockchain node, the first block is the block corresponding to the highest block height in the first block height record on the blockchain;
在确定所述第一块高记录正确之后,根据所述第二分支路径、所述本地存储的第二区块的区块头中状态树的根哈希,验证所述第二账户数据的是否正确;所述本地存储的第二区块的区块头是从所述区块链节点上获取的,所述第二区块是所述区块链上第二块高对应的区块;所述第二块高是所述第一块高记录中低于所述第一块高的所有块高中的最高的块高。After determining that the first block high record is correct, verify whether the second account data is correct according to the second branch path and the root hash of the state tree in the block header of the second block stored locally ; The block header of the second block stored locally is obtained from the block chain node, and the second block is the block corresponding to the second block height on the block chain; the first The second block height is the highest block height of all block heights lower than the first block height in the first block height record.
上述技术方案中,客户端向区块链节点发送数据获取请求,区块链节点根据客户端的数据获取请求,向客户端返回两组数据,第一组是第一块高记录和用于验证第一块高记录的第一分支路径,第二组是第二账户数据和用于验证第二账户数据的第二分支路径,从而客户端可以根据该两组数据分别对第一块高记录和第二账户数据进行验证。其中,第一分支路径和第二分支路径相比于现有技术中的分支路径都较短,区块链节点在获取分支路径时所需时长较短,且客户端验证所需时长也较短,从而提高客户端验证数据的效率。In the above technical solution, the client sends a data acquisition request to the blockchain node, and the blockchain node returns two sets of data to the client according to the data acquisition request from the client. The first branch path of a piece of high record, the second group is the second account data and the second branch path used to verify the second account data, so that the client can separately record the first piece of high record and the second branch path according to the two sets of data Two account data are verified. Among them, the first branch path and the second branch path are shorter than the branch path in the prior art, the time required for the blockchain node to obtain the branch path is shorter, and the time required for client verification is also shorter , so as to improve the efficiency of client verification data.
可选的,所述根据所述第一分支路径、本地存储的第一区块的区块头中状态树的根哈希验证所述第一块高记录是否正确,包括:Optionally, verifying whether the first block high record is correct according to the first branch path and the root hash of the state tree in the block header of the locally stored first block includes:
根据所述第一块高记录和所述第一分支路径中叶子节点和分支节点的数据,确定第一根哈希;Determine a first root hash according to the first block high record and the data of leaf nodes and branch nodes in the first branch path;
若所述第一根哈希等于所述本地存储的第一区块的区块头中状态树的根哈希,则确定所述第一块高记录正确。If the first root hash is equal to the root hash of the state tree in the block header of the locally stored first block, it is determined that the first block high record is correct.
上述技术方案中,客户端根据本地存储的第一区块的区块头中状态树的根哈希和第一分支路径,实现对第一块高记录的验证。In the above technical solution, the client realizes the verification of the first high record according to the root hash of the state tree and the first branch path in the block header of the first block stored locally.
可选的,所述根据所述第二分支路径、所述本地存储的第二区块的区块头中状态树的根哈希,验证所述第二账户数据的是否正确,包括:Optionally, the verifying whether the second account data is correct according to the second branch path and the root hash of the state tree in the block header of the locally stored second block includes:
根据所述第二账户数据和所述第二分支路径中叶子节点和分支节点的数据,确定第二根哈希;determining a second root hash according to the second account data and the data of leaf nodes and branch nodes in the second branch path;
若所述第二根哈希等于所述本地存储的第二区块的区块头中状态树的根哈希,则确定所述第二账户数据正确。If the second root hash is equal to the root hash of the state tree in the block header of the locally stored second block, it is determined that the second account data is correct.
上述技术方案中,客户端根据本地存储的第二区块的区块头中状态树的根哈希和第二分支路径,实现对第二账户数据的验证。In the above technical solution, the client realizes the verification of the second account data according to the root hash of the state tree in the block header of the second block stored locally and the second branch path.
可选的,所述方法还包括:Optionally, the method also includes:
向所述区块链节点发送查询请求;Send a query request to the blockchain node;
接收所述区块链节点返回的查询结果;所述查询结果是所述区块链节点在接收到所述查询请求后返回的区块链的当前块高;receiving the query result returned by the block chain node; the query result is the current block height of the block chain returned by the block chain node after receiving the query request;
判断所述本地存储的区块头的最高块高是否小于所述当前块高,若是,则向所述区块链节点发送区块头获取请求;所述区块头获取请求中包括待获取区块头的块高;Judging whether the highest block height of the locally stored block header is less than the current block height, if so, sending a block header acquisition request to the blockchain node; the block header acquisition request includes the block to be acquired high;
接收所述区块链节点返回的区块头,将接收到的区块头存储在本地。Receive the block header returned by the blockchain node, and store the received block header locally.
上述技术方案中,客户端定时去区块链节点获取最新区块的区块头,可以保障在需要对账户数据进行验证时,本地存储有用于验证的区块的区块头信息。In the above technical solution, the client regularly goes to the blockchain node to obtain the block header of the latest block, which can ensure that when the account data needs to be verified, the block header information of the block used for verification is locally stored.
可选的,所述将接收到的区块头存储在本地之前,还包括:Optionally, before storing the received block header locally, it also includes:
获取所述接收到的区块头中的N个签名信息;Obtain N pieces of signature information in the received block header;
根据共识节点列表,对所述N个签名信息验证;所述共识节点列表是根据所述区块链的创世块的区块头至所述接收到的区块头的前一个区块头确定的共识节点组成的列表;Verify the N signature information according to the consensus node list; the consensus node list is the consensus node determined according to the block header of the genesis block of the blockchain to the previous block header of the received block header list of components;
若所述N个签名信息通过验证,则确定所述接收到的区块头正确。If the N pieces of signature information pass the verification, it is determined that the received block header is correct.
可选的,所述根据共识节点列表,对所述N个签名信息验证,包括:Optionally, the verification of the N signature information according to the list of consensus nodes includes:
确定所述N个签名信息对应的N个共识节点;Determine the N consensus nodes corresponding to the N signature information;
判断所述N个共识节点中在所述共识节点列表中的M个共识节点;judging M consensus nodes in the list of consensus nodes among the N consensus nodes;
若M符合预设条件,则确定所述N个签名信息通过验证。If M meets the preset condition, it is determined that the N pieces of signature information pass the verification.
通过上述方式,客户端从创世块开始即对创世块的块头信息进行验证,且每增加一个区块的块头,都会结合当前共识节点列表中的共识节点对当前增加的区块的块头进行验证,以保障保存至本地的区块的块头信息是正确的,从而保障用于验证账户数据的区块头中状态树的根哈希的正确性,进而实现对账户数据的验证。Through the above method, the client will verify the block header information of the genesis block from the genesis block, and each time a block header is added, it will combine the consensus nodes in the current consensus node list to verify the block header information of the currently added block. Verification to ensure that the block header information of the block saved locally is correct, thereby ensuring the correctness of the root hash of the state tree in the block header used to verify the account data, thereby realizing the verification of the account data.
第三方面,本发明实施例提供的一种区块的状态树的生成装置,包括:In a third aspect, an apparatus for generating a state tree of a block provided by an embodiment of the present invention includes:
确定单元,用于针对区块链中的任一区块,确定所述区块的第一账户和第一账户数据;所述第一账户是所述区块中各交易执行后账户数据发生变化的账户,所述第一账户数据是所述各交易执行后所述第一账户中发生变化后的账户数据;The determination unit is configured to determine the first account and the first account data of the block for any block in the block chain; the first account is that the account data in the block changes after the execution of each transaction account, the first account data is the account data changed in the first account after the execution of each transaction;
构建单元,用于构建由各第一账户和所述各第一账户的第一账户数据构成的所述区块的状态树,并将所述状态树的根哈希存储在所述区块的区块头中,其中,所述状态树以键值对的方式存储。A construction unit, configured to construct the state tree of the block composed of each first account and the first account data of each first account, and store the root hash of the state tree in the block In the block header, the state tree is stored in the form of key-value pairs.
可选的,所述构建单元具体用于:Optionally, the construction unit is specifically used for:
针对任一第一账户的任一第一账户数据,将所述第一账户的标识、所述第一账户数据的标识和所述区块的块高作为key值,所述第一账户数据作为叶子节点的value值,基于MPT模式构建所述区块的状态树。For any first account data of any first account, the identifier of the first account, the identifier of the first account data, and the block height of the block are used as key values, and the first account data is used as The value of the leaf node is used to construct the state tree of the block based on the MPT mode.
可选的,所述第一账户数据包括所述各交易执行后所述第一账户中发生变化的块高记录、账户状态和/或合约状态;所述块高记录用于记录所述第一账户中的账户状态和/或合约状态发生历次变化时所在的区块的块高。Optionally, the first account data includes block height records, account status and/or contract status that have changed in the first account after the execution of each transaction; the block height records are used to record the first The block height of the block where the account status and/or contract status in the account have changed.
可选的,所述装置还包括处理单元;Optionally, the device further includes a processing unit;
所述处理单元用于:The processing unit is used for:
接收客户端的数据获取请求;所述数据获取请求中包括第二账户的标识、第二账户数据的标识和第一块高;Receive a data acquisition request from the client; the data acquisition request includes the identifier of the second account, the identifier of the second account data, and the first block height;
根据所述第二账户的标识和所述第二账户的第一块高记录的标识,确定所述第一块高记录;根据所述第二账户的标识、所述第二账户数据的标识、所述第一块高,确定所述第二账户数据;According to the identification of the second account and the identification of the first high record of the second account, determine the first high record; according to the identification of the second account, the identification of the second account data, The first block is high, determining the second account data;
从第一区块的状态树中获取用于验证所述第一块高记录的第一分支路径;所述第一区块是所述第一块高记录中的最高块高对应的区块;Obtaining a first branch path for verifying the first high record from the state tree of the first block; the first block is a block corresponding to the highest block height in the first high record;
从第二区块的状态树中获取用于验证所述第二账户数据的第二分支路径;所述第二区块是第二块高对应的区块;所述第二块高是所述第一块高记录中低于所述第一块高的所有块高中的最高的块高;Obtain the second branch path used to verify the second account data from the state tree of the second block; the second block is the block corresponding to the second block height; the second block height is the the highest block height of all block heights lower than the first block height in the first block height record;
将所述第一块高记录、所述第一分支路径、所述第二账户数据、所述第二分支路径发送至所述客户端,以使所述客户端对所述第一块高记录和第二账户数据进行验证。sending the first high record, the first branch path, the second account data, and the second branch path to the client, so that the client can check the first high record and the second account data for verification.
第四方面,本发明实施例提供的一种链上数据验证的装置,包括:In the fourth aspect, an on-chain data verification device provided by an embodiment of the present invention includes:
收发单元,用于向区块链节点发送数据获取请求;所述数据获取请求包括第二账户的标识、第二账户数据的标识和第一块高;A transceiver unit, configured to send a data acquisition request to the block chain node; the data acquisition request includes the identification of the second account, the identification of the second account data and the first block height;
所述收发单元,还用于接收所述区块链节点返回的第一块高记录、第一分支路径、第二账户数据、第二分支路径;所述第一块高记录和所述第二账户数据是所述区块链节点根据所述第二账户的标识、所述第二账户数据的标识和所述第一块高确定的;所述第一分支路径是所述区块链节点确定的用于验证所述第一块高记录的分支路径;所述第二分支路径是所述区块链节点确定的用于验证所述第二账户数据的分支路径;The transceiver unit is also used to receive the first high record, the first branch path, the second account data, and the second branch path returned by the block chain node; the first high record and the second The account data is determined by the block chain node according to the identification of the second account, the identification of the second account data and the first block height; the first branch path is determined by the block chain node The branch path used to verify the first block high record; the second branch path is the branch path determined by the block chain node for verifying the second account data;
验证单元,用于根据所述第一分支路径、本地存储的第一区块的区块头中状态树的根哈希验证所述第一块高记录是否正确;所述本地存储的第一区块的区块头是从所述区块链节点上获取的,所述第一区块是区块链上是所述第一块高记录中的最高块高对应的区块;The verification unit is used to verify whether the first block high record is correct according to the first branch path and the root hash of the state tree in the block header of the locally stored first block; the locally stored first block The block header is obtained from the blockchain node, and the first block is the block corresponding to the highest block height in the first block height record on the blockchain;
所述验证单元,还用于在确定所述第一块高记录正确之后,根据所述第二分支路径、所述本地存储的第二区块的区块头中状态树的根哈希,验证所述第二账户数据的是否正确;所述本地存储的第二区块的区块头是从所述区块链节点上获取的,所述第二区块是所述区块链上第二块高对应的区块;所述第二块高是所述第一块高记录中低于所述第一块高的所有块高中的最高的块高。The verification unit is further configured to verify that the first block high record is correct according to the second branch path and the root hash of the state tree in the block header of the second block stored locally. Whether the above-mentioned second account data is correct; the block header of the second block stored locally is obtained from the block chain node, and the second block is the second high-level block on the block chain Corresponding block; the second block height is the highest block height of all block heights lower than the first block height in the first block height record.
可选的,所述验证单元具体用于:Optionally, the verification unit is specifically used for:
根据所述第一块高记录和所述第一分支路径中叶子节点和分支节点的数据,确定第一根哈希;Determine a first root hash according to the first block high record and the data of leaf nodes and branch nodes in the first branch path;
若所述第一根哈希等于所述本地存储的第一区块的区块头中状态树的根哈希,则确定所述第一块高记录正确。If the first root hash is equal to the root hash of the state tree in the block header of the locally stored first block, it is determined that the first block high record is correct.
可选的,所述验证单元具体用于:Optionally, the verification unit is specifically used for:
根据所述第二账户数据和所述第二分支路径中叶子节点和分支节点的数据,确定第二根哈希;determining a second root hash according to the second account data and the data of leaf nodes and branch nodes in the second branch path;
若所述第二根哈希等于所述本地存储的第二区块的区块头中状态树的根哈希,则确定所述第二账户数据正确。If the second root hash is equal to the root hash of the state tree in the block header of the locally stored second block, it is determined that the second account data is correct.
可选的,所述装置还包括同步单元;Optionally, the device further includes a synchronization unit;
所述同步单元用于:The synchronization unit is used for:
向所述区块链节点发送查询请求;Send a query request to the blockchain node;
接收所述区块链节点返回的查询结果;所述查询结果是所述区块链节点在接收到所述查询请求后返回的区块链的当前块高;receiving the query result returned by the block chain node; the query result is the current block height of the block chain returned by the block chain node after receiving the query request;
判断所述本地存储的区块头的最高块高是否小于所述当前块高,若是,则向所述区块链节点发送区块头获取请求;所述区块头获取请求中包括待获取区块头的块高;Judging whether the highest block height of the locally stored block header is less than the current block height, if so, sending a block header acquisition request to the blockchain node; the block header acquisition request includes the block to be acquired high;
接收所述区块链节点返回的区块头,将接收到的区块头存储在本地。Receive the block header returned by the blockchain node, and store the received block header locally.
可选的,所述同步单元在所述将接收到的区块头存储在本地之前,还用于:Optionally, before the synchronization unit stores the received block header locally, it is also used for:
获取所述接收到的区块头中的N个签名信息;Obtain N pieces of signature information in the received block header;
根据共识节点列表,对所述N个签名信息验证;所述共识节点列表是根据所述区块链的创世块的区块头至所述接收到的区块头的前一个区块头确定的共识节点组成的列表;Verify the N signature information according to the consensus node list; the consensus node list is the consensus node determined according to the block header of the genesis block of the blockchain to the previous block header of the received block header list of components;
若所述N个签名信息通过验证,则确定所述接收到的区块头正确。If the N pieces of signature information pass the verification, it is determined that the received block header is correct.
可选的,所述同步单元具体用于:Optionally, the synchronization unit is specifically used for:
确定所述N个签名信息对应的N个共识节点;Determine the N consensus nodes corresponding to the N signature information;
判断所述N个共识节点中在所述共识节点列表中的M个共识节点;judging M consensus nodes in the list of consensus nodes among the N consensus nodes;
若M符合预设条件,则确定所述N个签名信息通过验证。If M meets the preset condition, it is determined that the N pieces of signature information pass the verification.
第五方面,本发明实施例还提供了一种计算设备,包括:In a fifth aspect, an embodiment of the present invention further provides a computing device, including:
存储器,用于存储程序指令;memory for storing program instructions;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述区块的状态树的生成方法。The processor is configured to call the program instructions stored in the memory, and execute the method for generating the state tree of the above block according to the obtained program.
第六方面,本发明实施例还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述区块的状态树的生成方法。In the sixth aspect, the embodiment of the present invention also provides a computer-readable non-volatile storage medium, including computer-readable instructions, and when the computer reads and executes the computer-readable instructions, the computer executes the above-mentioned blocks. The generation method of the state tree.
第七方面,本发明实施例还提供了一种计算设备,包括:In the seventh aspect, the embodiment of the present invention also provides a computing device, including:
存储器,用于存储程序指令;memory for storing program instructions;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述链上数据验证的方法。The processor is configured to call the program instructions stored in the memory, and execute the above-mentioned on-chain data verification method according to the obtained program.
第八方面,本发明实施例还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述链上数据验证的方法。In the eighth aspect, the embodiment of the present invention also provides a computer-readable non-volatile storage medium, including computer-readable instructions, when the computer reads and executes the computer-readable instructions, the computer executes the above-mentioned on-chain data method of verification.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without making creative efforts.
图1为一种Merkle Tree的示意图;Figure 1 is a schematic diagram of a Merkle Tree;
图2为现有技术中以太坊中状态树和存储树的示意图;Fig. 2 is a schematic diagram of state tree and storage tree in Ethereum in the prior art;
图3为本发明实施例提供的一种状态树和存储树的示意图;FIG. 3 is a schematic diagram of a state tree and a storage tree provided by an embodiment of the present invention;
图4为本发明实施例提供的另一种状态树和存储树的示意图;FIG. 4 is a schematic diagram of another state tree and storage tree provided by an embodiment of the present invention;
图5为本发明实施例提供的一种区块的状态树的生成方法的流程的示意图;FIG. 5 is a schematic diagram of the flow of a method for generating a state tree of a block provided by an embodiment of the present invention;
图6为本发明实施例提供的一种链上数据验证所适用的系统架构;FIG. 6 is a system architecture applicable to on-chain data verification provided by an embodiment of the present invention;
图7为本发明实施例提供的一种链上数据验证的方法的流程的示意图;FIG. 7 is a schematic diagram of the flow of a method for on-chain data verification provided by an embodiment of the present invention;
图8为本发明实施例提供的一种客户端获取区块头的流程的示意图;FIG. 8 is a schematic diagram of a process for a client to obtain a block header provided by an embodiment of the present invention;
图9为本发明实施例提供的另一种链上数据验证所适用的系统架构;FIG. 9 is another system architecture applicable to on-chain data verification provided by the embodiment of the present invention;
图10为本发明实施例提供的一种区块的状态树的生成装置的结构示意图;FIG. 10 is a schematic structural diagram of an apparatus for generating a state tree of a block provided by an embodiment of the present invention;
图11为本发明实施例提供的一种链上数据验证的装置的结构示意图。Fig. 11 is a schematic structural diagram of an on-chain data verification device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
为了更好的解释本发明,先对本发明所涉及的专业术语解释如下:In order to better explain the present invention, the professional terms involved in the present invention are first explained as follows:
1、Merkle Tree(默克尔树)1. Merkle Tree
Merkle Tree是一种由叶子节点、中间节点和根节点构成的二叉树。其中叶子节点记录的是数据(如本发明实施例中提及账户数据)的哈希值,中间节点记录的是它的两个子节点(子节点可能为叶子节点或者其他中间节点)组成后计算的哈希值,根节点所记录值的计算方法与中间节点所记录值的计算方法类似。Merkle Tree is a binary tree composed of leaf nodes, intermediate nodes and root nodes. Among them, what the leaf node records is the hash value of the data (such as the account data mentioned in the embodiment of the present invention), and what the intermediate node records is the hash value calculated after the composition of its two child nodes (the child nodes may be leaf nodes or other intermediate nodes). Hash value, the calculation method of the value recorded by the root node is similar to the calculation method of the value recorded by the intermediate node.
Merkle Tree可如图1所示,Merkle Tree自底向上的构建流程为,D1-D7是基础数据(用于构建叶子节点),H1-H7记录的是相应数据的哈希值(H1-H7即为叶子节点)。往上一层,H9是中间节点,记录的是将节点H2和H1作为输入进行哈希运算后得到的值。循环重复上述计算过程,最后计算得到最后一个节点的哈希值,该节点为根节点,所记录的哈希值为整棵Merkle Tree的哈希值。Merkle Tree can be shown in Figure 1. The bottom-up construction process of Merkle Tree is as follows: D1-D7 is the basic data (used to build leaf nodes), H1-H7 records the hash value of the corresponding data (H1-H7 is is a leaf node). Going up one level, H9 is an intermediate node, which records the value obtained by hashing the nodes H2 and H1 as inputs. The above calculation process is repeated cyclically, and finally the hash value of the last node is calculated, which is the root node, and the recorded hash value is the hash value of the entire Merkle Tree.
2、Merkle证明2. Merkle proof
从Merkle Tree的构建过程我们可以发现任意一个叶子节点所记录的数据被修改,叶子节点的哈希值会相应的改变,最终影响到根节点的哈希值。因此根节点的哈希值可以作为一组数据的唯一摘要。同时我们可以基于Merkle Tree,通过提供某一数据的Merkle分支路径来实现对该数据的存在性验证,该证明即为Merkle证明。From the construction process of Merkle Tree, we can find that the data recorded by any leaf node is modified, and the hash value of the leaf node will change accordingly, which will eventually affect the hash value of the root node. Therefore, the hash value of the root node can be used as the unique summary of a set of data. At the same time, based on the Merkle Tree, we can verify the existence of the data by providing the Merkle branch path of a certain data. This proof is the Merkle proof.
如图1中,验证方若想验证D2是否存在于Merkle Tree中,则区块链节点可以提供D1-H10-H14的Merkle分支路径,验证方根据该分支路径,算出D1和D2的哈希值,然后将H1和H2求哈希值,再与H10求哈希值,最后与H14求哈希值,得到的哈希值如果与根节点记录的哈希值一致,则表示D2存在于Merkle Tree中。As shown in Figure 1, if the verifier wants to verify whether D2 exists in the Merkle Tree, the blockchain node can provide the Merkle branch path of D1-H10-H14, and the verifier can calculate the hash values of D1 and D2 according to the branch path , then calculate the hash value of H1 and H2, then calculate the hash value with H10, and finally calculate the hash value with H14, if the obtained hash value is consistent with the hash value recorded by the root node, it means that D2 exists in the Merkle Tree middle.
2、Trie Tree(前缀树)2. Trie Tree (prefix tree)
Trie Tree是一种搜索树,又称Digital Tree(字典树)。与二叉树不同,Trie Tree的键值并不是由树中的节点存储,而是取决于其在树中的位置(即从根节点到达特定节点的路径)。一个节点的所有子孙都有相同的前缀,为这个节点对应的字符串(根节点对应空字符串)。只有叶子节点才有对应的存储数值。Trie Tree is a search tree, also known as Digital Tree (dictionary tree). Unlike a binary tree, the key value of a Trie Tree is not stored by a node in the tree, but depends on its position in the tree (that is, the path from the root node to a specific node). All descendants of a node have the same prefix, which is the string corresponding to this node (the root node corresponds to an empty string). Only leaf nodes have corresponding storage values.
3、Patricia Tree(压缩前缀树)3. Patricia Tree (compressed prefix tree)
Patricia Tree是一种更节省空间的前缀树,一个节点如果没有兄弟节点,则与其父节点合并。Patricia Tree is a more space-saving prefix tree. If a node has no sibling nodes, it is merged with its parent node.
4、以太坊的状态树和存储树4. The state tree and storage tree of Ethereum
如图2所示,以太坊包括状态树和存储树,状态树可以是状态MPT(可以认为MPT=Merkle Tree+Patricia Tree)或状态Merkle Tree,存储树可以是存储MPT或存储MerkleTree。As shown in Figure 2, Ethereum includes a state tree and a storage tree. The state tree can be a state MPT (which can be considered as MPT=Merkle Tree+Patricia Tree) or a state Merkle Tree, and the storage tree can be a storage MPT or a storage MerkleTree.
状态树由以太坊的账户构成,状态树的根节点的哈希记录在每个区块头的状态树根(state root)字段中。存储树是保存与账户相关联数据的结构,该项只有合约账户才有,所有智能合约的数据都以32字节映射的形式保存在存储树中。存储树的根节点的哈希值记录在账户的storage root字段中。The state tree is composed of Ethereum accounts, and the hash of the root node of the state tree is recorded in the state root field of each block header. The storage tree is a structure for storing data associated with an account. This item is only available for contract accounts. All smart contract data is stored in the storage tree in the form of a 32-byte map. The hash value of the root node of the storage tree is recorded in the storage root field of the account.
状态MPT或存储MPT的叶子节点记录key-value数据项的value,其key编码由MPT的从根节点到达叶子节点的路径构成。The state MPT or the leaf node of the storage MPT records the value of the key-value data item, and its key code is composed of the path from the root node to the leaf node of the MPT.
以太坊的状态树和存储树中,仍然可以基于Merkle证明对账户数据(包括账户状态和合约状态)进行存在性验证,以图2为例,若要验证合约状态之一的27在区块60中的存在性,则需要在存储树中确定用于验证27的分支路径,并根据该分支路径验证27是否构成Account 175的存储树,同时也需要在状态树中确定用于验证Account 175的分支路径,并根据该分支路径验证Account 175是否构成区块59的状态树,即需要进行两次Merkle证明。In the state tree and storage tree of Ethereum, the existence of account data (including account status and contract status) can still be verified based on Merkle proofs. Taking Figure 2 as an example, to verify that one of the contract statuses is 27 in block 60 , then it is necessary to determine the branch path used to verify 27 in the storage tree, and verify whether 27 constitutes the storage tree of Account 175 according to the branch path, and also need to determine the branch used to verify Account 175 in the state tree path, and verify whether Account 175 constitutes the state tree of block 59 according to the branch path, that is, two Merkle proofs are required.
但随着区块链数据的不断增长,需在链上分配更多的额外空间来存储树的构建关系。另外,链上数据的增加也使得提供分支路径以及外部进行Merkle证明的耗时也会越来越大。However, with the continuous growth of blockchain data, more additional space needs to be allocated on the chain to store tree construction relationships. In addition, the increase in data on the chain also makes it more and more time-consuming to provide branch paths and external Merkle proofs.
为解决上述问题,本发明实施例提供一种新的状态树和存储树的构建关系,其中,状态树和存储树中仅用于存储当前区块交易执行过程中所修改的账户数据,如新增的账户数据或被修改的账户数据。本发明实施例提供一种状态树和存储树可以如图3所示,对比于图2解释如下:In order to solve the above problems, the embodiment of the present invention provides a new construction relationship between the state tree and the storage tree, wherein the state tree and the storage tree are only used to store the account data modified during the execution of the current block transaction, such as the new Added account data or modified account data. The embodiment of the present invention provides a state tree and a storage tree as shown in FIG. 3, which are explained as follows compared with FIG. 2:
如图2的状态树和存储树中,区块60执行过程中修改了Account 175的合约状态,27变为45,则基于原有Account 175的合约状态26和该修改后的合约状态45确定父节点中的哈希值,并将构建出的存储树的根节点哈希值存储至区块60的Account 175的storageroot字段中;基于原有Account 174的账户状态和该修改后的Account 175的账户状态确定父节点中的哈希值,并将构建出的状态树的根节点哈希值存储至区块60的state root字段中。In the state tree and storage tree shown in Figure 2, the contract state of Account 175 is modified during the execution of block 60, and 27 becomes 45. Then, the parent is determined based on the original contract state 26 of Account 175 and the modified contract state 45. The hash value in the node, and store the root node hash value of the constructed storage tree in the storageroot field of Account 175 in block 60; based on the account status of the original Account 174 and the account of the modified Account 175 The state determines the hash value in the parent node, and stores the hash value of the root node of the constructed state tree in the state root field of the block 60 .
如图3的状态树和存储树中,区块60执行过程中修改了Account 175的合约状态,27变为45,则仅基于当前Account 175的修改后的合约状态45确定父节点中的哈希值,并将构建出的存储树的根节点哈希值存储至区块60的Account 175的storage root字段中;基于该修改后的Account 175的账户状态确定父节点中的哈希值,并将构建出的状态树的根节点哈希值存储至区块60的state root字段中。As shown in the state tree and storage tree of Figure 3, the contract state of Account 175 is modified during the execution of block 60, and 27 becomes 45, then the hash in the parent node is only determined based on the modified contract state 45 of the current Account 175 value, and store the hash value of the root node of the constructed storage tree in the storage root field of Account 175 of block 60; determine the hash value in the parent node based on the account status of the modified Account 175, and store The hash value of the root node of the constructed state tree is stored in the state root field of block 60 .
由上可知,本发明实施例中的状态树和存储树仅基于当前区块交易执行过程中所修改的或新增的账户数据生成,而不会再基于原有区块对应的未发生变化的账户数据生成,该方式通过精简数据量,可以极大地减少状态树和存储树的层级。举例来说,现有技术采用10000个账户构建区块60对应的状态树,而本发明实施例中若区块60中所有交易执行后仅有1000个账户的账户数据发生变化,则本发明实施例只需要采用1000个账户构建区块60对应的状态树,且该1000个账户基于各自发生变化的合约数据构建各自的存储树,本发明实施例的数据量减少至原数据量的1/10,可以极大地减少状态树和存储树的层级。It can be seen from the above that the state tree and storage tree in the embodiment of the present invention are only generated based on the modified or newly added account data during the execution of the current block transaction, and will not be based on the unchanged account data corresponding to the original block. Account data generation, this method can greatly reduce the level of the state tree and storage tree by streamlining the amount of data. For example, the existing technology uses 10,000 accounts to construct the state tree corresponding to block 60, but in the embodiment of the present invention, if only the account data of 1,000 accounts change after all transactions in block 60 are executed, the present invention implements For example, only 1,000 accounts need to be used to build the state tree corresponding to block 60, and the 1,000 accounts build their own storage trees based on their changed contract data, the data volume of the embodiment of the present invention is reduced to 1/10 of the original data volume , can greatly reduce the level of state tree and storage tree.
此外,以太坊的状态树和存储树中,采用两次Merkle证明,先证明合约状态在存储树中,再证明账户状态在状态树中,本发明实施例可以将状态树和存储树合并为一棵树,将状态树的叶子节点中的值下移至与存储树的叶子节点中的值平级,从而扁平化账户数据的层级结构。本发明实施例提供一种新的状态树可以如图4所示。区块对应一个状态树,该状态树的叶子节点包括账户状态和合约状态,通过该方式仅需要一次Merkle证明即可以实现对账户数据的存在性验证,比如需要验证合约状态27在区块60中的存在性,则需要在该状态树中获取用于验证该27的分支路径,并根据该分支路径验证27是否构成区块60的状态树即可,相比于现有技术,状态树的层级变小,且加快了分支路径的构建及验证效率。In addition, in the state tree and storage tree of Ethereum, two Merkle proofs are used, first to prove that the contract state is in the storage tree, and then to prove that the account state is in the state tree. The embodiment of the present invention can combine the state tree and the storage tree into one A tree, the value in the leaf node of the state tree is moved down to the same level as the value in the leaf node of the storage tree, thereby flattening the hierarchical structure of the account data. The embodiment of the present invention provides a new state tree as shown in FIG. 4 . The block corresponds to a state tree. The leaf nodes of the state tree include the account state and the contract state. In this way, only one Merkle proof is needed to verify the existence of the account data. For example, it is necessary to verify that the contract state 27 is in block 60 existence, it is necessary to obtain the branch path used to verify the 27 in the state tree, and verify whether 27 constitutes the state tree of the block 60 according to the branch path. Compared with the prior art, the level of the state tree becomes smaller, and speeds up the construction and verification efficiency of branch paths.
本发明实施例中,可以将落盘存储所用的key定义为“账号标识+账户数据标识+写入/修改该key-value所在块高”,value值即为账户数据标识对应的账户数据,此外,上述key中,账号标识可以理解成账号地址;账户数据标识可以理解成需持久化存储数据的序号,或者需持久化存储数据的标识,比如账户数据是账户状态中的账户余额,则账户数据标识可以是“balance”,比如账户数据是合约状态中的值,则账户数据标识可以是设定的序号,如图4中合约状态27的标识是2。本发明实施例中的叶子节点存储的是账户数据的哈希值。In the embodiment of the present invention, the key used for disk storage can be defined as "account identifier + account data identifier + write/modify the block height where the key-value is located", and the value value is the account data corresponding to the account data identifier. In addition , in the above key, the account ID can be understood as the account address; the account data ID can be understood as the serial number of the data that needs to be stored persistently, or the ID of the data that needs to be stored persistently. For example, the account data is the account balance in the account status, and the account data The identifier can be "balance". For example, if the account data is a value in the contract state, then the account data identifier can be a set serial number. For example, the identifier of the contract state 27 in Figure 4 is 2. The leaf node in the embodiment of the present invention stores the hash value of the account data.
基于key-value构建状态树,可以是构建状态MPT,key值指示MPT中从根节点到达叶子节点的路径,如图4中,key(0x234_balance_60)=100。Constructing a state tree based on key-value may be constructing a state MPT. The key value indicates the path from the root node to the leaf node in the MPT. As shown in FIG. 4 , key(0x234_balance_60)=100.
考虑到本发明实施例所构建的状态树仅是基于变化账户的变化账户数据构建的,该构建方式存在一个问题,即不能证明一个不存在的数据的正确性,相当于无法证明一个没有构成某一区块的状态树的账户数据是否在该区块的状态树中存在。举例来说,当前区块链的块高为100,存在某个账户的账户数据只在块高20时变化过,则仅能基于块高20的区块的状态树验证该账户的账户数据的正确性,而不能基于块高20以后的任一个的区块的状态树验证该账户的账户数据的正确性。Considering that the state tree constructed by the embodiment of the present invention is only constructed based on the change account data of the change account, there is a problem in this construction method, that is, it cannot prove the correctness of a non-existent data, which is equivalent to being unable to prove that a data that does not constitute a certain Whether the account data of the state tree of a block exists in the state tree of the block. For example, if the block height of the current blockchain is 100, and the account data of an account has only changed at block height 20, the account data of the account can only be verified based on the state tree of the block height 20. The correctness of the account data of the account cannot be verified based on the state tree of any block after block height 20.
为了解决上述问题,本发明实施例在存储上述key-value键值对的基础上,还会增加另外一组key-value键值对,其中,该key中包括账户标识和账户数据标识,此时的账户数据标识对应块高记录,value值即为块高记录,该块高记录用于记录账户标识对应账户中的账户数据发生历次变化时所在的区块的块高。In order to solve the above problems, the embodiment of the present invention will add another set of key-value key-value pairs on the basis of storing the above-mentioned key-value key-value pairs, wherein the key includes the account identifier and the account data identifier, at this time The account data identifier corresponds to the block height record, and the value value is the block height record. The block height record is used to record the block height of the block where the account data in the account corresponding to the account identifier has been changed.
举例来说,如图4中,区块链的当前区块高度为60,0x234_1为持久化存储的key,1为块高记录的标识,12-45-50为记录的块高记录,可以理解为账户0x234在区块高度12写入,在区块高度45和50进行修改。当前区块链上存储如表1所示的四个key-value键值对,其中,第一个key-value键值对即指示该账户0x234的块高记录,第二个至第四个key-value键值对即指示该账户0x234在对应块高上写入或修改时的balance值。For example, as shown in Figure 4, the current block height of the blockchain is 60, 0x234_1 is the key for persistent storage, 1 is the identifier of the block height record, and 12-45-50 is the recorded block height record, which is understandable Write at block height 12 for account 0x234, and modify at block height 45 and 50. Four key-value key-value pairs are stored on the current blockchain as shown in Table 1. Among them, the first key-value key-value pair indicates the block height record of the account 0x234, and the second to fourth key The -value key-value pair indicates the balance value when the account 0x234 is written or modified at the corresponding block height.
表1Table 1
通过存储该key-value键值对,可以快速确定出账户所对应的账户数据发生历次变化时所在的区块的块高,进一步确定应该基于哪一个区块的状态树验证待验证数据的正确性,具体实现方式可在下面具体描述。By storing the key-value key-value pair, the block height of the block where the account data corresponding to the account has been changed can be quickly determined, and further determine which block's state tree should be used to verify the correctness of the data to be verified , the specific implementation manner can be described in detail below.
基于上述描述,图5示例性的示出了本发明实施例提供的一种区块的状态树的生成方法的流程,该流程可以由区块的状态树的生成的装置执行,该装置可以位于区块链节点中,可以是该区块链节点。Based on the above description, FIG. 5 exemplarily shows the flow of a method for generating a state tree of a block provided by an embodiment of the present invention. The flow can be executed by a device for generating a state tree of a block, and the device can be located at Among the blockchain nodes, it may be the blockchain node.
步骤501,区块链节点针对区块链中的任一区块,确定区块的第一账户和第一账户数据。In step 501, the blockchain node determines the first account and the first account data of any block in the blockchain.
其中,第一账户是区块中各交易执行后账户数据发生变化的账户,第一账户数据是各交易执行后第一账户中发生变化后的账户数据。Wherein, the first account is an account whose account data changes after each transaction is executed in the block, and the first account data is the account data after each transaction is changed in the first account after each transaction is executed.
具体实现中,区块链节点基于当前区块中的各交易,确定各交易所涉及的账户,且判断各交易所涉及的账户中的账户数据是否发生变化,账户数据发生变化的账户即为第一账户,发生变化的账户数据即为第一账户数据,一个第一账户中可能存在一个第一账户数据,也可能存在多个第一账户数据。In the specific implementation, the blockchain node determines the accounts involved in each transaction based on the transactions in the current block, and judges whether the account data in the accounts involved in each transaction has changed, and the account whose account data has changed is the first For an account, the changed account data is the first account data, and there may be one first account data or multiple first account data in a first account.
可选的,第一账户中可能存在的第一账户数据可以包括各交易执行后第一账户中发生变化的块高记录、账户状态和/或合约状态。如表1中的例子,在区块50的第一账户0x234中可以包括的第一账户数据有块高记录12-45-50和balance的值200。Optionally, the first account data that may exist in the first account may include block height records, account statuses and/or contract statuses that have changed in the first account after execution of each transaction. As an example in Table 1, the first account data that may be included in the first account 0x234 of block 50 has a block height record of 12-45-50 and a value of 200 for balance.
又例如,当前区块中各交易共涉及账户100个,账户数据发生变化的账户为98个,则此时该当前区块对应的第一账户即为98个,该98个账户中的每一个账户都对应至少一个发生变化的账户数据。此处,可以是当前区块中的一笔交易或者多笔交易导致某个账户的状态数据在当前区块执行完毕后状态数据不发生变化。For another example, each transaction in the current block involves a total of 100 accounts, and there are 98 accounts whose account data has changed. At this time, there are 98 first accounts corresponding to the current block, and each of the 98 accounts All accounts correspond to at least one changed account data. Here, one transaction or multiple transactions in the current block may cause the state data of an account to remain unchanged after the execution of the current block is completed.
步骤502,区块链节点构建由各第一账户和各第一账户的第一账户数据构成的区块的状态树,并将状态树的根哈希存储在区块的区块头中。In step 502, the block chain node constructs a state tree of a block composed of each first account and the first account data of each first account, and stores the root hash of the state tree in the block header of the block.
其中,状态树以键值对的方式存储。Among them, the state tree is stored in the form of key-value pairs.
在构建过程中,可以针对任一第一账户的任一第一账户数据,将第一账户的标识、第一账户数据的标识和区块的块高作为key值,第一账户数据作为叶子节点的value值,基于MPT模式构建区块的状态树。During the construction process, for any first account data of any first account, the identifier of the first account, the identifier of the first account data and the block height of the block can be used as the key value, and the first account data can be used as the leaf node The value value of the block is based on the MPT mode to build the state tree of the block.
本发明实施例中,直接将key值进行持久化存储,而不是将key值的哈希进行持久化存储,通过该方式,可以保障同一账户下的账户数据具有相同的压缩前缀,也就是账号标识或账户地址,如图4所示,0x234的所有账户数据的key都有相同的前缀,即0x234,所以至少可以将0x234的所有账户数据的key以共同前缀0x234进行压缩。而现有技术中,对0x234的所有账户数据的key进行哈希计算后,所存在的共同前缀变少,形成状态树的层级较深。所以,本发明实施例可以有效利用Patricia Tree的优势,将状态树的层级压缩至最小,减少存储空间的同时也加快了分支路径的构建及验证效率。In the embodiment of the present invention, the key value is directly stored persistently instead of the hash of the key value. In this way, the account data under the same account can be guaranteed to have the same compressed prefix, that is, the account ID Or account address, as shown in Figure 4, all account data keys of 0x234 have the same prefix, that is, 0x234, so at least all account data keys of 0x234 can be compressed with the common prefix 0x234. However, in the prior art, after the hash calculation is performed on all account data keys of 0x234, there are fewer common prefixes, and the state tree is formed with a deeper level. Therefore, the embodiment of the present invention can effectively utilize the advantages of the Patricia Tree, compress the level of the state tree to the minimum, reduce the storage space, and speed up the construction and verification efficiency of the branch path.
基于上述区块链节点中状态树的构建方案,本发明实施例还提供一种链上数据验证的方法,该方法适用于如图6所示的系统架构,该系统架构可以包括客户端和区块链节点。其中,客户端又可以理解成数据使用方,区块链节点又可以理解成数据提供方;区块链节点是客户端可以访问的区块链系统中的任一个区块链节点。Based on the above construction scheme of the state tree in the blockchain node, the embodiment of the present invention also provides a method for data verification on the chain, which is applicable to the system architecture shown in Figure 6, and the system architecture can include the client and the district Blockchain nodes. Among them, the client can be understood as the data user, and the blockchain node can be understood as the data provider; the blockchain node is any blockchain node in the blockchain system that the client can access.
如图7为本发明实施例示出的链上数据验证的方法的流程,该流程具体包括:Figure 7 is the flow of the method for on-chain data verification shown in the embodiment of the present invention, the flow specifically includes:
步骤701,客户端向区块链节点发送数据获取请求。Step 701, the client sends a data acquisition request to the blockchain node.
数据获取请求包括第二账户的标识、第二账户数据的标识和第一块高,该数据获取请求用于指示获取第二账户的第二账户数据在第一块高上的值。The data acquisition request includes the identifier of the second account, the identifier of the second account data, and the first block, and the data acquisition request is used to instruct to acquire the value of the second account data of the second account on the first block.
步骤702,区块链节点根据第二账户的标识和第二账户的第一块高记录的标识,确定第一块高记录。Step 702, the block chain node determines the first high record according to the identification of the second account and the identification of the first high record of the second account.
区块链节点接收客户端发送的数据获取请求后,会根据第二账户的标识和第二账户的第一块高记录的标识,确定第一块高记录,如表1中,第二账户的标识为0x234,第二账户的第一块高记录的标识为1,则组成的key为0x234_1,根据持久化存储的key-value键值对,确定key为0x234_1对应的value为12-45-50。After the blockchain node receives the data acquisition request sent by the client, it will determine the first high record according to the identification of the second account and the identification of the first high record of the second account, as shown in Table 1, the second account's The ID is 0x234, and the ID of the first high record of the second account is 1, then the composed key is 0x234_1. According to the key-value key-value pair stored in the persistent storage, the value corresponding to the key 0x234_1 is determined to be 12-45-50 .
步骤703,区块链节点根据第二账户的标识、第二账户数据的标识、第一块高,确定第二账户数据。Step 703, the blockchain node determines the second account data according to the identifier of the second account, the identifier of the second account data, and the first block height.
区块链节点根据第二账户的标识、第二账户数据的标识、第一块高,确定第二账户数据,如表1中,若第一块高为48,则确定第二账户的标识为0x234,第二账户数据的标识为balance,则组成的key为0x234_balance_45,根据持久化存储的key-value键值对,确定key为0x234_balance_45对应的value为300。The blockchain node determines the second account data according to the identity of the second account, the identity of the second account data, and the height of the first block. As shown in Table 1, if the height of the first block is 48, it is determined that the identity of the second account is 0x234, the identifier of the second account data is balance, and the composed key is 0x234_balance_45. According to the key-value key-value pair in the persistent storage, the value corresponding to the key 0x234_balance_45 is determined to be 300.
步骤704,区块链节点从第一区块的状态树中获取用于验证第一块高记录的第一分支路径。Step 704, the block chain node obtains the first branch path for verifying the first high record from the state tree of the first block.
步骤705,区块链节点从第二区块的状态树中获取用于验证第二账户数据的第二分支路径。Step 705, the block chain node obtains the second branch path for verifying the second account data from the state tree of the second block.
由于发明实施例中构建某个区块的状态树只能用于验证该区块的状态树对应的账户数据的存在性,所以,要验证第二账户数据的存在性,需要先确定第二账户数据所在状态树对应的第二区块,进而根据第二区块的状态树,确定用于验证第二账户数据的第二分支路径。Since the construction of a state tree of a certain block in the embodiment of the invention can only be used to verify the existence of the account data corresponding to the state tree of the block, so to verify the existence of the second account data, it is necessary to first determine the existence of the second account data. The second block corresponding to the state tree where the data is located, and then according to the state tree of the second block, determine the second branch path for verifying the second account data.
在确定第二账户数据所在状态树对应的第二区块时,需要先确定该第二账户的账户数据历次被修改时所记录的块高记录,也即需要确定出第一块高记录,在确定出第一块高记录后,可以将第一块高记录中低于第一块高的所有块高中的最高的块高所对应的区块作为第二区块,该第二区块即用于记录第二账户在第一块高之前的最近一次被修改后的账户数据,进而根据第二区块的状态树,确定用于验证第二账户数据的第二分支路径。When determining the second block corresponding to the state tree where the second account data is located, it is necessary to first determine the block height record recorded when the account data of the second account has been modified, that is, it is necessary to determine the first block height record. After determining the first block height record, the block corresponding to the highest block height of all block heights lower than the first block height in the first block height record can be used as the second block, and the second block can be used After recording the latest modified account data of the second account before the first block, and then according to the state tree of the second block, determine the second branch path for verifying the second account data.
此外,为了保障第一块高记录的正确性,同样需要确定第一块高记录所在的状态树对应的第一区块,进而根据第一区块的状态树,确定用于验证第一块高记录的第一分支路径。具体的,该第一区块可以是第一块高记录中最高块高对应的区块。In addition, in order to ensure the correctness of the first high record, it is also necessary to determine the first block corresponding to the state tree where the first high record is located, and then according to the state tree of the first block, determine the The first branch path recorded. Specifically, the first block may be a block corresponding to the highest block height in the first block height record.
如表1中,若第一块高为48,则第一分支路径是由块高50的第一区块对应的状态树确定的,第二分支路径是由块高45的第二区块对应的状态树确定的。As shown in Table 1, if the first block height is 48, the first branch path is determined by the state tree corresponding to the first block with a block height of 50, and the second branch path is corresponding to the second block with a block height of 45 The state tree is determined.
步骤706,区块链节点将第一块高记录、第一分支路径、第二账户数据、第二分支路径发送至客户端。Step 706, the blockchain node sends the first high record, the first branch path, the second account data, and the second branch path to the client.
步骤707,客户端根据第一分支路径、本地存储的第一区块的区块头中状态树的根哈希验证第一块高记录是否正确;Step 707, the client verifies whether the first block high record is correct according to the first branch path and the root hash of the state tree in the block header of the first block stored locally;
客户端本地存储有区块链上各区块的区块头,用于在接收到区块链节点发送的第一块高记录、第一分支路径、第二账户数据、第二分支路径后,分别根据对应的区块头中的信息,对第一块高记录和第二账户数据进行验证。The client locally stores the block headers of each block on the block chain, which is used to calculate the block header according to the The information in the corresponding block header is used to verify the first high record and the second account data.
一种实现方式下,可以是客户端定时去区块链节点获取最新区块的区块头,另一实现方式下,可以是客户端在需要对接收到的数据进行验证时,再去区块链节点上获取。前者具体可以如图8所示,由客户端和区块链节点交互完成。In one way of implementation, the client can regularly go to the blockchain node to obtain the block header of the latest block. In another way, the client can go to the blockchain node when it needs to verify the received data. obtained on the node. The former can be specifically shown in Figure 8, which is completed by the interaction between the client and the blockchain node.
步骤801,客户端向区块链节点发送查询请求;Step 801, the client sends a query request to the blockchain node;
步骤802,区块链节点向客户端发送区块链的当前块高;Step 802, the blockchain node sends the current block height of the blockchain to the client;
步骤803,客户端确定本地存储的区块头的最高块高小于当前块高;Step 803, the client determines that the highest block height of the locally stored block header is smaller than the current block height;
步骤804,客户端向区块链节点发送区块头获取请求;Step 804, the client sends a block header acquisition request to the blockchain node;
步骤805,区块链节点确定客户端待获取的区块头;Step 805, the blockchain node determines the block header to be acquired by the client;
步骤806,区块链节点向客户端发送待获取的区块头;Step 806, the blockchain node sends the block header to be acquired to the client;
步骤807,客户端接收区块链节点返回的区块头,将接收到的区块头存储在本地。Step 807, the client receives the block header returned by the blockchain node, and stores the received block header locally.
步骤801至步骤807中,客户端向区块链节点发送查询请求,区块链节点在接收到该查询请求后,会向客户端反馈当前区块链上的当前块高,客户端接收该包括当前块高的查询结果,用于根据查询结果判断是否需要向区块链节点同步区块头,具体的,客户端判断本地存储的区块头的最高块高是否小于区块链上的当前块高,若是,则确定向区块链节点同步区块头,并向区块链节点发送区块头获取请求,其中,该区块头获取请求中即包括待获取区块头的块高。From step 801 to step 807, the client sends a query request to the blockchain node, and the blockchain node will feed back the current block height on the current blockchain to the client after receiving the query request, and the client receives the query request, which includes The query result of the current block height is used to judge whether the block header needs to be synchronized to the blockchain node according to the query result. Specifically, the client judges whether the highest block height of the locally stored block header is smaller than the current block height on the blockchain. If so, determine to synchronize the block header with the blockchain node, and send a block header acquisition request to the blockchain node, wherein the block header acquisition request includes the block height of the block header to be acquired.
举个例子,区块链节点的区块链的当前块高为100,客户端本地存储的区块头的最高块高为98,则客户端确定需要向区块链节点获取第99个、第100个区块的区块头,客户端向区块链节点发送区块头获取请求,其中,该区块头获取请求中即包括待获取区块头的块高为99和100。For example, if the current block height of the block chain of the blockchain node is 100, and the highest block height of the block header stored locally by the client is 98, then the client determines that it needs to obtain the 99th and 100th blocks from the blockchain node. The client sends a block header acquisition request to the blockchain node, wherein the block header acquisition request includes the block heights of the block header to be acquired as 99 and 100.
上述实现方式中,客户端定时去区块链节点获取最新区块的区块头,可以保障在需要对账户数据进行验证时,本地存储有用于验证的区块的区块头信息。In the above implementation method, the client regularly goes to the blockchain node to obtain the block header of the latest block, which can ensure that when the account data needs to be verified, the block header information of the block used for verification is locally stored.
由上可知,客户端可以根据第一分支路径、本地存储的第一区块的区块头中状态树的根哈希,确定第一块高记录是否正确。此处,客户端本地存储的第一区块也即客户端从区块链节点上获取的第一块高记录中的最高块高对应的区块。It can be seen from the above that the client can determine whether the first block high record is correct according to the first branch path and the root hash of the state tree in the block header of the first block stored locally. Here, the first block stored locally by the client is also the block corresponding to the highest block height in the first block height record obtained by the client from the blockchain node.
具体验证过程中,客户端根据第一块高记录和第一分支路径中叶子节点和分支节点的数据,确定第一根哈希,若客户端确定第一根哈希等于本地存储的第一区块的区块头中状态树的根哈希,则确定第一块高记录正确。In the specific verification process, the client determines the first root hash according to the first high record and the data of the leaf nodes and branch nodes in the first branch path. If the client determines that the first root hash is equal to the first area stored locally The root hash of the state tree in the block header of the block determines that the first block high record is correct.
步骤708,客户端在确定第一块高记录正确之后,根据第二分支路径、本地存储的第二区块的区块头中状态树的根哈希,验证第二账户数据的是否正确。Step 708: After determining that the first high record is correct, the client verifies whether the second account data is correct according to the second branch path and the root hash of the state tree in the block header of the second block stored locally.
客户端先判断第一块高记录是否正确,若正确之后,则可以进一步根据第二分支路径、本地存储的第二区块的区块头中状态树的根哈希,验证第二账户数据的正确性,其中,客户端本地存储的第二区块的区块头是从区块链节点上获取的,第二区块是区块链上第二块高对应的区块,第二块高是第一块高记录中低于第一块高的所有块高中的最高的块高。The client first judges whether the first high record is correct. If it is correct, it can further verify the correctness of the second account data according to the second branch path and the root hash of the state tree in the block header of the second block stored locally. In particular, the block header of the second block stored locally by the client is obtained from the blockchain node, the second block is the block corresponding to the second block height on the blockchain, and the second block height is the The highest block height of all block heights lower than the first block height in the block height record.
具体验证过程中,客户端可以根据第二账户数据和第二分支路径中叶子节点和分支节点的数据,确定第二根哈希,若客户端确定第二根哈希等于本地存储的第二区块的区块头中状态树的根哈希,则确定第二账户数据正确。In the specific verification process, the client can determine the second root hash according to the second account data and the data of the leaf nodes and branch nodes in the second branch path. If the client determines that the second root hash is equal to the second area stored locally The root hash of the state tree in the block header of the block determines that the second account data is correct.
需要说明的是,本发明实施例中虽然提供的是客户端先获取第一块高记录和第二账户数据,并基于第一区块对第一块高记录进行验证以及基于第二区块对第二账户数据进行验证,但本发明实施例中还可以是客户端先获取第一块高记录,并基于第一区块对第一块高记录进行验证,在对第一块高记录进行验证通过后,进而获取第二账户数据,并基于第二区块对第二账户数据进行验证。It should be noted that although it is provided in the embodiment of the present invention that the client first obtains the first high record and the second account data, and verifies the first high record based on the first block and verifies the first high record based on the second block. The second account data is verified, but in the embodiment of the present invention, the client can also obtain the first high record first, and verify the first high record based on the first block, and then verify the first high record After passing, the second account data is further obtained, and the second account data is verified based on the second block.
需要说明的是,由于客户端基于本地存储的第一区块的区块头的状态树的根哈希对第一块高记录进行验证,以及基于本地存储的第二区块的区块头的状态树的根哈希对第二账户数据进行验证,所以客户端首先需要确定本地存储的区块头信息是正确的。It should be noted that since the client verifies the first block high record based on the root hash of the state tree of the block header of the first block stored locally, and the state tree of the block header of the second block stored locally The root hash of the second account is verified, so the client first needs to confirm that the locally stored block header information is correct.
为证明区块头中信息的正确性,具体实现中,在区块头中增加了链上节点对区块头的签名列表,客户端在获取到该区块头后,会根据区块头中的签名列表验证该区块头的正确性,具体的,客户端将接收到的区块头存储在本地之前,获取接收到的区块头中的N个签名信息,并根据本地共识节点列表,对N个签名信息验证,若N个签名信息通过验证,则确定接收到的区块头正确。此处,共识节点列表是客户端根据区块链的创世块中的区块头至接收到的区块头的前一个区块头确定的共识节点组成的列表,如客户端获取到的当前的区块头是第100个区块的区块头,则客户端需要根据第0个区块(创世块)至第99个区块的区块头确定的共识节点列表,对当前的区块头的签名信息进行验证。In order to prove the correctness of the information in the block header, in the specific implementation, the signature list of the nodes on the chain to the block header is added in the block header. After the client obtains the block header, it will verify the block header according to the signature list in the block header. The correctness of the block header, specifically, before the client stores the received block header locally, obtain the N signature information in the received block header, and verify the N signature information according to the local consensus node list, if If the N signature information is verified, it is determined that the received block header is correct. Here, the list of consensus nodes is a list of consensus nodes determined by the client based on the block header in the genesis block of the blockchain to the previous block header of the received block header, such as the current block header obtained by the client is the block header of the 100th block, the client needs to verify the signature information of the current block header according to the list of consensus nodes determined by the block headers of the 0th block (genesis block) to the 99th block .
解释为,共识节点列表中的共识节点是在区块链的创世块中确定的,在后续区块交易中可能发生改变,比如,创世块中确定共识节点列表中的共识节点有A、B、C、D;在第0个区块至第49个区块时,区块头中共识节点列表中的共识节点未发生变化;在第50个区块时,区块中的交易执行后共识节点列表中增加共识节点E,则此时,共识节点列表中的共识节点有A、B、C、D、E;在第50个区块至第99个区块时共识节点列表中的共识节点未发生变化;所以,客户端在验证第100个区块头中N个签名信息时,可以是根据第0个区块至第99个区块的区块头确定的共识节点列表对该N个签名信息进行验证。It is explained that the consensus nodes in the consensus node list are determined in the genesis block of the blockchain, and may change in subsequent block transactions. For example, the consensus nodes in the consensus node list determined in the genesis block include A, B, C, D; From the 0th block to the 49th block, the consensus node in the consensus node list in the block header has not changed; at the 50th block, the transaction in the block is executed after the consensus Add consensus node E to the node list, then at this time, the consensus nodes in the consensus node list include A, B, C, D, E; the consensus nodes in the consensus node list from the 50th block to the 99th block No change; therefore, when the client verifies the N signature information in the 100th block header, it can be based on the consensus node list determined by the block headers from the 0th block to the 99th block. authenticating.
上述实施例中,虽然说共识节点列表是根据第0个区块至第99个区块的区块头确定的,但是在对第100个区块的区块头中签名信息进行验证时,直接采用第99个区块的区块头中共识节点列表进行验证即可,因为第99个区块的区块头已经通过第98个区块的区块头中共识节点列表的验证,第98个区块的区块头已经通过第97个区块的区块头中共识节点列表的验证,以此类推,第2个区块的区块头已经通过第1个区块的区块头中共识节点列表的验证,第1个区块的区块头已经通过第0个区块的区块头中共识节点列表的验证。In the above embodiment, although the list of consensus nodes is determined according to the block headers of the 0th block to the 99th block, when verifying the signature information in the block header of the 100th block, the The list of consensus nodes in the block header of the 99th block can be verified, because the block header of the 99th block has passed the verification of the list of consensus nodes in the block header of the 98th block, and the block header of the 98th block has passed the verification of the consensus node list in the block header of the 97th block, and so on, the block header of the second block has passed the verification of the consensus node list in the block header of the first block, and the first block The block header of the block has been verified by the list of consensus nodes in the block header of the 0th block.
此外,在当前区块的交易执行后共识节点列表中共识节点发生变化,则相当于某个合约数据发生变化,则需要采用当前区块的区块头的状态树根哈希验证该合约数据的正确性,以及采用当前区块的前一个区块的区块头的共识节点列表验证该当前区块头中的签名信息,相当于采用当前区块的前一个区块的区块头的共识节点列表验证该当前区块的区块头中状态树根哈希的正确性。仍以上述例子说明,第50个区块中的交易执行后共识节点列表中增加共识节点E,则第50个区块对应的状态树的合约数据发生变化,如增加某个合约数据(代表共识节点E),则需要采用第50个区块中状态树的根哈希对该增加的合约数据进行存在性验证,以及采用第49个区块的共识节点列表对该第50个区块的区块头信息进行验证,即对该第50个区块的区块头中状态树的根哈希进行验证。In addition, if the consensus node in the consensus node list changes after the transaction of the current block is executed, it means that a certain contract data changes, and the state tree root hash of the block header of the current block needs to be used to verify the correctness of the contract data. and use the consensus node list of the block header of the previous block to verify the signature information in the current block header, which is equivalent to using the consensus node list of the block header of the previous block to verify the current block. The correctness of the hash of the state tree root in the block header of the block. Still using the above example to illustrate, after the transaction in the 50th block is executed, the consensus node E is added to the consensus node list, and the contract data of the state tree corresponding to the 50th block changes, such as adding a certain contract data (representing the consensus Node E), it is necessary to use the root hash of the state tree in the 50th block to verify the existence of the added contract data, and use the consensus node list of the 49th block to verify the existence of the 50th block. The block header information is verified, that is, the root hash of the state tree in the block header of the 50th block is verified.
具体验证过程中,可以是客户端确定N个签名信息对应的N个共识节点,并判断N个共识节点中在共识节点列表中的M个共识节点,若M符合预设条件,则确定N个签名信息通过验证。M符合预设条件,指的是M的个数符合预设阈值,在不同共识算法情况下,预设阈值可以取不同值。一种实现方式中,采用PBFT(Practical Byzantine Fault Tolerance,实用拜占庭容错)共识算法,则预设阈值为f+1,当共识节点个数大于等于f+1时,即代表该区块的块头信息通过验证,其中,f=(N-1)/3。另一种实现方式中,采用POW(Proof of Work,工作证明)共识算法,则预设阈值为N/2+1,当共识节点个数大于等于N/2+1时,即代表该区块的块头信息通过验证,其中,N为共识列表中共识节点的个数。In the specific verification process, the client can determine the N consensus nodes corresponding to the N signature information, and determine the M consensus nodes in the consensus node list among the N consensus nodes. If M meets the preset conditions, then determine the N consensus nodes. The signature information is verified. M meets the preset condition, which means that the number of M meets the preset threshold. In the case of different consensus algorithms, the preset threshold can take different values. In one implementation, the PBFT (Practical Byzantine Fault Tolerance, Practical Byzantine Fault Tolerance) consensus algorithm is adopted, and the preset threshold is f+1. When the number of consensus nodes is greater than or equal to f+1, it represents the block header information of the block Pass the verification, where f=(N-1)/3. In another implementation, the POW (Proof of Work) consensus algorithm is adopted, and the preset threshold is N/2+1. When the number of consensus nodes is greater than or equal to N/2+1, it means that the block The block header information of is verified, where N is the number of consensus nodes in the consensus list.
此外,客户端还需要验证创世块信息的正确性,当客户端验证区块链上有特定个数的共识节点的创世块信息一致,即认可该创世块。此处的特定个数可以是上述预设阈值。In addition, the client also needs to verify the correctness of the genesis block information. When the client verifies that the genesis block information of a specific number of consensus nodes on the blockchain is consistent, the genesis block is approved. The specific number here may be the aforementioned preset threshold.
通过上述方式,客户端从创世块开始即对创世块的块头信息进行验证,且每增加一个区块的块头,都会结合当前共识节点列表中的共识节点对当前增加的区块的块头进行验证,以保障保存至本地的区块的块头信息是正确的,从而保障用于验证账户数据的区块头中状态树的根哈希的正确性,进而实现对账户数据的验证。Through the above method, the client will verify the block header information of the genesis block from the genesis block, and each time a block header is added, it will combine the consensus nodes in the current consensus node list to verify the block header information of the currently added block. Verification to ensure that the block header information of the block saved locally is correct, thereby ensuring the correctness of the root hash of the state tree in the block header used to verify the account data, thereby realizing the verification of the account data.
由上可知,客户端在对某个账户数据进行验证时,验证流为创世块→共识节点→区块头信息→状态树根哈希→账户数据,也就是,创世块对共识节点验证,共识节点对区块头信息验证,区块头信息对状态树根哈希验证,状态树根哈希对账户数据验证。而且,状态树在构建时,基于哈希计算的单向性,一旦对叶子节点(账户数据)修改,则都会改变状态树根哈希,也即,进一步保证账户数据的不被修改性。此外,上述相关验证点的信息都由链上节点提供,对于有准入概念的联盟链,链上节点在给客户端提供信息之前需进行鉴权,进一步保障数据验证的准确性。It can be seen from the above that when the client verifies an account data, the verification flow is genesis block→consensus node→block header information→state tree root hash→account data, that is, the genesis block verifies the consensus node, The consensus node verifies the block header information, the block header information verifies the state tree root hash, and the state tree root hash verifies the account data. Moreover, when the state tree is constructed, based on the unidirectionality of hash calculation, once the leaf node (account data) is modified, the root hash of the state tree will be changed, that is, to further ensure that the account data cannot be modified. In addition, the above-mentioned relevant verification point information is provided by the nodes on the chain. For the consortium chain with the concept of access, the nodes on the chain need to perform authentication before providing information to the client to further ensure the accuracy of data verification.
为了更好的解释本发明实施例,下面结合表1提供一个完整的链上数据验证的例子,具体如下:In order to better explain the embodiment of the present invention, a complete example of on-chain data verification is provided below in conjunction with Table 1, as follows:
客户端向区块链节点请求获取账户0x234在块高48的区块上的balance,区块链节点先根据0x234_1确定第一块高记录12-45-50,区块链节点根据块高50的第一区块的状态树确定用于验证第一块高记录12-45-50的第一分支路径;区块链节点根据第一块高记录12-45-50和块高48,确定第一块高记录中小于块高48且最大的块高为45,区块链节点先根据0x234_balance_45确定balance为300,并根据块高45的第二区块的状态树确定用于验证balance 300的第二分支路径。区块链节点将第一块高记录12-45-50、第一分支路径和balance 300、第二分支路径一起发送至客户端,客户端根据本地存储的块高50的第一区块的区块头,结合第一分支路径验证第一块高记录12-45-50的正确性,基于已经证明的第一块高记录12-45-50,确定balance在45区块处被修改,则使用本地存储的块高45的第二区块的区块头,结合第二分支路径验证,验证balance 300的正确性。结合上述过程,客户端即完成了查询并验证账户0x234在块高48的区块上的balance为300的过程。The client requests the block chain node to obtain the balance of the account 0x234 on the block with a block height of 48. The block chain node first determines the first block high record 12-45-50 according to 0x234_1, and the block chain node determines The state tree of the first block determines the first branch path used to verify the first block height record 12-45-50; the blockchain node determines the first branch path based on the first block height record 12-45-50 and block height 48 In the block height record, the block height is smaller than block height 48 and the maximum block height is 45. The blockchain node first determines that the balance is 300 according to 0x234_balance_45, and determines the second block used to verify the balance 300 according to the state tree of the second block with block height 45. branch path. The blockchain node sends the first block height record 12-45-50, the first branch path, balance 300, and the second branch path to the client, and the client bases the area of the first block with a block height of 50 stored locally Block header, combined with the first branch path to verify the correctness of the first block high record 12-45-50, based on the proven first block high record 12-45-50, determine that the balance is modified at block 45, then use the local The stored block header of the second block with a block height of 45, combined with the verification of the second branch path, verifies the correctness of balance 300. Combining the above process, the client has completed the process of querying and verifying that the account 0x234 has a balance of 300 on the block with a block height of 48.
需要说明的是,图6中的客户端还可以是与区块链节点不同联盟链的区块链节点,如图9中,可以包括第一区块链节点和第二区块链节点;其中,第一区块链节点又可以理解成数据使用方,第二区块链节点又可以理解成数据提供方;第一区块链节点和第二区块链节点属于不同的联盟链。It should be noted that the client in Figure 6 can also be a blockchain node of a different alliance chain from the blockchain node, as shown in Figure 9, it can include the first blockchain node and the second blockchain node; where , the first blockchain node can be understood as a data user, and the second blockchain node can be understood as a data provider; the first blockchain node and the second blockchain node belong to different alliance chains.
基于同一发明构思,图10示例性的示出了本发明实施例提供的一种区块的状态树的生成装置的结构,该装置可以执行区块的状态树的生成方法的流程。Based on the same inventive concept, FIG. 10 exemplarily shows the structure of an apparatus for generating a state tree of a block provided by an embodiment of the present invention, and the apparatus can execute the flow of a method for generating a state tree of a block.
该装置包括:The unit includes:
确定单元1001,用于针对区块链中的任一区块,确定所述区块的第一账户和第一账户数据;所述第一账户是所述区块中各交易执行后账户数据发生变化的账户,所述第一账户数据是所述各交易执行后所述第一账户中发生变化后的账户数据;The determining unit 1001 is configured to, for any block in the block chain, determine the first account and the first account data of the block; the first account is the account data that occurs after each transaction in the block is executed. A changed account, the first account data is the changed account data in the first account after the execution of each transaction;
构建单元1002,用于构建由各第一账户和所述各第一账户的第一账户数据构成的所述区块的状态树,并将所述状态树的根哈希存储在所述区块的区块头中,其中,所述状态树以键值对的方式存储。The construction unit 1002 is configured to construct the state tree of the block composed of each first account and the first account data of each first account, and store the root hash of the state tree in the block In the block header of , the state tree is stored in the form of key-value pairs.
可选的,所述构建单元1002具体用于:Optionally, the construction unit 1002 is specifically used for:
针对任一第一账户的任一第一账户数据,将所述第一账户的标识、所述第一账户数据的标识和所述区块的块高作为key值,所述第一账户数据作为叶子节点的value值,基于MPT模式构建所述区块的状态树。For any first account data of any first account, the identifier of the first account, the identifier of the first account data, and the block height of the block are used as key values, and the first account data is used as The value of the leaf node is used to construct the state tree of the block based on the MPT mode.
可选的,所述第一账户数据包括所述各交易执行后所述第一账户中发生变化的块高记录、账户状态和/或合约状态;所述块高记录用于记录所述第一账户中的账户状态和/或合约状态发生历次变化时所在的区块的块高。Optionally, the first account data includes block height records, account status and/or contract status that have changed in the first account after the execution of each transaction; the block height records are used to record the first The block height of the block where the account status and/or contract status in the account have changed.
可选的,所述装置还包括处理单元1003;Optionally, the device further includes a processing unit 1003;
所述处理单元1003用于:The processing unit 1003 is used for:
接收客户端的数据获取请求;所述数据获取请求中包括第二账户的标识、第二账户数据的标识和第一块高;Receive a data acquisition request from the client; the data acquisition request includes the identifier of the second account, the identifier of the second account data, and the first block height;
根据所述第二账户的标识和所述第二账户的第一块高记录的标识,确定所述第一块高记录;根据所述第二账户的标识、所述第二账户数据的标识、所述第一块高,确定所述第二账户数据;According to the identification of the second account and the identification of the first high record of the second account, determine the first high record; according to the identification of the second account, the identification of the second account data, The first block is high, determining the second account data;
从第一区块的状态树中获取用于验证所述第一块高记录的第一分支路径;所述第一区块是所述第一块高记录中的最高块高对应的区块;Obtaining a first branch path for verifying the first high record from the state tree of the first block; the first block is a block corresponding to the highest block height in the first high record;
从第二区块的状态树中获取用于验证所述第二账户数据的第二分支路径;所述第二区块是第二块高对应的区块;所述第二块高是所述第一块高记录中低于所述第一块高的所有块高中的最高的块高;Obtain the second branch path used to verify the second account data from the state tree of the second block; the second block is the block corresponding to the second block height; the second block height is the the highest block height of all block heights lower than the first block height in the first block height record;
将所述第一块高记录、所述第一分支路径、所述第二账户数据、所述第二分支路径发送至所述客户端,以使所述客户端对所述第一块高记录和第二账户数据进行验证。sending the first high record, the first branch path, the second account data, and the second branch path to the client, so that the client can check the first high record and the second account data for verification.
基于同一发明构思,图11示例性的示出了本发明实施例提供的一种链上数据验证的装置的结构,该装置可以执行链上数据验证的方法的流程。Based on the same inventive concept, FIG. 11 exemplarily shows the structure of an on-chain data verification device provided by an embodiment of the present invention, and the device can execute the flow of the on-chain data verification method.
该装置包括:The unit includes:
收发单元1101,用于向区块链节点发送数据获取请求;所述数据获取请求包括第二账户的标识、第二账户数据的标识和第一块高;The transceiver unit 1101 is configured to send a data acquisition request to the block chain node; the data acquisition request includes the identification of the second account, the identification of the second account data and the first block height;
所述收发单元1101,还用于接收所述区块链节点返回的第一块高记录、第一分支路径、第二账户数据、第二分支路径;所述第一块高记录和所述第二账户数据是所述区块链节点根据所述第二账户的标识、所述第二账户数据的标识和所述第一块高确定的;所述第一分支路径是所述区块链节点确定的用于验证所述第一块高记录的分支路径;所述第二分支路径是所述区块链节点确定的用于验证所述第二账户数据的分支路径;The transceiver unit 1101 is also configured to receive the first high record, the first branch path, the second account data, and the second branch path returned by the blockchain node; the first high record and the second The second account data is determined by the block chain node according to the identity of the second account, the identity of the second account data, and the first block height; the first branch path is the block chain node The determined branch path for verifying the first high record; the second branch path is the branch path determined by the block chain node for verifying the second account data;
验证单元1102,用于根据所述第一分支路径、本地存储的第一区块的区块头中状态树的根哈希验证所述第一块高记录是否正确;所述本地存储的第一区块的区块头是从所述区块链节点上获取的,所述第一区块是区块链上是所述第一块高记录中的最高块高对应的区块;The verification unit 1102 is configured to verify whether the first block high record is correct according to the first branch path and the root hash of the state tree in the block header of the locally stored first block; the locally stored first area The block header of the block is obtained from the blockchain node, and the first block is the block corresponding to the highest block height in the first block height record on the blockchain;
所述验证单元1102,还用于在确定所述第一块高记录正确之后,根据所述第二分支路径、所述本地存储的第二区块的区块头中状态树的根哈希,验证所述第二账户数据的是否正确;所述本地存储的第二区块的区块头是从所述区块链节点上获取的,所述第二区块是所述区块链上第二块高对应的区块;所述第二块高是所述第一块高记录中低于所述第一块高的所有块高中的最高的块高。The verification unit 1102 is further configured to, after determining that the first block high record is correct, verify according to the second branch path and the root hash of the status tree in the block header of the locally stored second block Whether the second account data is correct; the block header of the second block stored locally is obtained from the block chain node, and the second block is the second block on the block chain The block corresponding to the height; the second block height is the highest block height of all block heights lower than the first block height in the first block height record.
可选的,所述验证单元1102具体用于:Optionally, the verification unit 1102 is specifically configured to:
根据所述第一块高记录和所述第一分支路径中叶子节点和分支节点的数据,确定第一根哈希;Determine a first root hash according to the first block high record and the data of leaf nodes and branch nodes in the first branch path;
若所述第一根哈希等于所述本地存储的第一区块的区块头中状态树的根哈希,则确定所述第一块高记录正确。If the first root hash is equal to the root hash of the state tree in the block header of the locally stored first block, it is determined that the first block high record is correct.
可选的,所述验证单元1102具体用于:Optionally, the verification unit 1102 is specifically configured to:
根据所述第二账户数据和所述第二分支路径中叶子节点和分支节点的数据,确定第二根哈希;determining a second root hash according to the second account data and the data of leaf nodes and branch nodes in the second branch path;
若所述第二根哈希等于所述本地存储的第二区块的区块头中状态树的根哈希,则确定所述第二账户数据正确。If the second root hash is equal to the root hash of the state tree in the block header of the locally stored second block, it is determined that the second account data is correct.
可选的,所述装置还包括同步单元1103;Optionally, the device further includes a synchronization unit 1103;
所述同步单元1103用于:The synchronization unit 1103 is used for:
向所述区块链节点发送查询请求;Send a query request to the blockchain node;
接收所述区块链节点返回的查询结果;所述查询结果是所述区块链节点在接收到所述查询请求后返回的区块链的当前块高;receiving the query result returned by the block chain node; the query result is the current block height of the block chain returned by the block chain node after receiving the query request;
判断所述本地存储的区块头的最高块高是否小于所述当前块高,若是,则向所述区块链节点发送区块头获取请求;所述区块头获取请求中包括待获取区块头的块高;Judging whether the highest block height of the locally stored block header is less than the current block height, if so, sending a block header acquisition request to the blockchain node; the block header acquisition request includes the block to be acquired high;
接收所述区块链节点返回的区块头,将接收到的区块头存储在本地。Receive the block header returned by the blockchain node, and store the received block header locally.
可选的,所述同步单元1103在所述将接收到的区块头存储在本地之前,还用于:Optionally, before the synchronization unit 1103 stores the received block header locally, it is further configured to:
获取所述接收到的区块头中的N个签名信息;Obtain N pieces of signature information in the received block header;
根据共识节点列表,对所述N个签名信息验证;所述共识节点列表是根据所述区块链的创世块的区块头至所述接收到的区块头的前一个区块头确定的共识节点组成的列表;Verify the N signature information according to the consensus node list; the consensus node list is the consensus node determined according to the block header of the genesis block of the blockchain to the previous block header of the received block header list of components;
若所述N个签名信息通过验证,则确定所述接收到的区块头正确。If the N pieces of signature information pass the verification, it is determined that the received block header is correct.
可选的,所述同步单元1103具体用于:Optionally, the synchronization unit 1103 is specifically configured to:
确定所述N个签名信息对应的N个共识节点;Determine the N consensus nodes corresponding to the N signature information;
判断所述N个共识节点中在所述共识节点列表中的M个共识节点;judging M consensus nodes in the list of consensus nodes among the N consensus nodes;
若M符合预设条件,则确定所述N个签名信息通过验证。If M meets the preset condition, it is determined that the N pieces of signature information pass the verification.
基于同一发明构思,本发明实施例还提供了一种计算设备,包括:Based on the same inventive concept, an embodiment of the present invention also provides a computing device, including:
存储器,用于存储程序指令;memory for storing program instructions;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述区块的状态树的生成方法。The processor is configured to call the program instructions stored in the memory, and execute the method for generating the state tree of the above block according to the obtained program.
基于同一发明构思,本发明实施例还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述区块的状态树的生成方法。Based on the same inventive concept, an embodiment of the present invention also provides a computer-readable non-volatile storage medium, including computer-readable instructions, when the computer reads and executes the computer-readable instructions, the computer executes the above block The generation method of the state tree.
基于同一发明构思,本发明实施例还提供了一种计算设备,包括:Based on the same inventive concept, an embodiment of the present invention also provides a computing device, including:
存储器,用于存储程序指令;memory for storing program instructions;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行上述链上数据验证的方法。The processor is configured to call the program instructions stored in the memory, and execute the above-mentioned on-chain data verification method according to the obtained program.
基于同一发明构思,本发明实施例还提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行所述计算机可读指令时,使得计算机执行上述链上数据验证的方法。Based on the same inventive concept, an embodiment of the present invention also provides a computer-readable non-volatile storage medium, including computer-readable instructions. When a computer reads and executes the computer-readable instructions, the computer executes the above-mentioned on-chain The method of data validation.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。While preferred embodiments of the invention have been described, additional changes and modifications to these embodiments can be made by those skilled in the art once the basic inventive concept is appreciated. Therefore, it is intended that the appended claims be construed to cover the preferred embodiment as well as all changes and modifications which fall within the scope of the invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.
Claims (24)
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910960376.XA CN110602148B (en) | 2019-10-10 | 2019-10-10 | A method and device for generating a state tree of a block and verifying data on the chain |
CN202110689224.8A CN113329031B (en) | 2019-10-10 | 2019-10-10 | A method and device for generating a state tree of a block |
PCT/CN2020/116269 WO2021068728A1 (en) | 2019-10-10 | 2020-09-18 | Methods and apparatus for generating state tree of block and validating on-chain data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910960376.XA CN110602148B (en) | 2019-10-10 | 2019-10-10 | A method and device for generating a state tree of a block and verifying data on the chain |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110689224.8A Division CN113329031B (en) | 2019-10-10 | 2019-10-10 | A method and device for generating a state tree of a block |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110602148A true CN110602148A (en) | 2019-12-20 |
CN110602148B CN110602148B (en) | 2021-07-06 |
Family
ID=68866285
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110689224.8A Active CN113329031B (en) | 2019-10-10 | 2019-10-10 | A method and device for generating a state tree of a block |
CN201910960376.XA Active CN110602148B (en) | 2019-10-10 | 2019-10-10 | A method and device for generating a state tree of a block and verifying data on the chain |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110689224.8A Active CN113329031B (en) | 2019-10-10 | 2019-10-10 | A method and device for generating a state tree of a block |
Country Status (2)
Country | Link |
---|---|
CN (2) | CN113329031B (en) |
WO (1) | WO2021068728A1 (en) |
Cited By (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111177225A (en) * | 2020-01-02 | 2020-05-19 | 支付宝(杭州)信息技术有限公司 | Account state existence proving method and device and state inquiring method and device |
CN111209339A (en) * | 2020-01-03 | 2020-05-29 | 腾讯科技(深圳)有限公司 | Block synchronization method, device, computer and storage medium |
CN111444196A (en) * | 2020-06-12 | 2020-07-24 | 支付宝(杭州)信息技术有限公司 | Method, device and equipment for generating Hash of global state in block chain type account book |
CN111461751A (en) * | 2020-04-02 | 2020-07-28 | 武汉大学 | Block chain-based house property information chain organization method, historical state tracing method and device |
CN111488615A (en) * | 2020-04-08 | 2020-08-04 | 北京瑞策科技有限公司 | Cross-link realization method and device for service data block chain |
CN111488606A (en) * | 2020-04-08 | 2020-08-04 | 北京瑞策科技有限公司 | Data sharing method and device based on service data block chain |
CN111488359A (en) * | 2020-04-08 | 2020-08-04 | 北京瑞策科技有限公司 | Relation data storage method and device of business data block chain |
CN111488610A (en) * | 2020-04-08 | 2020-08-04 | 北京瑞策科技有限公司 | State data query method and device based on service data block chain |
CN111553670A (en) * | 2020-04-28 | 2020-08-18 | 腾讯科技(深圳)有限公司 | Transaction processing method and device and computer readable storage medium |
CN111640018A (en) * | 2020-05-06 | 2020-09-08 | 深圳前海微众银行股份有限公司 | Block chain transaction existence verification method and device |
CN112306991A (en) * | 2020-10-30 | 2021-02-02 | 深圳前海微众银行股份有限公司 | Method, device and equipment for processing data in tree structure and storage medium |
CN112364010A (en) * | 2021-01-12 | 2021-02-12 | 支付宝(杭州)信息技术有限公司 | Business record deleting method based on credible account book database |
WO2021068728A1 (en) * | 2019-10-10 | 2021-04-15 | 深圳前海微众银行股份有限公司 | Methods and apparatus for generating state tree of block and validating on-chain data |
CN113254450A (en) * | 2021-05-28 | 2021-08-13 | 山大地纬软件股份有限公司 | Method and system for storing account state of incremental MPT (message passing through) tree based on block chain |
CN113312205A (en) * | 2020-02-26 | 2021-08-27 | 腾讯科技(深圳)有限公司 | Data verification method and device, storage medium and computer equipment |
CN113360456A (en) * | 2021-08-11 | 2021-09-07 | 腾讯科技(深圳)有限公司 | Data archiving method, device, equipment and storage medium |
CN113505138A (en) * | 2021-09-06 | 2021-10-15 | 支付宝(杭州)信息技术有限公司 | Method and apparatus for state attestation and execution of blocks in a blockchain system |
WO2021218984A1 (en) * | 2020-04-28 | 2021-11-04 | 腾讯科技(深圳)有限公司 | Data routing method and related apparatus |
CN114490685A (en) * | 2021-12-29 | 2022-05-13 | 中国科学院计算技术研究所 | DNS data query and update method and system based on blockchain and verifiable computing |
CN114520810A (en) * | 2022-01-27 | 2022-05-20 | 山东浪潮工业互联网产业股份有限公司 | Block chain-based block data transmission method, equipment and medium |
CN114691687A (en) * | 2021-12-30 | 2022-07-01 | 北京连琪科技有限公司 | Method for verifying block state certification |
CN117573632A (en) * | 2023-11-14 | 2024-02-20 | 中国移动紫金(江苏)创新研究院有限公司 | Industrial data trusted sharing methods, devices, equipment and storage media |
Families Citing this family (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115514505B (en) * | 2021-06-07 | 2025-04-25 | 中国移动通信集团浙江有限公司 | Blockchain consensus node change method, device and blockchain system |
CN113254538B (en) * | 2021-06-17 | 2021-11-16 | 支付宝(杭州)信息技术有限公司 | Method for executing transaction in block chain and block chain link point |
CN113704249B (en) * | 2021-07-14 | 2024-07-26 | 杭州溪塔科技有限公司 | Method and device for using static merck tree in blockchain |
CN113988856A (en) * | 2021-11-08 | 2022-01-28 | 福建博泉哈希科技有限公司 | Block header propagation method and storage medium |
CN114266578B (en) * | 2021-11-23 | 2025-07-25 | 航天信息股份有限公司 | Transaction reconciliation method and system based on Merker tree |
CN114564539B (en) * | 2022-03-01 | 2022-11-25 | 山东大学 | Method and system for dynamically constructing blockchain world state based on account activity perception |
WO2023207080A1 (en) * | 2022-04-28 | 2023-11-02 | 蚂蚁区块链科技(上海)有限公司 | Data processing method in blockchain, and blockchain node |
CN115150092B (en) * | 2022-05-23 | 2024-09-06 | 网易(杭州)网络有限公司 | Method and device for creating service sub-chain, electronic equipment and computer storage medium |
CN115052008B (en) * | 2022-05-26 | 2023-07-25 | 南京邮电大学 | Block chain data under-chain storage method based on cloud storage |
CN115150417A (en) * | 2022-07-01 | 2022-10-04 | 南方电网电力科技股份有限公司 | Data storage method based on block chain and related device |
CN115021945B (en) * | 2022-08-08 | 2022-11-08 | 四块科技(深圳)有限公司 | Block chain transaction processing method and system |
CN115941692B (en) * | 2023-03-09 | 2023-05-23 | 中国信息通信研究院 | Information identification system, equipment and medium based on master-slave block chain storage mode |
CN116436917B (en) * | 2023-04-18 | 2025-03-21 | 中国银联股份有限公司 | A communication method and device based on blockchain |
CN117251120B (en) * | 2023-11-17 | 2024-03-01 | 杭州乒乓智能技术有限公司 | Accounting system optimization method, device, equipment and medium based on jvm out-of-heap memory |
CN118965447A (en) * | 2024-07-10 | 2024-11-15 | 成都红云鼎科技有限公司 | A ledger error correction method based on blockchain technology |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108039943A (en) * | 2017-12-06 | 2018-05-15 | 清华大学深圳研究生院 | A kind of encryption searching method that can verify that |
CN108153907A (en) * | 2018-01-18 | 2018-06-12 | 中国计量大学 | The memory management method of space optimization is realized by 16 Trie trees |
CN108197226A (en) * | 2017-12-29 | 2018-06-22 | 山大地纬软件股份有限公司 | MPTC account status tree and MPTC block chain method for quickly retrieving |
CN108595720A (en) * | 2018-07-12 | 2018-09-28 | 中国科学院深圳先进技术研究院 | A kind of block chain spatiotemporal data warehouse method, system and electronic equipment |
CN109145163A (en) * | 2018-08-22 | 2019-01-04 | 深圳前海微众银行股份有限公司 | Block chain data capacity reduction method, device and storage medium |
CN109829267A (en) * | 2019-02-22 | 2019-05-31 | 陕西优米数据技术有限公司 | A kind of copyright common recognition system and method based on block chain |
US20190228019A1 (en) * | 2017-04-12 | 2019-07-25 | Vijay Madisetti | Method and System for Tuning Blockchain Scalability, Decentralization, and Security for Fast and Low-Cost Payment and Transaction Processing |
CN110188550A (en) * | 2019-05-17 | 2019-08-30 | 深圳前海微众银行股份有限公司 | A blockchain data verification method and device |
Family Cites Families (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10097344B2 (en) * | 2016-07-15 | 2018-10-09 | Mastercard International Incorporated | Method and system for partitioned blockchains and enhanced privacy for permissioned blockchains |
CN106503992A (en) * | 2016-10-18 | 2017-03-15 | 北京天德科技有限公司 | A kind of block chain that Transaction Information and accounts information are stored respectively |
WO2018115567A1 (en) * | 2016-12-19 | 2018-06-28 | Nokia Technologies Oy | Method and apparatus for private data transfer between parties |
CN108282474B (en) * | 2018-01-18 | 2020-04-17 | 山东大学 | Block chain based digital asset transaction consistency maintenance method |
CN108615156A (en) * | 2018-05-09 | 2018-10-02 | 上海魅联信息技术有限公司 | A kind of data structure based on block chain |
CN108805570B (en) * | 2018-06-01 | 2021-05-25 | 腾讯科技(深圳)有限公司 | Data processing method, device and storage medium |
CN109359222B (en) * | 2018-08-06 | 2021-07-06 | 杭州复杂美科技有限公司 | Data storage method and system, equipment and storage medium |
CN109213900B (en) * | 2018-09-18 | 2020-10-16 | 百度在线网络技术(北京)有限公司 | Data modification method, device, equipment and medium for block chain |
CN109359159A (en) * | 2018-09-30 | 2019-02-19 | 深圳前海微众银行股份有限公司 | Distributed storage method, system and device |
CN110009334B (en) * | 2018-11-07 | 2020-04-28 | 阿里巴巴集团控股有限公司 | Meckel tree construction and simple payment verification method and device |
CN109409889B (en) * | 2018-11-13 | 2021-11-12 | 杭州秘猿科技有限公司 | Block determining method and device in block chain and electronic equipment |
CN109684333B (en) * | 2018-12-24 | 2021-02-09 | 杭州复杂美科技有限公司 | Data storage and cutting method, equipment and storage medium |
CN109933592B (en) * | 2019-03-22 | 2021-06-01 | 杭州复杂美科技有限公司 | Data storage method, data rollback method, device and storage medium |
CN110060064B (en) * | 2019-04-26 | 2023-05-16 | 深圳市迅雷网络技术有限公司 | A transaction information verification method and related device |
EP3669281B1 (en) * | 2019-07-11 | 2024-04-03 | Advanced New Technologies Co., Ltd. | Shared blockchain data storage |
CN113329031B (en) * | 2019-10-10 | 2023-06-13 | 深圳前海微众银行股份有限公司 | A method and device for generating a state tree of a block |
CN111008201B (en) * | 2020-03-09 | 2020-06-26 | 支付宝(杭州)信息技术有限公司 | Method and apparatus for parallel modification and reading of state trees |
-
2019
- 2019-10-10 CN CN202110689224.8A patent/CN113329031B/en active Active
- 2019-10-10 CN CN201910960376.XA patent/CN110602148B/en active Active
-
2020
- 2020-09-18 WO PCT/CN2020/116269 patent/WO2021068728A1/en active Application Filing
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190228019A1 (en) * | 2017-04-12 | 2019-07-25 | Vijay Madisetti | Method and System for Tuning Blockchain Scalability, Decentralization, and Security for Fast and Low-Cost Payment and Transaction Processing |
CN108039943A (en) * | 2017-12-06 | 2018-05-15 | 清华大学深圳研究生院 | A kind of encryption searching method that can verify that |
CN108197226A (en) * | 2017-12-29 | 2018-06-22 | 山大地纬软件股份有限公司 | MPTC account status tree and MPTC block chain method for quickly retrieving |
CN108153907A (en) * | 2018-01-18 | 2018-06-12 | 中国计量大学 | The memory management method of space optimization is realized by 16 Trie trees |
CN108595720A (en) * | 2018-07-12 | 2018-09-28 | 中国科学院深圳先进技术研究院 | A kind of block chain spatiotemporal data warehouse method, system and electronic equipment |
CN109145163A (en) * | 2018-08-22 | 2019-01-04 | 深圳前海微众银行股份有限公司 | Block chain data capacity reduction method, device and storage medium |
CN109829267A (en) * | 2019-02-22 | 2019-05-31 | 陕西优米数据技术有限公司 | A kind of copyright common recognition system and method based on block chain |
CN110188550A (en) * | 2019-05-17 | 2019-08-30 | 深圳前海微众银行股份有限公司 | A blockchain data verification method and device |
Non-Patent Citations (2)
Title |
---|
YANKAI XIE: "A Privacy-preserving Ethereum Lightweight Client", 《 2019 IEEE/CIC INTERNATIONAL CONFERENCE ON COMMUNICATIONS IN CHINA (ICCC)》 * |
尤瑶等: "一种支持区块链交易溯源的混合索引机制", 《计算机集成制造系统》 * |
Cited By (36)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021068728A1 (en) * | 2019-10-10 | 2021-04-15 | 深圳前海微众银行股份有限公司 | Methods and apparatus for generating state tree of block and validating on-chain data |
WO2021135756A1 (en) * | 2020-01-02 | 2021-07-08 | 支付宝(杭州)信息技术有限公司 | Method and device for proving account state existence, and state query method and device |
CN111177225B (en) * | 2020-01-02 | 2023-05-23 | 支付宝(杭州)信息技术有限公司 | Account state existence proving method and device and state inquiring method and device |
CN111177225A (en) * | 2020-01-02 | 2020-05-19 | 支付宝(杭州)信息技术有限公司 | Account state existence proving method and device and state inquiring method and device |
CN111209339A (en) * | 2020-01-03 | 2020-05-29 | 腾讯科技(深圳)有限公司 | Block synchronization method, device, computer and storage medium |
CN111209339B (en) * | 2020-01-03 | 2021-09-14 | 腾讯科技(深圳)有限公司 | Block synchronization method, device, computer and storage medium |
CN113312205A (en) * | 2020-02-26 | 2021-08-27 | 腾讯科技(深圳)有限公司 | Data verification method and device, storage medium and computer equipment |
CN113312205B (en) * | 2020-02-26 | 2022-07-29 | 腾讯科技(深圳)有限公司 | Data verification method and device, storage medium and computer equipment |
CN111461751B (en) * | 2020-04-02 | 2024-03-29 | 武汉大学 | Real estate information chain organization method based on block chain, historical state tracing method and device |
CN111461751A (en) * | 2020-04-02 | 2020-07-28 | 武汉大学 | Block chain-based house property information chain organization method, historical state tracing method and device |
CN111488615A (en) * | 2020-04-08 | 2020-08-04 | 北京瑞策科技有限公司 | Cross-link realization method and device for service data block chain |
CN111488610A (en) * | 2020-04-08 | 2020-08-04 | 北京瑞策科技有限公司 | State data query method and device based on service data block chain |
CN111488359A (en) * | 2020-04-08 | 2020-08-04 | 北京瑞策科技有限公司 | Relation data storage method and device of business data block chain |
CN111488606B (en) * | 2020-04-08 | 2021-04-27 | 北京瑞策科技有限公司 | Data sharing method and device based on service data block chain |
CN111488606A (en) * | 2020-04-08 | 2020-08-04 | 北京瑞策科技有限公司 | Data sharing method and device based on service data block chain |
CN111553670A (en) * | 2020-04-28 | 2020-08-18 | 腾讯科技(深圳)有限公司 | Transaction processing method and device and computer readable storage medium |
WO2021218984A1 (en) * | 2020-04-28 | 2021-11-04 | 腾讯科技(深圳)有限公司 | Data routing method and related apparatus |
CN111553670B (en) * | 2020-04-28 | 2021-10-15 | 腾讯科技(深圳)有限公司 | Transaction processing method and device and computer readable storage medium |
US12250149B2 (en) | 2020-04-28 | 2025-03-11 | Tencent Technology (Shenzhen) Company Limited | Data routing method and related apparatus |
CN111640018A (en) * | 2020-05-06 | 2020-09-08 | 深圳前海微众银行股份有限公司 | Block chain transaction existence verification method and device |
CN111444196A (en) * | 2020-06-12 | 2020-07-24 | 支付宝(杭州)信息技术有限公司 | Method, device and equipment for generating Hash of global state in block chain type account book |
CN111444196B (en) * | 2020-06-12 | 2020-10-16 | 支付宝(杭州)信息技术有限公司 | Method, device and equipment for generating Hash of global state in block chain type account book |
CN112306991A (en) * | 2020-10-30 | 2021-02-02 | 深圳前海微众银行股份有限公司 | Method, device and equipment for processing data in tree structure and storage medium |
CN112364010A (en) * | 2021-01-12 | 2021-02-12 | 支付宝(杭州)信息技术有限公司 | Business record deleting method based on credible account book database |
CN112364010B (en) * | 2021-01-12 | 2021-04-23 | 支付宝(杭州)信息技术有限公司 | Method and device for verifying existence of important business record |
CN113254450A (en) * | 2021-05-28 | 2021-08-13 | 山大地纬软件股份有限公司 | Method and system for storing account state of incremental MPT (message passing through) tree based on block chain |
CN113360456A (en) * | 2021-08-11 | 2021-09-07 | 腾讯科技(深圳)有限公司 | Data archiving method, device, equipment and storage medium |
CN113505138B (en) * | 2021-09-06 | 2021-12-21 | 支付宝(杭州)信息技术有限公司 | Method and apparatus for state attestation and execution of blocks in a blockchain system |
WO2023029731A1 (en) * | 2021-09-06 | 2023-03-09 | 支付宝(杭州)信息技术有限公司 | Method and device for state certification and block execution in blockchain system |
CN113505138A (en) * | 2021-09-06 | 2021-10-15 | 支付宝(杭州)信息技术有限公司 | Method and apparatus for state attestation and execution of blocks in a blockchain system |
CN114490685A (en) * | 2021-12-29 | 2022-05-13 | 中国科学院计算技术研究所 | DNS data query and update method and system based on blockchain and verifiable computing |
CN114691687A (en) * | 2021-12-30 | 2022-07-01 | 北京连琪科技有限公司 | Method for verifying block state certification |
CN114691687B (en) * | 2021-12-30 | 2022-12-06 | 北京连琪科技有限公司 | Method for verifying block state certification |
CN114520810A (en) * | 2022-01-27 | 2022-05-20 | 山东浪潮工业互联网产业股份有限公司 | Block chain-based block data transmission method, equipment and medium |
CN114520810B (en) * | 2022-01-27 | 2024-06-14 | 浪潮工业互联网股份有限公司 | Block data transmission method, equipment and medium based on block chain |
CN117573632A (en) * | 2023-11-14 | 2024-02-20 | 中国移动紫金(江苏)创新研究院有限公司 | Industrial data trusted sharing methods, devices, equipment and storage media |
Also Published As
Publication number | Publication date |
---|---|
CN113329031B (en) | 2023-06-13 |
CN110602148B (en) | 2021-07-06 |
CN113329031A (en) | 2021-08-31 |
WO2021068728A1 (en) | 2021-04-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113329031B (en) | A method and device for generating a state tree of a block | |
CN108846659B (en) | Block chain-based transfer method and device and storage medium | |
EP3678346B1 (en) | Blockchain smart contract verification method and apparatus, and storage medium | |
CN110737664B (en) | Method and device for synchronizing block chain link points | |
US20200322159A1 (en) | Method for index-based and integrity-assured search in a blockchain | |
CN109391645B (en) | Blockchain lightweight processing method, blockchain node and storage medium | |
JP2020519983A (en) | System and method for parallel processing blockchain transactions | |
CN112286939B (en) | Method, device and equipment for generating hash of global state in block chain type account book | |
US12137179B2 (en) | Systems and methods for processing blockchain transactions | |
CN112348518B (en) | A method and device for blockchain transaction proof | |
US20210049715A1 (en) | Blockchain-based data procesing method, apparatus, and electronic device | |
CN111640018B (en) | A method and device for verifying the existence of a blockchain transaction | |
US12271894B2 (en) | Method of selective authentication of a blockchain user with a smart contract | |
CN112785408A (en) | Account checking method and device based on Hash | |
WO2020220251A1 (en) | Data processing method for blockchain system and block generating method | |
CN114175011B (en) | Blockchain system with efficient world state data structure | |
CN111080296B (en) | Verification method and device based on blockchain system | |
CN112862490A (en) | Output consensus method under asynchronous network | |
JP2024505105A (en) | Method and device for validating database query results | |
CN115795563A (en) | Method and device for verifying status data | |
CN109685657B (en) | Method and node device for processing transactions in a blockchain network and storage medium | |
CN113763166B (en) | A method and device for data verification | |
CN114153849B (en) | Block chain data generation and verification method and device | |
WO2023184052A1 (en) | Data processing method, blockchain node and blockchain system | |
CN118779384A (en) | A decentralized identity storage method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |