Chain structure processing, transaction data processing, data verification method, device and medium

The transaction data merging and cross-chain transaction verification between the UTXO model and the balance model are realized through the chain structure processing method, which solves the problems of consortium chain data merging and cross-chain transaction verification between multiple independent private chains, and ensures the security within the consortium chain. Correct circulation and amount consistency of tokens.

CN113610643BActive Publication Date: 2024-08-27郑杰骞
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110931943.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-13
Publication Date
2024-08-27
Estimated Expiration
2041-08-13

AI Technical Summary

Technical Problem

Existing technology makes it difficult to merge transaction data between consortium chain UTXO models and balance models between multiple independent private chains, especially cross-chain transaction verification between private chains with different algorithms.

Method used

Provide a chain structure processing method, including the transaction data flow of UTXO model and balance model, achieve account consistency between models through transfer in and transfer out transactions, and use algorithms such as Pedersen's commitment to ensure cross-chain transactions Amount consistency and verification correctness.

Benefits of technology

It realizes the merger of transaction data between the UTXO model and the balance model, ensures the correct circulation of tokens within the alliance chain, and ensures the amount consistency and security of cross-chain transactions through verification of different algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113610643B
    Figure CN113610643B
Patent Text Reader

Abstract

The disclosed embodiments provide a method, device and medium for chain structure processing, transaction data processing and data verification, wherein the chain structure is a license chain, and the license chain includes transaction data of a UTXO model and transaction data of a balance model, and the chain structure processing method includes: the UTXO model performs an incoming transaction to the balance model, and / or the balance model performs an outgoing transaction to the UTXO model. The transaction data processing method includes: performing a flow of tokens of the UTXO model and the balance model of the license chain to obtain incoming transaction data and / or outgoing transaction data; merging the out-of-system verification data of multiple license chains belonging to the same alliance chain into the account book data of the alliance chain, and the out-of-system verification data includes one or more of the following: the incoming transaction data, the outgoing transaction data and the transaction data of the UTXO model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to but are not limited to the field of computer data processing technology, and in particular to a chain structure processing method, a transaction data processing method, a transaction processing method, a data verification method, a device, and a computer-readable storage medium. Background Art

[0002] In order to enable multiple independent private chain systems to form an alliance and jointly circulate the tokens issued by the alliance, the transaction data of the private chain UTXO (Unspent Transaction Outputs) model can be merged into the alliance chain ledger. Summary of the invention

[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

[0004] This article provides a chain structure processing method, a transaction data processing method, a data verification method, a storage medium and a computer device.

[0005] On the one hand, an embodiment of the present disclosure provides a method for processing a chain structure, wherein the chain structure is a permission chain, and the permission chain includes transaction data of a UTXO model and transaction data of a balance model, and the processing method includes:

[0006] The UTXO model performs an inbound transaction to the balance model, and / or

[0007] The balance model performs a transfer-out transaction to the UTXO model.

[0008] On the other hand, the embodiment of the present disclosure further provides a method for processing chain structure transaction data, wherein the chain structure is a permission chain, and the permission chain includes transaction data of a UTXO model and transaction data of a balance model, and the transaction data processing method includes:

[0009] Adopt any of the aforementioned chain structure processing methods to realize the circulation of the tokens of the UTXO model and the balance model of the permission chain, and obtain the data of the incoming transaction and / or the data of the outgoing transaction;

[0010] The off-system verification data of multiple permission chains belonging to the same alliance chain are merged into the account book data of the alliance chain, wherein the off-system verification data of the permission chain includes one or more of the following: the data of the incoming transaction, the data of the outgoing transaction and the transaction data of the UTXO model.

[0011] On the other hand, the embodiment of the present disclosure further provides a chain structure transaction processing method for cross-chain transactions between the first permission chain and the second permission chain, the first permission chain uses a first algorithm, and the second permission chain uses a second algorithm, the chain structure transaction processing method includes:

[0012] When the first permission chain and the second permission chain conduct cross-chain transactions, a first Pedersen commitment of the first algorithm, a second Pedersen commitment of the second algorithm, and proof data that the first amount represented by the second generator coefficients committed by the first Pedersen commitment and the second Pedersen commitment are equal are generated for the cross-chain output.

[0013] On the other hand, the embodiment of the present disclosure further provides a chain structure data verification method, wherein the chain structure is a permission chain, and the permission chain includes transaction data of a UTXO model and transaction data of a balance model, and the data verification method includes:

[0014] Adopt any of the aforementioned chain structure processing methods to realize the circulation of the tokens of the UTXO model and the balance model of the permission chain, and obtain the data of the incoming transaction and / or the data of the outgoing transaction;

[0015] The verifier outside the permission chain verifies the data of the incoming transaction and / or the transaction data of the UTXO model.

[0016] On the other hand, the embodiments of the present disclosure further provide a computer-readable storage medium storing program instructions, which, when executed, can implement the aforementioned chain structure processing method, chain structure transaction data processing method or chain structure data verification method.

[0017] On the other hand, the embodiments of the present disclosure also provide a blockchain mechanism, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the aforementioned chain structure processing method, chain structure transaction data processing method, or chain structure data verification method can be implemented.

[0018] By adopting the chain structure processing method of the embodiment of the present disclosure, the transfer between the UTXO model and the balance model can be realized through transfer-in transactions and transfer-out transactions, ensuring that the amount in the UTXO model is consistent with the balance status in the balance model. By adopting the chain structure transaction data processing method of the embodiment of the present disclosure, the license chain data can be merged into the alliance chain account data. By adopting the chain structure data verification method of the embodiment of the present disclosure, the correct flow of tokens within the alliance chain is guaranteed. By adopting the chain structure transaction processing method of the embodiment of the present disclosure, it is ensured that the license chains using different algorithms can verify that the amounts are equal.

[0019] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0020] Other aspects will be apparent upon reading and understanding the drawings and detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.

[0022] Figure 1 It is a flowchart of the chain structure data processing method according to an embodiment of the present disclosure;

[0023] Figure 2 A flowchart of a data processing method including a verification operation according to an embodiment of the present disclosure;

[0024] Figure 3 is a flow chart of a data verification method according to an embodiment of the present disclosure;

[0025] Figure 4 This is a schematic diagram of data in a permission chain block according to an embodiment of the present disclosure;

[0026] Figure 5 An example list of metadata in a permission chain block with multiple asset type tokens according to an embodiment of the present disclosure;

[0027] Figure 6 A schematic diagram of uploading block header data of a permissioned chain to a consortium chain according to an embodiment of the present disclosure;

[0028] Figure 7 This is a schematic diagram of the alliance chain block data of the embodiment of the present disclosure;

[0029] Figure 8 It is a schematic diagram of the structure of a computer device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] The present disclosure describes multiple embodiments, but the description is exemplary rather than restrictive, and it is apparent to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present disclosure. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.

[0031] The present disclosure includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features, and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme defined by the claims. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in the present disclosure may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other limitations. In addition, various modifications and changes may be made within the scope of protection of the attached claims.

[0032] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.

[0033] The steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. Also, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described can be performed in a sequence different from that shown here.

[0034] Multiple independent private chains can form an alliance, and the UTXO model transaction data of the private chains can be merged into the alliance chain ledger. However, there is currently no solution for private chains that support the balance model or private chains with different algorithms, such as the SM2 national encryption algorithm and non-national encryption algorithms such as secp256k1.

[0035] To this end, the embodiments of the present disclosure provide a processing method for a permission chain. A permission chain means that each node participating in the blockchain system is licensed. Nodes without permission cannot access the system. In this article, permission chains include private chains and alliance chains, where private chains refer to chains of institutions, including chains of a single institution and chains jointly participated by multiple institutions (alliances of institutions); alliance chains refer to alliance chains (alliances of chains) obtained by merging multiple member chains. The private chain in this article can be equivalent to a permission chain.

[0036] The embodiment of the present disclosure provides a method for processing a chain structure, wherein the chain structure is a permission chain, and the permission chain includes transaction data of a UTXO model and transaction data of a balance model. The processing method includes:

[0037] The UTXO model performs an inbound transaction to the balance model, and / or

[0038] The balance model performs a transfer-out transaction to the UTXO model.

[0039] When there are both transfer-in transactions and transfer-out transactions, this embodiment does not limit the execution order of the transfer-in transactions and transfer-out transactions.

[0040] Through the above transfer-in and transfer-out transactions, transfers between the UTXO model and the balance model can be realized, ensuring that the amount in the UTXO model is consistent with the balance status in the balance model.

[0041] In an exemplary embodiment, the UTXO model performs a transfer-in transaction to the balance model, including: the UTXO model performs a direct transfer-in transaction to the balance model; or the UTXO model performs an indirect transfer-in transaction to the balance model; wherein: the input of the direct transfer-in transaction references the unspent output of the UTXO transaction, and the output is the user account address of the balance model; the indirect transfer-in transaction includes a first intermediate transaction and a first receipt transaction, the input of the first intermediate transaction references the unspent output of the UTXO transaction, and the output of the first receipt transaction is the user account address or contract account address of the balance model. During the transfer-in process, in an indirect transaction scenario, the actual transfer is completed only when the receipt transaction is completed. When multiple intermediate transactions are referenced, the receipt transaction can also be called a confusing transaction. The user account address or contract account address of the balance model output by the receipt transaction cannot be used as an unspent output and cannot be referenced for spending.

[0042] In an exemplary embodiment, the first intermediate transaction in the indirect transfer-in transaction is bound to a first commitment of one or more recipients, the output of the first intermediate transaction is an intermediate transaction address, the input of the first receipt transaction is one or more of the first intermediate transactions, the output of the first receipt transaction is bound to a second commitment, the second commitment is a new commitment obtained after calculation of the first commitment, and the address of the second commitment generated by the first calculation is a user account address or a contract account address of the balance model.

[0043] In the disclosed embodiment, the first commitment can be the user's public key multiplied by the first coefficient, plus the first generator multiplied by the second coefficient, plus the second generator multiplied by the third coefficient, where the first coefficient can be, for example, 1, and the second coefficient can be, for example, 0. The second commitment is obtained by operating the first commitment, and the second commitment is the user's public key multiplied by the fourth coefficient, plus the second generator multiplied by the fifth coefficient, where the fourth coefficient can be equal to the first coefficient, and the fifth coefficient can be 0. For example, the user's public key P, the first generator G, the second generator H, the first commitment bound to a certain recipient in the first intermediate transaction is v1*P+v3*H, and the second commitment bound to the first receipt transaction output is C=v4*P+v5*H. For example, the second commitment can be obtained by operating in the following way: the first commitment is multiplied by a scalar (which can be 1, that is, unchanged), and then the second generator is multiplied by the sixth coefficient to obtain the second commitment. The second commitment obtains the output user account address of Hash(C) after the first operation, that is, v4=1, v5=0; or obtains the output contract account address, where the contract account address is obtained by calculating the user account address and a nonce value, so the contract account address is Hash(Hash(C-v5*H)||v5), that is, v4=1, v5=nonce, where Hash(C-v5*H) is the user account address. The user account address and the contract account address can have an address type identifier prefix.

