Methods and apparatus for generating a transaction address and index tree and determining a transaction recipient

By generating hidden addresses in the modal space and constructing an index tree, the problem of low transaction retrieval efficiency in privacy-preserving blockchain systems is solved, enabling fast and efficient transaction lookup and improving system performance.

CN114723524BActive Publication Date: 2025-12-19ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210356790.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-06
Publication Date
2025-12-19
Estimated Expiration
2042-04-06

AI Technical Summary

Technical Problem

In existing privacy-preserving blockchain systems, transaction retrieval based on hidden addresses is inefficient and struggles to support rapid retrieval in large-scale transactions, thus impacting overall performance.

Method used

By generating hidden addresses in the module space and building an index tree through hierarchical aggregation based on these hidden addresses, the index tree can be used for fast retrieval, thus narrowing the scope of transaction search.

Benefits of technology

It enables rapid retrieval of transactions in the blockchain while protecting privacy, improving the overall performance and efficiency of the system and reducing computational and communication overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114723524B_ABST
    Figure CN114723524B_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide a scheme for hidden address retrieval based on an index tree; in the scheme, a hidden address is generated in a certain module space, so that the target user and the non-target user of a transaction perform certain operations on the hidden address to obtain different properties of the results. Then, based on such a hidden address, layer-by-layer aggregation is performed to construct an index tree, wherein the aggregation does not change the properties of the operation results. When a user wants to find a target transaction belonging to himself, the index tree can be searched along, and branches of the tree that do not contain the target transaction are constantly excluded, thereby narrowing the range of branches containing the target transaction, and the target transaction belonging to the user can be quickly retrieved without traversing all transactions in the block.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] One or more embodiments of the present specification relate to the field of blockchain, and in particular, to a method and apparatus for generating an implicit address for a transaction in a blockchain and determining a transaction receiver based on the implicit address. BACKGROUND

[0002] A blockchain is a tamper-proof, shared digital ledger used to record transactions in a public or private peer-to-peer network. The ledger is distributed to all member nodes in the network, and a permanent record of asset transactions that occur in the network is recorded in blocks. Since the ledger is completely open, the blockchain ledger itself has no privacy protection function, and additional technology is needed to protect the privacy of asset transactions.

[0003] In order to protect the privacy of the receiver, an implicit address is used in some schemes to ensure identity anonymity. The principle of the implicit address is that the sender generates a one-time address for each transaction, so that even if multiple transactions are made with the same receiver, unrelated parties cannot distinguish them. Therefore, the implicit address helps to protect the privacy of the cryptocurrency payment receiver and the details of their assets. The semantic security of the implicit address scheme requires that an external observer cannot distinguish the selected user after observing the corresponding implicit address field. The search time of the existing semantically secure implicit address scheme is linearly related to the total number of all implicit address transactions. This makes it very difficult to retrieve from large-scale transactions.

[0004] Therefore, it is desirable to have an improved scheme that can support fast retrieval of batch transactions based on implicit addresses, thereby improving the overall performance of the blockchain system under privacy protection. SUMMARY

[0005] One or more embodiments of the present specification describe a method and apparatus for generating a transaction address, constructing an index tree, and determining a transaction receiver, which can support fast retrieval of batch transactions based on implicit addresses, thereby improving the overall performance of the blockchain system under privacy protection.

[0006] According to a first aspect, a method for generating a blockchain transaction based on privacy protection is provided, comprising:

[0007] obtaining a first public key of a first user, the first user being a target receiver of a current transaction, the first public key including a first numerical value defining a first modular space, and a first basis element group;

[0008] performing a first operation in the first modular space based on the first basis element group to generate an implicit address corresponding to the first user; the implicit address satisfies that the result of a predetermined operation on it in the first modular space using a first private key corresponding to the first public key is not 1;

[0009] obtaining a second public key of a second user, the second user being any user in the user set except the first user, the second public key including a second numerical value defining a second modulus space, and a second basis element group;

[0010] performing a second operation in the second modulus space based on the second basis element group to generate a second user corresponding hidden address; the hidden address satisfies that a result of a predetermined operation on it in the second modulus space using a second private key corresponding to the second public key is equal to 1;

[0011] aggregating each hidden address corresponding to each user in the user set to obtain an aggregated result as a receiving address of the current transaction; wherein the receiving address satisfies that a modulus result in a modulus space corresponding to the user is equal to the hidden address corresponding to the user.

[0012] According to a second aspect, a method for generating a block index tree in a blockchain is provided, comprising:

[0013] obtaining n receiving addresses corresponding to n transactions contained in a current block, wherein the receiving address of any transaction in the n transactions satisfies that a modulus result in a modulus space corresponding to each user in a user set is equal to a hidden address corresponding to the user; wherein the user set includes a first user as a target receiver of the transaction and a second user except the first user, the hidden address corresponding to the first user satisfies that a result of a predetermined operation on it in a first modulus space using a private key of the first user is not equal to 1; and the hidden address corresponding to the second user satisfies that a result of a predetermined operation on it in a second modulus space using a private key corresponding to the second user is equal to 1;

[0014] generating a root node by generating upper level nodes layer by layer using the n receiving addresses as node values of leaf nodes, until the root node is obtained; wherein generating the upper level nodes layer by layer includes aggregating node values of two adjacent nodes in a current level in a full modulus space to obtain a node value of a parent node of the two nodes in an upper level, wherein the full modulus space is an aggregated space of modulus spaces corresponding to each user in the user set;

[0015] recording an index tree formed from the leaf nodes to the root node.

[0016] According to a third aspect, a method for determining a transaction receiver in a block is provided, executed by a device corresponding to a target user, comprising:

[0017] obtaining an index tree corresponding to a current block, leaf nodes of the index tree corresponding to n receiving addresses corresponding to n transactions contained in the current block, a node value of any parent node being obtained based on an aggregation result of node values of two child nodes in a full modulus space, the full modulus space being an aggregated space of modulus spaces corresponding to each user in a user set;

[0018] starting from a root node of the index tree, searching the index tree along a path constituted by target nodes until a leaf node layer, wherein a node value of the target node satisfies that a result of a target operation on the target node value in a target module space corresponding to the target user by using a private key of the target user is not equal to 1;

[0019] determining transactions corresponding to a plurality of leaf nodes satisfying the target node as target transactions with the target user as a receiver.

[0020] According to a fourth aspect, a device for generating a blockchain transaction based on privacy protection is provided, comprising:

[0021] a first obtaining unit configured to obtain a first public key of a first user, the first user being a target receiver of a current transaction, the first public key comprising a first numerical value defining a first module space and a first basis element group;

[0022] a first address generating unit configured to generate a hidden address corresponding to the first user based on the first basis element group performing a first operation in the first module space; the hidden address satisfying that a result of a predetermined operation on the hidden address in the first module space by using a first private key corresponding to the first public key is not 1;

