CN110033264A - Merkel tree corresponding to building block and simple payment verification method and device - Google Patents
Merkel tree corresponding to building block and simple payment verification method and device Download PDFInfo
- Publication number
- CN110033264A CN110033264A CN201910100704.9A CN201910100704A CN110033264A CN 110033264 A CN110033264 A CN 110033264A CN 201910100704 A CN201910100704 A CN 201910100704A CN 110033264 A CN110033264 A CN 110033264A
- Authority
- CN
- China
- Prior art keywords
- transaction
- data
- storage location
- block
- hash
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/40—Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
- G06Q20/401—Transaction verification
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
- G06F21/6245—Protecting personal data, e.g. for financial or medical purposes
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Computer Security & Cryptography (AREA)
- Accounting & Taxation (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- Bioethics (AREA)
- General Physics & Mathematics (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Finance (AREA)
- Medical Informatics (AREA)
- Databases & Information Systems (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
公开了一种构建区块对应的梅克尔树、简单支付验证方法及装置。如果写入块链的某个交易是不宜公开的敏感内容,那么,可以将区块链中的该交易替换成该交易的交易哈希,并基于替换的交易哈希进行相关的梅克尔树构建、简单支付验证。
Disclosed are a method and device for constructing a Merkle tree corresponding to a block and simple payment verification. If a transaction written into the blockchain contains sensitive content that should not be made public, the transaction in the blockchain can be replaced with its transaction hash, and the relevant Merkle tree construction and simple payment verification can be performed based on the replaced transaction hash.
Description
技术领域technical field
本说明书实施例涉及信息技术领域,尤其涉及一种构建区块对应的梅克尔树、简单支付验证方法及装置。The embodiments of this specification relate to the field of information technology, and in particular, to a Merkle tree corresponding to a building block, a simple payment verification method, and an apparatus.
背景技术Background technique
区块链网络是一种去中心化的、由多个节点参与的分布式数据存储系统。数据一旦被写入每个节点上的区块链,一方面,意味着数据在全网公开,另一方面,写入区块链的数据也难以被删除与篡改。基于此,在数据存证领域,区块链技术具有很大的应用前景。A blockchain network is a decentralized, distributed data storage system participated by multiple nodes. Once data is written to the blockchain on each node, on the one hand, it means that the data is open to the entire network, and on the other hand, the data written into the blockchain is difficult to delete and tamper with. Based on this, in the field of data storage, blockchain technology has great application prospects.
此外,实践中,中心化设备也可以采用类区块链存储(可以视为中心化的区块链存储)的方式对数据进行存储,区块链中的区块与类区块链中的区块的生成原理相同。显然,如果要删除写入类区块链中的数据,除非中心化设备将存储的整个类区块链都删除。因此,中心化的类区块链存储也比较适合应用于数据存证业务。本文将区块链存储方式与其他中心化的类区块链存储方式统称为块链存储。In addition, in practice, centralized equipment can also use blockchain-like storage (which can be regarded as centralized blockchain storage) to store data. Blocks are generated on the same principle. Obviously, if you want to delete the data written in the quasi-blockchain, unless the centralized device deletes the entire quasi-blockchain stored. Therefore, centralized blockchain-like storage is also more suitable for data storage business. In this paper, the blockchain storage method and other centralized blockchain-like storage methods are collectively referred to as blockchain storage.
然而,在实际应用中,有些内容(本文称之为敏感内容)一旦被写入块链,就会造成难以消除的危害后果。However, in practical applications, once some content (called sensitive content in this paper) is written into the blockchain, it will cause harmful consequences that are difficult to eliminate.
假设将上述的敏感内容从块链中删除,那么很容易影响到针对其他数据(与所述敏感内容位于同一区块中的数据)的简单支付验证(Simplified Payment Verification,SPV)的准确性,从而影响数据存证业务的正常运行。Assuming that the above sensitive content is deleted from the blockchain, the accuracy of the Simple Payment Verification (SPV) for other data (data located in the same block as the sensitive content) is easily affected, so that Affect the normal operation of the data storage business.
基于以上,如何既使得写入块链的敏感内容不会被公开,又不会影响针对所述其他数据的存证业务的正常运行,是丞待解决的技术问题。Based on the above, it is a technical problem to be solved how to keep the sensitive content written in the blockchain from being disclosed and not to affect the normal operation of the certificate deposit business for the other data.
发明内容SUMMARY OF THE INVENTION
为了使得写入块链的敏感内容不会被公开,又不会影响针对所述其他数据的存证业务的正常运行,本说明书实施例提供一种区块对应的构建梅克尔树、简单支付验证方法及装置,技术方案如下:In order to prevent the sensitive content written into the block chain from being disclosed, and not to affect the normal operation of the certificate deposit business for the other data, the embodiments of this specification provide a block-corresponding Merkle tree construction and simple payment method. The verification method and device, the technical scheme is as follows:
根据本说明书实施例的第1方面,提供一种构建区块对应的梅克尔树的方法,包括:According to the first aspect of the embodiments of the present specification, a method for constructing a Merkle tree corresponding to a block is provided, including:
针对块链中的目标区块,获取所述目标区块的标签;For the target block in the blockchain, obtain the label of the target block;
若所述目标区块的标签是指定标签,则针对所述目标区块中的每个交易存储位置,从该交易存储位置读取数据;其中,所述指定标签表征所述目标区块中存储过至少一个敏感交易,针对每个敏感交易,该敏感交易已被替换成包含该敏感交易的交易哈希的隐匿化数据;If the tag of the target block is a designated tag, for each transaction storage location in the target block, data is read from the transaction storage location; wherein, the designated tag represents the storage in the target block. has passed at least one sensitive transaction, and for each sensitive transaction, the sensitive transaction has been replaced with cryptic data containing the transaction hash of the sensitive transaction;
若确定从该交易存储位置读取的数据包括交易,则对读取的数据所包括的交易进行哈希计算,得到该交易存储位置对应的交易哈希;If it is determined that the data read from the transaction storage location includes a transaction, perform a hash calculation on the transaction included in the read data to obtain a transaction hash corresponding to the transaction storage location;
若确定从该交易存储位置读取的数据包括隐匿化数据,则从读取的数据所包括的隐匿化数据中提取交易哈希,作为该交易存储位置对应的交易哈希;If it is determined that the data read from the transaction storage location includes concealed data, the transaction hash is extracted from the concealed data included in the read data as the transaction hash corresponding to the transaction storage location;
基于所述目标区块中各交易存储位置分别对应的交易哈希,构建所述目标区块对应的梅克尔树。A Merkle tree corresponding to the target block is constructed based on the transaction hashes corresponding to the respective transaction storage locations in the target block.
根据本说明书实施例的第2方面,提供一种构建区块对应的梅克尔树的装置,包括:According to a second aspect of the embodiments of the present specification, an apparatus for constructing a Merkle tree corresponding to a block is provided, including:
获取模块,针对块链中的目标区块,获取所述目标区块的标签;an obtaining module, for obtaining the label of the target block for the target block in the blockchain;
读取模块,若所述目标区块的标签是指定标签,则针对所述目标区块中的每个交易存储位置,从该交易存储位置读取数据;其中,所述指定标签表征所述目标区块中存储过至少一个敏感交易,针对每个敏感交易,该敏感交易已被替换成包含该敏感交易的交易哈希的隐匿化数据;The reading module, if the label of the target block is a designated label, for each transaction storage location in the target block, read data from the transaction storage location; wherein, the designated label represents the target At least one sensitive transaction has been stored in the block, and for each sensitive transaction, the sensitive transaction has been replaced with an encrypted data containing the transaction hash of the sensitive transaction;
第一处理模块,若确定从该交易存储位置读取的数据包括交易,则对读取的数据所包括的交易进行哈希计算,得到该交易存储位置对应的交易哈希;The first processing module, if it is determined that the data read from the transaction storage location includes a transaction, perform a hash calculation on the transaction included in the read data to obtain a transaction hash corresponding to the transaction storage location;
第二处理模块,若确定从该交易存储位置读取的数据包括隐匿化数据,则从读取的数据所包括的隐匿化数据中提取交易哈希,作为该交易存储位置对应的交易哈希;The second processing module, if it is determined that the data read from the transaction storage location includes concealed data, then extracts the transaction hash from the concealed data included in the read data as the transaction hash corresponding to the transaction storage location;
构建模块,基于所述目标区块中各交易存储位置分别对应的交易哈希,构建所述目标区块对应的梅克尔树。A construction module, which constructs a Merkle tree corresponding to the target block based on the transaction hashes corresponding to the respective transaction storage locations in the target block.
根据本说明书实施例的第3方面,提供一种简单支付验证方法,包括:According to a third aspect of the embodiments of this specification, a simple payment verification method is provided, including:
接收验证请求;所述验证请求包含目标交易标识;Receive a verification request; the verification request includes a target transaction identifier;
根据所述验证请求,在自身的区块链中确定所述目标交易标识对应的交易所在的区块,并基于第1方面的方法构建所述区块对应的梅克尔树;According to the verification request, determine the block in which the transaction corresponding to the target transaction identifier is located in its own blockchain, and build a Merkle tree corresponding to the block based on the method of the first aspect;
基于构建的梅克尔树,针对所述目标交易标识对应的交易进行简单支付验证。Based on the constructed Merkle tree, simple payment verification is performed for the transaction corresponding to the target transaction identifier.
根据本说明书实施例的第4方面,提供一种简单支付验证装置,包括:According to a fourth aspect of the embodiments of this specification, a simple payment verification device is provided, including:
接收模块,接收验证请求;所述验证请求包含目标交易标识;a receiving module, receiving a verification request; the verification request includes a target transaction identifier;
构建模块,根据所述验证请求,在自身的区块链中确定所述目标交易标识对应的交易所在的区块,并基于第1方面的方法构建所述区块对应的梅克尔树;The building module, according to the verification request, determines the block in which the transaction corresponding to the target transaction identifier is located in its own blockchain, and constructs the Merkle tree corresponding to the block based on the method of the first aspect;
验证模块,基于构建的梅克尔树,针对所述目标交易标识对应的交易进行简单支付验证。The verification module, based on the constructed Merkle tree, performs simple payment verification for the transaction corresponding to the target transaction identifier.
本说明书实施例所提供的技术方案,如果写入块链的某个交易是敏感交易(包含有不宜公开的敏感内容),那么,可以将块链中的该交易替换成包括该交易的交易哈希的隐匿化数据。一方面,该交易的交易哈希是对该交易采用单向散列算法(即哈希算法)计算得到的,由该交易的交易哈希无法逆推出该交易,因此,将该交易替换成隐匿化数据,相当于将块链中公示的该交易的明文内容不可恢复地隐匿起来。另一方面,将该交易替换成隐匿化数据,并不会影响该交易所在区块对应的梅克尔树的稳定性,也就不会影响到针对其他交易(与该交易位于同一区块中的交易)的简单支付验证(Simplified PaymentVerification,SPV)的准确性,从而保证了数据存证业务的正常运行。In the technical solution provided by the embodiments of this specification, if a transaction written into the blockchain is a sensitive transaction (containing sensitive content that should not be disclosed), then the transaction in the blockchain can be replaced with a transaction including the transaction. Hidden data. On the one hand, the transaction hash of the transaction is calculated by using a one-way hash algorithm (ie, a hash algorithm) for the transaction, and the transaction cannot be deduced from the transaction hash of the transaction. Therefore, the transaction is replaced by a hidden one. Converting data is equivalent to irretrievably hiding the plaintext content of the transaction published in the blockchain. On the other hand, replacing the transaction with hidden data will not affect the stability of the Merkle tree corresponding to the transaction in the block, nor will it affect other transactions (located in the same block as the transaction). The accuracy of the simple payment verification (Simplified Payment Verification, SPV) of the transaction), thus ensuring the normal operation of the data deposit business.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本说明书实施例。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not limiting of the embodiments of the present specification.
此外,本说明书实施例中的任一实施例并不需要达到上述的全部效果。In addition, any one of the embodiments of the present specification does not need to achieve all the above effects.
附图说明Description of drawings
为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书实施例中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present specification or the prior art, the following briefly introduces the accompanying drawings required in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some of the embodiments described in the embodiments of the present specification. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings.
图1是本说明提供的梅克尔树的结构示意图;Fig. 1 is the structural representation of Merkle tree provided by this description;
图2是本说明书实施例提供的一种对写入块链的交易进行隐匿的方法,的流程示意图;FIG. 2 is a schematic flowchart of a method for concealing transactions written into a block chain provided by an embodiment of this specification;
图3是本说明书实施例提供的构造隐匿化数据的过程示意图;3 is a schematic diagram of a process for constructing concealed data provided by an embodiment of this specification;
图4是本说明书实施例提供的构造隐匿化数据的另一过程示意图;4 is a schematic diagram of another process for constructing masked data provided by an embodiment of the present specification;
图5是本说明书实施例提供的一种对写入块链的交易进行隐匿的方法的流程示意图;FIG. 5 is a schematic flowchart of a method for concealing transactions written into a block chain provided by an embodiment of this specification;
图6是本说明书实施例提供的内容字段与标识字段的示意图;6 is a schematic diagram of a content field and an identification field provided by an embodiment of this specification;
图7是本说明书实施例提供的一种对写入区块链的交易进行隐匿的方法的流程示意图;7 is a schematic flowchart of a method for concealing transactions written into a blockchain provided by an embodiment of this specification;
图8是本说明书实施例提供的一种包含非敏感内容的隐匿化数据的示意图;FIG. 8 is a schematic diagram of anonymized data including non-sensitive content provided by an embodiment of the present specification;
图9是本说明书实施例提供的一种对写入块链的交易进行隐匿的方法的流程示意图;FIG. 9 is a schematic flowchart of a method for concealing a transaction written in a block chain provided by an embodiment of this specification;
图10是本说明书实施例提供的一种对写入块链的交易进行隐匿的方法的流程示意图;FIG. 10 is a schematic flowchart of a method for concealing a transaction written into a block chain provided by an embodiment of this specification;
图11是本说明书实施例提供的一种构建区块对应的梅克尔树的方法的流程示意图;11 is a schematic flowchart of a method for constructing a Merkle tree corresponding to a block provided by an embodiment of this specification;
图12是本说明书实施例提供的一种对写入块链的交易进行隐匿的方法的流程示意图;FIG. 12 is a schematic flowchart of a method for concealing transactions written into a block chain provided by an embodiment of this specification;
图13是本说明书实施例提供的另一种构建区块对应的梅克尔树的方法的流程示意图;13 is a schematic flowchart of another method for constructing a Merkle tree corresponding to a block provided by an embodiment of this specification;
图14是本说明书实施例提供的一种简单支付验证方法的流程示意图;14 is a schematic flowchart of a simple payment verification method provided by an embodiment of this specification;
图15是本说明书实施例提供的一种对写入块链的交易进行隐匿的装置的结构示意图;FIG. 15 is a schematic structural diagram of an apparatus for concealing transactions written in a block chain provided by an embodiment of this specification;
图16是本说明苏实施例提供的一种对写入块链的交易进行隐匿的装置的结构示意图;FIG. 16 is a schematic structural diagram of a device for hiding transactions written into a block chain provided by an embodiment of this specification;
图17是本说明苏实施例提供的一种对写入块链的交易进行隐匿的装置的结构示意图;FIG. 17 is a schematic structural diagram of a device for concealing transactions written into a block chain provided by an embodiment of this specification;
图18是本说明苏实施例提供的一种对写入块链的交易进行隐匿的装置的结构示意图;FIG. 18 is a schematic structural diagram of an apparatus for concealing transactions written into a block chain provided by an embodiment of this specification;
图19是本说明苏实施例提供的一种对写入块链的交易进行隐匿的装置的结构示意图;FIG. 19 is a schematic structural diagram of a device for hiding transactions written into a block chain provided by an embodiment of this specification;
图20是本说明书实施例提供的一种构建区块对应的梅克尔树的装置的结构示意图;20 is a schematic structural diagram of an apparatus for building a Merkle tree corresponding to a block provided by an embodiment of this specification;
图21是本说明书实施例提供的一种简单支付验证装置的结构示意图;21 is a schematic structural diagram of a simple payment verification device provided by an embodiment of this specification;
图22是用于配置本说明书实施例装置的一种计算机设备的结构示意图。FIG. 22 is a schematic structural diagram of a computer device for configuring the apparatus according to the embodiment of the present specification.
具体实施方式Detailed ways
如前所述,在实际应用中,敏感内容一旦被写入块链,就会造成难以消除的危害后果。As mentioned above, in practical applications, once sensitive content is written into the blockchain, it will cause harmful consequences that are difficult to eliminate.
例如,张三对李四进行诽谤,并将诽谤言论的文本文件上传到区块链网络进行存证,导致该文本文件被写入区块链,对李四的名誉造成不可消除的伤害。又如,A公司盗取B公司的商业机密,并将盗取的商业机密提交给采用类区块链存储方式的中心化设备进行存证,导致该商业机密被写入类区块链,为了消除危害,只能由中心化设备删除存储的整个类区块链,付出的代价过于巨大。For example, Zhang San slandered Li Si and uploaded the text file of the defamatory speech to the blockchain network for evidence, causing the text file to be written into the blockchain, causing irreparable damage to Li Si's reputation. Another example is that Company A steals the business secrets of Company B, and submits the stolen business secrets to a centralized device that uses a blockchain-like storage method for storage. To eliminate the harm, the entire block chain of storage can only be deleted by a centralized device, and the price to pay is too great.
需要说明的是,在本说明书中所描述的交易(transaction),是指写入块链中的一笔数据。交易是区块链协议或类区块链协议中所约定的一种数据结构,一笔数据要存入块链,就需要被封装成交易。It should be noted that the transaction described in this specification refers to a piece of data written into the blockchain. A transaction is a data structure agreed in a blockchain protocol or a blockchain-like protocol. To store a piece of data in the blockchain, it needs to be encapsulated into a transaction.
在基于块链的数据存证场景下,交易一旦被写入块链,就难以删除与篡改。然而,在实际应用中,如果写入块链的交易后续被认定包含不宜公开的敏感内容,那么,如何在保证块链存储业务正常运行的前提下,写入块链的敏感内容不再公开,就成为一个难以解决的技术问题。In the blockchain-based data storage scenario, once a transaction is written into the blockchain, it is difficult to delete and tamper with it. However, in practical applications, if the transactions written to the blockchain are subsequently determined to contain sensitive content that should not be disclosed, how can the sensitive content written to the blockchain be no longer disclosed under the premise of ensuring the normal operation of the blockchain storage business? It becomes a difficult technical problem to solve.
需要说明的是,假设将写入块链的敏感交易(包含敏感内容的交易)直接删除,那么很容易导致基于块链所运行的数据存证业务无法正常运行。原因具体为:It should be noted that if the sensitive transactions (transactions containing sensitive content) written into the blockchain are directly deleted, it is easy to cause the data storage business based on the blockchain to fail to operate normally. The reasons are as follows:
常见的块链技术(区块链或中心化的类区块链)往往支持简单支付SPV验证。SPV是指针对某个交易,验证该交易是否已写入块链。SPV的原理是,验证请求方向数据存储方(区块链节点或中心化设备)请求验证某个交易(称为目标交易)是否已写入块链,数据存储方首先会定位所述目标交易所在的区块(称为目标区块),然后基于目标区块中的各交易构建梅克尔树(Merkle trees),然后确定目标交易对应的梅克尔路径,并将目标交易对应的梅克尔路径所关联的哈希值返回给验证请求方。验证请求方会数据存储方返回的哈希值,验证目标交易对应的梅克尔路径是否正确,即根据目标交易的交易哈希与数据存储方返回的哈希值,依照所述目标交易对应的梅克尔路径,计算梅克尔树的根哈希,并判断计算得到的根哈希与目标区块的区块头中的根哈希是否一致,如果一致,就认定验证通过,证明目标交易确实已经被写入块链中。Common blockchain technologies (blockchain or centralized blockchain-like) tend to support simple payment SPV verification. SPV refers to a transaction to verify whether the transaction has been written to the blockchain. The principle of SPV is that the verification requester requests the data storage party (blockchain node or centralized device) to verify whether a transaction (called a target transaction) has been written to the blockchain, and the data storage party will first locate the target exchange In the block (called the target block), then build a Merkle tree based on each transaction in the target block, then determine the Merkle path corresponding to the target transaction, and assign the Merkle path corresponding to the target transaction. The hash value associated with the path is returned to the verification requester. Verify that the requester will receive the hash value returned by the data storage party, and verify whether the Merkle path corresponding to the target transaction is correct, that is, according to the transaction hash of the target transaction and the hash value returned by the data storage party, according to the corresponding target transaction. Merkle path, calculate the root hash of the Merkle tree, and judge whether the calculated root hash is consistent with the root hash in the block header of the target block. has been written into the blockchain.
图1是本说明提供的梅克尔树的结构示意图。如图1所示,在梅克尔树中,各叶子节点与目标区块中存储的各交易一一对应。每个叶子节点上的哈希值是对相应的交易进行哈希运算得到的交易哈希。而针对每个父节点,该父节点上的哈希值是对该父节点的两个子节点上的哈希值进行哈希运算得到的。FIG. 1 is a schematic diagram of the structure of a Merkle tree provided in this specification. As shown in Figure 1, in the Merkle tree, each leaf node corresponds to each transaction stored in the target block. The hash value on each leaf node is the transaction hash obtained by hashing the corresponding transaction. For each parent node, the hash value on the parent node is obtained by hashing the hash values on the two child nodes of the parent node.
假设目标交易交易1。验证请求方需要验证交易1是否被写入块链中。于是,验证请求方向任一数据存储方发送请求,数据存储方首先会确定目标区块并构建出如图1所示的梅克尔树。然后,数据存储方会确定交易1对应的梅克尔路径所关联的哈希值为Hash2、Hash10、Hash14,并将Hash2、Hash10、Hash14返回给验证请求方。验证请求方根据Hash1(交易1的交易哈希)、Hash2、Hash10、Hash14,依照交易1对应的梅克尔路径,就可以计算得到梅克尔树的根哈希,然后,验证请求方若发现计算得到的根哈希与目标区块的区块头中存储的根哈希一致,就认定交易1确实已经被写入块链。Suppose the target transaction transaction 1. The verification requester needs to verify that transaction 1 was written to the blockchain. Therefore, the verification requester sends a request to any data storage party, and the data storage party will first determine the target block and construct a Merkle tree as shown in Figure 1. Then, the data storage party will determine the hash values associated with the Merkle path corresponding to transaction 1 as Hash2, Hash10, and Hash14, and return Hash2, Hash10, and Hash14 to the verification requester. The verification requester can calculate the root hash of the Merkle tree according to Hash1 (transaction hash of transaction 1), Hash2, Hash10, and Hash14, and according to the Merkle path corresponding to transaction 1. Then, if the verification requester finds If the calculated root hash is consistent with the root hash stored in the block header of the target block, it is determined that transaction 1 has indeed been written to the block chain.
显然,在触发针对目标交易的简单支付验证之前,数据存储方通常需要基于目标区块中的各交易构建梅克尔树。这样,才能把目标交易对应的梅克尔路径所关联的哈希值返回给验证请求方,从而针对目标交易进行SPV。这也意味着,交易1~交易8中的任一交易被篡改或被删除,梅克尔树的根哈希(即Hash1-8)就会发生改变,从而导致简单支付验证失败。Obviously, before triggering simple payment verification for the target transaction, the data store usually needs to build a Merkle tree based on each transaction in the target block. In this way, the hash value associated with the Merkle path corresponding to the target transaction can be returned to the verification requester, so that SPV can be performed for the target transaction. This also means that if any one of transactions 1 to 8 is tampered with or deleted, the root hash of the Merkle tree (ie Hash1-8) will change, resulting in the failure of simple payment verification.
例如,如图1所示,交易2包含敏感内容,如果直接将交易2从块链中删除,那么,当需要针对交易1、交易3~8中的任一交易进行简单支付验证时,由于缺少交易2,只能基于交易1、交易3~8构建梅克尔树,如此,构建的梅克尔树的根哈希与目标区块的区块头中存储的根哈希是不一致的,会导致简单支付验证失败,得出交易1、交易3~8都未上链的错误结论。For example, as shown in Figure 1, transaction 2 contains sensitive content. If transaction 2 is directly deleted from the blockchain, when simple payment verification is required for any of transactions 1 and 3 to 8, due to the lack of For transaction 2, a Merkle tree can only be constructed based on transactions 1 and 3 to 8. In this way, the root hash of the constructed Merkle tree is inconsistent with the root hash stored in the block header of the target block, which will lead to The simple payment verification fails, and the wrong conclusion is drawn that neither transaction 1 nor transaction 3 to 8 are on the chain.
为此,本发明可以在对块链系统中的简单支付验证不构成干扰的前提下,实现了对块链中某个交易的隐匿。本发明的核心技术手段是将块链中需要被隐匿的交易(敏感交易)替换成包含该交易的交易哈希的隐匿化数据。如此,既可以停止公开该交易的明文内容,又不会干扰到基于块链的简单支付验证体系的平稳运行。For this reason, the present invention can realize the concealment of a transaction in the block chain on the premise of not interfering with the simple payment verification in the block chain system. The core technical means of the present invention is to replace the transaction (sensitive transaction) that needs to be concealed in the block chain with the concealed data including the transaction hash of the transaction. In this way, the plaintext content of the transaction can be stopped without disturbing the smooth operation of the simple payment verification system based on the blockchain.
为了使本领域技术人员更好地理解本说明书实施例中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行详细地描述,显然,所描述的实施例仅仅是本说明书的一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员所获得的所有其他实施例,都应当属于保护的范围。In order for those skilled in the art to better understand the technical solutions in the embodiments of the present specification, the technical solutions in the embodiments of the present specification will be described in detail below with reference to the accompanying drawings in the embodiments of the present specification. Obviously, the described implementation Examples are only some of the embodiments of the present specification, but not all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this specification should fall within the scope of protection.
以下结合附图,详细说明本说明书各实施例提供的技术方案。The technical solutions provided by the embodiments of the present specification will be described in detail below with reference to the accompanying drawings.
实施例一Example 1
图2是本说明书实施例提供的一种对写入块链的交易进行隐匿的方法,的流程示意图,包括以下步骤:FIG. 2 is a schematic flowchart of a method for concealing transactions written into a block chain provided by an embodiment of this specification, including the following steps:
S200:接收隐匿指令。S200: Receive a concealed instruction.
本发明所应用的场景为基于块链的数据存证场景。在此场景下,由包括多个节点的区块链网络对数据进行块链式的分布式存证,或者,由中心化设备对数据进行块链式的中心化存证。The application scenario of the present invention is a blockchain-based data storage scenario. In this scenario, a blockchain network including multiple nodes performs blockchain-type distributed storage for data, or a centralized device performs blockchain-type centralized storage for data.
在区块链场景下,本方法的执行主体可以是各区块链节点;在类区块链场景下,本方法的执行主体可以是中心化设备。In a blockchain scenario, the execution subject of this method may be each blockchain node; in a quasi-blockchain scenario, the execution subject of this method may be a centralized device.
在本说明书中,隐匿指令包含目标交易标识,所述目标交易标识一般是包含敏感内容的敏感交易的交易标识。当然,图1所示的方法也可以对写入块链的非敏感交易进行隐匿,因此,所述目标交易标识理论上可以是任一交易的交易标识。In this specification, a concealed instruction includes a target transaction identifier, and the target transaction identifier is generally a transaction identifier of a sensitive transaction containing sensitive content. Of course, the method shown in FIG. 1 can also conceal the non-sensitive transactions written in the block chain. Therefore, the target transaction identifier can theoretically be the transaction identifier of any transaction.
需要说明的是,交易的交易标识用于唯一标识交易。具体地,交易的交易标识可以是对交易进行哈希运算后得到的交易哈希,也可以是为交易分配的唯一编号。It should be noted that the transaction identifier of the transaction is used to uniquely identify the transaction. Specifically, the transaction identifier of the transaction may be a transaction hash obtained by performing a hash operation on the transaction, or may be a unique number assigned to the transaction.
在步骤S200中,隐匿指令可以是某个用户发出的。该用户可以是上传敏感内容的用户,也可以是有权要求隐匿敏感内容的主体(如法院、受害人等)。In step S200, the concealment instruction may be issued by a certain user. The user may be a user who uploads sensitive content, or a subject (such as a court, a victim, etc.) who has the right to request the concealment of sensitive content.
在区块链场景下,各区块链节点接收隐匿指令,具体可以是:各区块链节点接收封装有隐匿指令的隐匿交易。各区块链节点以执行所述隐匿交易的方式执行隐匿指令,待隐匿交易执行完毕后,各区块链节点会将隐匿交易也写入区块链进行存证。In the blockchain scenario, each blockchain node receives a hidden instruction, which may specifically be: each blockchain node receives a hidden transaction encapsulated with a hidden instruction. Each blockchain node executes the concealed instruction in the manner of executing the concealed transaction. After the concealed transaction is executed, each blockchain node will also write the concealed transaction into the blockchain for evidence.
S202:根据所述隐匿指令,确定隐匿化数据。S202: Determine the concealed data according to the concealment instruction.
在本说明书中,隐匿化数据至少包括目标交易标识对应的交易的交易哈希。In this specification, the concealment data includes at least the transaction hash of the transaction corresponding to the target transaction identifier.
S204:将块链中对应于所述目标交易标识的交易替换成所述隐匿化数据。S204: Replace the transaction corresponding to the target transaction identifier in the block chain with the concealed data.
在本说明书中,将块链中对应于所述目标交易标识的交易替换成所述隐匿化数据,具体可以是:In this specification, the transaction corresponding to the target transaction identifier in the block chain is replaced with the concealed data, which may be specifically:
首先确定块链中所述目标交易标识对应的交易所在的区块(称为目标区块),然后将目标区块中所述目标交易标识对应的交易存储位置所存储的交易更换为所述隐匿化数据。First determine the block (called the target block) in which the transaction corresponding to the target transaction identifier in the block chain is located, and then replace the transaction stored in the transaction storage location corresponding to the target transaction identifier in the target block with the Anonymize data.
块链实际上是由多个区块按照成块的时间先后顺序连接成的存储结构。对于每个区块而言,该区块中存在多个交易存储位置。所谓交易存储位置,是指区块中用于存储交易的存储空间或存储地址。假设块链中写入了100个交易,那么,区块链中也同时有100个交易存储位置,分别用于存储这100个交易。A block chain is actually a storage structure composed of multiple blocks connected in chronological order. For each block, there are multiple transaction storage locations within that block. The so-called transaction storage location refers to the storage space or storage address in the block for storing transactions. Assuming that 100 transactions are written in the blockchain, there are also 100 transaction storage locations in the blockchain, which are used to store these 100 transactions respectively.
在本说明书中,可以根据所述目标交易标识,在块链中进行遍历,以搜索所述目标交易标识对应的交易,也就是定位到所述目标交易标识对应的交易所在的交易存储位置。随后,从定位到的交易存储位置删除所述目标交易标识对应的交易,并向定位到的交易存储位置存入隐匿化数据。In this specification, the block chain can be traversed according to the target transaction identifier to search for the transaction corresponding to the target transaction identifier, that is, to locate the transaction storage location where the transaction corresponding to the target transaction identifier is located. Subsequently, the transaction corresponding to the target transaction identifier is deleted from the located transaction storage location, and the hidden data is stored in the located transaction storage location.
进一步地,由于根据目标交易标识在区块链中以遍历的方式定位交易效率较低,因此,在本说明书中,可以预先针对写入块链的任一交易,在块链之外,另行记录该交易的交易标识与块链中该交易所在的交易存储位置之间的对应关系。Further, since it is inefficient to locate transactions in the blockchain by traversing according to the target transaction identifier, in this specification, any transaction written into the blockchain can be recorded in advance outside the blockchain. The correspondence between the transaction identifier of the transaction and the transaction storage location in the blockchain.
其中,针对写入块链的任一交易,块链中该交易所在的交易存储位置,一般是该交易所在的区块的高度(即区块链中区块的顺位号)以及该交易在区块中的偏移量。例如,打包有交易A的区块被写入到区块链中第4个区块之后,即打包有交易A的区块的高度是5,并且,交易A在区块中的偏移量为120,则交易A对应的交易存储位置可以是(5,120)。Among them, for any transaction written into the blockchain, the transaction storage location of the transaction in the blockchain is generally the height of the block in which the transaction is located (that is, the sequence number of the block in the blockchain) and the The offset of the transaction in the block. For example, after the block containing transaction A is written to the fourth block in the blockchain, the height of the block containing transaction A is 5, and the offset of transaction A in the block is 120, the transaction storage location corresponding to transaction A may be (5, 120).
在本说明书中,在类区块链的场景下,中心化设备还可以将所述隐匿指令封装成隐匿交易写入块链。In this specification, in a blockchain-like scenario, the centralized device can also encapsulate the hidden instruction into a hidden transaction and write it into the blockchain.
此外,在区块链或类区块链的场景下,写入块链的隐匿交易不仅封装有隐匿指令,还封装有所述隐匿化数据的数据哈希。In addition, in a blockchain or blockchain-like scenario, a hidden transaction written to the blockchain is encapsulated not only with a hidden instruction, but also with a data hash of the hidden data.
通过图2所述的方法,可以实现对写入块链中的敏感内容的隐匿。并且,由于对敏感内容的隐匿方式为将包含敏感内容的敏感交易替换成包含敏感交易的交易哈希的隐匿化数据,因此,并不会对正常的SPV产生影响。Through the method described in Figure 2, the concealment of sensitive content written in the blockchain can be achieved. In addition, since the method of concealing the sensitive content is to replace the sensitive transaction containing the sensitive content with the concealed data containing the transaction hash of the sensitive transaction, the normal SPV will not be affected.
此外,所述隐匿化数据除了包括所述目标交易标识对应的交易的交易哈希之外,还可以包括更多信息。In addition, the masked data may include more information in addition to the transaction hash of the transaction corresponding to the target transaction identifier.
具体地,图3是本说明书实施例提供的构造隐匿化数据的过程示意图。每个节点在构造隐匿化数据时,可以获取所述目标交易标识对应的交易的交易哈希;将预设的前标记字符拼接到所述交易哈希的首部;根据所述前标记字符与所述交易哈希拼接成的数据,确定所述隐匿化数据。Specifically, FIG. 3 is a schematic diagram of a process of constructing masked data provided by an embodiment of the present specification. When constructing the concealed data, each node can obtain the transaction hash of the transaction corresponding to the target transaction identifier; splicing a preset pre-mark character to the header of the transaction hash; The data obtained by splicing the transaction hashes is used to determine the concealed data.
上述的前标记字符的作用是,当针对某个交易存储位置进行数据读取时,如果该交易存储位置的交易已经被替换成了隐匿化数据,那么,读取到所述隐匿化数据中的前标记字符时,相当于明确:“该交易存储位置所存储的不是交易的明文内容,而是交易哈希”。The function of the above-mentioned pre-marked characters is that when data is read for a certain transaction storage location, if the transaction in the transaction storage location has been replaced with concealed data, then the data in the concealed data is read. When the preceding mark character is used, it is equivalent to clear: "What is stored in this transaction storage location is not the plaintext content of the transaction, but the transaction hash".
由于交易哈希一般是固定长度的字符串,因此,还可以进一步在隐匿化数据中交易哈希之后增加备注信息。这样,当读取完所述隐匿化数据中的交易哈希之后,所述隐匿化数据中剩余的部分即是备注信息。Since the transaction hash is generally a string of fixed length, remark information can be further added after the transaction hash in the hidden data. In this way, after reading the transaction hash in the concealed data, the remaining part of the concealed data is the remark information.
需要说明的是,所述备注信息具体可以是为实现特定业务需要所添加的信息。例如,所述备注信息可以是“hidden”,表明所述目标交易标识对应的交易已经被隐匿。当用户查询所述目标交易标识对应的交易时,所述备注信息可以提示用户交易是不可见的。It should be noted that, the remark information may specifically be information added to achieve specific business needs. For example, the remark information may be "hidden", indicating that the transaction corresponding to the target transaction identifier has been hidden. When the user queries the transaction corresponding to the target transaction identifier, the remark information may prompt the user that the transaction is invisible.
进一步地,图4是本说明书实施例提供的构造隐匿化数据的另一过程示意图。在构造隐匿化数据时,可以获取所述目标交易标识对应的交易的交易哈希;将预设的前标记字符拼接到所述交易哈希的首部,将预设的后标记字符拼接到所述交易哈希的尾部,并且,将备注信息拼接到所述后标记字符的尾部;然后,将所述前标记字符、所述交易哈希、所述后标记字符以及所述备注信息拼接成的数据确定为所述隐匿化数据。Further, FIG. 4 is a schematic diagram of another process of constructing masked data provided by an embodiment of the present specification. When constructing the concealed data, the transaction hash of the transaction corresponding to the target transaction identifier can be obtained; the preset pre-mark characters are spliced into the header of the transaction hash, and the preset post-mark characters are spliced into the The tail of the transaction hash, and the remark information is spliced to the tail of the post-mark character; then, the data formed by splicing the pre-mark character, the transaction hash, the post-mark character and the remark information Determined to be the anonymized data.
上述的后标记字符的作用是,当隐匿化数据中包括备注信息(或后文提及的非敏感内容)时,不需要根据交易哈希的固定长度值进行数据读取,而是使用后标记字符将隐匿化数据中的交易哈希与备注信息(非敏感内容)进行区隔,以便进行区分。The function of the above-mentioned post-mark character is that when the hidden data includes remark information (or the non-sensitive content mentioned later), it is not necessary to read the data according to the fixed-length value of the transaction hash, but the post-mark is used. Characters separate transaction hashes in masked data from remarks (non-sensitive content) for easy differentiation.
需要说明的是,上述的前标记字符与后标记字符可以根据实际需要进行指定。例如,所述前标记字符可以为“0E”,所述后标记字符可以为“0F”。It should be noted that, the above-mentioned pre-marked characters and post-marked characters can be specified according to actual needs. For example, the preceding marker character may be "OE" and the last marker character may be "0F".
实施例二Embodiment 2
在本说明书中,所述隐匿化数据中也可以不包括实施例一中所述的前标记字符以及后标记字符,而是采用其他手段对某个交易存储位置上存储的是交易还是隐匿化数据进行标记。In this specification, the concealed data may not include the pre-marked characters and the post-marked characters described in the first embodiment, and other means are used to determine whether the transaction or concealed data is stored in a transaction storage location. mark.
具体地,预先针对块链中的每个交易存储位置,在该交易存储位置创设内容字段和标识字段,内容字段用于存储交易或基于所述交易生成的隐匿化数据,标识字段用于存储第一标识符或第二标识符,对该内容字段中是交易还是隐匿化数据进行标识。Specifically, for each transaction storage location in the blockchain, a content field and an identification field are created in the transaction storage location in advance. The content field is used to store the transaction or the hidden data generated based on the transaction, and the identification field is used to store the first An identifier or a second identifier that identifies whether the content field is transaction or masked data.
其中,当所述内容字段包括交易时,所述标识字段包括第一标识符,当所述内容字段包括基于所述交易生成的隐匿化数据时,所述标识字段包括第二标识符。Wherein, when the content field includes a transaction, the identification field includes a first identifier, and when the content field includes masking data generated based on the transaction, the identification field includes a second identifier.
图5是本说明书实施例提供的另一种对写入块链的交易进行隐匿的方法的流程示意图,包括如下步骤:FIG. 5 is a schematic flowchart of another method for concealing transactions written into a block chain provided by an embodiment of this specification, including the following steps:
S500:接收包含目标交易标识隐匿指令,并确定存储所述目标交易标识对应的交易的交易存储位置,作为目标交易存储位置。S500: Receive a concealment instruction including a target transaction identifier, and determine a transaction storage location for storing the transaction corresponding to the target transaction identifier as a target transaction storage location.
在本说明书中,针对块链中的每个交易存储位置,该交易存储位置存储有内容字段以及标识字段,若所述内容字段包含交易,则所述标识字段包含第一标识符。In this specification, for each transaction storage location in the blockchain, the transaction storage location stores a content field and an identification field, and if the content field includes a transaction, the identification field includes a first identifier.
S502:根据所述隐匿指令,确定隐匿化数据。S502: Determine the concealed data according to the concealment instruction.
S504:将所述目标交易存储位置的内容字段中的交易替换成所述隐匿化数据。S504: Replace the transaction in the content field of the target transaction storage location with the anonymized data.
S506:将所述目标交易存储位置的标识字段中的第一标识符替换成第二标识符。S506: Replace the first identifier in the identification field of the target transaction storage location with the second identifier.
例如,所述第一标识符可以占用两个字节的“FF”,所述第二标识符可以是占用两个字节的“00”。For example, the first identifier may be "FF" occupying two bytes, and the second identifier may be "00" occupying two bytes.
此处对实施例二的有益效果进行分析。在实施例一中,采用在所述隐匿化数据中的交易哈希之前拼接前标记字符的方式,来对某个交易存储位置上存储的是交易还是隐匿化数据进行标记区分。The beneficial effects of the second embodiment are analyzed here. In the first embodiment, a method of splicing pre-marked characters before the transaction hash in the concealed data is used to mark and distinguish whether a transaction or concealed data is stored in a transaction storage location.
但是,实践中,为了避免隐匿化数据中的交易哈希与前标记字符产生“哈希碰撞”(即节点或中心化设备在执行交易隐匿逻辑时,无法区分从交易存储位置读取的字符是前标记字符还是交易哈希中的字符),通常会将前标记字符设置为理论上不会与交易哈希重复的特殊字符,这样的特殊字符一般很长(占用很多字节),给从交易存储位置上读取数据的节点或中心化设备带来很大的负担。However, in practice, in order to avoid "hash collision" between the transaction hash and the pre-marked character in the hidden data (that is, when the node or centralized device executes the transaction hiding logic, it is impossible to distinguish the character read from the transaction storage location is The pre-mark character is still the character in the transaction hash), usually the pre-mark character is set to a special character that theoretically will not be repeated with the transaction hash. Nodes or centralized devices that read the data on the storage location bring a lot of burden.
为此,如果采用实施例二中的方式,不再使用前标记字符与交易哈希进行拼接,而是在交易存储位置上划分出两个独立的字段,即内容字段与标识字段,内容字段用于存储交易或交易被隐匿后替换成的隐匿化数据,标识字段存储用于标识内容字段中是交易还是隐匿化数据的标识符。这样,只需要在标识字段中写入较短的标识符,就可以实现对某个交易存储位置上存储的是交易还是隐匿化数据的标记区分。For this reason, if the method in the second embodiment is adopted, the pre-mark character and the transaction hash are no longer used for splicing, but two independent fields are divided in the transaction storage location, namely the content field and the identification field. The content field uses The identification field stores an identifier used to identify whether the transaction or the concealed data in the content field is used to store the transaction or the concealed data replaced after the transaction is concealed. In this way, it is only necessary to write a short identifier in the identification field to realize the mark distinction of whether the transaction or the hidden data is stored in a certain transaction storage location.
图6是本说明书实施例提供的内容字段与标识字段的示意图。如图6所示,假设目标区块中的交易存储位置1的内容字段存储的是交易,交易存储位置2的内容字段存储的是隐匿化数据,那么,可以根据标识字段进行识别。FIG. 6 is a schematic diagram of a content field and an identification field provided by an embodiment of this specification. As shown in FIG. 6 , assuming that the content field of transaction storage location 1 in the target block stores transactions, and the content field of transaction storage location 2 stores concealed data, the identification field can be used for identification.
实施例三Embodiment 3
基于实施例一与实施例二,还可以对隐匿化数据的构成进行优化。Based on the first embodiment and the second embodiment, the composition of the concealed data can also be optimized.
图7是本说明书实施例提供的另一种对写入区块链的交易进行隐匿的方法的流程示意图,包括以下步骤:7 is a schematic flowchart of another method for concealing transactions written into a blockchain provided by an embodiment of this specification, including the following steps:
S700:接收隐匿指令。S700: Receive a concealed instruction.
在本说明书中,所述隐匿指令具体可以包括目标交易标识与隐匿条件。其中,所述隐匿条件用于确定所述目标交易标识对应的交易中的敏感内容。In this specification, the concealment instruction may specifically include a target transaction identifier and concealment conditions. Wherein, the concealment condition is used to determine the sensitive content in the transaction corresponding to the target transaction identifier.
进一步地,所述隐匿条件可以是敏感位置信息,用于表征敏感内容在所述目标交易标识对应的交易中所处的位置。例如,所述敏感位置信息可以是字节范围信息(1,6),表示目标交易标识对应的交易中第1个字节到第6个字节的内容是敏感内容。Further, the concealment condition may be sensitive location information, which is used to represent the location of the sensitive content in the transaction corresponding to the target transaction identifier. For example, the sensitive location information may be byte range information (1, 6), indicating that the content of the first byte to the sixth byte in the transaction corresponding to the target transaction identifier is sensitive content.
S702:获取所述目标交易标识对应的交易的交易哈希,并根据所述隐匿指令包括的隐匿条件,从所述目标交易标识对应的交易中提取非敏感内容。S702: Obtain the transaction hash of the transaction corresponding to the target transaction identifier, and extract non-sensitive content from the transaction corresponding to the target transaction identifier according to the concealment condition included in the concealment instruction.
所述非敏感内容是所述目标交易标识对应的交易中除敏感内容以外的内容。The non-sensitive content is content other than the sensitive content in the transaction corresponding to the target transaction identifier.
S704:根据所述交易哈希与所述非敏感内容,确定隐匿化数据。S704: Determine the concealed data according to the transaction hash and the non-sensitive content.
在步骤S704中,所述隐匿化数据可以只包括所述交易哈希与所述非敏感内容。由于交易哈希一般是固定长度的,因此,一般不会出现交易哈希与所述非敏感内容的混淆。In step S704, the masked data may only include the transaction hash and the non-sensitive content. Since transaction hashes are generally of fixed length, confusion of transaction hashes with the non-sensitive content generally does not occur.
此外,可以结合实施例一,存在以下几种情况:In addition, in conjunction with Embodiment 1, the following situations exist:
1、所述隐匿化数据中还可以包括前标记字符。1. The masked data may also include pre-mark characters.
2、所述隐匿化数据中还可以包括前标记字符、后标记字符。2. The concealed data may also include pre-marked characters and post-marked characters.
其中,后标记字符可以用于将所述交易哈希与所述非敏感内容进行区隔。Wherein, the post-mark character can be used to distinguish the transaction hash from the non-sensitive content.
3、所述隐匿化数据中还可以包括前标记字符、第一后标记字符、第二后标记字符、备注信息。3. The concealed data may further include pre-marked characters, first post-marked characters, second post-marked characters, and remark information.
其中,第一后标记字符可以用于将所述交易哈希与所述非敏感内容进行区隔,第二后标记字符可以用于将所述非敏感内容与所述备注信息进行区隔。Wherein, the first post-mark character can be used to distinguish the transaction hash from the non-sensitive content, and the second post-mark character can be used to distinguish the non-sensitive content from the remark information.
S706:将块链中对应于所述目标交易标识的交易替换成所述隐匿化数据。S706: Replace the transaction corresponding to the target transaction identifier in the block chain with the concealed data.
如此,可以在隐匿所述目标交易标识对应的交易中的敏感内容的前提下,保留所述目标交易标识对应的交易中的非敏感内容,如图8所示。In this way, on the premise of concealing the sensitive content in the transaction corresponding to the target transaction identifier, the non-sensitive content in the transaction corresponding to the target transaction identifier can be retained, as shown in FIG. 8 .
实施例四Embodiment 4
基于实施例三,还可以对所述隐匿化数据的生成方法进行进一步优化。Based on the third embodiment, the method for generating the concealed data can be further optimized.
图9是本说明书实施例提供的一种对写入块链的交易进行隐匿的方法的流程示意图,包括如下步骤:FIG. 9 is a schematic flowchart of a method for concealing transactions written into a block chain provided by an embodiment of this specification, including the following steps:
S900:接收隐匿指令。S900: Receive a hidden command.
S902:获取所述目标交易标识对应的交易的交易哈希,并根据所述隐匿指令包括的隐匿条件,从所述目标交易标识对应的交易中提取非敏感内容。S902: Obtain the transaction hash of the transaction corresponding to the target transaction identifier, and extract non-sensitive content from the transaction corresponding to the target transaction identifier according to the concealment condition included in the concealment instruction.
S904:基于预设的表述方式调整模型,调整所述非敏感内容的表述方式,并根据所述交易哈希与调整后的所述非敏感内容,确定隐匿化数据。S904: Adjust the model based on the preset expression mode, adjust the expression mode of the non-sensitive content, and determine the concealed data according to the transaction hash and the adjusted non-sensitive content.
S906:将块链中对应于所述目标交易标识的交易替换成所述隐匿化数据。S906: Replace the transaction corresponding to the target transaction identifier in the block chain with the concealed data.
其中,所述表述方式调整模型具体可以是预设的表述方式调整规则,例如,所述表述方式调整规则可以是:如果非敏感内容中存在汉字,则将该汉字替换成拼音。又如,所述表述方式调整规则可以是:如果非敏感内容中存在大写英文字母,则将至少一个大写英文字母替换成小写英文字母。The expression mode adjustment model may specifically be a preset expression mode adjustment rule. For example, the expression mode adjustment rule may be: if there is a Chinese character in the non-sensitive content, replace the Chinese character with pinyin. For another example, the expression mode adjustment rule may be: if there is an uppercase English letter in the non-sensitive content, at least one uppercase English letter is replaced with a lowercase English letter.
所述表述方式调整模型具体也可以是预先根据机器学习算法训练的智能模型。Specifically, the expression adjustment model may also be an intelligent model trained in advance according to a machine learning algorithm.
总之,所述表述方式调整模型的作用在于,对所述非敏感内容表述方式进行调整,使得调整后的非敏感内容所传达的信息在调整前的非敏感内容所传达的信息的涵盖范围内。In a word, the function of the expression mode adjustment model is to adjust the expression mode of the non-sensitive content so that the information conveyed by the adjusted non-sensitive content is within the coverage range of the information conveyed by the non-sensitive content before the adjustment.
优选地,调整后的非敏感内容所传达的信息与调整前的非敏感内容所传达的信息可以一致,即非敏感内容的表述方式经过调整后,所传达的信息并未丢失。Preferably, the information conveyed by the adjusted non-sensitive content may be consistent with the information conveyed by the pre-adjusted non-sensitive content, that is, after the expression of the non-sensitive content is adjusted, the conveyed information is not lost.
为了杜绝这种情况出现,对写入隐匿化数据中的非敏感内容的表述方式进行调整,就可以使得不论如何尝试,都无法根据调整后的非敏感内容破解出被隐匿的敏感内容。In order to prevent this from happening, adjusting the expression of the non-sensitive content written in the concealed data can make it impossible to decipher the concealed sensitive content based on the adjusted non-sensitive content no matter how much you try.
实施例五Embodiment 5
基于上述的实施例一~四,可以引入权限验证机制。Based on the above-mentioned first to fourth embodiments, an authority verification mechanism may be introduced.
图10是本说明书实施例提供的一种对写入块链的交易进行隐匿的方法的流程示意图,包括如下步骤:FIG. 10 is a schematic flowchart of a method for concealing transactions written into a block chain provided by an embodiment of this specification, including the following steps:
S1000:接收隐匿指令;S1000: Receive hidden commands;
S1002:获取所述隐匿指令的签名,并判断获取的签名是否满足指定条件,若是,则执行步骤S804,若否,则执行步骤S806。S1002: Acquire the signature of the concealed instruction, and determine whether the acquired signature satisfies the specified condition, if yes, execute step S804, if not, execute step S806.
S1004:根据所述隐匿指令,确定包括所述目标交易标识对应的交易的交易哈希的隐匿化数据,以及,将块链中对应于所述目标交易标识的交易替换成所述隐匿化数据。S1004: Determine, according to the concealment instruction, concealed data including the transaction hash of the transaction corresponding to the target transaction identifier, and replace the transaction corresponding to the target transaction identifier in the block chain with the concealed data.
S1006:拒绝所述隐匿指令。S1006: Reject the concealed instruction.
在实际应用中,可以要求所述隐匿指令必须具有满足指定条件的签名。各区块链节点或中心化设备当确定隐匿指令的签名满足指定条件时,才会执行所述隐匿指令。In practical applications, it may be required that the concealed instruction must have a signature that satisfies a specified condition. Each blockchain node or centralized device will only execute the hidden instruction when it is determined that the signature of the hidden instruction meets the specified conditions.
具体地,所述指定条件可以包括但不限于以下三种情况:Specifically, the specified conditions may include but are not limited to the following three situations:
1、若所述目标交易标识对应的交易是写入区块链的交易,则所述隐匿指令的签名为区块链节点的签名。此时,所述指定条件为获取的签名的数量大于指定数量。1. If the transaction corresponding to the target transaction identifier is a transaction written into the blockchain, the signature of the hidden instruction is the signature of the blockchain node. At this time, the specified condition is that the number of acquired signatures is greater than the specified number.
例如,区块链网络中有10个节点,可以将所述指定数量设置为5,则所述隐匿指令必须得到多于5个节点的认可才有效。For example, if there are 10 nodes in the blockchain network, the specified number can be set to 5, then the hidden instruction must be approved by more than 5 nodes to be valid.
2、若所述目标交易标识对应的交易是写入类区块链的交易,则所述指定条件为获取的签名包括至少两个权限方的签名。2. If the transaction corresponding to the target transaction identifier is a transaction written in a block chain, the specified condition is that the acquired signature includes the signatures of at least two authorized parties.
具体而言,实践中,权限方可以包括法院、中心化设备的控制方、中心化设备的数据存证服务所针对的业务方等。Specifically, in practice, the authorized party may include the court, the controller of the centralized device, the business party targeted by the data storage service of the centralized device, etc.
3、预先为每个权限方的签名分配权重。若所述目标交易标识对应的交易是写入类区块链的交易,则所述指定条件为获取的各签名分别对应的权重之和大于指定权重。3. Pre-allocate weights to the signatures of each authorized party. If the transaction corresponding to the target transaction identifier is a transaction written into a block chain, the specified condition is that the sum of the corresponding weights of the acquired signatures is greater than the specified weight.
例如,可以为法院分配100的权重,为中心化设备的控制方分配50的权重,为业务方分配40的权重。同时,将指定权重设置为60。For example, a court can be assigned a weight of 100, the controller of a centralized device can be assigned a weight of 50, and a business party can be assigned a weight of 40. Also, set the specified weight to 60.
实施例六Embodiment 6
基于实施例一~五中的方法,本说明书实施例提供的一种构建区块对应的梅克尔树的方法,如图11所示,包括:Based on the methods in Embodiments 1 to 5, a method for constructing a Merkle tree corresponding to a block provided by the embodiments of this specification, as shown in FIG. 11 , includes:
S1100:针对目标区块中的每个交易存储位置,从该交易存储位置读取数据。S1100: For each transaction storage location in the target block, read data from the transaction storage location.
S1102:若确定从该交易存储位置读取的数据包括交易,则对读取的数据所包括的交易进行哈希计算,得到该交易存储位置对应的交易哈希。S1102: If it is determined that the data read from the transaction storage location includes a transaction, perform a hash calculation on the transaction included in the read data to obtain a transaction hash corresponding to the transaction storage location.
S1104:若确定从该交易存储位置读取的数据包括隐匿化数据,则从读取的数据所包括的隐匿化数据中提取交易哈希,作为该交易存储位置对应的交易哈希。S1104: If it is determined that the data read from the transaction storage location includes concealed data, extract a transaction hash from the concealed data included in the read data as a transaction hash corresponding to the transaction storage location.
S1106:基于所述目标区块中各交易存储位置分别对应的交易哈希,构建所述目标区块对应的梅克尔树。S1106: Construct a Merkle tree corresponding to the target block based on the transaction hashes corresponding to each transaction storage location in the target block.
实施例七Embodiment 7
基于实施例六,在将目标交易标识对应的交易进行隐匿之后,还可以进一步将所述目标交易标识对应的交易所在的区块的标签确定为指定标签。Based on the sixth embodiment, after the transaction corresponding to the target transaction identifier is concealed, the label of the block where the transaction corresponding to the target transaction identifier is located may be further determined as a designated label.
在本说明书中,块链中的至少部分区块可以具有标签,用于标注该区块中存在至少一个被隐匿的交易。In this specification, at least a part of the block in the blockchain may have a label for indicating that there is at least one hidden transaction in the block.
具体地,可以约定指定标签用于表征区块中存在至少一个被隐匿的交易。在将对应于所述目标交易标识的交易替换成所述隐匿化数据之后,可以判断所述目标交易标识对应的交易所在的区块(目标区块)的标签是否有标签,如果没有标签,就为目标区块分配指定标签。如果有标签,进一步判断是否为指定标签。如果是指定标签,说明所述目标区块中除了所述目标交易标识对应的交易之外,还存在其他已经被隐匿的敏感交易,则不需要对目标区块的标签进行变动;如果不是指定标签,说明目标区块未包含隐匿化数据,则需要将目标区块的标签修改为指定标签。Specifically, a designated label can be agreed to represent that there is at least one hidden transaction in the block. After replacing the transaction corresponding to the target transaction identifier with the concealed data, it can be determined whether the label of the block (target block) where the transaction corresponding to the target transaction identifier is located has a label, and if there is no label, Assign the specified label to the target block. If there is a label, it is further judged whether it is the specified label. If it is a designated label, it means that in addition to the transaction corresponding to the target transaction identifier, there are other hidden sensitive transactions in the target block, and the label of the target block does not need to be changed; if it is not a designated label , indicating that the target block does not contain hidden data, then the tag of the target block needs to be modified to the specified tag.
如此,块链中的区块的标签不是1就是0。如果所述指定标签是1,则当区块包含隐匿化数据时,其标签是1,当区块不包含隐匿化数据时,其标签是0。如果所述指定标签是0,则当区块包含隐匿化数据时,其标签是0,当区块不包含隐匿化数据时,其标签是1。As such, blocks in the blockchain have labels that are either 1 or 0. If the specified label is 1, the label is 1 when the block contains masked data, and the label is 0 when the block does not contain masked data. If the specified label is 0, the label is 0 when the block contains masked data, and the label is 1 when the block does not contain masked data.
将所述目标交易标识对应的交易所在的区块的标签确定为指定标签的作用在于,减轻区块链节点或中心化设备的计算负担。具体而言,倘若不对包含隐匿化数据的区块进行标注,那么,如图11所示的方法,当需要针对目标区块构建梅克尔树时,区块链节点或中心化设备并不明确目标区块中是否包含隐匿化数据,于是,就不得不依次针对所述目标区块中的每个交易存储位置,判断该交易存储位置上存储的是交易还是隐匿化数据,从而采用不同的策略得到该交易存储位置对应的交易哈希。当需要构建梅克尔树的区块很多,而被隐匿的敏感交易很少时,如果针对每个区块都执行如图11所示的方法,那么会浪费很多计算资源。The function of determining the label of the block where the transaction corresponding to the target transaction identifier is located as the designated label is to reduce the computational burden of the blockchain node or the centralized device. Specifically, if the block containing the hidden data is not marked, then, as shown in Figure 11, when the Merkle tree needs to be constructed for the target block, the blockchain node or centralized device is not clear Whether the target block contains hidden data, therefore, it is necessary to determine whether the transaction storage position stores the transaction or the hidden data for each transaction storage location in the target block in turn, so as to adopt different strategies Get the transaction hash corresponding to the transaction storage location. When there are many blocks that need to build a Merkle tree and few sensitive transactions are hidden, if the method shown in Figure 11 is executed for each block, it will waste a lot of computing resources.
而在实施例七中,可以在开始构建任一区块对应的梅克尔树之前,首先根据该区块的标签判断该区块是否包含隐匿化数据,如此,可以当目标区块中不存在被隐匿的敏感交易时,采用默认方式构建目标区块对应的默克尔树(而不是采用图11所示的方式),节省计算资源。In the seventh embodiment, before starting to construct the Merkle tree corresponding to any block, it is possible to first judge whether the block contains hidden data according to the label of the block. In this way, it can be assumed that the target block does not exist For hidden sensitive transactions, the default method is used to construct the Merkle tree corresponding to the target block (instead of the method shown in Figure 11), which saves computing resources.
图12是本说明书实施例提供的一种对写入块链的交易进行隐匿的方法的流程示意图,包括如下步骤:FIG. 12 is a schematic flowchart of a method for concealing transactions written into a block chain provided by an embodiment of this specification, including the following steps:
S1200:接收隐匿指令。S1200: Receive a concealed instruction.
S1202:根据所述隐匿指令,确定隐匿化数据。S1202: Determine the concealed data according to the concealment instruction.
S1204:将块链中对应于所述目标交易标识的交易替换成所述隐匿化数据。S1204: Replace the transaction corresponding to the target transaction identifier in the block chain with the anonymized data.
S1206:将所述目标交易标识对应的交易所在的区块的标签确定为指定标签。S1206: Determine the label of the block where the transaction corresponding to the target transaction identifier is located as the designated label.
图13是本说明书实施例提供的另一种构建区块对应的梅克尔树的方法的流程示意图,包括如下步骤:13 is a schematic flowchart of another method for constructing a Merkle tree corresponding to a block provided by an embodiment of this specification, including the following steps:
S1300:针对块链中的目标区块,获取所述目标区块的标签。S1300: For a target block in the blockchain, obtain a label of the target block.
S1302:若所述目标区块的标签是指定标签,则针对所述目标区块中的每个交易存储位置,从该交易存储位置读取数据。S1302: If the tag of the target block is a designated tag, for each transaction storage location in the target block, read data from the transaction storage location.
S1304:若确定从该交易存储位置读取的数据包括交易,则对读取的数据所包括的交易进行哈希计算,得到该交易存储位置对应的交易哈希。S1304: If it is determined that the data read from the transaction storage location includes a transaction, perform a hash calculation on the transaction included in the read data to obtain a transaction hash corresponding to the transaction storage location.
S1306:若确定从该交易存储位置读取的数据包括隐匿化数据,则从读取的数据所包括的隐匿化数据中提取交易哈希,作为该交易存储位置对应的交易哈希。S1306: If it is determined that the data read from the transaction storage location includes concealed data, extract a transaction hash from the concealed data included in the read data as a transaction hash corresponding to the transaction storage location.
S1308:基于所述目标区块中各交易存储位置分别对应的交易哈希,构建所述目标区块对应的梅克尔树。S1308: Construct a Merkle tree corresponding to the target block based on the transaction hashes corresponding to each transaction storage location in the target block.
进一步地,针对所述目标区块中的每个交易存储位置,若该交易存储位置读取的数据不包括所述前标记字符,则确定从该交易存储位置读取的数据包括交易;若从该交易存储位置读取的数据包括所述前标记字符,则确定从该交易存储位置读取的数据包括隐匿化数据。Further, for each transaction storage location in the target block, if the data read from the transaction storage location does not include the preceding mark character, then determine that the data read from the transaction storage location includes a transaction; The data read from the transaction storage location includes the preceding mark character, and it is determined that the data read from the transaction storage location includes the obscured data.
或者,若从该交易存储位置读取的数据中的标识字段包括第一标识符,则确定从该交易存储位置读取的数据包括交易;若从该交易存储位置读取的数据中的标识字段包括第二标识符,则确定从该交易存储位置读取的数据包括隐匿化数据。Alternatively, if the identification field in the data read from the transaction storage location includes the first identifier, it is determined that the data read from the transaction storage location includes a transaction; if the identification field in the data read from the transaction storage location Including the second identifier, it is determined that the data read from the transaction storage location includes masked data.
在实施例七中,从读取的数据所包括的隐匿化数据中提取交易哈希的方式具体可以是,将读取的数据所包括的隐匿化数据中位于所述前标记字符之后的数据确定为交易哈希并提取;或,将读取的数据所包括的隐匿化数据中位于所述前标记字符之后的指定长度的数据确定为交易哈希并提取。In Embodiment 7, the method of extracting the transaction hash from the concealed data included in the read data may specifically be: determining the data located after the preceding mark character in the concealed data included in the read data. Hash and extract the transaction; or, determine the data of a specified length after the pre-mark character in the concealed data included in the read data as the transaction hash and extract.
其中,所述指定长度为交易哈希的固定长度。The specified length is a fixed length of the transaction hash.
在实施例七中,也可以将读取的数据所包括的隐匿化数据中位于所述前标记字符与所述后标记字符之间的数据确定为交易哈希并提取。In Embodiment 7, the data located between the pre-marked character and the post-marked character in the concealed data included in the read data may also be determined as a transaction hash and extracted.
在实施例七中,若所述目标区块的标签不是指定标签,则采用默认方式构建所述目标区块对应的梅克尔树。In the seventh embodiment, if the label of the target block is not a specified label, a Merkle tree corresponding to the target block is constructed by default.
在实施例七中,进一步地,可以预先创建一个二进制数串,假设块链包括N个区块,那么所述二进制数串至少有N个二进制位,二进制数串的第i个二进制位的值为块链中的第i个区块的标签,i∈[1,N]。In the seventh embodiment, further, a binary number string may be created in advance. Assuming that the block chain includes N blocks, the binary number string has at least N binary digits, and the value of the ith binary digit of the binary number string is is the label of the i-th block in the blockchain, i∈[1, N].
如此,获取所述目标区块的标签方式可以是,确定所述目标区块的序号M;从所述二进制数串中读取第M个二进制位的值,作为所述目标区块的标签。In this way, the method of obtaining the label of the target block may be: determining the serial number M of the target block; reading the value of the Mth binary digit from the binary number string as the label of the target block.
图14是本说明书实施例提供的一种简单支付验证方法的流程示意图,包括如下步骤:14 is a schematic flowchart of a simple payment verification method provided by an embodiment of this specification, including the following steps:
S1400:接收验证请求;所述验证请求包含目标交易标识;S1400: Receive a verification request; the verification request includes a target transaction identifier;
S1402:根据所述验证请求,在自身的区块链中确定所述目标交易标识对应的交易所在的区块,并基于图11或图13所示的方法构建所述区块对应的梅克尔树;S1402: According to the verification request, determine the block in which the transaction corresponding to the target transaction identifier is located in its own blockchain, and construct the Merk corresponding to the block based on the method shown in FIG. 11 or FIG. 13 Er tree;
S1404:基于构建的梅克尔树,针对所述目标交易标识对应的交易进行简单支付验证。S1404: Based on the constructed Merkle tree, perform simple payment verification for the transaction corresponding to the target transaction identifier.
图15是本说明书实施例提供的一种对写入块链的交易进行隐匿的装置的结构示意图,针对块链中的每个交易存储位置,该交易存储位置存储有内容字段以及标识字段,若所述内容字段包含交易,则所述标识字段包含第一标识符,所述装置包括:FIG. 15 is a schematic structural diagram of a device for hiding transactions written into a blockchain provided by an embodiment of this specification. For each transaction storage location in the blockchain, the transaction storage location stores a content field and an identification field. If the content field contains a transaction, the identification field contains a first identifier, and the apparatus includes:
接收模块1501,接收包含目标交易标识隐匿指令,并确定存储所述目标交易标识对应的交易的交易存储位置,作为目标交易存储位置;The receiving module 1501 receives a hidden instruction including a target transaction identifier, and determines a transaction storage location for storing the transaction corresponding to the target transaction identifier, as the target transaction storage location;
确定模块1502,根据所述隐匿指令,确定隐匿化数据;所述隐匿化数据包括所述目标交易标识对应的交易的交易哈希;The determining module 1502 determines concealed data according to the concealment instruction; the concealment data includes the transaction hash of the transaction corresponding to the target transaction identifier;
处理模块1503,将所述目标交易存储位置的内容字段中的交易替换成所述隐匿化数据,以及,将所述目标交易存储位置的标识字段中的第一标识符替换成第二标识符。The processing module 1503 replaces the transaction in the content field of the target transaction storage location with the anonymized data, and replaces the first identifier in the identification field of the target transaction storage location with the second identifier.
所述隐匿指令还包括隐匿条件,用于确定所述目标交易标识对应的交易中的敏感内容;The concealment instruction further includes concealment conditions for determining the sensitive content in the transaction corresponding to the target transaction identifier;
所述确定模块1502,获取所述目标交易标识对应的交易的交易哈希,并根据所述隐匿指令包括的隐匿条件,从所述目标交易标识对应的交易中提取非敏感内容;根据所述交易哈希与所述非敏感内容,确定隐匿化数据。The determining module 1502 obtains the transaction hash of the transaction corresponding to the target transaction identifier, and extracts non-sensitive content from the transaction corresponding to the target transaction identifier according to the concealment condition included in the concealment instruction; according to the transaction Hash with the non-sensitive content to determine the anonymized data.
所述隐匿条件为敏感位置信息,用于表征敏感内容在所述目标交易标识对应的交易中所处的位置。The concealment condition is sensitive location information, which is used to represent the location of the sensitive content in the transaction corresponding to the target transaction identifier.
所述确定模块1502,将预设的后标记字符拼接到所述交易哈希的尾部;将所述非敏感内容拼接到所述后标记字符的尾部;将所述交易哈希、所述后标记字符与所述非敏感内容拼接成的数据确定为隐匿化数据。The determining module 1502 splices a preset post-mark character to the tail of the transaction hash; splices the non-sensitive content to the tail of the post-mark character; splices the transaction hash, the post-mark The data formed by splicing characters and the non-sensitive content is determined to be concealed data.
所述确定模块1502,基于预设的表述方式调整模型,调整所述非敏感内容的表述方式;根据所述交易哈希与调整后的所述非敏感内容,确定隐匿化数据。The determining module 1502 adjusts the model based on the preset expression mode, and adjusts the expression mode of the non-sensitive content; and determines the concealed data according to the transaction hash and the adjusted non-sensitive content.
所述确定模块1502,获取所述隐匿指令的签名,并判断获取的签名是否满足指定条件;若是,则根据所述隐匿指令,确定隐匿化数据;若否,则拒绝所述隐匿指令。The determining module 1502 acquires the signature of the concealment instruction, and judges whether the acquired signature satisfies the specified condition; if so, determines concealed data according to the concealment instruction; if not, rejects the concealment instruction.
若所述目标交易标识对应的交易是写入区块链的交易,则所述隐匿指令的签名为区块链节点的签名,并且,所述指定条件为获取的签名的数量大于指定数量。If the transaction corresponding to the target transaction identifier is a transaction written into the blockchain, the signature of the hidden instruction is the signature of the blockchain node, and the specified condition is that the number of acquired signatures is greater than the specified number.
若所述目标交易标识对应的交易是写入类区块链的交易,则所述指定条件为获取的签名包括至少两个权限方的签名。If the transaction corresponding to the target transaction identifier is a transaction written in a block chain, the specified condition is that the acquired signature includes the signatures of at least two authorized parties.
每个权限方的签名分配有权重;The signature of each authorized party is assigned weight;
若所述目标交易标识对应的交易是写入类区块链的交易,则所述指定条件为获取的各签名分别对应的权重之和大于指定权重。If the transaction corresponding to the target transaction identifier is a transaction written into a block chain, the specified condition is that the sum of the corresponding weights of the acquired signatures is greater than the specified weight.
所述装置还包括:The device also includes:
交易写入模块1504,将封装有所述隐匿指令的隐匿交易写入块链。The transaction writing module 1504 writes the hidden transaction encapsulated with the hidden instruction into the block chain.
所述交易写入模块1504,将封装有所述隐匿指令与所述隐匿化数据的数据哈希的隐匿交易写入块链。The transaction writing module 1504 writes the concealed transaction encapsulated with the data hash of the concealed instruction and the concealed data into the block chain.
所述装置还包括:The device also includes:
标签确定模块1505,将所述目标交易标识对应的交易所在的区块的标签确定为指定标签。The label determination module 1505 determines the label of the block where the transaction corresponding to the target transaction identifier is located as the designated label.
针对块链中的任一区块,若该区块未包含隐匿化数据,则该区块的标签不是所述指定标签。For any block in the blockchain, if the block does not contain concealed data, the label of the block is not the specified label.
设块链包括N个区块,预先创建的二进制数串的第i个二进制位的值为块链中的第i个区块的标签,i∈[1,N]。Assuming that the block chain includes N blocks, the value of the ith binary bit of the pre-created binary string is the label of the ith block in the block chain, i∈[1,N].
图16是本说明苏实施例提供的一种对写入块链的交易进行隐匿的装置的结构示意图,包括:FIG. 16 is a schematic structural diagram of an apparatus for concealing transactions written into a block chain provided by an embodiment of this specification, including:
接收模块1601,接收隐匿指令;所述隐匿指令包含目标交易标识与隐匿条件,所述隐匿条件用于确定所述目标交易标识对应的交易中的敏感内容;The receiving module 1601 receives a concealed instruction; the concealed instruction includes a target transaction identifier and a concealment condition, and the concealment condition is used to determine the sensitive content in the transaction corresponding to the target transaction identifier;
获取提取模块1602,获取所述目标交易标识对应的交易的交易哈希,并根据所述隐匿指令包括的隐匿条件,从所述目标交易标识对应的交易中提取非敏感内容;The acquisition and extraction module 1602 acquires the transaction hash of the transaction corresponding to the target transaction identifier, and extracts non-sensitive content from the transaction corresponding to the target transaction identifier according to the concealment condition included in the concealment instruction;
确定模块1603,根据所述交易哈希与所述非敏感内容,确定隐匿化数据;Determining module 1603, determining concealed data according to the transaction hash and the non-sensitive content;
处理模块1604,将块链中对应于所述目标交易标识的交易替换成所述隐匿化数据。The processing module 1604 replaces the transaction corresponding to the target transaction identifier in the block chain with the anonymized data.
针对块链中的每个交易存储位置,该交易存储位置存储有内容字段以及标识字段,所述内容字段包括交易或基于所述交易生成的隐匿化数据;For each transaction storage location in the blockchain, the transaction storage location stores a content field and an identification field, and the content field includes a transaction or anonymized data generated based on the transaction;
其中,当所述内容字段包括交易时,所述标识字段包括第一标识符,当所述内容字段包括基于所述交易生成的隐匿化数据时,所述标识字段包括第二标识符。Wherein, when the content field includes a transaction, the identification field includes a first identifier, and when the content field includes masking data generated based on the transaction, the identification field includes a second identifier.
所述隐匿条件为敏感位置信息,用于表征敏感内容在所述目标交易标识对应的交易中所处的位置。The concealment condition is sensitive location information, which is used to represent the location of the sensitive content in the transaction corresponding to the target transaction identifier.
所述确定模块1603,将预设的后标记字符拼接到所述交易哈希的尾部;将所述非敏感内容拼接到所述后标记字符的尾部;将所述交易哈希、所述后标记字符与所述非敏感内容拼接成的数据确定为隐匿化数据。The determining module 1603 splices a preset post-mark character to the tail of the transaction hash; splices the non-sensitive content to the tail of the post-mark character; splices the transaction hash, the post-mark The data formed by splicing characters and the non-sensitive content is determined to be concealed data.
所述确定模块1603,基于预设的表述方式调整模型,调整所述非敏感内容的表述方式;根据所述交易哈希与调整后的所述非敏感内容,确定隐匿化数据。The determining module 1603 adjusts the model based on the preset expression method, and adjusts the expression method of the non-sensitive content; and determines the concealed data according to the transaction hash and the adjusted non-sensitive content.
所述确定模块1603,获取所述隐匿指令的签名,并判断获取的签名是否满足指定条件;若是,则根据所述隐匿指令,确定隐匿化数据;若否,则拒绝所述隐匿指令。The determining module 1603 acquires the signature of the concealment instruction, and judges whether the acquired signature satisfies the specified condition; if so, determines concealment data according to the concealment instruction; if not, rejects the concealment instruction.
若所述目标交易标识对应的交易是写入区块链的交易,则所述隐匿指令的签名为区块链节点的签名,并且,所述指定条件为获取的签名的数量大于指定数量。If the transaction corresponding to the target transaction identifier is a transaction written into the blockchain, the signature of the hidden instruction is the signature of the blockchain node, and the specified condition is that the number of acquired signatures is greater than the specified number.
若所述目标交易标识对应的交易是写入类区块链的交易,则所述指定条件为获取的签名包括至少两个权限方的签名。If the transaction corresponding to the target transaction identifier is a transaction written in a block chain, the specified condition is that the acquired signature includes the signatures of at least two authorized parties.
每个权限方的签名分配有权重;The signature of each authorized party is assigned weight;
若所述目标交易标识对应的交易是写入类区块链的交易,则所述指定条件为获取的各签名分别对应的权重之和大于指定权重。If the transaction corresponding to the target transaction identifier is a transaction written into a block chain, the specified condition is that the sum of the corresponding weights of the acquired signatures is greater than the specified weight.
所述装置还包括:The device also includes:
标签确定模块1605,将所述目标交易标识对应的交易所在的区块的标签确定为指定标签。The label determination module 1605 determines the label of the block where the transaction corresponding to the target transaction identifier is located as the designated label.
针对块链中的任一区块,若该区块未包含隐匿化数据,则该区块的标签不是所述指定标签。For any block in the blockchain, if the block does not contain concealed data, the label of the block is not the specified label.
设块链包括N个区块,预先创建的二进制数串的第i个二进制位的值为块链中的第i个区块的标签,i∈[1,N]。Assuming that the block chain includes N blocks, the value of the ith binary bit of the pre-created binary string is the label of the ith block in the block chain, i∈[1,N].
所述装置还包括:The device also includes:
交易写入模块1606,将封装有所述隐匿指令的隐匿交易写入块链。The transaction writing module 1606 writes the hidden transaction encapsulated with the hidden instruction into the block chain.
所述交易写入模块1606,将封装有所述隐匿指令与所述隐匿化数据的数据哈希的隐匿交易写入块链。The transaction writing module 1606 writes the concealed transaction encapsulated with the data hash of the concealed instruction and the concealed data into the block chain.
图17是本说明苏实施例提供的一种对写入块链的交易进行隐匿的装置的结构示意图,包括:FIG. 17 is a schematic structural diagram of an apparatus for concealing transactions written into a block chain provided by an embodiment of this specification, including:
接收模块1701,接收隐匿指令;所述隐匿指令包含目标交易标识与隐匿条件,所述隐匿条件用于确定所述目标交易标识对应的交易中的敏感内容;The receiving module 1701 receives a concealed instruction; the concealed instruction includes a target transaction identifier and a concealment condition, and the concealment condition is used to determine the sensitive content in the transaction corresponding to the target transaction identifier;
获取提取模块1702,获取所述目标交易标识对应的交易的交易哈希,并根据所述隐匿指令包括的隐匿条件,从所述目标交易标识对应的交易中提取非敏感内容;Obtaining and extracting module 1702, obtaining the transaction hash of the transaction corresponding to the target transaction identifier, and extracting non-sensitive content from the transaction corresponding to the target transaction identifier according to the concealment condition included in the concealment instruction;
调整确定模块1703,基于预设的表述方式调整模型,调整所述非敏感内容的表述方式,并根据所述交易哈希与调整后的所述非敏感内容,确定隐匿化数据;The adjustment determination module 1703 adjusts the model based on the preset expression mode, adjusts the expression mode of the non-sensitive content, and determines the concealed data according to the transaction hash and the adjusted non-sensitive content;
处理模块1704,将块链中对应于所述目标交易标识的交易替换成所述隐匿化数据。The processing module 1704 replaces the transaction corresponding to the target transaction identifier in the block chain with the anonymized data.
针对块链中的每个交易存储位置,该交易存储位置存储有内容字段以及标识字段,所述内容字段包括交易或基于所述交易生成的隐匿化数据;For each transaction storage location in the blockchain, the transaction storage location stores a content field and an identification field, and the content field includes a transaction or anonymized data generated based on the transaction;
其中,当所述内容字段包括交易时,所述标识字段包括第一标识符,当所述内容字段包括基于所述交易生成的隐匿化数据时,所述标识字段包括第二标识符。Wherein, when the content field includes a transaction, the identification field includes a first identifier, and when the content field includes masking data generated based on the transaction, the identification field includes a second identifier.
所述隐匿条件为敏感位置信息,用于表征敏感内容在所述目标交易标识对应的交易中所处的位置。The concealment condition is sensitive location information, which is used to represent the location of the sensitive content in the transaction corresponding to the target transaction identifier.
所述调整确定模块1703,将预设的后标记字符拼接到所述交易哈希的尾部;将调整后的所述非敏感内容拼接到所述后标记字符的尾部;将所述交易哈希、所述后标记字符与调整后的所述非敏感内容拼接成的数据确定为隐匿化数据。The adjustment determination module 1703 splices the preset post-mark character to the tail of the transaction hash; splices the adjusted insensitive content to the tail of the post-mark character; splices the transaction hash, The data obtained by splicing the post-marked characters and the adjusted insensitive content is determined to be concealed data.
所述调整确定模块1703,获取所述隐匿指令的签名,并判断获取的签名是否满足指定条件;若是,则根据所述隐匿指令,确定隐匿化数据;若否,则拒绝所述隐匿指令。The adjustment determination module 1703 obtains the signature of the concealed instruction, and judges whether the acquired signature satisfies the specified condition; if so, determines concealed data according to the concealed instruction; if not, rejects the concealed instruction.
若所述目标交易标识对应的交易是写入区块链的交易,则所述隐匿指令的签名为区块链节点的签名,并且,所述指定条件为获取的签名的数量大于指定数量。If the transaction corresponding to the target transaction identifier is a transaction written into the blockchain, the signature of the hidden instruction is the signature of the blockchain node, and the specified condition is that the number of acquired signatures is greater than the specified number.
若所述目标交易标识对应的交易是写入类区块链的交易,则所述指定条件为获取的签名包括至少两个权限方的签名。If the transaction corresponding to the target transaction identifier is a transaction written in a block chain, the specified condition is that the acquired signature includes the signatures of at least two authorized parties.
每个权限方的签名分配有权重;The signature of each authorized party is assigned weight;
若所述目标交易标识对应的交易是写入类区块链的交易,则所述指定条件为获取的各签名分别对应的权重之和大于指定权重。If the transaction corresponding to the target transaction identifier is a transaction written into a block chain, the specified condition is that the sum of the corresponding weights of the acquired signatures is greater than the specified weight.
所述装置还包括:The device also includes:
标签确定模块1705,将所述目标交易标识对应的交易所在的区块的标签确定为指定标签。The label determination module 1705 determines the label of the block in which the transaction corresponding to the target transaction identifier is located as the designated label.
针对块链中的任一区块,若该区块未包含隐匿化数据,则该区块的标签不是所述指定标签。For any block in the blockchain, if the block does not contain concealed data, the label of the block is not the specified label.
设块链包括N个区块,预先创建的二进制数串的第i个二进制位的值为块链中的第i个区块的标签,i∈[1,N]。Assuming that the block chain includes N blocks, the value of the ith binary bit of the pre-created binary string is the label of the ith block in the block chain, i∈[1,N].
所述装置还包括:The device also includes:
交易写入模块1706,将封装有所述隐匿指令的隐匿交易写入块链。The transaction writing module 1706 writes the hidden transaction encapsulated with the hidden instruction into the block chain.
所述交易写入模块1706,将封装有所述隐匿指令与所述隐匿化数据的数据哈希的隐匿交易写入块链。The transaction writing module 1706 writes the concealed transaction encapsulated with the data hash of the concealed instruction and the concealed data into the block chain.
图18是本说明苏实施例提供的一种对写入块链的交易进行隐匿的装置的结构示意图,包括:FIG. 18 is a schematic structural diagram of an apparatus for concealing transactions written into a block chain provided by an embodiment of this specification, including:
接收模块1801,接收隐匿指令;所述隐匿指令包含目标交易标识;The receiving module 1801 receives a concealed instruction; the concealed instruction includes a target transaction identifier;
获取判断模块1802,获取所述隐匿指令的签名,并判断获取的签名是否满足指定条件;Obtaining judgment module 1802, obtaining the signature of the concealed instruction, and judging whether the obtained signature satisfies the specified condition;
第一处理模块1803,若是,则根据所述隐匿指令,确定包括所述目标交易标识对应的交易的交易哈希的隐匿化数据,以及,将块链中对应于所述目标交易标识的交易替换成所述隐匿化数据;The first processing module 1803, if so, according to the concealment instruction, determine the concealment data including the transaction hash of the transaction corresponding to the target transaction identifier, and replace the transaction corresponding to the target transaction identifier in the blockchain into said anonymized data;
第二处理模块1804,若否,则拒绝所述隐匿指令。The second processing module 1804, if not, rejects the concealed instruction.
若所述目标交易标识对应的交易是写入区块链的交易,则所述隐匿指令的签名为区块链节点的签名,并且,所述指定条件为获取的签名的数量大于指定数量。If the transaction corresponding to the target transaction identifier is a transaction written into the blockchain, the signature of the hidden instruction is the signature of the blockchain node, and the specified condition is that the number of acquired signatures is greater than the specified number.
若所述目标交易标识对应的交易是写入类区块链的交易,则所述指定条件为获取的签名包括至少两个权限方的签名。If the transaction corresponding to the target transaction identifier is a transaction written in a block chain, the specified condition is that the acquired signature includes the signatures of at least two authorized parties.
每个权限方的签名分配有权重;The signature of each authorized party is assigned weight;
若所述目标交易标识对应的交易是写入类区块链的交易,则所述指定条件为获取的各签名分别对应的权重之和大于指定权重。If the transaction corresponding to the target transaction identifier is a transaction written into a block chain, the specified condition is that the sum of the corresponding weights of the acquired signatures is greater than the specified weight.
所述第一处理模块1803,获取所述目标交易标识对应的交易的交易哈希;将预设的前标记字符拼接到所述交易哈希的首部;根据所述前标记字符与所述交易哈希拼接成的数据,确定隐匿化数据。The first processing module 1803 obtains the transaction hash of the transaction corresponding to the target transaction identifier; splices a preset pre-mark character to the header of the transaction hash; It is hoped that the spliced data will determine the hidden data.
所述第一处理模块1803,将预设的后标记字符拼接到所述交易哈希的尾部,并且,将备注信息拼接到所述后标记字符的尾部;将所述前标记字符、所述交易哈希、所述后标记字符以及所述备注信息拼接成的数据确定为隐匿化数据。The first processing module 1803 splices the preset post-mark character to the tail of the transaction hash, and splices the remark information to the tail of the post-mark character; splices the pre-mark character, the transaction The data obtained by splicing the hash, the post-mark character and the remark information is determined to be concealed data.
针对块链中的每个交易存储位置,该交易存储位置存储有内容字段以及标识字段,所述内容字段包括交易或基于所述交易生成的隐匿化数据;For each transaction storage location in the blockchain, the transaction storage location stores a content field and an identification field, and the content field includes a transaction or anonymized data generated based on the transaction;
其中,当所述内容字段包括交易时,所述标识字段包括第一标识符,当所述内容字段包括基于所述交易生成的隐匿化数据时,所述标识字段包括第二标识符。Wherein, when the content field includes a transaction, the identification field includes a first identifier, and when the content field includes masking data generated based on the transaction, the identification field includes a second identifier.
所述隐匿指令还包括隐匿条件,用于确定所述目标交易标识对应的交易中的敏感内容;The concealment instruction further includes concealment conditions for determining the sensitive content in the transaction corresponding to the target transaction identifier;
所述第一处理模块1803,获取所述目标交易标识对应的交易的交易哈希,并根据所述隐匿指令包括的隐匿条件,从所述目标交易标识对应的交易中提取非敏感内容;根据所述交易哈希与所述非敏感内容,确定隐匿化数据。The first processing module 1803 obtains the transaction hash of the transaction corresponding to the target transaction identifier, and extracts non-sensitive content from the transaction corresponding to the target transaction identifier according to the concealment condition included in the concealment instruction; The transaction hash and the non-sensitive content are used to determine the concealed data.
所述隐匿条件为敏感位置信息,用于表征敏感内容在所述目标交易标识对应的交易中所处的位置。The concealment condition is sensitive location information, which is used to represent the location of the sensitive content in the transaction corresponding to the target transaction identifier.
所述第一处理模块1803,将预设的后标记字符拼接到所述交易哈希的尾部;将所述非敏感内容拼接到所述后标记字符的尾部;将所述交易哈希、所述后标记字符与所述非敏感内容拼接成的数据确定为隐匿化数据。The first processing module 1803 splices the preset post-mark character to the tail of the transaction hash; splices the non-sensitive content to the tail of the post-mark character; splices the transaction hash, the The data formed by splicing the back-marked characters and the non-sensitive content is determined to be concealed data.
所述第一处理模块1803,基于预设的表述方式调整模型,调整所述非敏感内容的表述方式;根据所述交易哈希与调整后的所述非敏感内容,确定隐匿化数据。The first processing module 1803 adjusts the model based on the preset expression method, and adjusts the expression method of the non-sensitive content; and determines the concealed data according to the transaction hash and the adjusted non-sensitive content.
所述装置还包括:The device also includes:
标签确定模块1805,将所述目标交易标识对应的交易所在的区块的标签确定为指定标签。The label determination module 1805 determines the label of the block where the transaction corresponding to the target transaction identifier is located as the designated label.
针对块链中的任一区块,若该区块未包含隐匿化数据,则该区块的标签不是所述指定标签。For any block in the blockchain, if the block does not contain concealed data, the label of the block is not the specified label.
设块链包括N个区块,预先创建的二进制数串的第i个二进制位的值为块链中的第i个区块的标签,i∈[1,N]。Assuming that the block chain includes N blocks, the value of the ith binary bit of the pre-created binary string is the label of the ith block in the block chain, i∈[1,N].
所述装置还包括:The device also includes:
交易写入模块1806,将封装有所述隐匿指令的隐匿交易写入块链。The transaction writing module 1806 writes the hidden transaction encapsulated with the hidden instruction into the block chain.
所述交易写入模块1806,将封装有所述隐匿指令与所述隐匿化数据的数据哈希的隐匿交易写入块链。The transaction writing module 1806 writes the concealed transaction encapsulated with the data hash of the concealed instruction and the concealed data into the block chain.
图19是本说明苏实施例提供的一种对写入块链的交易进行隐匿的装置的结构示意图,包括:FIG. 19 is a schematic structural diagram of an apparatus for concealing transactions written into a block chain provided by an embodiment of this specification, including:
接收模块1901,接收隐匿指令;所述隐匿指令包含目标交易标识;The receiving module 1901 receives a concealed instruction; the concealed instruction includes a target transaction identifier;
确定模块1902,根据所述隐匿指令,确定隐匿化数据;所述隐匿化数据包括所述目标交易标识对应的交易的交易哈希;The determining module 1902 determines concealed data according to the concealment instruction; the concealment data includes the transaction hash of the transaction corresponding to the target transaction identifier;
处理模块1903,将块链中对应于所述目标交易标识的交易替换成所述隐匿化数据,以及,将所述目标交易标识对应的交易所在的区块的标签确定为指定标签。The processing module 1903 replaces the transaction corresponding to the target transaction identifier in the block chain with the concealed data, and determines the tag of the block in which the transaction corresponding to the target transaction identifier is located as the designated tag.
所述确定模块1902,获取所述目标交易标识对应的交易的交易哈希;将预设的前标记字符拼接到所述交易哈希的首部;根据所述前标记字符与所述交易哈希拼接成的数据,确定隐匿化数据。The determining module 1902 obtains the transaction hash of the transaction corresponding to the target transaction identifier; splices a preset pre-mark character to the header of the transaction hash; splices the pre-mark character and the transaction hash according to the pre-mark character The generated data is determined to be anonymized data.
所述确定模块1902,将预设的后标记字符拼接到所述交易哈希的尾部,并且,将备注信息拼接到所述后标记字符的尾部;将所述前标记字符、所述交易哈希、所述后标记字符以及所述备注信息拼接成的数据确定为隐匿化数据。The determining module 1902 splices the preset post-mark character to the tail of the transaction hash, and splices the remark information to the tail of the post-mark character; splices the pre-mark character, the transaction hash , the data spliced into the post-marked character and the remark information is determined to be concealed data.
针对块链中的每个交易存储位置,该交易存储位置存储有内容字段以及标识字段,所述内容字段包括交易或基于所述交易生成的隐匿化数据;For each transaction storage location in the blockchain, the transaction storage location stores a content field and an identification field, and the content field includes a transaction or anonymized data generated based on the transaction;
其中,当所述内容字段包括交易时,所述标识字段包括第一标识符,当所述内容字段包括基于所述交易生成的隐匿化数据时,所述标识字段包括第二标识符。Wherein, when the content field includes a transaction, the identification field includes a first identifier, and when the content field includes masking data generated based on the transaction, the identification field includes a second identifier.
所述隐匿指令还包括隐匿条件,用于确定所述目标交易标识对应的交易中的敏感内容;The concealment instruction further includes concealment conditions for determining the sensitive content in the transaction corresponding to the target transaction identifier;
所述确定模块1902,获取所述目标交易标识对应的交易的交易哈希,并根据所述隐匿指令包括的隐匿条件,从所述目标交易标识对应的交易中提取非敏感内容;根据所述交易哈希与所述非敏感内容,确定隐匿化数据。The determining module 1902 obtains the transaction hash of the transaction corresponding to the target transaction identifier, and extracts non-sensitive content from the transaction corresponding to the target transaction identifier according to the concealment condition included in the concealment instruction; according to the transaction Hash with the non-sensitive content to determine the anonymized data.
所述隐匿条件为敏感位置信息,用于表征敏感内容在所述目标交易标识对应的交易中所处的位置。The concealment condition is sensitive location information, which is used to represent the location of the sensitive content in the transaction corresponding to the target transaction identifier.
所述确定模块1902,将预设的后标记字符拼接到所述交易哈希的尾部;将所述非敏感内容拼接到所述后标记字符的尾部;将所述交易哈希、所述后标记字符与所述非敏感内容拼接成的数据确定为隐匿化数据。The determining module 1902 splices a preset post-mark character to the tail of the transaction hash; splices the non-sensitive content to the tail of the post-mark character; splices the transaction hash, the post-mark The data formed by splicing characters and the non-sensitive content is determined to be concealed data.
所述确定模块1902,基于预设的表述方式调整模型,调整所述非敏感内容的表述方式;根据所述交易哈希与调整后的所述非敏感内容,确定隐匿化数据。The determining module 1902 adjusts the model based on the preset expression mode, and adjusts the expression mode of the non-sensitive content; and determines the concealed data according to the transaction hash and the adjusted non-sensitive content.
所述确定模块1902,获取所述隐匿指令的签名,并判断获取的签名是否满足指定条件;若是,则根据所述隐匿指令,确定隐匿化数据;若否,则拒绝所述隐匿指令。The determining module 1902 acquires the signature of the concealment instruction, and judges whether the acquired signature satisfies the specified condition; if so, determines concealment data according to the concealment instruction; if not, rejects the concealment instruction.
若所述目标交易标识对应的交易是写入块链的交易,则所述隐匿指令的签名为块链节点的签名,并且,所述指定条件为获取的签名的数量大于指定数量。If the transaction corresponding to the target transaction identifier is a transaction written into the block chain, the signature of the hidden instruction is the signature of the block chain node, and the specified condition is that the number of acquired signatures is greater than the specified number.
若所述目标交易标识对应的交易是写入类区块链的交易,则所述指定条件为获取的签名包括至少两个权限方的签名。If the transaction corresponding to the target transaction identifier is a transaction written in a block chain, the specified condition is that the acquired signature includes the signatures of at least two authorized parties.
每个权限方的签名分配有权重;The signature of each authorized party is assigned weight;
若所述目标交易标识对应的交易是写入类区块链的交易,则所述指定条件为获取的各签名分别对应的权重之和大于指定权重。If the transaction corresponding to the target transaction identifier is a transaction written into a block chain, the specified condition is that the sum of the corresponding weights of the acquired signatures is greater than the specified weight.
针对块链中的任一区块,若该区块未包含隐匿化数据,则该区块的标签不是所述指定标签。For any block in the blockchain, if the block does not contain concealed data, the label of the block is not the specified label.
设块链包括N个区块,预先创建的二进制数串的第i个二进制位的值为块链中的第i个区块的标签,i∈[1,N]。Assuming that the block chain includes N blocks, the value of the ith binary bit of the pre-created binary string is the label of the ith block in the block chain, i∈[1,N].
所述装置还包括:The device also includes:
交易写入模块1904,将封装有所述隐匿指令的隐匿交易写入块链。The transaction writing module 1904 writes the hidden transaction encapsulated with the hidden instruction into the block chain.
所述交易写入模块1904,将封装有所述隐匿指令与所述隐匿化数据的数据哈希的隐匿交易写入块链。The transaction writing module 1904 writes the concealed transaction encapsulated with the data hash of the concealed instruction and the concealed data into the block chain.
图20是本说明书实施例提供的一种构建区块对应的梅克尔树的装置的结构示意图,包括:20 is a schematic structural diagram of an apparatus for building a Merkle tree corresponding to a block provided by an embodiment of this specification, including:
获取模块2001,针对块链中的目标区块,获取所述目标区块的标签;Obtaining module 2001, for the target block in the blockchain, obtains the label of the target block;
读取模块2002,若所述目标区块的标签是指定标签,则针对所述目标区块中的每个交易存储位置,从该交易存储位置读取数据;其中,所述指定标签表征所述目标区块中存储过至少一个敏感交易,针对每个敏感交易,该敏感交易已被替换成包含该敏感交易的交易哈希的隐匿化数据;The reading module 2002, if the label of the target block is a designated label, then for each transaction storage location in the target block, read data from the transaction storage location; wherein, the designated label represents the At least one sensitive transaction has been stored in the target block, and for each sensitive transaction, the sensitive transaction has been replaced with the hidden data containing the transaction hash of the sensitive transaction;
第一处理模块2003,若确定从该交易存储位置读取的数据包括交易,则对读取的数据所包括的交易进行哈希计算,得到该交易存储位置对应的交易哈希;The first processing module 2003, if it is determined that the data read from the transaction storage location includes a transaction, perform a hash calculation on the transaction included in the read data to obtain a transaction hash corresponding to the transaction storage location;
第二处理模块2004,若确定从该交易存储位置读取的数据包括隐匿化数据,则从读取的数据所包括的隐匿化数据中提取交易哈希,作为该交易存储位置对应的交易哈希;The second processing module 2004, if it is determined that the data read from the transaction storage location includes concealed data, extracts a transaction hash from the concealed data included in the read data, as the transaction hash corresponding to the transaction storage location ;
构建模块2005,基于所述目标区块中各交易存储位置分别对应的交易哈希,构建所述目标区块对应的梅克尔树。The construction module 2005 constructs a Merkle tree corresponding to the target block based on the transaction hashes corresponding to each transaction storage location in the target block.
将所述目标区块中存储的敏感交易替换成隐匿化数据的操作如下:The operation of replacing the sensitive transaction stored in the target block with the hidden data is as follows:
确定所述敏感交易的交易哈希;determining the transaction hash of said sensitive transaction;
将预设的前标记字符拼接到所述交易哈希的首部;splicing a preset pre-mark character to the header of the transaction hash;
根据所述前标记字符与所述交易哈希拼接成的数据,确定隐匿化数据;Determine the concealed data according to the data spliced into the pre-marked character and the transaction hash;
将所述敏感交易替换成确定的隐匿化数据。The sensitive transactions are replaced with certain anonymized data.
根据所述前标记字符与所述交易哈希拼接成的数据,确定隐匿化数据,具体包括:According to the data spliced into the pre-marked character and the transaction hash, determine the concealed data, which specifically includes:
将预设的后标记字符拼接到所述交易哈希的尾部,并且,将备注信息拼接到所述后标记字符的尾部;splicing the preset post-mark character to the tail of the transaction hash, and splicing the remark information to the tail of the post-mark character;
将所述前标记字符、所述交易哈希、所述后标记字符以及所述备注信息拼接成的数据确定为隐匿化数据。The data obtained by splicing the pre-marked characters, the transaction hash, the post-marked characters, and the remark information is determined as concealed data.
所述第一处理模块2003,若从该交易存储位置读取的数据不包括所述前标记字符,则确定从该交易存储位置读取的数据包括交易;The first processing module 2003 determines that the data read from the transaction storage location includes a transaction if the data read from the transaction storage location does not include the preceding mark character;
所述第二处理模块2004,若从该交易存储位置读取的数据包括所述前标记字符,则确定从该交易存储位置读取的数据包括隐匿化数据。The second processing module 2004, if the data read from the transaction storage location includes the preceding mark character, determines that the data read from the transaction storage location includes the concealed data.
所述第二处理模块2004,将读取的数据所包括的隐匿化数据中位于所述前标记字符之后的数据确定为交易哈希并提取;或,将读取的数据所包括的隐匿化数据中位于所述前标记字符之后的指定长度的数据确定为交易哈希并提取。The second processing module 2004 determines and extracts the data located after the pre-marked character in the concealed data included in the read data as transaction hash; or, extracts the concealed data included in the read data The data of the specified length located after the pre-mark character is determined as the transaction hash and extracted.
所述第二处理模块2004,将读取的数据所包括的隐匿化数据中位于所述前标记字符与所述后标记字符之间的数据确定为交易哈希并提取。The second processing module 2004 determines and extracts the data located between the pre-marked character and the post-marked character in the concealed data included in the read data as a transaction hash.
针对块链中的每个交易存储位置,该交易存储位置存储有内容字段以及标识字段,所述内容字段包括交易或基于所述交易生成的隐匿化数据;For each transaction storage location in the blockchain, the transaction storage location stores a content field and an identification field, and the content field includes a transaction or anonymized data generated based on the transaction;
其中,当所述内容字段包括交易时,所述标识字段包括第一标识符,当所述内容字段包括基于所述交易生成的隐匿化数据时,所述标识字段包括第二标识符;Wherein, when the content field includes a transaction, the identification field includes a first identifier, and when the content field includes masked data generated based on the transaction, the identification field includes a second identifier;
所述第一处理模块2003,若从该交易存储位置读取的数据中的标识字段包括第一标识符,则确定从该交易存储位置读取的数据包括交易;The first processing module 2003 determines that the data read from the transaction storage location includes a transaction if the identification field in the data read from the transaction storage location includes the first identifier;
所述第二处理模块2004,若从该交易存储位置读取的数据中的标识字段包括第二标识符,则确定从该交易存储位置读取的数据包括隐匿化数据。The second processing module 2004, if the identification field in the data read from the transaction storage location includes the second identifier, determines that the data read from the transaction storage location includes the concealed data.
所述构建模块2005,若所述目标区块的标签不是指定标签,则采用默认方式构建所述目标区块对应的梅克尔树。The construction module 2005, if the tag of the target block is not a specified tag, constructs the Merkle tree corresponding to the target block in a default manner.
设块链包括N个区块,预先创建的二进制数串的第i个二进制位的值为块链中的第i个区块的标签,i∈[1,N];Suppose the block chain includes N blocks, and the value of the ith binary bit of the pre-created binary string is the label of the ith block in the block chain, i∈[1,N];
所述获取模块2001,确定所述目标区块的序号M;从所述二进制数串中读取第M个二进制位的值,作为所述目标区块的标签。The obtaining module 2001 determines the serial number M of the target block; reads the value of the Mth binary digit from the binary number string as a label of the target block.
图21是本说明书实施例提供的一种简单支付验证装置的结构示意图,包括:21 is a schematic structural diagram of a simple payment verification device provided by an embodiment of this specification, including:
接收模块2101,接收验证请求;所述验证请求包含目标交易标识;The receiving module 2101 receives a verification request; the verification request includes a target transaction identifier;
构建模块2102,根据所述验证请求,在自身的区块链中确定所述目标交易标识对应的交易所在的区块,并基于图11或图13所示的方法构建所述区块对应的梅克尔树;The construction module 2102, according to the verification request, determines the block in which the transaction corresponding to the target transaction identifier is located in its own blockchain, and constructs the block corresponding to the block based on the method shown in FIG. 11 or FIG. 13 . Merkle tree;
验证模块2103,基于构建的梅克尔树,针对所述目标交易标识对应的交易进行简单支付验证。The verification module 2103, based on the constructed Merkle tree, performs simple payment verification for the transaction corresponding to the target transaction identifier.
一种基于类区块链的中心化存储方案,如下:A blockchain-like centralized storage solution is as follows:
S1,接收待存储的数据记录,确定各数据记录的哈希值。S1, receive the data records to be stored, and determine the hash value of each data record.
此处的待存储的数据记录,可以是客户端个人用户的各种消费记录,也可以是应用服务器基于用户的指令,在执行业务逻辑时产生的业务结果、中间状态以及操作记录等等。具体的业务场景可以包括消费记录、审计日志、供应链条、政府监管记录、医疗记录等等。The data records to be stored here can be various consumption records of individual client users, or can be business results, intermediate states, and operation records generated by the application server when executing business logic based on user instructions. Specific business scenarios can include consumption records, audit logs, supply chains, government regulatory records, medical records, and more.
S2,当达到预设的成块条件时,确定待写入区块中的各数据记录,生成包含区块的哈希值和数据记录的第N个区块。S2, when the preset block forming condition is reached, determine each data record to be written in the block, and generate the Nth block including the hash value of the block and the data record.
所述预设的成块条件包括:待存储的数据记录数量达到数量阈值,例如,每接收到一千条数据记录时,生成一个新区块,将一千条数据记录写入块中;或者,距离上一次成块时刻的时间间隔达到时间阈值,例如,每隔5分钟,生成一个新区块,将在这5分钟内接收到的数据记录写入块中。The preset block-forming conditions include: the number of data records to be stored reaches the number threshold, for example, every time a thousand data records are received, a new block is generated, and one thousand data records are written into the block; or, When the time interval from the last block formation time reaches the time threshold, for example, every 5 minutes, a new block is generated, and the data records received within these 5 minutes are written into the block.
此处的N指的是区块的序号,换言之,在本说明书实施例中,区块是以块链的形式,基于成块时间的顺序先后排列,具有很强的时序特征。其中,区块的块高基于成块时间的先后顺序单调递增。块高可以是序号,此时第N个区块的块高即为N;块高也可以其它方式生成。Here, N refers to the serial number of the block. In other words, in the embodiment of this specification, the blocks are in the form of a block chain and are arranged in sequence based on the time of block formation, and have strong timing characteristics. Among them, the block height of the block increases monotonically based on the sequence of block formation time. The block height can be a serial number, and at this time, the block height of the Nth block is N; the block height can also be generated in other ways.
当N=1时,即此时的区块为为初始区块。初始区块的哈希值和块高基于预设方式给定。例如,初始区块中不包含数据记录,哈希值则为任一给定的哈希值,块高blknum=0;又例如,初始区块的生成触发条件与其它区块的触发条件一致,但是初始区块的哈希值由对初始区块中的所有内容取哈希确定。When N=1, that is, the block at this time is the initial block. The hash value and block height of the initial block are given based on a preset method. For example, the initial block does not contain data records, the hash value is any given hash value, and the block height blknum=0; for another example, the generation trigger condition of the initial block is consistent with the trigger conditions of other blocks, But the hash of the initial block is determined by hashing everything in the initial block.
当N>1时,由于前一区块的内容和哈希值已经确定,则此时,可以基于前一区块(即第N-1个区块)的哈希值生成当前区块(第N个区块)的哈希值,例如,一种可行的方式为,确定每一条将要写入第N个块中的数据记录的哈希值,按照在块中的排列顺序,生成一个默克尔树,将默克尔树的根哈希值和前一区块的哈希值拼接在一起,再次采用哈希算法,生成当前块的哈希值。又例如,还可以按照块中数据记录的顺序进行拼接并取哈希得到整体数据记录的哈希值,拼接前一区块的哈希值和整体数据记录的哈希值,并对拼接得到的字串进行哈希运算,生成区块的哈希值。When N>1, since the content and hash value of the previous block have been determined, at this time, the current block (th N blocks) hash value, for example, a feasible way is to determine the hash value of each data record to be written in the Nth block, and generate a Merk according to the arrangement order in the block. Merkle tree, the root hash value of the Merkle tree and the hash value of the previous block are spliced together, and the hash algorithm is used again to generate the hash value of the current block. For another example, the hash value of the overall data record can be obtained by splicing and hashing according to the order of the data records in the block, the hash value of the previous block and the hash value of the overall data record can be spliced, and the splicing obtained The string is hashed to generate the hash value of the block.
通过前述的区块的生成方式,每一个区块通过哈希值确定,区块的哈希值由区块中的数据记录的内容、顺序以及前一区块的哈希值决定。用户可以随时基于区块的哈希值发起验证,对于区块中任何内容(包括对于区块中数据记录内容或者顺序的修改)的修改都会造成在验证时计算得到的区块的哈希值和区块生成时的哈希值不一致,而导致验证失败,从而实现了中心化下的不可篡改。Through the aforementioned block generation method, each block is determined by a hash value, and the hash value of a block is determined by the content and sequence of the data records in the block and the hash value of the previous block. Users can initiate verification based on the hash value of the block at any time. Any modification of the content in the block (including the modification of the data record content or sequence in the block) will cause the hash value of the block calculated during verification and The hash value of the block is inconsistent, which leads to the failure of verification, thus realizing the immutability under centralization.
通过生成包括一定数量的数据记录的区块,并且记录下区块生成时的哈希值,从而实现以区块链的方式对数据记录进行中心化的存储。在这种数据存储方式下,每一区块的哈希值依赖于前一区块的哈希值以及自身所包含的数据记录的内容。用户可以基于上述存储形式随时查询自己的数据记录,以及可以依据所述哈希值对指定的区块或者指定的数据记录进行哈希值验证,保证了用户数据的完整性,提高用户体验。By generating a block including a certain number of data records, and recording the hash value when the block is generated, the centralized storage of data records in the form of blockchain is realized. In this data storage method, the hash value of each block depends on the hash value of the previous block and the content of the data records contained in it. Users can query their own data records at any time based on the above storage form, and can perform hash value verification on the specified block or specified data record according to the hash value, which ensures the integrity of user data and improves user experience.
本说明书实施例还提供一种计算机设备,其至少包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,处理器执行所述程序时实现图2、5、7、9~14所示方法的功能。The embodiments of the present specification also provide a computer device, which at least includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein, when the processor executes the program, FIGS. 2 , 5 and 7 are implemented. , the functions of the methods shown in 9 to 14.
图22示出了本说明书实施例所提供的一种更为具体的计算设备硬件结构示意图,该设备可以包括:处理器2210、存储器2220、输入/输出接口2230、通信接口2240和总线2250。其中处理器2210、存储器2220、输入/输出接口2230和通信接口2240通过总线2250实现彼此之间在设备内部的通信连接。FIG. 22 is a schematic diagram of a more specific hardware structure of a computing device provided by an embodiment of this specification. The device may include: a processor 2210 , a memory 2220 , an input/output interface 2230 , a communication interface 2240 and a bus 2250 . The processor 2210 , the memory 2220 , the input/output interface 2230 and the communication interface 2240 realize the communication connection among each other within the device through the bus 2250 .
处理器2210可以采用通用的CPU(Central Processing Unit,中央处理器)、微处理器、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本说明书实施例所提供的技术方案。The processor 2210 may be implemented by a general-purpose CPU (Central Processing Unit, central processing unit), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute related program to implement the technical solutions provided by the embodiments of this specification.
存储器2220可以采用ROM(Read Only Memory,只读存储器)、RAM(Random AccessMemory,随机存取存储器)、静态存储设备,动态存储设备等形式实现。存储器2220可以存储操作系统和其他应用程序,在通过软件或者固件来实现本说明书实施例所提供的技术方案时,相关的程序代码保存在存储器2220中,并由处理器2210来调用执行。The memory 2220 may be implemented in the form of a ROM (Read Only Memory, read only memory), a RAM (Random Access Memory, random access memory), a static storage device, a dynamic storage device, and the like. The memory 2220 may store an operating system and other application programs. When implementing the technical solutions provided by the embodiments of this specification through software or firmware, relevant program codes are stored in the memory 2220 and invoked by the processor 2210 for execution.
输入/输出接口2230用于连接输入/输出模块,以实现信息输入及输出。输入输出/模块可以作为组件配置在设备中(图中未示出),也可以外接于设备以提供相应功能。其中输入设备可以包括键盘、鼠标、触摸屏、麦克风、各类传感器等,输出设备可以包括显示器、扬声器、振动器、指示灯等。The input/output interface 2230 is used for connecting input/output modules to realize information input and output. The input/output/module can be configured in the device as a component (not shown in the figure), or can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, and the like.
通信接口2240用于连接通信模块(图中未示出),以实现本设备与其他设备的通信交互。其中通信模块可以通过有线方式(例如USB、网线等)实现通信,也可以通过无线方式(例如移动网络、WIFI、蓝牙等)实现通信。The communication interface 2240 is used to connect a communication module (not shown in the figure), so as to realize the communication interaction between the device and other devices. The communication module may implement communication through wired means (eg, USB, network cable, etc.), or may implement communication through wireless means (eg, mobile network, WIFI, Bluetooth, etc.).
总线2250包括一通路,在设备的各个组件(例如处理器2210、存储器2220、输入/输出接口2230和通信接口2240)之间传输信息。The bus 2250 includes a path to transfer information between the various components of the device (eg, the processor 2210, the memory 2220, the input/output interface 2230, and the communication interface 2240).
需要说明的是,尽管上述设备仅示出了处理器2210、存储器2220、输入/输出接口2230、通信接口2240以及总线2250,但是在具体实施过程中,该设备还可以包括实现正常运行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述设备中也可以仅包含实现本说明书实施例方案所必需的组件,而不必包含图中所示的全部组件。It should be noted that, although the above-mentioned device only shows the processor 2210, the memory 2220, the input/output interface 2230, the communication interface 2240 and the bus 2250, in the specific implementation process, the device may also include necessary components for normal operation. other components. In addition, those skilled in the art can understand that, the above-mentioned device may only include components necessary to implement the solutions of the embodiments of the present specification, rather than all the components shown in the figures.
本说明书实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现图2、5、7、9~14所示方法的功能。Embodiments of the present specification further provide a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements the functions of the methods shown in FIGS. 2 , 5 , 7 , and 9 to 14 .
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes both persistent and non-permanent, removable and non-removable media, and storage of information may be implemented by any method or technology. Information may be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Flash Memory or other memory technology, Compact Disc Read Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本说明书实施例可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本说明书实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本说明书实施例各个实施例或者实施例的某些部分所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the embodiments of the present specification can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solutions of the embodiments of this specification or the parts that make contributions to the prior art may be embodied in the form of software products, and the computer software products may be stored in storage media, such as ROM/RAM, A magnetic disk, an optical disk, etc., includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments in this specification.
上述实施例阐明的系统、方法、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The systems, methods, modules or units described in the above embodiments may be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementing device is a computer, which may be in the form of a personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation device, email sending and receiving device, game control desktop, tablet, wearable device, or a combination of any of these devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于方法和设备实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的方法实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,在实施本说明书实施例方案时可以把各模块的功能在同一个或多个软件和/或硬件中实现。也可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the method and device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for related parts. The method embodiments described above are only illustrative, and the modules described as separate components may or may not be physically separated. When implementing the solutions of the embodiments of this specification, the functions of each module may be integrated into the same module. or multiple software and/or hardware implementations. Some or all of the modules may also be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
以上所述仅是本说明书实施例的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本说明书实施例原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本说明书实施例的保护范围。The above are only specific implementations of the embodiments of the present specification. It should be pointed out that for those skilled in the art, without departing from the principles of the embodiments of the present specification, several improvements and modifications can be made. These Improvements and modifications should also be regarded as the protection scope of the embodiments of the present specification.
Claims (21)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010581368.7A CN111784350B (en) | 2019-01-31 | 2019-01-31 | Meeker tree corresponding to building block, simple payment verification method and device |
| CN201910100704.9A CN110033264B (en) | 2019-01-31 | 2019-01-31 | Merkle tree corresponding to construction block, simple payment verification method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910100704.9A CN110033264B (en) | 2019-01-31 | 2019-01-31 | Merkle tree corresponding to construction block, simple payment verification method and device |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010581368.7A Division CN111784350B (en) | 2019-01-31 | 2019-01-31 | Meeker tree corresponding to building block, simple payment verification method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110033264A true CN110033264A (en) | 2019-07-19 |
| CN110033264B CN110033264B (en) | 2020-05-05 |
Family
ID=67235498
Family Applications (2)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010581368.7A Active CN111784350B (en) | 2019-01-31 | 2019-01-31 | Meeker tree corresponding to building block, simple payment verification method and device |
| CN201910100704.9A Active CN110033264B (en) | 2019-01-31 | 2019-01-31 | Merkle tree corresponding to construction block, simple payment verification method and device |
Family Applications Before (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010581368.7A Active CN111784350B (en) | 2019-01-31 | 2019-01-31 | Meeker tree corresponding to building block, simple payment verification method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (2) | CN111784350B (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111625258A (en) * | 2020-05-22 | 2020-09-04 | 深圳前海微众银行股份有限公司 | Mercker tree updating method, device, equipment and readable storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106534085A (en) * | 2016-10-25 | 2017-03-22 | 杭州云象网络技术有限公司 | Privacy protection method based on block chain technology |
| CN106899412A (en) * | 2017-03-30 | 2017-06-27 | 北京链银博科技有限责任公司 | A kind of block chain method for secret protection, apparatus and system |
| US20180041520A1 (en) * | 2015-08-31 | 2018-02-08 | Tencent Technology (Shenzhen) Company Limited | Data access method based on cloud computing platform, and user terminal |
| CN108696511A (en) * | 2018-04-24 | 2018-10-23 | 深圳市元征科技股份有限公司 | A kind of public notification of information method, apparatus and relevant device based on block chain |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CA3019642C (en) * | 2016-04-01 | 2023-03-07 | Jpmorgan Chase Bank, N.A. | Systems and methods for providing data privacy in a private distributed ledger |
| KR101950912B1 (en) * | 2016-08-01 | 2019-02-21 | 서강대학교산학협력단 | Verification system and method for transaction based block chain |
| CN106682907A (en) * | 2016-12-10 | 2017-05-17 | 江苏恒为信息科技有限公司 | Comparison and consensus method for block chain data |
| CN107077674B (en) * | 2016-12-29 | 2021-06-11 | 达闼机器人有限公司 | Transaction verification processing method and device and node equipment |
| CN108881449B (en) * | 2018-06-27 | 2021-07-16 | 青岛墨一客区块链有限公司 | An anonymous calling method and system for blockchain |
-
2019
- 2019-01-31 CN CN202010581368.7A patent/CN111784350B/en active Active
- 2019-01-31 CN CN201910100704.9A patent/CN110033264B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20180041520A1 (en) * | 2015-08-31 | 2018-02-08 | Tencent Technology (Shenzhen) Company Limited | Data access method based on cloud computing platform, and user terminal |
| CN106534085A (en) * | 2016-10-25 | 2017-03-22 | 杭州云象网络技术有限公司 | Privacy protection method based on block chain technology |
| CN106899412A (en) * | 2017-03-30 | 2017-06-27 | 北京链银博科技有限责任公司 | A kind of block chain method for secret protection, apparatus and system |
| CN108696511A (en) * | 2018-04-24 | 2018-10-23 | 深圳市元征科技股份有限公司 | A kind of public notification of information method, apparatus and relevant device based on block chain |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111625258A (en) * | 2020-05-22 | 2020-09-04 | 深圳前海微众银行股份有限公司 | Mercker tree updating method, device, equipment and readable storage medium |
| CN111625258B (en) * | 2020-05-22 | 2021-08-27 | 深圳前海微众银行股份有限公司 | Mercker tree updating method, device, equipment and readable storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110033264B (en) | 2020-05-05 |
| CN111784350A (en) | 2020-10-16 |
| CN111784350B (en) | 2024-11-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20210160053A1 (en) | Merkle tree construction methods and apparatuses and simplified payment verification methods and apparatuses | |
| US11108547B2 (en) | Methods and apparatuses for reading blockchain data | |
| TWI706282B (en) | Method and device for concealing transactions written in blockchain, blockchain system, and computer equipment | |
| CN111352935B (en) | A method, device and device for index creation in a blockchain ledger | |
| CN110046509B (en) | Method and device for hiding transaction written into block chain | |
| CN110008743A (en) | Data attribute identification method, device and equipment in a kind of piece of chain type account book | |
| CN110008733B (en) | Method and device for hiding transaction written into block chain | |
| CN110059087B (en) | Data attribute identification method, device and equipment in block chain type account book | |
| CN110059088A (en) | Data attribute identification method, device and equipment in a kind of piece of chain type account book | |
| CN110033264B (en) | Merkle tree corresponding to construction block, simple payment verification method and device | |
| CN110009341B (en) | Method and device for hiding transaction written into block chain | |
| CN110020548B (en) | Method and device for hiding transaction written into block chain | |
| CN110008734B (en) | Method and device for hiding transaction written into block chain | |
| CN110688664B (en) | Authority management method, device and equipment in block chain type account book | |
| HK40039096A (en) | Method and device for hiding transaction written into blockchain | |
| HK40039451A (en) | Method and device for hiding transactions written into blockchain | |
| HK40039450A (en) | Method and device for constructing merkel tree corresponding to block and simple payment verification | |
| CN112307011B (en) | Data storage method, device and equipment | |
| HK40024020A (en) | Authority management method, device and equipment in block chain type account book | |
| HK40024020B (en) | Authority management method, device and equipment in block chain type account book | |
| HK40010919A (en) | Method and device for hiding transaction written into block chain |
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 | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20201015 Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands Patentee after: Innovative advanced technology Co.,Ltd. Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands Patentee before: Advanced innovation technology Co.,Ltd. Effective date of registration: 20201015 Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands Patentee after: Advanced innovation technology Co.,Ltd. Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands Patentee before: Alibaba Group Holding Ltd. |
|
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20240914 Address after: Guohao Times City # 20-01, 128 Meizhi Road, Singapore Patentee after: Ant Chain Technology Co.,Ltd. Country or region after: Singapore Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands Patentee before: Innovative advanced technology Co.,Ltd. Country or region before: Cayman Islands |
|
| TR01 | Transfer of patent right |