[0044] In an exemplary embodiment, the balance model performs a transfer-out transaction to the UTXO model, including: the balance model performs a direct transfer-out transaction to the UTXO model, or the balance model performs an indirect transfer-out transaction to the UTXO model; wherein: the input of the direct transfer-out transaction is the user account address or contract account address of the balance model, and the output is the user's one-time address of the UTXO transaction; the indirect transfer-out transaction includes a second intermediate transaction and a second receipt transaction, the input of the second intermediate transaction references the user account address or contract account address of the balance model, and the output of the second receipt transaction is the user's one-time address of the UTXO transaction. Similarly, in the transfer-out process, in an indirect transaction scenario, the actual transfer is completed only when the receipt transaction is completed. When multiple intermediate transactions are referenced, the receipt transaction can also be called a confusing transaction. The user's one-time address output by the receipt transaction can be used as an unspent output and can be referenced for spending.

[0045] In an exemplary embodiment, the second intermediate transaction in the indirect transfer transaction is bound to a third commitment of one or more recipients, the output of the second intermediate transaction is the intermediate transaction address, the input of the second receipt transaction is one or more of the second intermediate transactions, the output of the second receipt transaction is bound to a fourth commitment, the fourth commitment is a new commitment obtained after calculation of the third commitment, and the address generated by the second calculation of the fourth commitment is the user's one-time address of the UTXO transaction.

[0046] The third commitment may be the same as or different from the first commitment. Accordingly, the fourth commitment may be the same as or different from the second commitment.

[0047] In the disclosed embodiment, the third commitment is the same as the first commitment as an example. The third commitment is the user's public key multiplied by the first coefficient, plus the first generator multiplied by the second coefficient, plus the second generator multiplied by the third coefficient, where the first coefficient can be, for example, 1, and the second coefficient can be, for example, 0. The fourth commitment is obtained by operating the third commitment, and the fourth commitment is the user's public key multiplied by the fourth coefficient, plus the first generator multiplied by the fifth coefficient, where the fourth coefficient can be equal to the first coefficient, and the fifth coefficient can be equal to the second coefficient. For example, the user's public key P, the first generator G, the second generator H, the third commitment bound to a certain recipient by the second intermediate transaction is v1*P+v2*G+v3*H, and the fourth commitment bound to the second receipt transaction output is C=v4*P+v5*G. For example, the fourth commitment can be obtained by the following operation: the third commitment is multiplied by a scalar (which can be 1, that is, unchanged), and then the first generator is multiplied by the sixth coefficient and the second generator is multiplied by the seventh coefficient to obtain the fourth commitment. The fourth commitment is that the user's one-time address obtained by the second operation is Hash(C), and the corresponding public key is commitment C, and the private key is v4*d+v5, where d is the user's private key, that is, P=d*G. Different public and private keys, that is, the user's one-time key, can be obtained through different coefficients v4 and v5, so the output is the user's one-time address. The user's one-time address can have an address type identifier prefix and / or a system identifier prefix.

[0048] The disclosed embodiment also provides a chain structure transaction data processing method, wherein the chain structure is a permission chain, and the permission chain includes transaction data of a UTXO model and transaction data of a balance model. The data processing method is as follows: Figure 1 As shown, including:

[0049] Step 11, using the chain structure processing method of any of the above embodiments to realize the circulation of the tokens of the UTXO model and the balance model of the permission chain, and obtain the data of the incoming transaction and / or the data of the outgoing transaction;

[0050] If a transfer-in transaction from the UTXO model to the balance model is executed, the data obtained is the data of the transfer-in transaction, and the data of the transfer-in transaction includes input, output, amount, etc., and optionally may also include a signature, for example: the input reference is the user's one-time address of the UTXO model, or the address of the first intermediate transaction, the output is the user's account address or contract account address of the balance model, and the commitment of the output transfer amount; whether it is a transfer-in transaction is judged by the input address (non-balance model) and the output address (balance model). If a transfer-out transaction from the balance model to the UTXO model is executed, the data obtained is the data of the transfer-out transaction, and the data of the transfer-out transaction includes input, output, etc., for example: the input reference is the user's account address or contract account address of the balance model, the output is the user's one-time address of the UTXO model, or the intermediate transaction address of the second intermediate transaction, the second intermediate transaction is referenced by the second receipt transaction, and the user's one-time address of the UTXO model is output; whether it is a transfer-out transaction is judged by the input address (balance model) and the output address (non-balance model).

[0051] Step 12, merging the off-system verification data of multiple permission chains belonging to the same alliance chain into the account book data of the alliance chain, wherein the off-system verification data of the permission chain includes one or more of the following: the data of the incoming transaction, the data of the outgoing transaction and the transaction data of the UTXO model.

[0052] In an exemplary embodiment, the step 12 of merging the off-system verification data of multiple permission chains belonging to the same alliance chain into the ledger data of the alliance chain includes: generating the first-layer ledger data of the alliance chain after consensus on the block header data of the multiple permission chains, and using the off-system verification data corresponding to the block header data of the permission chain as the second-layer ledger data of the alliance chain, which is essentially merging the TXO (Transaction Output) transaction data chains of multiple permission chains into the TXO transaction data chain of the alliance chain.

[0053] The alliance chain in the disclosed embodiment refers to an alliance of member chains. Different from the alliance of institutions, the account book data of the alliance chain described in the disclosed embodiment has a two-layer structure. The first layer is the block header data of multiple member chains (such as permission chains), which is the result of multiple member chains being merged into an alliance chain. The second layer is the external verification data corresponding to each member chain. The alliance chain of an institution has only one layer of structure and does not contain the block header data of other chains as a separate layer of data, such as the block data structure of Ethereum. It can be seen that the difference between the alliance of an institution and the alliance of a chain can be reflected in the different block data structures of the chains. The permission chain in the disclosed embodiment is a blockchain with a one-layer structure.

[0054] In the disclosed embodiment, the address used when the permission chain participates in a transaction contains a unique identifier of the chain, so that the transaction data chains of different permission chains are logically isolated.

[0055] By adopting the transaction data processing method described above, it becomes possible to merge multiple permission chains into a consortium chain.

[0056] In an exemplary embodiment, the method may further include: a verifier verifies the external verification data of the permission chain block, which may specifically include any one of the following verifications:

[0057] Verification 1: Verify whether the input reference of the transaction data of the UTXO model and / or the data transferred into the transaction is the unspent output on the alliance chain;

[0058] That is, verify whether the input reference of the transaction data of the UTXO model is an unspent output on the alliance chain, and / or whether the input reference of the data transferred into the transaction is an unspent output on the alliance chain.

[0059] Verification 2: Verify whether the input reference of the transaction data of the non-cross-chain UTXO model of the permission chain and / or the data transferred into the transaction is the forward unspent output of the permission chain.

[0060] That is, verify whether the unspent output of the non-cross-chain transaction address referenced by the input of the transaction data of the UTXO model of the permission chain is the forward unspent output of the permission chain, and / or whether the unspent output of the non-cross-chain transaction address referenced by the input of the data transferred into the transaction is the forward unspent output of the permission chain.

[0061] In this embodiment, the verification of the external verification data of the permission chain block by the verifier is not limited to when it is performed, that is, it can be performed at any time period. The correctness of the input reference is ensured through verification to avoid transaction errors.

[0062] In an exemplary embodiment, before merging the external verification data of multiple permissioned chains belonging to the same alliance chain into the ledger data of the alliance chain, Figure 2 As shown, the method may further include the following steps 13 and 14:

[0063] Step 13: The consortium chain verifier verifies the external verification data of the permission chain block to be uploaded, including any of the following verifications:

[0064] Verification 3: Verify whether the input references of the transaction data of the UTXO model and / or the data transferred into the transaction are unspent outputs on the alliance chain;

[0065] That is, verify whether the input reference of the transaction data of the UTXO model is an unspent output on the alliance chain, and / or whether the input reference of the data transferred into the transaction is an unspent output on the alliance chain.

[0066] Verification 4: Verify whether the transaction data of the non-cross-chain UTXO model of the permission chain and / or the input reference of the data transferred into the transaction is the forward unspent output of the permission chain;

[0067] That is, verify whether the unspent output of the non-cross-chain transaction address referenced by the input of the transaction data of the UTXO model of the permission chain is the forward unspent output of the permission chain, and / or whether the unspent output of the non-cross-chain transaction address referenced by the input of the data transferred into the transaction is the forward unspent output of the permission chain. And through the permission chain block header data, it is ensured that the unspent output of the non-cross-chain transaction address referenced by the input of the transaction data after being linked to the alliance chain is also the forward unspent output on the alliance chain.

[0068] In this embodiment, the verification performed by the consortium chain verifier is performed before the consortium chain ledger data is merged. After the verification is passed, the external verification data of multiple permission chains belonging to the same consortium chain are merged into the consortium chain ledger data, specifically by merging the block header data of the permission chain. In this embodiment, the verification performed by the consortium chain verifier is the verification of the permission chain block to be put on the chain.

[0069] Step 14, after verification, add a block header hash value for indicating the restricted alliance chain block height to the permission chain block header data to be uploaded, wherein the restricted alliance chain block height is at least the maximum block height corresponding to the unspent output on the alliance chain referenced by the cross-permission chain transaction in the permission chain block; in an exemplary embodiment, the restricted alliance chain block height may be greater than the maximum block height, for example: the previous permission chain block contains a block header hash value for indicating the restricted alliance chain block height and the restricted alliance chain block height is greater than the aforementioned maximum block height (the larger value is taken from the two);

[0070] By limiting the alliance chain block height, the blocks on the alliance chain can only be on the back of the alliance chain block height, ensuring that cross-chain transactions all refer to the forward unspent output on the alliance chain. And what is added is the alliance chain block header hash value of the corresponding height, so even if the alliance chain forks before this height, it can determine that there is no forward block header with the same hash value, so the permission chain block header cannot be consensus-linked to the alliance chain; if it forks after this height, it can determine the forward block header with the same hash value, so the permission chain block header can be consensus-linked to the alliance chain.

[0071] In an exemplary embodiment, the block header hash value for indicating the limit on the alliance chain block height is added to the permission chain block header data to be uploaded to the chain, and the following method can be adopted:

[0072] When the permission chain block to be chained does not contain a cross-permission chain transaction, the permission chain is recursively forward to the previous permission chain block containing a cross-permission chain transaction, and the permission chain block header pointing to the permission chain block is found on the alliance chain, and the block header hash value used to indicate the limit on the alliance chain block height in the permission chain block header is added to the permission chain block header data currently to be chained (explicit height restriction method); or when the permission chain block to be chained does not contain a cross-permission chain transaction, and the permission chain is recursively forward to the permission chain block containing a cross-permission chain transaction (that is, as long as there is a permission chain block containing a cross-permission chain transaction), the second preset value (for example, FF...FF) is added to the permission chain block header data currently to be chained (implicit height restriction method).

[0073] In an exemplary embodiment, when the permission chain is recursively forward to the genesis block and still does not contain a cross-permission chain transaction, the block header hash value used to indicate the restriction on the alliance chain block height in the permission chain block header data to be uploaded to the chain is set to a first preset value (for example, zero).

[0074] Step 15, the consortium chain verifier endorses and signs the permission chain block header data to which the block header hash value indicating the limit on the consortium chain block height is added;

[0075] In the process of merging the alliance chain ledger data, the bookkeepers of the alliance chain reach a consensus on the licensed chain block header data endorsed and signed by multiple alliance chain validators to generate the first-layer ledger data of the alliance chain. The off-system verification data corresponding to the licensed chain block header constitutes the second-layer ledger data of the alliance chain. Therefore, the licensed chain block header data of the on-chain alliance chain all contain a block header hash value indicating the limit on the alliance chain block height. Because the maximum block height corresponding to the unspent output on the alliance chain referenced by the cross-licensed chain transaction in the licensed chain block is certain, the block header hash values ​​indicating the limit on the alliance chain block height added by different validators are the same.

[0076] The bookkeeper of the consortium chain must ensure that the block header hash value corresponding to the permission chain block header of the consortium chain on the chain, which indicates the limit on the block height of the consortium chain, is equal to a certain forward consortium chain block header hash value. If the hash value is the first preset value or the second preset value, the block height of the consortium chain on the chain is not limited. If the permission chain block header contains the first preset value, it can be used as the first block header data of the consortium chain on the chain. The first block header data of the permission chain on the chain consortium chain must contain the first preset value; if the permission chain block header contains the second preset value, it means that the block before the permission chain contains cross-permission chain transactions and cannot be used as the first block header data of the consortium chain on the chain. In combination with the method of chaining the consortium chain in sequence, the block height of the consortium chain on the chain is implicitly limited. The permission chain block header containing the second preset value must be chained to the consortium chain after the explicit restriction of the block height of the consortium chain on the chain.

[0077] In an exemplary embodiment, the permission chain block header data includes a unique identifier of the permission chain. By including the unique identifier of the chain in the block header, the block header data of different permission chains can be isolated.

[0078] In an exemplary embodiment, the off-system verification data of the permission chain may also include metadata. For any asset type token, the metadata includes the cumulative transfer-in amount commitment and the cumulative transfer-out amount commitment of the UTXO model of the asset type token to the balance model, and range proof data that the difference between the cumulative transfer-in amount commitment and the cumulative transfer-out amount commitment is greater than or equal to zero.

[0079] When the permission chain supports multiple asset type tokens, each asset type token is calculated separately, and multiple lists can be set to record the cumulative transfer amount commitment, cumulative transfer amount commitment, and range proof data of the difference between the two being greater than or equal to zero for each asset type token.

[0080] In an exemplary embodiment, when there is a cross-permission chain transaction or an issuance transaction or a recovery transaction, for any asset type token, the metadata may also include: a first result of the cumulative input amount commitment plus the cumulative issuance amount commitment of the asset type token in the cross-permission chain transaction, and a second result of the cumulative output amount commitment plus the cumulative recovery amount commitment of the cross-permission chain transaction, and range proof data that the difference between the first result and the second result is greater than or equal to zero. The difference between the first result and the second result is the amount commitment of the current total amount of the asset type token in the permission chain.

[0081] In other embodiments, when there is a cross-permission chain transaction, for any asset type token, the metadata may further include: the amount commitment of the current total amount of the asset type token of the permission chain, and the range proof data that the amount commitment is greater than or equal to zero. The amount commitment of the current total amount of the asset type token of the permission chain is the difference between the sum of the cumulative input amount commitment and the cumulative issuance amount commitment of the cross-permission chain transaction of the asset type token and the sum of the cumulative output amount commitment and the cumulative recovery amount commitment of the cross-permission chain transaction.

[0082] In an exemplary embodiment, the range proof greater than or equal to zero, that is, the range proof of non-negative numbers, is equivalent to a proof within a certain range, such as [0, 2^64), because negative numbers will be larger than this range.

[0083] In an exemplary embodiment, the method further includes: generating a first Merkle tree from a set of off-system verification data of the license chain, generating a second Merkle tree from a set of other data of the license chain other than the off-system verification data, and recording the root hash value of the first Merkle tree and the root hash value of the second Merkle tree in the block header data of the license chain.

[0084] In an exemplary embodiment, the transaction data is obtained through a transaction process, and the method may further include the following transaction process:

[0085] The first permission chain generates cross-chain output transaction data and outputs a unique cross-chain transaction address;

[0086] The second permission chain generates cross-chain input transaction data, and the input references the cross-chain transaction address;

[0087] Wherein: the cross-chain transaction address includes an address type indicating that the current address is a cross-chain transaction address, a unique identifier of the first permission chain, a unique identifier of the second permission chain, and a unique number of the first permission chain across chains.

[0088] The above transaction is a cross-chain transaction. In the cross-chain output transaction data generated by the first permission chain, the input is the unspent transaction output of the first permission chain, and the output is the unique cross-chain transaction address. In the cross-chain input transaction data generated by the second permission chain, the input references the unique cross-chain transaction address, and the output is the one-time address of the user of the second permission chain. Both the cross-chain output transaction and the cross-chain input transaction are transaction data of the UTXO model and are connected through a unique cross-chain transaction address.

[0089] In an exemplary embodiment, the first permission chain generates cross-chain output transaction data, including:

[0090] The first permission chain generates a first Pedersen commitment of the first algorithm, a second Pedersen commitment of the second algorithm, and proof data that the first amount v1 represented by the second generator coefficients committed by the first Pedersen commitment and the second Pedersen commitment are equal, that is, proof data used to prove that the first amount v1 represented by the second generator coefficients committed by the first Pedersen commitment and the first amount v1 represented by the second generator coefficients committed by the second Pedersen commitment are equal.

[0091] The second permission chain generates a cross-chain input transaction using the second Pedersen commitment of the second algorithm.

[0092] The proof data includes: a third Pedersen commitment of the first algorithm, a fourth Pedersen commitment of the second algorithm, and a first scalar, a second scalar, and a third scalar, wherein the second amount v2 represented by the second generator coefficient committed by the third Pedersen commitment and the fourth Pedersen commitment is equal;

[0093] The first scalar is the first hash value multiplied by the first amount plus the second hash value multiplied by the second amount;

[0094] The second scalar is the first hash value multiplied by the first generator coefficient of the first Pedersen commitment plus the second hash value multiplied by the first generator coefficient of the third Pedersen commitment;

[0095] The third scalar is the first hash value multiplied by the first generator coefficient of the second Pedersen commitment plus the second hash value multiplied by the first generator coefficient of the fourth Pedersen commitment;

[0096] The first hash value h1 is obtained by using the first Pedersen commitment, the second Pedersen commitment, the third Pedersen commitment, the fourth Pedersen commitment, the parameters of the first algorithm, and the parameters of the second algorithm through a first hash function, and the second hash value h2 is obtained by using the first Pedersen commitment, the second Pedersen commitment, the third Pedersen commitment, the fourth Pedersen commitment, the parameters of the first algorithm, and the parameters of the second algorithm through a second hash function. h1 and h2 meet a certain length, and if the length is not enough, it can be extended, for example, taking the square of the hash value.

[0097] The Pedersen commitment is expressed as C=b*G+v*H, where G is the first generator, H is the second generator, b is the blinding factor, and v is the committed amount.

[0098] The output commitments are: the first Pedersen commitment C1 = b1*G1 + v1*H1 and the second Pedersen commitment C2 = b2*G2 + v1*H2. The first Pedersen commitment uses the first algorithm, that is, uses the generators G1 and H1, and the second Pedersen commitment uses the second algorithm, that is, uses the generators G2 and H2.

[0099] To prove that the first amounts in different algorithms are equal, that is, v1 in C1 is equal to v1 in C2, the following proof data is required: randomly generated commitments and related scalars. Specifically:

[0100] The randomly generated commitments include: a third Pedersen commitment C3 = b3*G1+v2*H1 and a fourth Pedersen commitment C4 = b4*G2+v2*H2. The third Pedersen commitment uses the first algorithm, i.e., generators G1 and H1, and the fourth Pedersen commitment uses the second algorithm, i.e., generators G2 and H2. In an exemplary embodiment, the range of the second amount v2 may be greater than the range of the first amount v1, for example, greater than 2^64.

[0101] Get the first hash value h1=Hash1(C1||C2||C3||C4||G1||H1||G2||H2) and the second hash value h2=Hash2(C1||C2||C3||C4||G1||H1||G2||H2)

[0102] The scalars proved by calculation include: The first scalar m1 = h1*v1 + h2*v2

[0103] The second scalar m2 = h1*b1+h2*b3

[0104] The third scalar m3 = h1*b2 + h2*b4

[0105] By proving that m2*G1+m1*H1 is equal to h1*C1+h2*C3 and

[0106] m3*G2+m1*H2 equals h1*C2+h2*C4 to prove that v1 in C1 is equal to v1 in C2.

[0107] Because the discrete logarithms of the first generator G and the second generator H in the first algorithm or the second algorithm are unknown, only the coefficient of the second generator H related to the amount is considered. Let the coefficients of the second generator H of C1, C2, C3, and C4 be a1, a2, a3, and a4 respectively. According to the proof equation, we get m1=h1*a1+h2*a3 and m1=h1*a2+h2*a4. Since the first hash value h1 and the second hash value h2 are unpredictable, only a1=a2 and a3=a4 can satisfy the equation. Therefore, v1 in C1 is equal to v1 in C2.

[0108] Where G1 and H1 are generators of the first algorithm, and G2 and H2 are generators of the second algorithm.

[0109] In an exemplary embodiment, a multi-signature sub-key is used in a transaction, wherein the multi-signature sub-key implicitly contains a combination relationship of the multi-signature sub-keys.

[0110] The key can generate a subkey based on the identifier, and multiple keys can form a multi-signature key. The different combination relationships of the multi-signature key can be encoded in advance, and different encoding results can be used as the key identifier or part of the key identifier of different multi-signature subkeys. Multiple subkeys corresponding to multiple keys are generated according to the key identifier, and multiple subkeys are combined into a multi-signature subkey. At this time, the multi-signature subkey hides the combination relationship. When using the multi-signature subkey for trading, other traders do not know the combination relationship, which can prevent tampering with the key combination relationship.