[0023] a second obtaining unit configured to obtain a second public key of a second user, the second user being any user in a user set except the first user, the second public key comprising a second numerical value defining a second module space and a second basis element group;

[0024] a second address generating unit configured to generate a hidden address corresponding to the second user based on the second basis element group performing a second operation in the second module space; the hidden address satisfying that a result of a predetermined operation on the hidden address in the second module space by using a second private key corresponding to the second public key is equal to 1;

[0025] an aggregating unit configured to aggregate the hidden addresses corresponding to each user in the user set, and taking an aggregation result as a receiving address of the current transaction; wherein a modulo result of the receiving address in a module space corresponding to each user is equal to the hidden address corresponding to the user.

[0026] According to a fifth aspect, a device for generating an index tree of a block in a blockchain is provided, comprising:

[0027] An address obtaining unit is configured to obtain n receiving addresses corresponding to n transactions contained in a current block, wherein a receiving address of any transaction in the n transactions satisfies that a modulo result of a user in a user set in a modulo space is equal to a hidden address corresponding to the user; wherein the user set includes a first user as a target receiver of the transaction and a second user other than the first user, the hidden address corresponding to the first user satisfies that a result of a predetermined operation on the hidden address in a first modulo space by using a private key of the first user is not 1, and the hidden address corresponding to the second user satisfies that a result of a predetermined operation on the hidden address in a second modulo space by using a private key of the second user is equal to 1;

[0028] A node generating unit is configured to generate a root node by generating upper-level nodes layer by layer with the n receiving addresses as node values of leaf nodes, wherein generating the upper-level nodes layer by layer includes aggregating node values of two adjacent nodes in a current level in a full-amount modulo space to obtain a node value of a parent node of the two nodes in an upper level, wherein the full-amount modulo space is an aggregation space of modulo spaces corresponding to users in the user set;

[0029] A recording unit is configured to record an index tree formed from the leaf nodes to the root node.

[0030] According to a sixth aspect, there is provided a device for determining a transaction receiver in a block, deployed in a device corresponding to a target user, comprising:

[0031] An index tree obtaining unit is configured to obtain an index tree corresponding to a current block, leaf nodes of the index tree corresponding to n receiving addresses corresponding to n transactions contained in the current block, and a node value of any parent node being obtained based on an aggregation result of node values of two child nodes in a full-amount modulo space, the full-amount modulo space being an aggregation space of modulo spaces corresponding to users in a user set;

[0032] A retrieving unit is configured to retrieve the index tree along a path constituted by target nodes starting from a root node of the index tree until a leaf node layer, wherein a node value of the target node satisfies that a result of a target operation on the node value in a target modulo space corresponding to the target user by using a private key of the target user is not equal to 1;

[0033] A determining unit is configured to determine transactions corresponding to a plurality of leaf nodes satisfying the target node as target transactions with the target user as a receiver.

[0034] According to a seventh aspect, there is provided a computer-readable storage medium having a computer program stored thereon, when the computer program is executed in a computer, the computer is caused to execute the method of any one of the first aspect to the third aspect.

[0035] According to an eighth aspect, there is provided a computing device comprising a memory and a processor, the memory having stored therein executable code which, when executed by the processor, implements the method of any one of the first aspect to the third aspect.

[0036] In the embodiments of the present specification, a scheme for hidden address retrieval based on an index tree is proposed; in the scheme, a hidden address is generated in a certain module space, so that the target user and the non-target user of a transaction obtain different properties of results by performing certain operations on the hidden address; then based on such a hidden address, layer-by-layer aggregation is performed to construct an index tree, wherein the aggregation does not change the properties of the operation results. When a user wants to find the target transaction belonging to himself, the index tree can be searched along, and the tree branches not containing the target transaction are constantly excluded, so as to narrow the range of branches containing the target transaction, without traversing all transactions in the block, the target transaction belonging to himself can be quickly retrieved. BRIEF DESCRIPTION OF DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0038] Figure 1 A schematic diagram of a transaction based on a hidden address in a blockchain according to an embodiment is shown;

[0039] Figure 2 A schematic diagram of generating a hidden address and performing hidden address retrieval according to an embodiment is shown;

[0040] Figure 3 A flowchart of a method of generating a transaction in a blockchain system according to an embodiment is shown;

[0041] Figure 4 A flowchart of constructing an index tree according to an embodiment is shown;

[0042] Figure 5 A schematic diagram of an index tree obtained according to an embodiment is shown;

[0043] Figure 6 A flowchart of determining a transaction receiver in a block according to an embodiment is shown;

[0044] Figure 7 A structural schematic diagram of a transaction generation device of a blockchain according to an embodiment is shown;

[0045] Figure 8 A structural schematic diagram of a block index tree generation device according to an embodiment is shown;

[0046] Figure 9 A structure diagram of an apparatus for determining a transaction receiver in a block according to an embodiment is shown. DETAILED DESCRIPTION

[0047] The scheme provided in the present specification is described below with reference to the accompanying drawings.

[0048] Figure 1 A schematic diagram of a transaction in a blockchain based on a stealth address according to an embodiment is shown. As an example, Figure 1 The blockchain C in the above scheme is used to implement digital collectible transactions, where a digital collectible transaction refers to the transfer of the ownership of a digital collectible, and each transaction can include the identification (ID) of the digital collectible to be transferred, without involving an amount. Each user in the blockchain system has his / her corresponding key pair, including a public key pk and a private key sk, where the public key is publicly disclosed, and the private key is held by the user. When user A wants to transfer the ownership of one of his / her digital collectibles to user B through the blockchain C, he / she can issue a transaction including the ID of the digital collectible. In order to protect the privacy of the receiver, user A can obtain the public key pk B of user B, and generate a one-time address, i.e., a stealth address, as the receiver address using the public key pk B and a random number. Then, the transaction is recorded on the blockchain. User B can obtain the transaction information from the chain, and use his / her private key sk B to search for the receiver address of each transaction, and determine the transaction belonging to him / her from the receiver address, so as to obtain the ownership of the digital collectible. Since a random number is introduced each time the receiver address is generated, the stealth addresses of multiple transactions for the same receiver are different. In this way, the privacy of the receiver is effectively protected. It should be understood that although the above describes the framework and schematic process of the stealth address scheme by taking the digital collectible transaction as an example, the stealth address scheme can also be applied to other types and other content of transactions; the present disclosure focuses on the generation and search process of the stealth address, and is not limited to the type and content of the transaction.