[0111] The embodiment of the present disclosure also provides a chain structure transaction processing method for cross-chain transactions between a first permission chain and a second permission chain, wherein the first permission chain uses a first algorithm and the second permission chain uses a second algorithm, and the chain structure transaction processing method includes:

[0112] When the first permission chain and the second permission chain conduct cross-chain transactions, a first Pedersen commitment of the first algorithm, a second Pedersen commitment of the second algorithm, and proof data that the first amount represented by the second generator coefficients committed by the first Pedersen commitment and the second Pedersen commitment are equal are generated for the cross-chain output.

[0113] The proof data that the first amount represented by the second generator coefficients promised by the first Pedersen commitment and the second Pedersen commitment are equal refers to: proof data proving that the first amount represented by the second generator coefficients promised by the first Pedersen commitment is equal to the first amount represented by the second generator coefficients promised by the second Pedersen commitment.

[0114] The cross-chain transaction between the first permission chain and the second permission chain may adopt the cross-chain transaction process described above in this article, or other cross-chain transaction methods may be adopted.

[0115] By adopting the method described in this embodiment, by providing proof data, it is possible to prove that the amounts promised by different algorithms are equal, thereby making it possible to realize cross-chain transactions between permission chains using different algorithms.

[0116] The details of the proof data are described in the previous article and will not be repeated here.

[0117] The disclosed embodiment also provides a chain structure data verification method, wherein the chain structure is a permission chain, and the permission chain includes transaction data of a UTXO model and transaction data of a balance model. The data verification method is as follows: Figure 3 As shown, the following steps are included:

[0118] Step 21, using the chain structure processing method in any of the aforementioned embodiments to realize the circulation of the tokens of the UTXO model and the balance model of the permission chain, and obtain the data of the incoming transaction and / or the data of the outgoing transaction;

[0119] Step 22: A verifier outside the permission chain verifies the data of the incoming transaction and / or the transaction data of the UTXO model.

[0120] Among them, the verifier outside the permission chain verifies the data of the incoming transaction and / or the transaction data of the UTXO model, which can be the aforementioned verification one or verification two, which will not be repeated here.

[0121] The verification method described in the embodiment of the present disclosure is adopted to ensure the correct flow of tokens within the alliance chain.

[0122] In an exemplary embodiment, the method may further include:

[0123] The validator outside the permission chain verifies the metadata. For any asset type token, the metadata includes the cumulative transfer-in amount commitment and the cumulative transfer-out amount commitment of the UTXO model of the asset type token to the balance model, and the range proof data that the difference between the cumulative transfer-in amount commitment and the cumulative transfer-out amount commitment is greater than or equal to zero.

[0124] The following is a description of the embodiments of the present disclosure.

[0125] The permission chain described in this article can support both the UTXO model and the balance model. The transaction data of the UTXO model can be merged into the alliance chain ledger, and the transaction data of the balance model does not participate in the merger of the alliance chain. The disclosed embodiment provides a token circulation method of the UTXO model and the balance model, or a transfer method, which can realize the transfer of token transaction data between the UTXO model and the balance model.

[0126] The license chain described in the disclosed embodiment includes a UTXO model functional area, which can generate transaction data of the UTXO model. Because the transaction data of the UTXO model can form a DAG (directed acyclic graph) structure, the transaction data of the UTXO model of multiple independent license chains can be merged into the account data of the alliance chain through the transaction data of the DAG structure generated by multiple license chains and logically isolated. The license chains within the alliance can jointly circulate the tokens issued by the alliance and can effectively limit the circulation boundary of the alliance token. Because the cross-license chain output transaction must contain a valid cross-chain transaction address, it can only be output to the license chain within the alliance. And the input reference of the cross-license chain input transaction must be an unspent output on the alliance chain, that is, the referenced cross-chain output transaction has been chained to the alliance chain, so after the merger, the cross-license chain transaction is converted into a transaction within the alliance chain.

[0127] After a cross-chain transaction method such as a notary or relay chain is output to a certain permission chain, it cannot be restricted to circulation only within the permission chain, and the permission chain can also be circulated through other methods. Different from cross-chain transaction methods such as a notary or relay chain, the embodiment of the present disclosure merges the permission chain into a consortium chain (an alliance of chains), which limits the token to be circulated only between permission chains within the alliance, and cannot be transferred to other chains outside the alliance. And the transaction data of the token circulated in the permission chain is converted into the transaction data of the token circulated in the consortium chain after merging, that is, the process of token circulation has a valid certificate of the consortium chain, so the SPV (Simplified Payment Verification) certificate of the consortium chain can be used to verify whether the token of a certain permission chain is a valid token issued by the consortium.

[0128] The merged consortium chain contains two layers of data structure. The first layer is the block header data of the permission chain, and the second layer is the actual transaction ledger data of the consortium chain, which is the transaction data of the UTXO model in the permission chain ledger data corresponding to the permission chain block header of the first layer. The amount of first-layer ledger data actually generated by the consortium chain accountant is very small, and can contain the permission chain ledger data of multiple large-scale ledgers, and the block header will not leak privacy. Therefore, through layered ledgers and multi-level consensus (at least two levels of permission chain and consortium chain), the accounting and security privacy issues of large-scale ledger data of the consortium chain are solved.

[0129] The above-mentioned license chain can also include a balance model function area to generate transaction data of the balance model, and can support user-defined smart contracts and state storage. The validator of the alliance chain cannot read the transaction data of the license chain balance model, and the data of the license chain balance model does not participate in the merger of the alliance chain. Therefore, the data in the block of the license chain is divided into two parts. The first part is the data verified by the validator of the alliance chain and participates in the merger of the alliance chain. The embodiment of the disclosure is called the external verification data of the system; the second part is the remaining data except the external verification data of the system, mainly including the data of the balance model. The license chain block header data contains two Merkle tree root hash values ​​generated by these two parts of data in the block. Therefore, the verification of the account data of the license chain is divided into two ways: external verification of the system (that is, the validator of the alliance chain only reads and verifies the verification data outside the system) and internal verification. Internal verification is the verification within the license chain, which will verify the account data of the entire license chain. For example, internal verification will verify whether the user's one-time address output by the UTXO model is valid, because the license chain does not allow output to the one-time address of non-system users, so the validity of the output address needs to be verified; while the system's external verification is more similar to the verification method of the public chain, which can be output to any address, and does not verify whether the output one-time address is a valid user address. It only verifies whether it is a valid unlocking spend and there is no double spend, and the input amount of the transaction is equal to the output amount of the transaction, which means that the correct flow of the token issued by the alliance is guaranteed, and the flow verification does not include users, so it is private. The internal verification also guarantees the correct flow of tokens, but the flow verification will include the flow to the correct user address.

[0130] Therefore, the permission chain contains user relationships, which will limit whether the address being circulated is a valid user address; the merged alliance chain does not contain users, and only limits the token to circulate between permission chains within the alliance, and does not allow it to circulate to other chains outside the alliance. Therefore, it is different from cross-chain transaction methods such as notaries or relay chains, and can effectively limit the circulation boundary of alliance tokens. For example, non-alliance tokens of permission chains can be exported across chains to other non-alliance chains without any restrictions, so permission chains can participate in multiple different alliances at the same time and circulate tokens of different asset types issued by different alliances.

[0131] In an exemplary embodiment, the consortium chain also allows the permission chain to transfer token transactions from the UTXO model to the balance model, and transfer token transactions from the balance model to the UTXO model. After the actual consortium token is transferred to the balance model, it exceeds the boundary of the consortium chain. Because the consortium chain obtained by merging the permission chains does not contain the balance model, the token transferred to the balance model no longer has the membership certificate of the consortium chain. Only the token transferred back to the UTXO model can have the membership certificate of the consortium chain. Therefore, the transfer-in token transaction and the transfer-out token transaction are limited to the permission chain system, and the consortium chain verifier does not read the balance model transaction, so the permission chain gives the result of the cumulative transfer-in amount commitment minus the cumulative transfer-out amount commitment, and the range proof data that the result is greater than or equal to zero. The external verification of the system only verifies whether the commitment result is correct and the range proof that the result is greater than or equal to zero, that is, the transfer-out token transaction is considered valid; while the internal verification verifies whether the balance corresponding to the input address of the transfer-out token transaction is greater than or equal to the transfer-out token amount.

[0132] Transactions in the UTXO model can contain one or more inputs and one or more outputs. Each input refers to an unspent transaction output in the forward direction and becomes spent, and creates one or more new unspent transaction outputs. Reference connections can be divided into explicit connections and implicit connections. The unlocking script needs to be associated with the corresponding locking script. Others can know the referenced unspent outputs, which is an explicit connection method, such as "txid+index" or a one-time address, where txid represents the transaction ID of the input referencing the unspent output, and index represents the sequence number. The spending voucher set records the fingerprints of all spent outputs and therefore cannot be spent repeatedly. Others do not know the referenced unspent outputs, which is an implicit connection method, such as zero-knowledge proof or ring confidential transactions.

[0133] The above can be seen as spending one or more outputs (spent) and creating one or more new outputs (unspent), and continuously looping backwards. All the spent outputs STXO and unspent outputs UTXO can form a DAG structure (directed acyclic graph), regardless of whether the connection between them is explicit or implicit. And the DAG structure reflects the process of token circulation, so it is called a transaction data chain (or TXO transaction data chain) of the DAG structure.

[0134] The explicit connection between lock and unlock indicates that it is a connection on the transaction chain. No matter whether the reference connection is txid+index or a one-time address, as long as it can effectively reference a certain output and determine whether it has not been spent. The implicit connection using the spending voucher method does not indicate which connection on the transaction chain it is, but the spending voucher cannot be double-spent, indicating that it is one of the connections and has not been spent before. Therefore, even if the implicit connection is not indicated, it is still a transaction chain of the DAG structure, but the connection of the chain is hidden (the sender knows the unspent output referenced but others do not know).

[0135] Therefore, no matter which type of UTXO model transaction is used, it can be abstracted into a transaction chain of DAG structure, and DAG structure is also the theoretical basis for merging. Because the DAG structure can be split into multiple sub-DAG structures, multiple sub-DAG structures can also be merged into one DAG structure. Because the transaction of the UTXO model of the alliance chain can form a transaction chain of DAG structure (using the explicit one-time address connection method), and then can be split into multiple sub-DAGs, each sub-DAG is formed by the transaction of the UTXO model of a private chain, so the transactions of the UTXO model of multiple private chains can be merged into the ledger of the alliance chain. Therefore, the merged alliance chain only contains the data of the UTXO model, and does not contain the balance model.

[0136] The DAG structure of the consortium chain uses an explicit one-time address connection method because each address can contain the chain's unique identifier (that is, the system ID) as a prefix, and the address is unique within the private chain, so the transaction data can be logically isolated and has a globally unique connection address, so there will be no conflict in transactions merged into the consortium chain. If the transaction data of the private chain is directly merged, only the explicit one-time address connection method can be used. However, the transaction data of each private chain is independently verified and uploaded to the consortium chain, and the first layer of the consortium chain only has the block header data of the private chain. Therefore, the internal connection of the sub-DAG structure of the private chain can be replaced with other methods, including txid+index or privacy connection, but cross-private chain transactions still need to maintain the one-time address method. Therefore, the transaction data of the UTXO model of multiple private chains with different technical methods can be merged into the ledger of the consortium chain.

[0137] The transactions of the above UTXO model form a transaction chain of DAG structure, which defaults to a homogeneous token of one asset type. However, the system can have homogeneous tokens of multiple asset types, or non-homogeneous tokens. Tokens of different asset types can be distinguished by identification. Non-homogeneous tokens spend an existing output and create a new output, so they form a common chain structure. Homogenous tokens of the same asset type have a multi-input and multi-output structure, so they form a complex chain structure. And if there are homogeneous tokens of several asset types in the system, several corresponding DAG structure transaction chains are formed.

[0138] The alliance only verifies the tokens issued by the alliance, and does not process and verify other tokens in the private chain. Therefore, merging into the alliance chain ledger is equivalent to merging the circulation of the tokens issued by the alliance. Therefore, even if tokens issued by different alliances circulate in a private chain, the alliance only verifies the circulation of tokens of this alliance, which is equivalent to a different DAG structure. Therefore, the tokens of two or more alliances can circulate in the system, and can participate in the merger of multiple alliance chains without conflict. After meeting the conditions, the private chain can also choose to join or leave the alliance chain. For example, if there is no unspent output of the alliance token circulating in the system, it can leave the alliance chain.

[0139] Different private chains use different cryptographic algorithms and can be merged. For example, private chain A uses the national secret SM2 elliptic curve, and private chain B uses the secp256k1 elliptic curve. When trading across private chains, the elliptic curve and algorithm that identifies the output user's one-time public key (or commitment address) must be used. Then it is necessary to prove that the amount committed by A's output is equal to the amount committed by B's input on different elliptic curves. For example, A's output amount commitment C1 and B's input amount commitment C2:

[0140] The output commitments are: the first Pedersen commitment C1 = b1*G1 + v1*H1 and the second Pedersen commitment C2 = b2*G2 + v1*H2.

[0141] The randomly generated commitments include: the third Pedersen commitment C3 = b3*G1 + v2*H1 and the fourth Pedersen commitment C4 = b4*G2 + v2*H2.

[0142] So we get the third hash value h3=Hash1(C1||C2||C3||C4||G1||H1||G2||H2) and the fourth hash value h4=Hash2(C1||C2||C3||C4||G1||H1||G2||H2)

[0143] Hash1 and Hash2 can be different hash functions, such as SHA256 and SM3, but the length of h1 and h2 must be greater than the length of the elliptic curve order, so the value can be the square of the hash value, that is, and If SHA512 is used, the hash values ​​may be used, ie, h1 = h3 and h2 = h4.

[0144] The scalars proved by calculation include: The first scalar m1 = h1*v1 + h2*v2

[0145] The second scalar m2 = h1*b1+h2*b3

[0146] The third scalar m3 = h1*b2 + h2*b4

[0147] By proving whether m2*G1+m1*H1 is equal to h1*C1+h2*C3 and

[0148] Is m3*G2+m1*H2 equal to h1*C2+h2*C4 to prove that v1 in C1 is equal to v1 in C2.

[0149] G1 and H1 are generators of the SM2 elliptic curve, and G2 and H2 are generators of the secp256k1 elliptic curve. So C1 and C3 are points on the SM2 elliptic curve, and C2 and C4 are points on the secp256k1 elliptic curve. v1 is the amount promised to be transferred, and v2 is a randomly generated amount, and v2 can be greater than 2. 64 . The above h1 and h2 are 64 bytes. The scalar m1 participates in the operation of the first algorithm and the second algorithm at the same time, which can be expressed as m1%(n1*n2), where n1 is the order of the first algorithm and n2 is the order of the second algorithm, so the scalar m1 is stored in 64 bytes. Scalars m2 and m3 are only operated in their respective algorithms, which can be expressed as m2%n1 and m3%n2, so m2 and m3 are stored in 32 bytes. Therefore, the cross-permission chain output transaction data output by A to B contains the amount commitments C1 and C2 of different elliptic curves, and provides proof of equal amounts.

[0150] The transaction amount of the UTXO model can be kept confidential using homomorphic encryption, such as using Pedersen Commitment, expressed as Cv=b*G+v*H, where v is the committed amount, b is the blinding factor, and G and H are the first and second generators on the elliptic curve, respectively. The commitment Cv has the property of additive homomorphism, so Cv1+Cv2=(b1+b2)*G+(v1+v2)*H can be used. The above addition can also be subtraction, that is, Cv1-Cv2=(b1-b2)*G+(v1-v2)*H. And it can be combined with range proofs, such as using the Bulletproofs protocol to prove that the amount v committed by Cv is within a certain range, such as v∈[0,2^64). The range proof greater than or equal to zero described in this article, that is, the range proof of non-negative numbers, is equivalent to a proof within a certain range, such as [0,2^64).

[0151] In order to ensure that the private chain system can support smart contracts with state storage, a balance model functional area is added to the private chain system, that is, the private chain system can have both the UTXO model functional area and the balance model functional area.

[0152] The balance model contains user accounts and contract accounts, which are user account addresses and contract account addresses respectively. The account status has a balance value, which can be added and subtracted, so it can be represented by a Pedersen commitment. Therefore, the transaction amount of the UTXO model, or the Balance value of the balance model, can be a commitment Cv to keep the committed value v confidential. The balance model transaction can also contain a sequence number nonce to prevent the replay of the balance model transaction data.