[0049] In order to implement the above stealth address generation and search, in an embodiment, the stealth address is generated based on the discrete logarithm in an elliptic curve group. Specifically, the public and private key pair (pk B , sk B ) owned by receiver B satisfies pk B = sk B ·G, where G is a randomly generated generator of an elliptic curve. When sender A wants to transact with receiver B, a random number and a corresponding group element (r A , R A ) are selected, satisfying R A = r AG. Sender A computes and defines the receiver address (stealth address) as T A = H(r A · pk B )G, where H(·) is a cryptographic hash function. Then A signs the transaction and sends it on-chain. When user B comes online, it obtains the receiver address field T A from a transaction on-chain, computes a T' A = H(sk B · R A )G using the private key, and if T' A = T A , then B determines that the transaction belongs to itself and receives the transaction.

[0050] In the above stealth address scheme, the receiver B needs to scan every transaction in the blockchain, take out the receiver address attached to each transaction record, do the corresponding group element multiplication and modular exponentiation operation, and then compare. Under this scheme, the communication overhead and user computing overhead on the chain are linearly related to the transaction volume O(n), where n is the total number of transactions. When the transaction size n on the chain is large, the communication overhead and computing overhead are both large.

[0051] In order to further improve the efficiency of stealth address retrieval while protecting privacy, in an embodiment of the present specification, a stealth address retrieval scheme based on an index tree is proposed; in this scheme, a stealth address is generated in a certain modulus space, so that the target user and non-target user of the transaction perform certain operations on the stealth address to obtain different properties of the results; then based on such a stealth address, layer-by-layer aggregation is performed to construct an index tree, where the aggregation does not change the properties of the operation results. When a user wants to find the target transaction that belongs to himself, he can search along the index tree, constantly exclude tree branches that do not contain the target transaction, thereby narrowing the range of branches that contain the target transaction, and without traversing all transactions in the block, the target transaction that belongs to himself can be quickly retrieved.

[0052] Figure 2 A schematic diagram showing the generation of a stealth address and stealth address retrieval according to an embodiment is shown. As Figure 2As shown, during the initialization phase, each user of the blockchain system generates their own public and private keys, where the public key defines the modulus space corresponding to that user. During the transaction generation phase, the sender generates a transaction Tx for user i, where a hidden address is generated based on user i's public key and the public keys of all other users, serving as the recipient address for this transaction. This hidden address satisfies the property that the result of operations on user i's modulus space differs from the result of operations on other users' modulus spaces. This transaction Tx is recorded in a block. When the block meets the conditions for being added to the blockchain, an index tree construction phase is executed, where an index tree is generated for all transactions in the block. In this index tree, the node values ​​of the leaf nodes correspond to the recipient addresses of each transaction in the block, and the node values ​​of other nodes are obtained by aggregating the node values ​​of their child nodes; this aggregation does not change the property of the result of operations on the corresponding modulus space. Then, during the retrieval phase, when user i wants to determine which transactions in the block belong to them, user i can search along the index tree corresponding to the block. Based on the characteristic that the properties of the results of modulo space operations remain unchanged, tree branches that do not contain the target transaction are continuously eliminated, and the target transaction belonging to them is quickly retrieved.

[0053] The specific implementation process of each stage in this implementation plan is described in detail below.

[0054] First, during the initialization phase of the blockchain system, each user generates their own public and private keys. Assuming there are k users in the entire blockchain system, they can form a user set U = {u1, ..., u2}. k For each user, denoted as u. i The process of generating its public and private keys can be performed as follows.

[0055] The user u i Based on the system's preset security parameters, two prime numbers, for example, λ bits, can be randomly generated and denoted as the first prime number p. i Second prime number q i These two prime numbers (which must be odd) can be represented as p. i =2p′ i +1, q i =2q′ i +1, where p′ i ,q′ i These can be considered as auxiliary elements used to help generate these two prime numbers, and are respectively called the first auxiliary element p′. i Second auxiliary element q′ i Calculate the product N of these two prime numbers. i =p i q i The value N i This serves as the size of the module space corresponding to that user.

[0056] Furthermore, a product N′ is calculated based on the first auxiliary element and the second auxiliary element. i =p′ i q′ i , as an auxiliary value. In N i Group of Ranks In the middle, two N′ are randomly selected. i The element of order g i , g′ i This means that the following equation (1) holds:

[0057]

[0058] Let one element g in equation (1) i Called the first primitive, another element g′ i This is called an intermediate unit. It can be found in the above N... i In the corresponding modulus space, using the second auxiliary element q′ i For the intermediate unit g′ i Perform a setting operation (such as an exponential operation) to obtain another primitive h. i As the second basic unit, it is shown in equation (2) below:

[0059]

[0060] The size N of the above module space can be expressed as a numerical value. i The first primitive g i The second basic unit h i This constitutes the public key corresponding to the user. Therefore, user u i public key pk i =(N i g i h i ), where the value N i Define the module space for this user, g i h i This can be referred to as its primitive set. Furthermore, the user u is set... i The corresponding private key is equal to the first auxiliary element mentioned above, which is given by the following equation (3):

[0061] sk i =p′ i (3)

[0062] Combining the above (1)-(3), we can obtain that the second elementary element h i If user u is used i private key sk i =p′ i In N i When a setting operation is performed on it in the modulo space, the result must be equal to 1, that is, the following equation (4) holds:

[0063]

[0064] Each user generates a corresponding public key and private key in the above manner. Each user discloses its public key and sends it to the chain, and an aggregate public key N = Π i N i is calculated. The aggregate public key can be synchronized to each user in the user set U.

[0065] The above realizes the initialization of the key in the blockchain system. After that, the user can use the public and private keys generated by the initialization to issue a transaction in the blockchain system. The process of generating a transaction is described below.

[0066] Figure 3 A method flowchart for generating a transaction in a blockchain system according to an embodiment is shown. The method flowchart can be executed by a user device of a transaction issuer. As Figure 3 shown, to generate a transaction, in step 31, the public key of the target recipient of the current transaction is obtained. In the following text, for the sake of clarity and distinction, the target recipient is referred to as a first user, denoted as user u t , then according to the above initialization process, the first public key of the first user u t is pk t = (N t , g t , h t ), which includes the first number N t defining the first modular space, and the first base element tuple (g t , h t ).

[0067] In step 32, a first operation is performed in the first modular space based on the first base element tuple to generate a hidden address corresponding to the first user; so that the hidden address satisfies that the result of a predetermined operation on it in the first modular space using the first private key corresponding to the first public key is not 1.

[0068] In an embodiment, for the first base element g t and the second base element h t in the first base element tuple (g t , h t ), the above first operation can include performing an exponential operation on the second base element h t using a random number (referred to as a first random number), combining the operation result with the first base element g t , and obtaining the modulo result of the combined result in the first modular space as the hidden address H t of the transaction corresponding to the user u t . Exemplarily, the process can be represented as formula (5):

[0069]

[0070] Where, r t It is the first random number.