[0153] The transaction address of the UTXO model (also called the user's one-time address) can be "address type + system ID (or chain ID) + transaction method (optional) + hash value of the user's one-time public key". The user's one-time public key is generated by the user's signature public key and the generated private key. For example, the user's signature public key Pb and the generated private key s are used to generate a one-time public key Qb = Hash (c*s*G) * G + Pb, where c is called the generation coefficient, and the corresponding private key is (Hash (c*s*G) + d) % n, where d is the user's signature private key Pb = d*G, and n is the order of the additive group based on G. A one-time public key can also be generated by Qb = Hash (Hash (c, s) * G) * Pb, and the corresponding private key is (Hash (Hash (c, s) * G) * d) % n. Then generate the corresponding hash value through the user's one-time public key, for example: the hash value of the public key Lb = HL (ID, Qb), where Qb is the user's one-time public key, which can be called the one-time public key corresponding to the user's one-time address, and HL is the address hash function. Take the user address of 12317466924e4f854afd8e494fa657a4 as an example, where 1 is the user address type, 23 is the system ID (or chain ID), 1 represents the committed address transaction method, and the rest is the hash value of the user's one-time public key. The user's one-time address must correspond to a user's one-time public key. The unlocking script of the referenced address must give a one-time public key or a committed address operation (that is, the committed address is associated with the user's one-time public key) to obtain the one-time address, and the private key signature corresponding to the one-time public key must be used to complete the unlocking. The address length is not limited, and the lengths of different types of addresses can also be different.

[0154] The user account address of the balance model can be "address type + public key address", and the public key address is the address generated by the user's signature public key operation, for example: user account address La = 8 + HL (ID, Pa), where 8 is the user account address type, Pa is the user's signature public key, and HL is the address hash function. The transaction data of the balance model can include: the sender's account address L1, the receiver's account address L2, the transfer amount commitment Cv3, the sender's serial number count nonce, and the sender's signature private key signature on the transaction data. According to the Balance value Cv1 corresponding to the sender's account address L1 and the Balance value Cv2 corresponding to the receiver's account address L2, it can be calculated that after the transfer is completed, the Balance value of L1 is Cv1-Cv3, and the Balance value of L2 is Cv2+Cv3. The transaction data can also include Cv1-Cv3>=0 and Cv3∈[0,2^64) range proof. Transactions in the balance model can also create and call contracts, but this article does not cover this.

[0155] The contract account address of the balance model can be "address type + hash value", where the hash value can be the hash result of the user account address La that created the contract and nonce. For example: contract account address Lc = 9 + HL (ID, La || nonce), where 9 represents the contract account address type, and nonce is the transaction count when the user creates the contract. Therefore, the corresponding contract account address can be calculated through the user account address and nonce value. The contract account also has a Balance value, but it can only be controlled by the contract.

[0156] In order to meet the needs of management and flexibility, the permission chain system can include direct transaction methods and indirect transaction methods. The direct transaction method is that the transaction generated by the sender directly outputs the one-time public key or address of the receiver; the indirect transaction method is that the transaction generated by the sender does not directly output the public key or address of the receiver, but outputs the intermediate transaction address, and then the endorsement node of the permission chain generates a receipt to confuse the transaction data and reference the intermediate transaction address, and outputs the one-time public key or address of the receiver. Since the indirect transaction method is the output generated by the endorsement node, the method of binding the public key operation with the intermediate transaction address output by the sender is used. The indirect transaction method is different from most blockchain transaction methods, because the sender cannot directly output the one-time address or cross-chain transaction address of the cross-chain transaction receiver (non-user of this permission chain), so cross-permission chain transactions need to use the indirect transaction method.

[0157] The transaction data of cross-licensed chain transactions uses the cross-chain transaction address method. Specifically, the user of the first licensed chain generates an intermediate transaction and outputs the intermediate transaction address. The endorsement node of the first licensed chain generates cross-chain output transaction data, inputs reference to the intermediate transaction address, and outputs a unique cross-chain transaction address; the endorsement node of the second licensed chain generates cross-chain input transaction data, inputs reference to the cross-chain transaction address, and outputs the user's one-time address. The cross-chain transaction address contains the address type of the cross-chain transaction address, the unique identifier of the first licensed chain, the unique identifier of the second licensed chain, and the unique number of the first licensed chain across chains. Therefore, the address is globally unique, and indicates that the cross-chain output from the first licensed chain to the second licensed chain can only be referenced by the transaction input of the second licensed chain.

[0158] The UTXO model and the balance model mainly transfer tokens through transfer-in and transfer-out transactions, including user accounts and contract accounts in the balance model. Similar to transactions, the system can use direct or indirect transfer-in and transfer-out transactions to realize the flow of tokens between the UTXO model and the balance model, which are explained below.

[0159] Direct transfer transaction: The input is the unspent output of the referenced UTXO model, and the output is the user account address L2 of the balance model, and the output cannot be referenced for spending. The output can use the amount commitment, and the output amount commitment Cvin is the amount of the transfer balance model, so the balance result Cv2+Cvin is obtained by adding the Balance value Cv2 of L2 in a homomorphic manner. The transaction can include a range proof of Cvin∈[0,2^64). Direct transfer does not support the output of the contract account address because the execution of the contract may fail, but the transfer transaction cannot be revoked after being uploaded to the chain, and the output cannot be referenced for spending, so an indirect transfer method must be used to output to the contract account address.

[0160] Direct transfer transaction: The input is the user account address or contract account address of the balance model, and the output is the user one-time address of the UTXO model. Since the input is the address of the balance model, the nonce count must be included in the transaction to prevent replay. If the input is a user account address, the transaction is generated by the user, and the nonce value is the transaction count of the sender's user account, and then the sender signs the transaction with the signature private key. If the input is a contract account address, the transaction is generated by the contract script, and the transfer transaction is actually generated and signed by the endorsement node that executes the contract. The nonce value is the count of the transfer transaction generated by the contract account address. For example, the Balance value Cv1 of the input address L1 (user account address or contract account address) is subtracted from the amount commitment Cvou of the transfer transaction output to obtain the balance result Cv1-Cvou. The transaction can include a range proof of Cv1-Cvou>=0 and a range proof of Cvou∈[0,2^64).

[0161] Indirect transfer transaction: The indirect transfer method is that the user generates an intermediate transaction (i.e., the aforementioned first intermediate transaction), and the intermediate transaction output is bound to the commitment address. The intermediate transaction references the unspent output of the UTXO model, and the output is the intermediate transaction address. After receiving the intermediate transaction, the endorsement node generates a receipt transaction (i.e., the aforementioned first receipt transaction). The input of the first receipt transaction is one or more of the aforementioned first intermediate transactions. The output of the first receipt transaction contains the user account address or contract account address to be transferred to the balance model, and is bound (or associated) to the commitment address bound to the intermediate transaction. The commitment address can be generated in the following way: C = r*P+t*H, where C is the commitment address, P is the user's signature public key, H is the second generator, r is the first coefficient, and t is the second coefficient. It can also contain a third generator H2 and a third coefficient u, such as C = r*P+t*H+u*H2.

[0162] For example, when transferring to a user account address, the input commitment address of the obfuscated transaction is C1=r1*P+t1*H, C2=r2*C1 and r2=(1-r1) / r1, the output user account address is La=8+HL(ID,P), and the bound commitment address is C3=C1+C2-(t1 / r1)*H=P. It can be verified whether La is equal to 8+HL(ID,C3). If the contract account address is transferred, the input commitment address of the obfuscated transaction is C1=r1*P+t1*H+nonce*r1*H2, C2=r2*C1 and r2=(1-r1) / r1, the output contract account address is Lc=9+HL(ID,La||nonce) and La=8+HL(ID,P), and the bound commitment address is C3=C1+C2-(t1 / r1)*H=P+nonce*H2, so the coefficient nonce can be given, and La`=8+HL(ID,C3-nonce*H2) can be calculated to verify whether Lc is correct. The user account address or contract account address of the above output cannot be referenced and spent either. The output amount commitment Cvin is similar to direct transfer, and is accumulated to the Balance value of the corresponding account. After the obfuscation, other people do not know which input address the output corresponds to, that is, they do not know which address generates the transfer-in transaction, because the commitment address bound to the intermediate transaction cannot distinguish whether it is a transfer-in or a normal transaction. Only the endorsement node can know, but it can be verified by the commitment address. The above coefficient r1 can also be equal to 1, then C2 is equal to the unit element, which is the infinity point or zero point of the elliptic curve.

[0163] If the output of indirect transfer is a contract account address, the corresponding contract script will be called, and the call parameters will be encrypted and saved in the intermediate transaction data, but the contract execution may fail. The endorsement node will execute the corresponding contract script while generating the receipt confusion transaction. If the execution is successful, the execution result will be encrypted and stored in the note information corresponding to the confusion transaction; if the execution fails, the contract account address of the confusion transaction output will be cancelled, the input amount will be output to the sender's new address, and the reason for the failure will be encrypted and stored in the note information of the receipt transaction, and finally the receipt transaction will be endorsed and signed. Therefore, if the contract execution fails, there is actually no output contract account address, and no transfer transaction will be formed, so the user can quote the spend again.

[0164] Indirect transfer transaction: Similar to direct transfer transaction, the difference is that instead of directly outputting the user's one-time address of the UTXO model, the second intermediate transaction outputs the intermediate transaction address, which is bound to the output user's commitment address. If the input is the user account address of the balance model, the intermediate transaction data is generated by the user; if the input is the contract account address of the balance model, the intermediate transaction data is generated when the endorsement node executes the contract, and the endorsement node generates a receipt transaction (i.e. the aforementioned second receipt transaction). The input of the second receipt transaction is one or more of the second intermediate transactions, and the output of the second receipt transaction is the user's one-time address of the UTXO model, and is associated with the commitment address bound to the intermediate transaction address.

[0165] Therefore, through the transfer-in and transfer-out transactions of the above-mentioned UTXO model and balance model, tokens can be circulated in different model functional areas, supporting transfer-in to the contract account model and execution of the corresponding contract script, as well as execution of the contract and transfer-out to the user's one-time address of the UTXO model.

[0166] Before merging the UTXO model transaction data of each private chain account, the transaction data can be verified. Only when it is correct can it be merged into a consortium chain (or an on-chain consortium chain). The purpose of the verification is to prevent the private chain from generating incorrect transaction data, which will lead to the unknown issuance of consortium tokens, so the total amount of tokens circulating within the consortium can be confirmed. The above adds a balance model function area, but the data of the balance model part does not participate in the merger. It is necessary to verify the correct flow of tokens in the UTXO model transaction data and verify whether the transfer amount is valid. And it is only necessary to verify that the cumulative transfer amount commitment CvinSum>= cumulative transfer amount commitment CvoutSum, and the transfer amount can be considered valid without verifying the balance model data. If the balance status of a private chain of a system is wrong, it can be ensured that it is within the system and will not be transmitted to other institutional systems, avoiding the spread of risks and protecting other member institutions of the consortium chain.

[0167] like Figure 4As shown, the data in the license chain block is divided into two parts: external verification data and other data. The first part is the external verification data, including transaction data, transfer-in transaction data and transfer-out transaction data of the UTXO model, and optionally metadata, which includes the range proof of CvinSum-CvoutSum>=0. The second part is the rest of the data except the external verification data, that is, the non-external verification data, mainly including the transaction data of the balance model. These two data sets in the block generate a Merkle Tree respectively, and the corresponding Merkle Root can be recorded in the block header data of the private chain. Therefore, verification also includes two types: external verification and internal verification. External verification of the system can be the verification of the data to be merged in the license chain by the validators of the alliance chain such as other institutions or endorsement nodes of the alliance chain when merging the alliance chain. The external verification method only verifies one or more of the following: whether the reference unlocking of the UTXO model transaction is valid, whether the sum of the input amount commitments of the transaction is equal to the sum of the output amount commitments, and the range proof of the output amount commitment, that is, only verifying whether the circulation of the alliance token is correct. Internal verification can include all verifications within the permission chain, including whether the output address user exists, whether the contract result is correct, whether the user status is correct, etc.

[0168] In an exemplary embodiment, the first data in the off-system verification data set may be metadata, which is not transaction data. The metadata includes proof data of the transfer-in and transfer-out amount commitments, namely, CvinSum and CvoutSum and the range proof of CvinSum-CvoutSum>=0, where CvinSum is the cumulative transfer-in amount commitment from the UTXO model to the balance model, and CvoutSum is the cumulative transfer-out amount commitment from the UTXO model to the balance model. CvinSum and CvoutSum can be calculated by adding up the CvinSum` and CvoutSum` contained in the metadata of the previous block, as well as all the transfer-in and transfer-out amounts in this block, so the verification process does not require storage of the state. The metadata may also include other additional information, such as the commitment CincomeAll of the total amount of tokens currently circulated in the private chain system and the commitment CoutgoAll of the total amount of withdrawals, as well as the range proof of CincomeAll-CoutgoAll>=0. Among them, CincomeAll is the sum of the cumulative input amount commitment and the cumulative issuance amount commitment of cross-permission chain transactions, and CoutgoAll is the sum of the cumulative output amount commitment and the cumulative recovery amount commitment of cross-permission chain transactions. Figure 5 This is a sample list of metadata in a permissioned blockchain block with tokens of various asset types.

[0169] The above analysis shows that the homogeneous tokens of several asset types in the system form several corresponding DAG structured transaction chains. Therefore, multiple tokens issued by alliances may circulate on the private chain, so the metadata in the block can contain a list, which records the cumulative data and proofs of tokens of different asset types. For example, CincomeAll = cumulative cross-chain input amount commitment + cumulative issuance amount commitment, CoutgoAll = cumulative cross-chain output amount commitment + cumulative recovery amount commitment, and CincomeAll-CoutgoAll represents the total amount of a certain type of asset in the system, while CvinSum-CvoutSum represents the total amount of the balance model of a certain type of asset in the system, so the difference between the two is the total amount of the UTXO model of a certain type of asset in the system, and the metadata can provide a range proof of the difference between the two. Therefore, the metadata list records multiple token identifiers of different asset types and the corresponding cumulative amount commitments and range proof data.

[0170] If the internal transactions of the private chain system use zero-knowledge proof, the externally verified consortium chain verifier can only verify whether the zero-knowledge proof is correct, and does not know the actual transaction data, and cross-private chain transactions need to be converted to address transactions. In order to prevent the system from transferring out illegal tokens, the validity of cross-chain output transactions can be proved by the amount in the metadata. The principle is similar to verifying that the cumulative transfer-in amount commitment of the UTXO model and the balance model is greater than or equal to the cumulative transfer-out amount commitment, so that the system cannot output wrong tokens across private chains to other institutional systems to avoid the spread of risks.

[0171] In an exemplary embodiment, the specific merging process is as follows: after a certain permission chain generates new block data, the validator of the alliance chain performs external verification on the block data, that is, only verifies the external verification data in the block, and needs to verify whether the unspent transactions referenced by the input of the data to be uploaded have the member certificate of the alliance chain, that is, to ensure that the data of the alliance chain uploaded are all unspent outputs on the referenced alliance chain, so the cross-permission chain transactions are transformed into transactions within the alliance chain after merging. After the validator successfully verifies, the block header hash value used to indicate the limit of the alliance chain block height is added to the permission chain block header data, that is, the maximum block height corresponding to the unspent output on the alliance chain referenced by the cross-permission chain transaction in the block. If the permission chain block does not contain a cross-permission chain transaction, it is equal to the block header hash value corresponding to the previous permission chain block header contained in the permission chain block header indicating the limit of the alliance chain block height, that is, if it does not contain a cross-permission chain transaction, the limit of the alliance chain block height remains unchanged. If the previous block does not contain a cross-permission chain transaction and there is no on-chain consortium chain (the block headers of the on-chain consortium chain all have a block header hash value indicating the limit on the consortium chain block height), it is necessary to continue to recurse forward. If the recursion to the genesis block still does not contain a cross-permission chain transaction, the block header hash value indicating the limit on the consortium chain block height of the block header is set to a first preset value (for example, zero).

[0172] like Figure 6 As shown, the consortium chain block header X contains block header data of multiple permission chains, exemplarily including block header data of permission chains A and B, and may also contain block header data of other permission chains. Among them, the block headers N1 and N2 of permission chain B have the hash value of block header X1 that indicates the limit of the consortium chain block height, so it means that N1 and N2 can only be chained to the consortium chain after the consortium chain block header X1. Therefore, N1 is chained to the consortium chain block X2, and N2 is chained to the consortium chain block Xn. And the consortium chain blocks X2 and Xn do not contain the block header data of permission chain B, but only contain the block header data of other permission chains, so the block header data of permission chain B is chained to the consortium chain in sequence. Similarly, the consortium chain block Xn also includes the block header Nm of permission chain B, indicating that a block of the consortium chain can contain multiple block header data of a permission chain, but it must also meet the requirement of chaining in sequence. These two conditions ensure that the input references of the UTXO transaction data of the permission chain corresponding to the on-chain consortium chain are all forward unspent outputs on the consortium chain and will not be affected by the fork of the consortium chain.

[0173] The validator then endorses and signs the block header data and sends it to the account keeper of the alliance chain, who then reaches a consensus on the block header data and uploads it to the alliance chain. Similarly, when other private chains of other systems generate new block data, they also verify it and upload the consensus on the block header data to the chain.

[0174] The account keeper of the consortium chain must ensure that the previous permission chain block header data contained in the permission chain block header data is chained to the consortium chain before, and there is no other block header data of the permission chain subsequently, that is, the permission chain block header is chained in sequence. And the block header hash value corresponding to the permission chain block header used to indicate the limit of the consortium chain block height is equal to a certain forward consortium chain block header hash value. If the hash value is the first preset value, the block height of the consortium chain on the chain is not limited, because there is no reference to the unspent output of other permission chains, and the consortium chain can be chained at any block height. Because the transactions in the permission chain block can be divided into transactions within the permission chain and cross-permission chain transactions. These two conditions respectively guarantee the validity of transactions within the permission chain on the consortium chain and the validity of cross-permission chain transactions on the consortium chain, because the permission chain block header is chained in sequence, which can ensure that the transactions within the permission chain reference the forward unspent output within the permission chain. And if the alliance chain is forked, the block header hash value used to indicate the limit on the alliance chain block height can ensure that the transaction data after being uploaded to the alliance chain satisfies the input reference to the forward unspent output on the alliance chain.

[0175] The bookkeeper verifies that a certain permission chain block header is chained to the alliance chain in sequence, and also needs to verify whether the first block header of the permission chain chained to the alliance chain is valid. If the block header hash value indicating the limit of the alliance chain block height contained in the first block header is not the first preset value, it cannot be verified whether it is a valid first block header, because the blocks before the permission chain may contain cross-chain transaction data. Therefore, the block header hash value indicating the limit of the alliance chain block height contained in the first block header of a permission chain chained to the alliance chain must be the first preset value to indicate that the blocks before the permission chain do not contain cross-chain transaction data. If the current block of the permission chain does not contain cross-permission chain transactions, and the blocks before the permission chain contain cross-permission chain transactions, because the permission chain block headers are chained to the alliance chain in sequence, the block header hash value indicating the limit of the alliance chain block height of the current block header can be set to the second preset value (for example, FF...FF). The permission chain block header data containing the second preset value does not limit the block height of the on-chain alliance chain, but indicates that the block before the permission chain contains cross-permission chain transactions and cannot be used as the first block header data of the on-chain alliance chain. It implicitly limits the block height of the on-chain alliance chain by chaining in sequence, because the on-chain alliance chain must be chained after the explicit restriction of the on-chain alliance chain block (including cross-chain transactions) height.

[0176] The merged alliance chain has a two-layer structure, such as Figure 7As shown in the figure, the first layer is the middle layer of the alliance chain (including the block header data of the private chain), and the second layer is the ledger data of the alliance chain (that is, the block data corresponding to the private chain block header). The non-external verification data in the permission chain block does not belong to the alliance chain. Therefore, before the transaction data of the private chain is chained to the alliance chain, there is only the member certificate of the private chain. After being chained to the alliance chain, there is the member certificate of the alliance chain, and the certificate is also two-layered. The alliance chain uses a two-layer structure. The amount of data in the first layer that needs to be merged and generated is very small. It can support the merging of multiple private chains with large amounts of ledger data, and only the first layer of data is made public, so no privacy information will be leaked. Therefore, through layered ledgers and multi-level consensus, the accounting and security privacy issues of large-scale ledger data of the alliance chain are solved.

[0177] Several member chains of the alliance chain can achieve faster cross-chain transactions between sub-alliances by establishing sub-alliance chains. The on-chain method of the sub-alliance chain is the same as that of the alliance chain, but there are fewer member chains involved, and they can trust each other to only verify cross-chain transactions, so cross-chain transactions between sub-alliances can be completed more quickly. The validator of the alliance chain verifies the cross-permission chain transaction between the sub-alliance chains as a transaction method within the sub-alliance chain, and verifies the cross-permission chain transaction between non-sub-alliance chains as a normal cross-chain transaction method. The transaction data within the chain only needs to reference the unspent output within the chain, so the block header hash value of the sub-alliance chain used to indicate the limit on the alliance chain block height is the maximum block height corresponding to the unspent output on the alliance chain referenced by the cross-permission chain transaction between non-sub-alliance chains. The new first-layer block data generated by the sub-alliance chain is composed of the block header data of the permission chains participating in the sub-alliance chain, which are then packaged together and added with a block header hash value used to represent the limit on the alliance chain block height and uploaded to the alliance chain. This ensures cross-chain transactions between the permission chains of the sub-alliance chain and can be processed as intra-chain transactions of the sub-alliance chain.

[0178] The balance model can also use an independent system, that is, the private chain only contains transactions and transfer-in and transfer-out transactions of the UTXO model (it is necessary to be able to calculate the amount commitment, and the actual transfer-out transaction is initiated by the balance model). The balance model uses an independent system, which is a different consensus from the UTXO model. The consensus block time cannot be guaranteed, and the transactions and status are based on the data of their own blocks. Therefore, the two parts need to have their own set of transfer-in and transfer-out transactions. For example, if the UTXO model generates a transfer-in transaction, the balance model needs to copy it; or if the balance model generates a transfer-out transaction, the UTXO model also needs to copy it. In order to ensure that the transfer-in and transfer-out transactions of two different systems correspond one to one, they can be verified by serial number counting.

[0179] The private chain of the above-mentioned institution can also be a permission chain (an alliance of institutions) jointly managed by multiple institution nodes, that is, it has endorsement nodes and accounting nodes of multiple institutions, and the relevant institution ID is replaced by the system ID or chain ID. That is, whether it is a private chain or a permission chain of an institutional alliance, it can participate in the alliance chain that is merged into a chain, and the embodiments of the present disclosure do not impose any restrictions. And it can also be merged into an alliance chain through a sub-alliance chain (an alliance of chains), for example, by merging the block header data of the first layer.

[0180] The above user's signature key can be replaced by the user's signature subkey, for example, signature subpublic key PkId = Hash (su, keyId) * Pk, where su is the user's generated private key or viewing private key, Pk is the user's signature public key, keyId is the subkey identifier, and the corresponding signature subprivate key is dkId = Hash (su, keyId) * dk% n, where dk is the private key of Pk, and n is the order of the additive group based on G. Therefore, different signature subkeys can be used in different scenarios to protect the privacy and security of users.

[0181] You can also use a multi-signature key method. For example, if a user has five public keys Pa, Pb, Pc, Pd, and Pe, and needs to use the five public keys to register on the private chain, then the user's multi-signature public key is Px = Pa + Pb + Pc + Pd + Pe, and the user's multi-signature sub-public key is h*Px = h*(Pa + Pb + Pc + Pd + Pe), which is the sum of each sub-public key of the user, where h = Hash(su, keyId). However, the multi-signature key lacks a combination relationship, and the key combination relationship can be encoded as sc, and keyId can contain sc information.

[0182] For example, the five public keys of the above user are five points P(x,y) on the elliptic curve, which are sorted P1-P5 in order of x. According to the sequence number and combination relationship of the key, for example, OP_2(1,3,5)OP_3OP_CMS AND OP_1(2,4)OP_2OP_CMS, where OP_CMS means verifying m-of-n multi-signatures, which contain n public keys and at least m public keys are signed. So the above means that keys 1,3,5 are signed 2-of-3 and keys 2,4 are signed 1-of-2. The combination relationship is encoded as sc through recursive length prefix (RLP). keyID contains sc information, such as keyID+sc. Therefore, the generated multi-signature subkey is also associated with the key combination relationship, and the subkeys generated by different combination relationships are different. The user public key is used in the above transaction. The recipient only needs to show a multi-signature public key or a normal public key to the sender. The sender cannot distinguish the key type because they are all points on the elliptic curve, but the multi-signature public key lacks a combination relationship. Through the multi-signature sub-key with implicit combination relationship, users only need to register multiple original public keys to generate multi-signature sub-public keys in any combination. The system can also verify the validity of the combination relationship. Multi-signature sub-keys with different combination relationships can be used in different scenarios, and it can prevent others from replacing or tampering with other combination relationships.

[0183] An exemplary embodiment of the present disclosure also provides a computer storage medium, which stores computer executable instructions; after the computer executable instructions are executed, the methods provided by one or more of the aforementioned exemplary embodiments can be implemented, for example, a chain structure processing method, a chain structure data processing method, or a chain structure data verification method. The computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer.

[0184] An exemplary embodiment of the present disclosure also provides a computer device (or computer equipment). The computer device may include a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the chain structure processing method, the chain structure data processing method, or the chain structure data verification method in the present disclosure may be implemented. The structure of the above-mentioned computer device is described below by an example.

[0185] like Figure 8 As shown, in one example, a computer device may include: a processor 101, a memory 102, a bus system 103 and a transceiver 104, wherein the processor 101, the memory 102 and the transceiver 104 are connected via the bus system 103, the memory 10 is used to store instructions, and the processor 101 is used to execute the instructions stored in the memory 102 to control the transceiver 104 to send signals.

[0186] It should be understood that the processor 101 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0187] The memory 102 may include a read-only memory and a random access memory, and provides instructions and data to the processor 101. A portion of the memory 102 may also include a nonvolatile random access memory. For example, the memory 102 may also store information on the device type.

[0188] In addition to the data bus, the bus system 103 may also include a power bus, a control bus, and a status signal bus. Figure 8 In FIG. 1 , all buses are labeled as bus system 103 .

[0189] In the implementation process, the processing performed by the computer device can be completed by the hardware integrated logic circuit in the processor 101 or the instructions in the form of software. That is, the steps of the method disclosed in the embodiment of the present disclosure can be embodied as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 102, and the processor 101 reads the information in the memory 102 and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.

[0190] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0191] The above shows and describes the basic principles and main features of the present application and the advantages of the present application. The present application is not limited by the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present application. Without departing from the spirit and scope of the present application, the present application may have various changes and improvements, and these changes and improvements all fall within the scope of the present application to be protected.

Claims

1. A chain structure transaction data processing method, characterized in that: The chain structure is a permission chain, the permission chain includes transaction data of the UTXO model and transaction data of the balance model, and the transaction data processing method includes: The UTXO model performs an incoming transaction to the balance model, and / or the balance model performs an outgoing transaction to the UTXO model, so as to realize the flow of tokens between the UTXO model of the permission chain and the balance model, and obtain the data of the incoming transaction and / or the data of the outgoing transaction; The consortium chain verifier verifies the off-system verification data of the permission chain block to be chained, including: verifying whether the input reference of the transaction data of the UTXO model and / or the data transferred into the transaction is the unspent output on the consortium chain, or verifying whether the input reference of the transaction data of the non-cross-chain UTXO model of the permission chain and / or the data transferred into the transaction is the forward unspent output of the permission chain; After the verification is passed, a block header hash value indicating the restricted alliance chain block height is added to the permission chain block header data to be chained, and the restricted alliance chain block height is at least the maximum block height corresponding to the unspent output on the alliance chain referenced by the cross-permission chain transaction in the permission chain block, so as to limit the permission chain block header of the chained alliance chain to only be behind the alliance chain block represented by the block header hash value, and ensure that the cross-chain transactions all reference the forward unspent output on the alliance chain; Endorsing the permission chain block header data with the block header hash value added to indicate the limit on the alliance chain block height; The off-system verification data of multiple permission chains belonging to the same alliance chain are merged into the account book data of the alliance chain, wherein the off-system verification data of the permission chain includes one or more of the following: the data of the incoming transaction, the data of the outgoing transaction and the transaction data of the UTXO model.

2. The method according to claim 1, characterized in that: The step of merging the external verification data of multiple permission chains belonging to the same alliance chain into the ledger data of the alliance chain includes: After consensus is reached on the block header data of the multiple permission chains, the first-layer ledger data of the alliance chain is generated, and the off-system verification data corresponding to the block header data of the permission chain is used as the second-layer ledger data of the alliance chain, so as to merge the TXO transaction data chains of the multiple permission chains into the TXO transaction data chain of the alliance chain.

3. The method according to claim 1, characterized in that The method further includes: verifying, by a verifier, the external verification data of the permission chain block, including: Verify that the transaction data of the UTXO model and / or the input references of the data transferred into the transaction are unspent outputs on the consortium chain; or Verify whether the transaction data of the non-cross-chain UTXO model of the permission chain and / or the input reference of the data transferred into the transaction is the forward unspent output of the permission chain.

4. The method according to claim 1, characterized in that: The method of merging the off-system verification data of multiple permission chains belonging to the same alliance chain into the ledger data of the alliance chain includes: generating the first-layer ledger data of the alliance chain after consensus of the block header data of multiple permission chains that have been endorsed and signed, and using the off-system verification data corresponding to the block header data of the permission chain as the second-layer ledger data of the alliance chain.

5. The method according to claim 4, characterized in that The adding of a block header hash value for indicating a limit on the alliance chain block height in the permission chain block header data to be uploaded to the chain includes: When the permission chain block to be chained does not contain a cross-permission chain transaction, the permission chain is recursively forward to the previous permission chain block containing a cross-permission chain transaction, and the permission chain block header pointing to the permission chain block is found on the alliance chain, and the block header hash value used to indicate the restriction of the alliance chain block height in the permission chain block header is added to the permission chain block header data currently to be chained, indicating that the permission chain block header currently to be chained can only be chained after the alliance chain block represented by the block header hash value; or when the permission chain block to be chained does not contain a cross-permission chain transaction, and the permission chain is recursively forward to the permission chain block containing a cross-permission chain transaction, the second preset value is added to the permission chain block header data currently to be chained.

6. The method according to claim 5, characterized in that The method also includes: when the cross-permission chain transaction is still not included in the genesis block when recursively forward on the permission chain, setting the block header hash value used to indicate the restriction on the alliance chain block height in the permission chain block header data to be chained to a first preset value.

7. The method according to claim 1, characterized in that The off-system verification data of the permission chain also includes metadata. For any asset type token, the metadata includes the cumulative transfer-in amount commitment and the cumulative transfer-out amount commitment of the UTXO model of the asset type token to the balance model, and range proof data that the difference between the cumulative transfer-in amount commitment and the cumulative transfer-out amount commitment is greater than or equal to zero.

8. The method according to claim 7, characterized in that For any asset type token, the metadata also includes: a first result of the cumulative input amount commitment plus the cumulative issuance amount commitment of the cross-permission chain transaction of the asset type token, and a second result of the cumulative output amount commitment plus the cumulative recovery amount commitment of the cross-permission chain transaction, and range proof data that the difference between the first result and the second result is greater than or equal to zero.

9. The method according to claim 1, characterized in that: The method further comprises: The off-system verification data set of the license chain generates a first Merkle tree, and the other data sets of the license chain except the off-system verification data generate a second Merkle tree. The root hash value of the first Merkle tree and the root hash value of the second Merkle tree are recorded in the block header data of the license chain.

10. The method according to claim 1, characterized in that The method further comprises: The first permission chain generates cross-chain output transaction data and outputs a unique cross-chain transaction address; The second permission chain generates cross-chain input transaction data, and the input references the cross-chain transaction address; Wherein: the cross-chain transaction address includes an address type indicating that the current address is a cross-chain transaction address, a unique identifier of the first permission chain, a unique identifier of the second permission chain, and a unique number of the first permission chain across chains.

11. The method according to claim 10, characterized in that The first permission chain generates cross-chain output transaction data, including: The first permission chain generates a first Pedersen commitment of a first algorithm for cross-chain output, a second Pedersen commitment of a second algorithm, and proof data that the first amounts represented by the second generator coefficients committed by the first Pedersen commitment and the second Pedersen commitment are equal.

12. The method according to claim 1, characterized in that The UTXO model performs a transfer transaction to the balance model, including: The UTXO model performs a direct transfer-in transaction to the balance model; or the UTXO model performs an indirect transfer-in transaction to the balance model; wherein: the input of the direct transfer-in transaction references the unspent output of the UTXO transaction, and the output is the user account address of the balance model; the indirect transfer-in transaction includes a first intermediate transaction and a first receipt transaction, the input of the first intermediate transaction references the unspent output of the UTXO transaction, and the output of the first receipt transaction is the user account address or contract account address of the balance model.

13. The method according to claim 12, characterized in that The first intermediate transaction in the indirect transfer transaction is bound to the first commitment of one or more recipients, the output of the first intermediate transaction is the intermediate transaction address, the input of the first receipt transaction is one or more of the first intermediate transactions, the output of the first receipt transaction is bound to the second commitment, the second commitment is a new commitment obtained after the first commitment is calculated, and the address of the second commitment generated by the first calculation is the user account address or contract account address of the balance model.

14. The method according to claim 1, characterized in that The balance model performs a transfer transaction to the UTXO model, including: The balance model performs a direct transfer transaction to the UTXO model, or the balance model performs an indirect transfer transaction to the UTXO model; Among them: the input of the direct transfer transaction is the user account address or contract account address of the balance model, and the output is the user's one-time address of the UTXO transaction; the indirect transfer transaction includes a second intermediate transaction and a second receipt transaction, the input of the second intermediate transaction references the user account address or contract account address of the balance model, and the output of the second receipt transaction is the user's one-time address of the UTXO transaction.

15. The method according to claim 14, characterized in that The second intermediate transaction in the indirect transfer transaction is bound to the third commitment of one or more recipients, the output of the second intermediate transaction is the intermediate transaction address, the input of the second receipt transaction is one or more of the second intermediate transactions, the output of the second receipt transaction is bound to the fourth commitment, the fourth commitment is a new commitment obtained after the third commitment is calculated, and the address generated by the second calculation of the fourth commitment is the user's one-time address of the UTXO transaction.

16. A chain structure transaction processing method, characterized in that: For cross-chain transactions between a first permission chain and a second permission chain, the first permission chain uses a first algorithm, the second permission chain uses a second algorithm, and the chain structure transaction processing method includes: When the first permission chain and the second permission chain conduct cross-chain transactions, a first Pedersen commitment of the first algorithm, a second Pedersen commitment of the second algorithm, and proof data that the first amounts represented by the second generator coefficients committed by the first Pedersen commitment and the second Pedersen commitment are equal are generated for cross-chain output, so as to prove that the first amounts in different algorithms are equal.

17. The method according to claim 16, characterized in that The proof data includes: a third Pedersen commitment of the first algorithm, a fourth Pedersen commitment of the second algorithm, and a first scalar, a second scalar, and a third scalar, wherein the second amount represented by the second generator coefficient committed by the third Pedersen commitment and the fourth Pedersen commitment is equal; The first scalar is the first hash value multiplied by the first amount plus the second hash value multiplied by the second amount; The second scalar is the first hash value multiplied by the first generator coefficient of the first Pedersen commitment plus the second hash value multiplied by the first generator coefficient of the third Pedersen commitment; The third scalar is the first hash value multiplied by the first generator coefficient of the second Pedersen commitment plus the second hash value multiplied by the first generator coefficient of the fourth Pedersen commitment; The first hash value is obtained by the first Pedersen commitment, the second Pedersen commitment, the third Pedersen commitment, the fourth Pedersen commitment, the parameters of the first algorithm, and the parameters of the second algorithm through a first hash function; the second hash value is obtained by the first Pedersen commitment, the second Pedersen commitment, the third Pedersen commitment, the fourth Pedersen commitment, the parameters of the first algorithm, and the parameters of the second algorithm through a second hash function.

18. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the method of any one of claims 1-15 or 16-17.

19. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 15 or 16 to 17 are implemented.