[0071] The primitive h of any user i shown by equation (4) i The properties can be derived if user u is used. t private key sk t =p′ t In N t In the modulo space, the hidden address H t Perform the aforementioned settings, because The part must be 1, therefore the final result depends on This part makes the final result not equal to 1. Therefore, the hidden address H t If the result of performing the aforementioned predetermined operation on the first private key corresponding to the first public key in the first modulus space is not 1, then the condition is met.

[0072] Furthermore, in step 33, the second public key of the second user is obtained, wherein the second user is any user in the user set U other than the aforementioned first user. For the sake of distinction, any second user is denoted as u. j Then the second user u j The second public key is pk j =(N j g j h j This includes the second numerical value N that defines the second modulus space. j and the second primitive (g) j h j ).

[0073] In step 34, a second operation is performed on the second primitive group in the second modular space to generate the hidden address corresponding to the second user; such that the hidden address satisfies the condition that the result of a predetermined operation performed on it in the second modular space using the second private key corresponding to the second public key is equal to 1.

[0074] In one embodiment, for the second primitive (g) j h j The third primitive g in ) j and the fourth element h j The second operation mentioned above may include using another random number (called the second random number) to perform an operation on the fourth primitive h. j Perform an exponential operation and obtain the modulo result of the exponential operation in the second modulo space, which serves as the transaction corresponding to user u. j Hidden address H j For example, the process can be represented by equation (6):

[0075]

[0076] Where, r j It is the second random number.

[0077] It should be understood that the primitive h of any user shown according to equation (4) i The properties can be derived if user u is used. j private key sk j =p′ j In N j In the modulo space, the hidden address H j Perform the aforementioned settings operation, and you will have The hidden address H must be 1. j If the result of performing the aforementioned predetermined operation on the second modulus space using the second private key corresponding to the second public key is equal to 1.

[0078] After generating the corresponding hidden address for each second user in the user set U according to steps 33-34 above, in step 35, the hidden addresses corresponding to each user in the user set are aggregated, and the aggregation result is used as the receiving address of the current transaction; wherein, the modulo result of the receiving address in the modulo space corresponding to each user is equal to the hidden address corresponding to that user.

[0079] In one embodiment, the hidden addresses corresponding to each user can be aggregated according to the Chinese Remainder Theorem to obtain the following aggregated address Y as the receiving address, where the aggregated address satisfies:

[0080]

[0081] The aggregate address Y obtained according to equation (7) satisfies that the modulo result in the modulo space corresponding to each user is equal to the hidden address corresponding to that user. Based on the above hidden address generation process for each user, it can be concluded that the aggregate address Y generated above satisfies that, for the target receiving user of the transaction (first user u)... t For example, if we use its private key sk t In the user's module space N t The aforementioned pre-defined operation is performed on the aggregate address Y, and the result is not 1; for the non-target receiving user of the transaction (second user u) j For example, if we use its private key sk j In the user's module space N j The aforementioned pre-defined operation is performed on the aggregate address Y, and the result is equal to 1.

[0082] Thus, the transaction issuer generates the receiving address Y of the current transaction through the above steps. The transaction issuer can fill the receiving address into the receiver address field of the current transaction T, sign the entire content of the transaction in a conventional manner, and thus generate a transaction. As mentioned above, the transaction can be an ownership transfer transaction not involving an amount, such as a transaction for transferring the ownership of a digital collectible; in some scenarios, it can also be a transaction involving an amount or an amount, which is not limited herein. Then, the transaction issuer can send the current transaction to a node device in the blockchain system, so that the transaction is packaged in a certain block and recorded on the chain.

[0083] The construction process of the index tree of the block is described below.

[0084] It can be understood that each user device sends the transaction generated by it to the node device, and the node device checks each transaction received, and records the transaction that passes the check in the latest block in a certain format. When the block meets the conditions for block generation and chain recording, the node device can construct the index tree corresponding to the block based on all transactions contained in the block.

[0085] Figure 4 A flowchart for constructing an index tree according to an embodiment is shown, which can be performed by a node device. As shown in Figure 4 To construct the index tree, in step 41, n receiving addresses corresponding to n transactions contained in the current block are obtained.

[0086] It can be understood that the receiving address of each of the n transactions is generated according to Figure 3 Thus, the receiving address Y of any transaction Tx satisfies that the result of taking modulo in the modulo space corresponding to each user in the user set U is equal to the hidden address corresponding to the user; further, the hidden address corresponding to each user satisfies that, for the target receiver of the transaction Tx, i.e., the first user, if a predetermined operation is performed on the hidden address of the first user in the corresponding first modulo space using the private key of the first user, the result is not 1; for any second user other than the target receiver, if the predetermined operation is performed on the hidden address of the second user in the second modulo space using the private key corresponding to the second user, the result is equal to 1.

[0087] Next, in step 42, the n receiving addresses of the n transactions are taken as the node values of the leaf nodes, and the nodes of the previous level are generated layer by layer until the root node is obtained; wherein, generating the nodes of the previous level layer by layer includes aggregating the node values of two adjacent nodes in the current level in the full-amount modulo space to obtain the node value of the parent node of the two nodes in the previous level, wherein the full-amount modulo space is an aggregation space of the modulo spaces corresponding to each user in the user set, i.e., the aforementioned aggregation public key N = Π i N iThe defined module space.

[0088] In one specific implementation, step 42 can include the following sub-steps.

[0089] In step 421, n leaf nodes and their node values are generated. It is assumed that the current block contains n = 2 t pen transactions, whose corresponding n receiver fields are respectively denoted as Y1, Y2, …, Y n n leaf nodes are generated, and each leaf node Leaf i (1≤i≤n) can record the data pair (T i , Y i ) composed of its transaction number and receiver address, for storing the transaction T i and its corresponding receiver address Y i . The receiver address recorded in the leaf node can be taken as the node value of the node.

[0090] In step 422, for the current level, the node values of two adjacent nodes are aggregated in the full module space N to obtain the node value of the parent node of the two nodes in the previous level. Specifically, for two adjacent transactions Y 2i-1 , Y 2i , they are combined into one element through modulo N multiplication, i.e., a combined element Y (2i-1,2i) = Y 2i-1 Y 2i mod N is calculated as the node value of the parent node of the two nodes. Wherein, N is the full module space corresponding to the aforementioned aggregation public key. If the current level is the leaf node level, then this step can obtain n / 2 parent nodes in the previous level, whose node values are Y (1,2) , Y (3,4) , …, Y (n-1,n) .

[0091] In step 423, it is determined whether the root node is reached. If not, step 422 is repeated. Until the node values of all leaf nodes are aggregated into one element as the node value of the root node Root = Y (1,2,…,n) .

[0092] Therefore, in step 43, the index tree formed from the leaf node to the root node is recorded.

[0093] In one embodiment, the index tree can be recorded in the block header of the current block. The index tree will be included in the entire block and be chained together subsequently.

[0094] In another embodiment, each node device of the blockchain records the index tree locally, for example, in the world state data of the blockchain. Subsequently, the index tree can be provided to the querying user in response to the user's query request.

[0095] Figure 5 A schematic diagram of an index tree obtained according to one embodiment is shown. As shown, for an index tree containing n=2... t The root node of the block for this transaction stores a global index value Y. (1,2,...,n) The first-level index stores the node values ​​of 2 branch nodes, the second-level index stores the node values ​​of 4 nodes, and the i-th-level index stores 2 i The node values ​​of the intermediate nodes are stored at level t, which are leaf nodes. t The receiving address corresponding to each transaction. The node value of each node, except for the leaf nodes, is obtained by aggregating the node values ​​of its two child nodes in a modulo N space.

[0096] As can be understood, the index trees above have a typical binary tree structure; therefore, the examples above are all for cases containing n=2. t The block for each transaction is described. For transactions with a quantity less than 2... t Blocks of this form can be constructed by padding. Specifically, when building the index tree, several padding transactions can be added to the leaf node level so that the number of transactions after padding meets the requirement of 2. t The form is as follows. Furthermore, these fill transactions are merely for filling gaps and do not actually belong to any user; therefore, the corresponding leaf node value (i.e., the receiving address of the fill transaction) can be set to 1. Thus, any operation performed by any user on this receiving address in the corresponding modulo space will result in 1, without affecting the aggregation result described above.

[0097] Using the methods described above, node devices can construct an index tree corresponding to a block. This index tree helps users quickly determine whether the block contains their own transaction and quickly retrieve their transaction. The following describes the process of finding transactions based on the index tree, i.e., determining the recipient of transactions in a block.

[0098] Figure 6 The flowchart illustrates a process for determining the recipient of a transaction in a block according to one embodiment. This process can be performed via a device corresponding to a target user. The target user can be any user currently online who wishes to find transactions belonging to them.

[0099] like Figure 6 As shown, firstly, in step 61, the index tree corresponding to the current block is obtained. This index tree can be obtained through the aforementioned combination... Figure 3 The method of generation has, for example Figure 5The index tree takes the form shown. Specifically, the leaf nodes of this index tree correspond to the n receiving addresses corresponding to all n transactions contained in the current block. The node value of any parent node is obtained based on the aggregation result of the node values ​​of its two child nodes in the full modulo space N, where the full modulo space N is the modulo space N corresponding to each user i in the user set. i The aggregation space.

[0100] In one embodiment, the block header of each block records the index tree corresponding to that block. Thus, a target user can read the index tree from the block header of the current block to be queried. In another embodiment, the target user can also send a query request to the node device, which will return the index tree corresponding to the current block.

[0101] Next, in step 62, starting from the root node of the index tree, the index tree is retrieved along the path formed by the target nodes until the leaf node level, where the node value of the target node satisfies the condition that the result of a target operation performed on the target user in the target modulo space corresponding to the target user using the target user's private key is not equal to 1. It will be proven later that the condition satisfied by the target node means that the tree branch starting from that node contains transactions belonging to the target user.

[0102] Specifically, the target user is denoted as user u. i In step 62, the first step is to determine whether the root node is the target node. To do this, the value of the root node is read, i.e., Root = Y. (1,2,…,n) Then, a target operation is applied to it. This target operation may include first calculating the node values ​​for the target modulus space N. i The first modulo result; then, using the target user u i private key sk i =p′ i Perform an exponential operation on the first modulo result and obtain the result of this exponential operation for the target modulo space N. i The second modulo result is used as the result of the target operation. For the root node Root = Y (1,2,…,n) For example, the first modulo result is R. i =Rootmod N i The second modulo result is If S i If the value is 1, then the root node does not belong to the target node, and therefore the current block does not contain any nodes belonging to user u. i The transaction. If S i If ≠ 1, then the root node belongs to the target node, and therefore the current block contains nodes belonging to user u. i The transaction.

[0103] In the case where the root node is determined to be the target node, the next level of nodes is searched to determine the subsequent target node. Specifically, for any current node k at any intermediate level, a target operation is performed on its node value R, i.e., a first modulo result R i = R mod N i and a second modulo result is determined. If the result of the target operation S i is equal to 1, it is determined that the current node k is not the target node, which means that the branch starting from the current node k does not contain a transaction belonging to the user u i . In this case, the current node k and all subsequent nodes thereof can be excluded from the subsequent search range. If the result of the target operation S i is not equal to 1, it is determined that the current node is the target node, which means that the branch starting from the current node k contains a transaction belonging to the user u i . In this case, the search should continue along the current node k.

[0104] In this way, the index tree is searched along the path formed by the target nodes until the leaf node level. Thus, in step 63, the transactions corresponding to the leaf nodes that meet the target nodes are determined as the target transactions received by the target user.

[0105] In the above process of continuously searching for the target nodes, various specific search algorithms can be used, such as breadth-first, depth-first, etc., which are not limited herein. In an embodiment, a first child node of the current target node can be obtained; a target operation is performed on the node value of the first child node using the private key of the target user in the target modulus space; if the result of the target operation is equal to 1, a second child node is determined as the updated current target node; if the result of the target operation is not equal to 1, at least the first child node is determined as the updated current target node. For example, in a specific search scheme, the following iteration step is repeatedly performed. In the iteration step, after the current target node is determined, the next level is entered along a fixed side (e.g., the left side), and the left child node L of the current target node is taken as the current node to continue the determination. If the node L belongs to the target node, it is taken as the current target node, and the iteration step is repeated. If the node L does not belong to the target node, it is determined that the right child node R must belong to the target node, and the right child node R is taken as the current target node, and the iteration step is repeated.

[0106] The effectiveness of the above search method is discussed below.

[0107] Taking two transactions in the leaf node layer of the index tree as an example, it is assumed that the leaf node layer at least includes a leaf node Leaf1 corresponding to transaction T1 and a leaf node Leaf2 corresponding to transaction T2, where the target user corresponding to transaction T1 is u1, the target user corresponding to transaction T2 is u2, the modulus space of the two users is N1 and N2 respectively, and the receiving address of the two transactions is Y1 and Y2 respectively.

[0108] According to the foregoing combination Figure 3 According to the described receiving address construction method, for the user u1, which is the target receiving user of transaction T1, according to formula (5) and formula (7), Y1 satisfies:

[0109]

[0110] The user u1 is not the target receiving user of transaction T2, so according to formula (6) and (7), Y2 satisfies:

[0111]

[0112] According to formula (4) again, if the private key sk1 of the user u1 is used to operate the receiving address in the corresponding modulus space N1, then:

[0113]

[0114] That is, for the transaction T1 belonging to oneself, the operation result is not equal to 1; for the transaction not belonging to oneself, the operation result is equal to 1.

[0115] Further, according to the construction method of the foregoing index tree, the node value of the parent node K of the two leaf nodes Leaf1 and Leaf2 is the aggregation result of the receiving addresses Y1 and Y2 of the two transactions:

[0116] Y (1,2) = Y1Y2 mod N (11)

[0117] Where N is the total modulus space. It should be understood that since the modulus space of each user is the product of two prime numbers randomly generated by each user, the modulus spaces N i of each user are relatively prime. The total modulus space is the product of the modulus spaces of each user, so aggregation in the total modulus space will not affect the nature of the operation result in a single modulus space.

[0118] Therefore, according to formula (10) and (11), the result of the target operation of the user u1 on the node Y (1,2) using the private key sk1 is:

[0119]

[0120] Based on this, it can be further deduced that, based on Y (1,2) The node value aggregated by the continued aggregation also satisfies S i Not equal to 1.

[0121] Through the above analysis process, if a transaction T1 is for a user u1, the receiving address Y1 of the transaction satisfies Y1≠Y1, and the operation result of the private key of the user u1 in the corresponding modulus space is not equal to 1, then the node value aggregated based on the receiving address Y1 in the index tree satisfies S i Not equal to 1. Therefore, the node with the target operation result not equal to 1 can be determined as the target node, and it is determined that the branch thereof contains transactions belonging to the user u1. Conversely, if the m transactions are not for the user u1, then the receiving address of each transaction satisfies Y1≠Y1, and the operation result of the private key of the user u1 in the corresponding modulus space is equal to 1, then the node value aggregated by all or part of the m transactions in the index tree satisfies S i Equal to 1. Therefore, the node with the target operation result equal to 1 is not the target node, and it is impossible for the branch thereof to contain transactions belonging to the user u1.

[0122] In this way, the target node with the target operation result not equal to 1 can be searched in the index tree, and the target transaction belonging to the target user can be quickly located along the path of the target node.

[0123] In actual scenarios, the proportion of transactions belonging to a specific user in all transactions is very low and very sparse. Therefore, the probability of n transactions in a block containing transactions belonging to a specific user is not high, and even if it does, the number of transactions belonging to the specific user is relatively small. According to the above index tree and search process, in the case where the current block does not contain transactions belonging to the target user, the target user only needs to perform the target operation on the root node value to determine such a case, that is, only one operation is required to obtain the result in this case. In the case where the current block contains transactions belonging to the target user, the target user searches layer by layer and constantly excludes the branches of non-target nodes, and reaches the leaf node corresponding to the transaction at the tth layer. The time complexity of the search is O(log2(n)), and n is the total number of transactions. Compared with the conventional technique in which whether the block contains the transaction of the target user or not, the search efficiency of the above search method is greatly improved.

[0124] On the other hand, corresponding to the processes of each of the above stages, the embodiments of the present specification also disclose a device for generating a blockchain transaction based on privacy protection, which can be deployed in any computing unit, platform, server, or device with computing and processing capabilities.Figure 7 A structural schematic diagram of a blockchain transaction generation apparatus according to an embodiment is shown as Figure 7 The apparatus 700 includes:

[0125] A first obtaining unit 71, configured to obtain a first public key of a first user, the first user being a target receiver of a current transaction, the first public key including a first numerical value defining a first modulus space, and a first base element group;

[0126] A first address generation unit 72, configured to perform a first operation in the first modulus space based on the first base element group, to generate a hidden address corresponding to the first user; the hidden address satisfying that a result of a predetermined operation on it in the first modulus space using a first private key corresponding to the first public key is not 1;

[0127] A second obtaining unit 73, configured to obtain a second public key of a second user, the second user being any user in a user set except the first user, the second public key including a second numerical value defining a second modulus space, and a second base element group;

[0128] A second address generation unit 74, configured to perform a second operation in the second modulus space based on the second base element group, to generate a hidden address corresponding to the second user; the hidden address satisfying that a result of a predetermined operation on it in the second modulus space using a second private key corresponding to the second public key is equal to 1;

[0129] An aggregation unit 75, configured to aggregate the hidden addresses corresponding to the respective users in the user set, and take an aggregation result as a receiving address of the current transaction; wherein a modulus result of the receiving address in a modulus space corresponding to each user is equal to the hidden address corresponding to the user.

[0130] In one embodiment, the first base element group includes a first base element and a second base element, the second base element satisfying that a result of the predetermined operation on it in the first modulus space using the first private key is equal to 1; correspondingly, the first address generation unit 72 is configured to perform the following first operation: performing an exponential operation on the second base element based on a first random number, combining the operation result and the first base element, and obtaining a modulus result of the combination result in the first modulus space.

[0131] Further, in one example, the first numerical value is a product of a first prime number and a second prime number, the first prime number and the second prime number being determined based on a first auxiliary element and a second auxiliary element respectively, the first private key being equal to the first auxiliary element; the second base element being determined based on an operation on an intermediate base element in the first modulus space using the second auxiliary element; wherein the first base element and the intermediate base element are both elements of a first auxiliary value order, the first auxiliary value being a product of the first auxiliary element and the second auxiliary element.

[0132] In one embodiment, the second group of base elements includes a third base element and a fourth base element, and the fourth base element satisfies that a result of performing the predetermined operation in the second module space by using the second private key is equal to 1; accordingly, the second address generation unit 74 is configured to perform a second operation of performing an exponential operation on the fourth base element based on the second random number, and obtaining a modulo result of the operation result in the second module space.

[0133] In one example, the current transaction is used to transfer the digital collectible to a target recipient.

[0134] According to another aspect, the embodiments of the present specification also disclose a device for generating a block index tree in a blockchain, deployed in a blockchain node device, which can be implemented as any computing unit, platform, server, device, etc. with computing and processing capabilities. Figure 8 A structural diagram of a device for generating a block index tree according to one embodiment is shown as Figure 8 As shown in the figure, the device 800 includes:

[0135] An address acquisition unit 81 is configured to acquire n receiving addresses corresponding to n transactions contained in a current block, wherein the receiving address of any transaction in the n transactions satisfies that a modulo result in a module space corresponding to each user in a user set is equal to a hidden address corresponding to the user; wherein the user set includes a first user who is a target recipient of the transaction and a second user other than the first user, the hidden address corresponding to the first user satisfies that a result of performing a predetermined operation on the hidden address in a first module space by using a private key of the first user is not 1, and the hidden address corresponding to the second user satisfies that a result of performing a predetermined operation on the hidden address in a second module space by using a private key of the second user is equal to 1;

[0136] A node generation unit 82 is configured to generate a node of an upper level layer by layer by taking the n receiving addresses as node values of leaf nodes, until a root node is obtained; wherein generating a node of an upper level layer by layer includes aggregating node values of two adjacent nodes in a current layer in a total module space to obtain a node value of a parent node of the two nodes in the upper level layer, wherein the total module space is an aggregation space of module spaces corresponding to each user in the user set;

[0137] A recording unit 83 is configured to record an index tree formed from the leaf nodes to the root node.

[0138] In one embodiment, the recording unit 83 is configured to record the index tree in a block header of the current block. In another embodiment, the recording unit 83 is configured to record the index tree in a node device of the blockchain.

[0139] According to yet another aspect, the embodiments of the present specification also disclose a device for determining a transaction receiver in a block, deployed in a device corresponding to a target user. Figure 9 A structural diagram of a device for determining a transaction receiver in a block according to an embodiment is shown in FIG. 9. Figure 9 As shown in FIG. 9, the device 900 includes:

[0140] An index tree obtaining unit 91 configured to obtain an index tree corresponding to a current block, leaf nodes of the index tree corresponding to N receiving addresses corresponding to N transactions contained in the current block, a node value of any parent node being obtained based on an aggregated result of node values of two child nodes in a full-amount modulus space, the full-amount modulus space being an aggregated space of modulus spaces corresponding to respective users in a user set;

[0141] A retrieving unit 92 configured to retrieve the index tree from a root node of the index tree along a path constituted by target nodes until a leaf node layer, wherein a node value of the target node satisfies that a result of a target operation on the target node value in a target modulus space corresponding to the target user using a private key of the target user is not equal to 1;

[0142] A determining unit 93 configured to determine transactions corresponding to a plurality of leaf nodes satisfying the target node as target transactions with the target user as a receiver.

[0143] According to another aspect, the embodiments also provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of at least one of the preceding stages.

[0144] According to still another aspect, the embodiments also provide a computing device including a memory and a processor, the memory having executable code stored therein, and the processor implementing the method of at least one of the preceding stages when executing the executable code.

[0145] Those skilled in the art should be aware that, in one or more examples described above, the functions described in the present specification can be implemented in hardware, software, firmware or any combination thereof. When implemented in software, the functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0146] The above detailed description sets forth the purposes, technical solutions and beneficial effects of the present application. It should be understood that the above detailed description is merely a specific implementation of the present application, and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical solutions of the present application shall be included in the protection scope of the present application.

Claims

1. A method for determining a transaction receiver in a block, executed by a device corresponding to a target user, comprising: obtaining an index tree corresponding to a current block in a blockchain, wherein leaf nodes of the index tree correspond to N receiver addresses corresponding to N transactions contained in the current block, a node value of any parent node is obtained based on an aggregation result of node values of two child nodes of the parent node in a total modulus space, the total modulus space is an aggregation space of modulus spaces corresponding to each user in a user set, a modulus of the aggregation space is equal to a result of multiplying moduli of each modulus space, and the aggregation result is a result of taking modulus of a product of the node values of the two child nodes with respect to the aggregation space; starting from a root node of the index tree, searching the index tree along a path formed by target nodes until a leaf node layer, wherein a node value of the target node satisfies that a result of a target operation on the node value in a target modulus space corresponding to the target user using a private key of the target user is not equal to 1, the target operation comprises: first taking a first modulus result of the node value with respect to the target modulus space; then performing an exponent operation on the first modulus result using the private key of the target user, and obtaining a second modulus result of the exponent operation with respect to the target modulus space; determining transactions corresponding to several leaf nodes satisfying the target node as target transactions with the target user as a receiver.

2. The method of claim 1, wherein, The searching the index tree along the path formed by the target nodes comprises: obtaining a first side child node of a current target node; performing a target operation on a node value of the first side child node in the target modulus space using the private key of the target user; if a result of the target operation is equal to 1, determining a second side child node as an updated current target node; if the result of the target operation is not equal to 1, determining at least the first side child node as the updated current target node.

3. The method of claim 1, wherein, The receiver address of any transaction of the N transactions satisfies that a result of taking modulus of a modulus space corresponding to each user in a user set is equal to a stealth address corresponding to the user; wherein the user set includes a first user as a target receiver of the transaction and a second user other than the first user, and the stealth address corresponding to the first user satisfies that a result of an exponent operation on the stealth address in a first modulus space using a private key of the first user is not equal to 1; the stealth address corresponding to the second user satisfies that a result of an exponent operation on the stealth address in a second modulus space using a private key corresponding to the second user is equal to 1. 4.The method of claim 1, wherein the index tree is recorded in a block header of the current block. 5.The method of claim 1, wherein the index tree is recorded in each node device of the blockchain.

6. The method of claim 3, wherein, Each value defining a modulus space corresponding to each user is relatively prime to each other, and a value defining the total modulus space is a product of the values. 7.The method of claim 3, wherein the first public key of the first user includes a first value defining the first modulus space, and a first primitive group; the stealth address corresponding to the first user is generated based on a first operation of the first primitive group in the first modulus space. ​ The second public key of the second user includes a second numerical value defining a second module space, and a second base element group; The hidden address corresponding to the second user is generated based on a second operation of the second base element group in the second module space.

8. The method of claim 7, wherein the first base element group includes a first base element and a second base element, the second base element satisfying that a result of the exponentiation operation on the second base element in the first module space with a first private key corresponding to the first public key is equal to 1; The first operation includes performing an exponentiation operation on the second base element based on a first random number, combining the operation result and the first base element, and obtaining a modulo result of the combination in the first module space.

9. The method of claim 8, wherein, The first numerical value is a product of a first prime number and a second prime number, the first prime number and the second prime number are determined based on a first auxiliary element and a second auxiliary element respectively, the first private key is equal to the first auxiliary element, the second base element is determined based on an operation on an intermediate base element in the first module space with the second auxiliary element, and the first base element and the intermediate base element are both elements of a first auxiliary value order, the first auxiliary value being a product of the first auxiliary element and the second auxiliary element.

10. The method of claim 7, wherein, The second base element group includes a third base element and a fourth base element, the fourth base element satisfying that a result of the exponentiation operation in the second module space with a second private key corresponding to the second public key is equal to 1; The second operation includes performing an exponentiation operation on the fourth base element based on a second random number, and obtaining a modulo result of the operation in the second module space.

11. The method of claim 1, wherein, The target transaction is used to transfer a digital collectible to the target user.

12. A method for generating a blockchain transaction based on privacy protection, comprising: obtaining a first public key of a first user, the first user being a target receiver of a current transaction, the first public key including a first numerical value defining a first module space, and a first base element group; generating a hidden address corresponding to the first user based on a first operation of the first base element group in the first module space; the hidden address satisfying that a result of an exponentiation operation on the hidden address in the first module space with a first private key corresponding to the first public key is not equal to 1; obtaining a second public key of a second user, the second user being any user in a user set except the first user, the second public key including a second numerical value defining a second module space, and a second base element group; generating a hidden address corresponding to the second user based on a second operation of the second base element group in the second module space; the hidden address satisfying that a result of an exponentiation operation on the hidden address in the second module space with a second private key corresponding to the second public key is equal to 1; aggregating the hidden addresses corresponding to each user in the user set to obtain an aggregation result as a receiving address of the current transaction; wherein a modulo result of the receiving address in a module space corresponding to each user is equal to the hidden address corresponding to the user.

13. The method of claim 12, wherein the first base element group includes a first base element and a second base element, the second base element satisfying that a result of the exponentiation operation on the second base element in the first module space with the first private key is equal to 1. The first operation includes performing an exponentiation operation on the second base element based on a first random number, combining an operation result and the first base element, and obtaining a modulo result of the combination result in a first modulus space.

14. The method of claim 13, wherein, The first number value is a product of a first prime number and a second prime number, the first prime number and the second prime number are determined based on a first auxiliary element and a second auxiliary element respectively, the first private key is equal to the first auxiliary element, the second base element is determined based on an operation on an intermediate base element in the first modulus space using the second auxiliary element, and the first base element and the intermediate base element are both elements of a first auxiliary value order, the first auxiliary value being a product of the first auxiliary element and the second auxiliary element.

15. The method of claim 12, wherein, The second base element group includes a third base element and a fourth base element, and the fourth base element satisfies that a result of the exponentiation operation in the second modulus space using the second private key is equal to 1. The second operation includes performing an exponentiation operation on the fourth base element based on a second random number, and obtaining a modulo result of the operation result in the second modulus space.

16. The method of claim 12, wherein, The current transaction is used to transfer the digital collectible to the target receiver.

17. A method for generating a block index tree in a blockchain, comprising: obtaining n receiving addresses corresponding to n transactions contained in a current block, wherein the receiving address of any transaction in the n transactions satisfies that a modulo result in a modulus space corresponding to each user in a user set is equal to a stealth address corresponding to the user; wherein the user set includes a first user who is a target receiver of the transaction and a second user other than the first user, the stealth address corresponding to the first user satisfies that a result of an exponentiation operation on the stealth address in a first modulus space using a private key of the first user is not equal to 1, and the stealth address corresponding to the second user satisfies that a result of an exponentiation operation on the stealth address in a second modulus space using a private key of the second user is equal to 1; generating a parent node of a current level by aggregating node values of two adjacent nodes in the current level in a total modulus space, until a root node is obtained, wherein the total modulus space is an aggregation space of the modulus spaces corresponding to each user in the user set; recording an index tree formed from the leaf node to the root node.

18. The method of claim 17, wherein, Recording an index tree formed from the leaf node to the root node, comprising: recording the index tree in a block header of the current block.

19. The method of claim 17, wherein, Recording an index tree formed from the leaf node to the root node, comprising: recording the index tree in each node device of the blockchain.

20. The method of claim 17, wherein, The values defining the modulus spaces corresponding to each user are relatively prime to each other, and a value defining the total modulus space is a product of the values.

21. An apparatus for generating a blockchain transaction based on privacy protection, comprising: a first obtaining unit configured to obtain a first public key of a first user, the first user being a target receiver of a current transaction, the first public key including a first number value defining a first modulus space and a first base element group; The first address generating unit is configured to generate a hidden address corresponding to the first user by performing a first operation on the first base group in a first module space; the hidden address satisfies that a result of an exponential operation on the hidden address by using a first private key corresponding to the first public key in the first module space is not 1; The second obtaining unit is configured to obtain a second public key of a second user, the second user being any user in the user set except the first user, and the second public key including a second numerical value defining a second module space and a second base group; The second address generating unit is configured to generate a hidden address corresponding to the second user by performing a second operation on the second base group in the second module space; the hidden address satisfies that a result of an exponential operation on the hidden address by using a second private key corresponding to the second public key in the second module space is equal to 1; The aggregation unit is configured to aggregate the hidden addresses corresponding to the users in the user set, and take an aggregation result as a receiving address of the current transaction; wherein a result of taking modulus of the receiving address in a module space corresponding to each user is equal to the hidden address corresponding to the user.

22. An apparatus for generating a block index tree in a blockchain, comprising: An address obtaining unit configured to obtain n receiving addresses corresponding to n transactions contained in a current block, wherein a receiving address of any transaction in the n transactions satisfies that a result of taking modulus of the receiving address in a module space corresponding to each user in a user set is equal to a hidden address corresponding to the user; wherein the user set includes a first user as a target receiver of the transaction and a second user except the first user, the hidden address corresponding to the first user satisfies that a result of an exponential operation on the hidden address by using a private key of the first user in a first module space is not 1, and the hidden address corresponding to the second user satisfies that a result of an exponential operation on the hidden address by using a private key corresponding to the second user in a second module space is equal to 1; A node generating unit configured to generate a root node by generating upper-level nodes layer by layer with the n receiving addresses as node values of leaf nodes; wherein generating the upper-level nodes layer by layer includes aggregating node values of two adjacent nodes in a current level in a full-amount module space to obtain a node value of a parent node of the two nodes in an upper level, wherein the full-amount module space is an aggregation space of the module spaces corresponding to the users in the user set; A recording unit configured to record an index tree formed from the leaf nodes to the root node.

23. An apparatus for determining a transaction receiver in a block, deployed in a device corresponding to a target user, comprising: An index tree obtaining unit configured to obtain an index tree corresponding to a current block in a blockchain, leaf nodes of the index tree corresponding to n receiving addresses corresponding to n transactions contained in the current block, a node value of any parent node being obtained based on an aggregation result of node values of two child nodes in a full-amount module space, the full-amount module space being an aggregation space of module spaces corresponding to users in a user set, a modulus of the aggregation space being equal to a result of multiplying the moduli of the module spaces, and the aggregation result being a result of taking modulus of a product of the node values of the two child nodes with respect to the aggregation space; The retrieval unit is configured to start from a root node of the index tree, retrieve the index tree along a path constituted by target nodes until a leaf node layer, wherein a node value of the target node satisfies that a result of a target operation on the node value in a target modulus space corresponding to the target user using a private key of the target user is not equal to 1, and the target operation comprises: first, obtaining a first modulus result of the node value with respect to the target modulus space; then, performing an exponential operation on the first modulus result using the private key of the target user, and obtaining a second modulus result of a result of the exponential operation with respect to the target modulus space; The determination unit is configured to determine transactions corresponding to the leaf nodes that satisfy the target node as target transactions with the target user as a receiver.

24. A computing device comprising a memory and a processor, wherein: The memory stores executable code, and the processor executes the executable code to implement the method in any one of claims 1-20.

Citation Information

Patent Citations

  • Service interaction method and system based on blockchain invisible address

    CN111507711A

  • Data transmission method and device, storage medium and electronic equipment

    CN111629084A