WO2021120253A1 - Data storage method and verification method for blockchain structure, blockchain structure implementation method, blockchain-structured system, device, and medium - Google Patents

Data storage method and verification method for blockchain structure, blockchain structure implementation method, blockchain-structured system, device, and medium Download PDF

Info

Publication number
WO2021120253A1
WO2021120253A1 PCT/CN2019/128379 CN2019128379W WO2021120253A1 WO 2021120253 A1 WO2021120253 A1 WO 2021120253A1 CN 2019128379 W CN2019128379 W CN 2019128379W WO 2021120253 A1 WO2021120253 A1 WO 2021120253A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
key
chain
information
transaction
Prior art date
Application number
PCT/CN2019/128379
Other languages
French (fr)
Chinese (zh)
Inventor
郑杰骞
Original Assignee
郑杰骞
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 郑杰骞 filed Critical 郑杰骞
Priority to TW109119498A priority Critical patent/TWI749583B/en
Publication of WO2021120253A1 publication Critical patent/WO2021120253A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2219Large Object storage; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • This article relates to, but is not limited to, the field of computer data processing technology, especially a chain structure data storage method and device, a chain structure verification method and device, a chain structure system and implementation method, a storage medium, and a computer device.
  • the current decentralized system has the following problem: the node needs to store all the data in order to verify the entire ledger data.
  • This article provides a data storage method, chain structure verification method, chain structure realization method and system.
  • the present disclosure provides a data storage method for storing data in a chain structure, and the method includes:
  • connection information of the chain in the chain structure is used as the first key, and the data in the chain structure associated with the first key is used as the value, and the data is stored as input data or output data.
  • the input data and output data stored in the data storage device are associated according to the same connection information.
  • the present disclosure further provides a chain structure verification method, the method includes:
  • connection information of the chain in the chain structure as the first key, and use the data in the chain structure associated with the first key as the value to verify whether the data associated with the first key has errors, After verifying that the data associated with the first key has no errors, the data is stored as input data or output data.
  • the present disclosure further provides a chain structure verification method, the method includes:
  • connection information of the chain in the chain structure Taking part or all of the connection information of the chain in the chain structure as the second key, acquiring data stored in the data storage device and associated with the second key from the data storage device, and verifying the data according to the acquired data Whether there are errors in the data in the chain structure.
  • the present disclosure also provides a method for implementing a chain structure.
  • the chain structure system includes a first chain system, a second chain system, and a data storage device, and the method includes:
  • the second chain system After verifying the block data of the first chain, the second chain system writes one or more continuous block data of the first chain into the block data of the second chain;
  • the data storage device uses part or all of the connection information of the chain in the second chain as the first key, and the data associated with the first key as the value. After verifying that the data associated with the first key has no errors, it will The data is stored as input data or output data, and the input data and output data stored in the same data storage device are related according to the same connection information.
  • the present disclosure also provides a chain structure data storage device, the data storage device includes a first storage module and a second storage module, wherein:
  • the first storage module is configured to store part or all of the connection information of the chain in the chain structure as a first key
  • the second storage module is configured to store the data in the chain structure associated with the first key as input data or output data, and the input data and output data stored in the same data storage device are related according to the same connection information United.
  • the present disclosure also provides a chain structure data verification device.
  • the data verification device includes a key value search module and a second verification module, wherein:
  • the key value search module is configured to search for part or all of the connection information of the chain in the chain structure as the second key
  • the second verification module is configured to obtain data associated with the second key stored by the data storage device from a data storage device, and verify whether the data in the chain structure has errors according to the obtained data.
  • the present disclosure also provides a chain structure system, including: a first chain system, a second chain system, and a data storage device, wherein:
  • the first chain system is configured to, after signing the ledger data, write the signed ledger data into the block data of the first chain;
  • the second chain system is configured to write one or more continuous block data of the first chain into the block data of the second chain after verifying the block data of the first chain;
  • the data storage device is configured to use part or all of the connection information of the chain in the second chain as the first key, and the data associated with the first key as the value, to verify whether the data associated with the first key has errors After verifying that the data associated with the first key has no error, the data is stored as input data or output data, and the input data and output data stored in the same data storage device are associated according to the same connection information.
  • the present disclosure also provides a computer-readable storage medium that stores computer-executable instructions, and the computer-executable instructions are used to implement any of the foregoing methods.
  • the present disclosure also provides a computer device, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor.
  • the processor implements any of the foregoing when the program is executed. Steps in a method.
  • Fig. 1 is a flowchart of an exemplary data storage method
  • Fig. 2 is a schematic structural diagram of an exemplary data storage device
  • Figure 3 is a flowchart of an exemplary data verification method
  • FIG. 4 is a schematic diagram of an exemplary data storage device with verification function
  • Figure 5 is a flowchart of another exemplary data verification method
  • Figure 6 is a schematic structural diagram of an exemplary data verification device
  • Fig. 7 is a flowchart of an exemplary chain structure realization method
  • Figure 8 is a schematic diagram of an exemplary chain structure system
  • Fig. 9 is an exemplary connection storage diagram, and the connection information is Bd1;
  • Figure 10 is an exemplary three-layer two-chain system architecture diagram
  • Fig. 11 is a schematic structural diagram of an exemplary computer device.
  • 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 depend on the specific order of the steps described herein, the method or process should not be limited to the steps in the specific order described. As those of ordinary skill in the art will understand, other sequence of steps are also possible. Therefore, the specific order of the steps set forth in the specification should not be construed as a limitation on the claims. In addition, the claims for the method and/or process should not be limited to performing their steps in the written order. Those skilled in the art can easily understand that these orders can be changed and still remain within the spirit and scope of the embodiments herein. .
  • This paper proposes a combination of private chain and public chain to solve the credibility problem of private chain data, and solve part of the fairness problem, and each user only needs to store part of the ledger data to equivalently verify all the ledger data.
  • Token refers to the token on the blockchain, also known as a pass.
  • CA Certificate Authority
  • eID electronic Identity
  • SPV Simple Payment Verification
  • POA Proof of Authority
  • Proof of Authority a consensus algorithm based on identity and reputation.
  • Gossip network protocol also called Epidemic Protocol (epidemic protocol), is an unstructured peer-to-peer network protocol, and is a network protocol used by systems such as Bitcoin.
  • DHT Distributed Hash Table
  • Distributed Hash Table is a distributed storage method. Without a server, each client is responsible for a small range of routing, and is responsible for storing a small part of data, so as to realize the addressing and storage of the entire DHT network.
  • Kademlia network protocol is a distributed hash table (DHT) network protocol, a structured peer-to-peer network protocol, and a network protocol adopted by systems such as IPFS.
  • DHT distributed hash table
  • Consistent Hash Algorithm An implementation of DHT. It can satisfy balance, monotonicity, dispersion and load in a dynamically changing environment.
  • UTXO Unspent Transaction Output
  • unspent transaction output refers to one or more unspent transaction outputs that become spent, and creates one or more new unspent transaction outputs, and continues to loop back.
  • DAG Directed Acyclic Graph
  • the public chain refers to a blockchain that anyone can read, send transactions, and participate in consensus. It is a completely decentralized system.
  • a public chain system that is the same as the public chain system except that anyone can send transactions is adopted to satisfy transaction centralization and decentralization of ledger data.
  • anyone can read and verify transactions and participate in consensus which can be traced and cannot be tampered with.
  • Private chain refers to a data chain whose write permission is in the hands of an organization, and belongs to a centralized system.
  • Consortium chain refers to a data chain whose write permission is in the hands of multiple organizations, and belongs to a partially decentralized system.
  • An exemplary embodiment of this document provides a data storage method for storing data in a chain structure, as shown in FIG. 1, including steps 11-12.
  • Step 11 Use part or all of the connection information of the chain in the chain structure as the first key
  • Step 12 The data in the chain structure associated with the first key is used as a value, and the data is stored as input data or output data.
  • the input data and output data stored in the same data storage device are related according to the same connection information. United.
  • One or a group of data contains the information in the previous one or a group of data, which is the connection information of the chain, and the connection information makes the aforementioned data logically form a chain structure.
  • the device set up for data storage can be implemented using DHT technology.
  • the device stores connection information in the chain structure as a first key (also referred to as a key value or a key value).
  • the connection information as the first key may be part or all of the chain structure connection information.
  • the first key may be, for example, an address or a hash value of the address.
  • each or each group of data includes input information and output information, wherein the input information of the current data is the output information of the data M, and the data M is logically the current data
  • the previous data previous data
  • the input information of the current data or the output information of the data M belongs to the connection information of the chain
  • the output information of the current data is the input information of the data N
  • the data N is logically the current data
  • the latter data next data
  • the output information of the current data or the input information of the data N also belong to the connection information of the chain.
  • the chain structure is, for example, a UTXO chain
  • each transaction data includes the referenced unspent output as input information and the new unspent output as output information.
  • the data storage device When receiving data that matches the first key value, stores the data as input data or output data according to the meaning of the data in the chain structure.
  • the input data and output data stored on the same data storage device are related according to the same key (that is, the connection information of the chain).
  • This storage method can be called connection storage or data pair storage.
  • One or more sets of input data and output data may be stored on the same data storage device.
  • the input data and output data are related according to the same connection information.
  • the chain structure can be any chain with chain structure characteristics.
  • the data storage device may be a user-end node or a consensus group, or other devices that need to be connected for storage.
  • the data to be stored can be transaction data or control data.
  • the token issuance data and consensus reward data in the control data can be stored as input data
  • the token recovery data in the control data can be stored as output data.
  • the corresponding keys are the preset address for token issuance, the preset address for consensus reward, and the preset address for token recovery.
  • the data associated with the first key is stored as input data; the first key is used as the When part or all of the input information in the chain structure, the data associated with the first key is stored as output data.
  • the data associated with the first key is stored as input data
  • the data associated with the first key is stored as output data
  • the data storage device in this embodiment can be used in combination with other systems, for example, with a decentralized system, or with a centralized system.
  • the above-mentioned data storage device may, for example, as shown in FIG. 2, include a first storage module 21 and a second storage module 22, wherein:
  • the first storage module 21 is configured to store part or all of the connection information of the chain in the chain structure as a first key
  • the second storage module 22 is configured to store the data in the chain structure associated with the first key as input data or output data, and the input data and output data stored in the same data storage device are associated according to the same connection information .
  • the second storage module 22 stores the data associated with the first key as input data, and when the first key As part or all of the input information in the chain structure, the second storage module 22 stores the data associated with the first key as output data.
  • the entire chain structure can be segmented by multiple data storage devices, which is convenient for retrieval and verification.
  • An exemplary embodiment herein also provides a chain structure verification method, which is verified by a data storage device. As shown in FIG. 3, the method includes steps 31-33.
  • Step 31 using part or all of the connection information of the chain in the chain structure as the first key;
  • Step 32 Use the data in the chain structure associated with the first key as a value, and verify whether the data associated with the first key has errors;
  • Step 33 After verifying that the data associated with the first key has no errors, store the data as input data or output data.
  • the chain structure can be any chain with the characteristics of a chain structure.
  • the data storage device may be a user-end node or a consensus group, or other devices that need to be connected for storage.
  • the data to be stored can be transaction data or control data.
  • the connection information as the first key can be part or all of the chain structure connection information.
  • the chain structure verification is performed by the device for data storage (for example, the user end node).
  • the data storage device stores the connection information in the chain structure as the first key. Therefore, when the data storage device receives data matching the first key corresponding to the device, it verifies the data. After there is no error, connect to storage again.
  • the data storage device verifies that the ledger data has no errors, and when it determines that the output information of the ledger data matches the first key, it stores the ledger data as input data and determines that the When the input information of the ledger data matches the first key, the ledger data is stored as output data, and the input data and output data stored on the same device are associated according to the same connection information. There can be one or more input data stored on the same device, and there can be zero (ie no output data), or one or more stored output data.
  • the verification is performed when the storage is connected, and the verification of the entire chain structure can be converted into partial verification, which is performed separately by multiple data storage devices, which is equivalent to verifying the correctness of all data.
  • This equivalent verification is adopted. In this way, the verification work is distributed to multiple devices to reduce the workload pressure of data verification.
  • storing the data as input data or output data may be in the following manner: when the first key is used as part or all of the output information in the chain structure, the first key is used as part or all of the output information in the chain structure.
  • the data associated with one key is stored as input data; when the first key is used as part or all of the input information in the chain structure, the data associated with the first key is stored as output data; stored on this device.
  • the input data and the output data are related according to the same connection information.
  • the foregoing verification of whether the data associated with the first key has errors includes one or more of the following verifications:
  • Verification 11 verifying whether the data is data on the chain structure
  • Verification 12 When the first key is used as the input information in the chain structure, verify whether there is output information that has the same connection information as the input information;
  • Verification 13 when the first key is used as the input information in the chain structure, verify whether the output information that has the same connection information as the input information has been used;
  • Verification 14 when the first key is used as the input information in the chain structure, and the data associated with the first key includes the transaction amount, verify whether the transaction amount is correct.
  • Verification 15 When the first key is used as the input information in the chain structure, and the data associated with the first key includes signature information, verify whether the signature information is correct.
  • the signature information is the unlocking signature of the user terminal that generates the transaction data.
  • the verification of whether the signature information is correct is to verify whether the signature information is valid.
  • the above verification sequence number is only for convenience of explanation, and does not represent the verification sequence.
  • the verification is error-free; for verification 12, if there is output information that has the same connection information as the input information, then the verification is error-free; for verification 13, If the output information that has the same connection information as the input information has not been used, the verification is error-free; for verification 14, the transaction amount is correct, then the verification is error-free; for verification 15, the verification that the signature information is valid, then the verification is no error.
  • the data storage device synchronizes the block header data in the chain structure, and the device searches whether the device stores the input data associated with the first key (you can also download the data from the first key). Search in the chain structure), if not, it is judged as a connection error, if there is, it is judged whether the associated connection of the input data is quoted, if it has been quoted, it is judged as a connection error; judge the account data Whether the transaction amount is correct, if it is correct, store the ledger data as output data, and mark the associated connection of the input data as being referenced, that is, the associated output information will be marked as used. If it is not correct, judge It is a data error.
  • the data contains signature information, verify whether the signature information is correct, and if it is incorrect, it is judged as a data error.
  • the signature information is, for example, the unlocking signature of the user terminal that generates the transaction data.
  • the output information associated with the input information will be marked as used.
  • the following methods may be used to verify whether the data is data on the chain structure:
  • the method further includes: according to the request of the data verification device, returning to the data verification device the data associated with the connection information of the chain stored by the device, including but not limited to the following data One or more of: input data, output data, Merkel tree certification path, additional verification data.
  • the Merkel tree certification path exists corresponding to the input data or the output data. Additional verification data may or may not be available. The additional verification data is used to verify whether the transaction amount is correct. For example, in UTXO, all input amounts and all output amounts need to be accumulated, so other transaction data may be required to complete the verification of the transaction amount.
  • the additional verification data also has a corresponding Merkel tree verification path.
  • a verification mechanism for other devices is set up, that is, a non-data storage device is used as a data verification device to verify whether the data in the chain structure has errors, and the node selected as the data verification device obtains it from the storage device Relevant data to complete verification.
  • the data storage device in this embodiment can be used in combination with other systems, for example, with a decentralized system, or with a centralized system.
  • the above-mentioned data storage device with verification function may, for example, as shown in FIG. 4, includes a third storage module 41, a first verification module 42, and a fourth storage module 43, wherein:
  • the third storage module 41 is configured to store part or all of the connection information of the chain in the chain structure as the first key
  • the first verification module 42 is configured to verify whether the data in the chain structure associated with the first key has errors
  • the fourth storage module 43 is configured to store the data in the chain structure associated with the first key as input data or output data after the verification module 42 verifies that there is no error.
  • the storage mode of the third storage module 41 may be the same as that of the first storage module 21 in FIG. 2, and the storage mode of the fourth storage module 43 may be the same as that of the second storage module 22 in FIG.
  • the data storage device with the verification function can add a first verification module 42 on the basis of the data storage device shown in FIG. 2 described above.
  • the fourth storage module 43 stores the data associated with the first key as input data, and when the first key is used as the input data, When part or all of the input information in the chain structure, the fourth storage module 43 stores the data associated with the first key as output data.
  • the first verification module 42 can perform any one or more of the above-mentioned verifications 11-15, which will not be repeated here.
  • the data storage device may further include a sending module, which is configured to return to the data verification device according to a request of another data verification device, the information associated with the connection information of the chain stored by the data verification device.
  • Data includes one or more of the following data: input data, output data, Merkel tree certification path, additional verification data.
  • the entire chain structure can be segmented and verified by multiple data storage devices.
  • An exemplary embodiment herein also provides a chain structure verification method, which is implemented by a data verification device. As shown in FIG. 5, the method includes steps 51-52.
  • Step 51 Use part or all of the connection information of the chain in the chain structure as a second bond
  • Step 52 Obtain the data associated with the second key (that is, the value corresponding to the key) stored on the data storage device from the data storage device, and verify whether the data in the chain structure is available according to the acquired data. error.
  • the non-data storage device verifies whether the data in the chain structure has errors, and the node as the data verification device obtains relevant data from the data storage device to complete the verification.
  • the second key may be, for example, an address or a hash value of the address.
  • the data associated with the second key obtained from the data storage device includes, but is not limited to, one or more of the following: stored by the data storage device: and the second key Associated data, Merkel tree certification path, additional verification data, wherein the second key is used as part or all of the output information in the chain structure, or the second key is used as the input in the chain structure Part or all of the information.
  • the data associated with the second key is the input data stored by the data storage device; the second key is used as the chain
  • the data associated with the second key is the output data stored by the data storage device.
  • the data verification device can synchronize the block header of the chain structure, and the block header contains the cumulative ledger data volume, and the data verification device uses the cumulative ledger data volume in the block header to generate a number address (using cumulative control data volume Generate the control data number address, use the accumulated transaction data volume to generate the transaction data number address), obtain part or all of the connection information of the chain according to the number address as the second key, and obtain the data stored on the data storage device from the data storage device The data associated with the second key.
  • the control data number address is used as the key to obtain the control data corresponding to the control data number address, and it can also include the Merkel tree authentication path of the control data; the transaction data number address is used as the key to obtain the transaction corresponding to the transaction data number address.
  • the data may also include the Merkel tree authentication path of the transaction data.
  • the preset address of the token issuance data of the control data (referred to as the token issuance address), the preset address of the token recovery data (referred to as the token recycling address) or the preset address of consensus reward data (referred to as the reward address) can be used as
  • the key is used to obtain the data associated with the key stored thereon from the data storage device;
  • the transaction address of the transaction data can be used as the key, and the key is used to obtain the data associated with the key stored on the data storage device.
  • the foregoing verification of whether the data in the chain structure has errors based on the acquired data includes:
  • Synchronizing the block header data in the chain structure combining the block header data and the data associated with the second key obtained from the data storage device, to verify whether the data in the chain structure has errors. For example, including one or more of the following verifications:
  • Verification 21 verifying whether the value associated with the second key obtained from the data storage device is data on the chain structure
  • Verification 22 when the second key is used as the input information of the acquired data, verify whether there is output information that has the same connection information as the input information;
  • Verification 23 when the second key is used as the input information of the acquired data, verify whether the output information having the same connection information as the input information has been used;
  • Verification 24 when the second key is used as the input information of the acquired data, and when the acquired data includes the transaction amount, verify whether the transaction amount is correct;
  • Verification 25 when the second key is used as the input information of the acquired data, and when the acquired data includes signature information, verify whether the signature information is correct.
  • the above verification sequence number is only for convenience of explanation, and does not represent the verification sequence.
  • the verification is error-free; for the verification 22, if there is output information that has the same connection information as the input information, the verification is error-free; for verification 23. If the output information with the same connection information as the input information has not been used, the verification is error-free; for verification 24, if the transaction amount is correct, then the verification is error-free; for verification 25, verify that the signature information is valid, then verify Is error-free.
  • An exemplary verification process use the Merkel tree authentication path to verify the input data stored on the data storage device, or as long as one of the input data and output data is not data on the chain, it is judged as a data error; judge if If there is only output data, it is judged as a connection error; if it is judged that the associated connection of the input data has been quoted, it is judged as a connection error; if it is judged that the transaction amount of the output data is incorrect, it is judged as a data error; If the signature information in the data (for example, the unlocking signature of the user terminal that generates the data) is incorrect, it is judged as a data error.
  • the above-mentioned data verification device may, for example, as shown in FIG. 6, include a key value search module 41 and a second verification module 62, where
  • the key value search module 61 is configured to search for part or all of the connection information of the chain in the chain structure as the second key;
  • the second verification module 62 is configured to obtain the data associated with the second key (that is, the value corresponding to the key) stored by the data storage device from the data storage device, and verify the data in the chain structure according to the obtained data Are there any errors in the data?
  • the second verification module 62 can perform any one or more of the foregoing verifications 21-25, which will not be repeated here.
  • An exemplary embodiment of this document also provides a method for implementing a chain structure.
  • the chain structure system includes a first chain system, a second chain system, and a data storage device. As shown in FIG. 7, the method includes step 71 -73.
  • Step 71 After the first chain system signs the ledger data, it writes the signed ledger data into the block data of the first chain;
  • Step 72 After verifying the block data of the first chain, the second chain system writes one or more continuous block data of the first chain into the block data of the second chain;
  • Step 73 The data storage device uses part or all of the link information of the second chain as the first key, and the data associated with the first key as the value, and after verifying that the data associated with the first key has no errors , Storing the data as input data or output data, and the input data and output data stored in the same data storage device are associated according to the same connection information.
  • the ledger data includes transaction data and/or control data.
  • the first chain is a private chain or a consortium chain, and is a chain controlled by a management end.
  • the second chain is similar to a public chain, except that not arbitrary data can be chained.
  • the first chain When the first chain generates new block data, it will be synchronized to the chain generating node of the second chain. After the block data is verified, the chain generating node of the second chain will generate new block data according to the consensus algorithm of the second chain. .
  • the second chain sequentially records the block data submitted by the first chain.
  • Each block data on the second chain contains the number of block data of the first chain. That is, each block on the second chain can Contains 1 to n block data of the first chain, and the number is determined by the consensus algorithm of the second chain.
  • each block data on the external second chain system is composed of one or more block data of the first chain system. Therefore, the logical state of the first chain system and the second chain system are the same. .
  • This embodiment uses the method of first generating the chain and then verifying, that is, the method of first generating the second chain, and then verifying by the third-tier data storage device.
  • the actual ledger data is chained by the first layer, the first chain system, and the second layer, the second chain system, can verify the Merkel tree and the signature of the management end, and does not modify the ledger data, but is stored by the third layer data
  • the device verifies whether there are errors in the ledger data. Realize transaction centralization and decentralization of ledger data.
  • the data storage device on the third layer stores and verifies data in a connected storage manner.
  • Each data storage device only needs to store and verify a small amount of data to achieve equivalent verification of the entire chain, reducing the burden on each device.
  • the chain generation node of the second layer can only verify the signature of the management end of the first chain system and the Merkel tree, which reduces the calculation amount of the second chain system.
  • the method further includes: the first chain system uses part or all of the connection information of the chain in the first chain as a third key, and data associated with the third key is used as a value,
  • the value associated with the third key is assigned to a consensus group that has the same third key as the value; for example, the first chain system may perform the above assignment before signing the transaction data.
  • the consensus group verifies the data associated with the third key, where:
  • the data associated with the third key includes transaction data, and the verification includes one or more of the following:
  • the third key When the third key is used as the input information of the transaction data, it is verified whether the signature information of the transaction data (the unlocking signature of the user terminal) is correct.
  • An exemplary verification process the consensus group searches for input data connected to the transaction data, that is, when the third key is used as the input information of the transaction data, it searches whether there is an output with the same connection information as the input information If the information is not found, it is judged as a connection error.
  • connection information Whether it is found, it is judged whether the associated connection of the input data is referenced, that is, when the third key is used as the input information of the transaction data, the verification is the same as the input information Whether the output information of the connection information has been used, if it has been quoted or used, it is judged as a connection error, if it has not been quoted, it is judged whether the transaction amount of the transaction data is correct, if not, it is judged as data Error, if it is correct, determine whether the signature information contained in the data (such as the unlocking signature of the user terminal that generates the transaction data) is correct, if it is incorrect, it is determined as the data error, if it is correct, the transaction data is stored as output data (ie
  • the consensus group may also use the above-mentioned connection storage method to store data), and mark the associated connection of the input data as being referenced, that is, the associated output information will be marked as used.
  • the third key is stored as input data or output data, where, when the third key is part or all of the output information in the first chain, the data associated with the third key is stored as input data, when When the third key is used as part or all of the input information in the first chain, the data associated with the third key is stored as output data; the input data and output data stored on the same consensus group are based on the same connection Information related.
  • the transaction data or control data is stored as input data; if the transaction data or control data is determined to be The input information matches the third key, and the transaction data or control data is stored as output data.
  • the first chain system includes multiple consensus groups.
  • the nodes in the same consensus group have the same keys. If the received transaction data is verified, the transaction data and the key are connected and stored. When the control data is verified, the key value and the control data are connected and stored. If the data is output information in the chain structure, the data is stored as input data; if the data is input information in the chain structure, the data is stored as output data.
  • the input data and output data stored on the same consensus group have the same key to form a data connection storage.
  • the storage of data by the data storage device is the same as the processing in the foregoing embodiment: when the first key is part or all of the output information in the second chain, the The data associated with the first key is stored as input data; when the first key is part or all of the input information in the second chain, the data associated with the first key is stored as output data; this data storage
  • the input data and output data stored on the device are related according to the same connection information.
  • the verification by the data storage device whether the data associated with the first key has an error includes one or more of the following verifications:
  • Verification verifying the integrity of the second chain
  • Verification 32 verifying whether the data is data on the second chain
  • Verification 33 when the first key is used as the input information of the ledger data in the second chain, it is verified whether there is output information that has the same connection information as the input information;
  • Verification 34 when the first key is used as the input information of the ledger data in the second chain, verify whether the output information that has the same connection information as the input information has been used;
  • Verification 35 When the first key is used as the input information of the ledger data in the second chain, and the data associated with the first key includes the transaction amount, verify whether the transaction amount is correct.
  • Verification 36 When the first key is used as the input information of the ledger data in the second chain, and the data associated with the first key includes signature information, verify whether the signature information is correct.
  • the verification 32-36 in this embodiment is similar to the verification 11-15 in the foregoing embodiment, except that the verification object in this embodiment is the second chain.
  • the method further includes: the first chain system sequentially numbers the ledger data, and the block header of the block data corresponding to the ledger data contains the cumulative amount of the ledger data.
  • the second chain system includes the accumulated book data amount in the block data in the block header of the block data of the second chain.
  • the transaction data is numbered in the first order
  • the control data is numbered in the second order
  • the last transaction is written in the block header of the block data
  • the serial number of the data and/or the serial number of the last control data makes the block header data include the cumulative transaction data volume and the cumulative control data volume.
  • each consensus group receives the cumulative transaction data volume sent by the previous consensus group, on the basis of the cumulative transaction data volume, it ranks the transaction data of this consensus group to be chained, and recalculates the new cumulative transaction data volume And send it to the next consensus group; after the consensus group numbers the transaction data to be chained, the consensus group requests to sign the numbered transaction data, and writes the signed transaction data into the first chain,
  • the block header of the block in which the transaction data is located contains the accumulated transaction data amount accumulating the transaction data.
  • the cumulative account data volume of the first chain includes the first cumulative transaction data volume and/or the first cumulative control data volume
  • the cumulative account data volume in the second chain includes the second cumulative transaction data volume and/or the second cumulative control data volume .
  • the second chain is asynchronous and homomorphic with the first chain. Since the block header of the first chain contains the accumulated transaction data amount and the accumulated control data amount, the block header of the second chain also contains the corresponding accumulated transaction data amount. And the amount of accumulated control data. By carrying the accumulated book data amount in the block header data, the data storage device can verify the integrity of the second chain according to the accumulated book data amount.
  • the data storage device can verify the integrity of the chain structure in the following manner: the data storage device synchronizes the block header of the second chain, and according to the cumulative ledger data volume (accumulated transaction data volume) in the block header And cumulative control data volume) to verify the integrity of the second chain.
  • the numbered address is used as the key to verify. For example, the device calculates all the transaction data number addresses of the current block according to the cumulative transaction data volume in the current block header data and the cumulative transaction data volume in the previous block header data, and according to the cumulative control data volume in the current block header data and the cumulative transaction data volume in the previous block header data.
  • the cumulative transaction data volume in the previous block header data is calculated to obtain all the control data number addresses of the current block, and it is judged that if each transaction data number address matches the network identifier of the node's distributed hash table, then search for the transaction
  • the transaction data corresponding to the data number address is judged if each control data number address matches the network identifier of the distributed hash table of the node, then the control data corresponding to the control data number address is searched, and if found, the integrity verification is performed Pass, if not found, integrity verification fails.
  • Integrity verification is verification performed by the data storage device storing the numbered address, and can be verified during storage. Because the characteristic of the distributed hash table is to store data on the node corresponding to the key to provide key retrieval, it itself needs to store the key and value. Here, because the numbered address is a sequence number and is known, the key is known, and it is also known on which nodes the key should be stored. Therefore, the node only needs to synchronize the block header data to know which keys of the numbered address should be stored by itself. If the node judges that it needs to store the data of the key, but does not store the data, it will be in the third layer (user side) or second layer. The layer (like public chain) retrieves the data, and then performs integrity verification, so that the integrity of the data can be verified through the node's own verification. Because through the cumulative number of block headers, the node can know which numbered addresses are available.
  • Random verification can be any node, not just a node that stores numbered addresses, some numbered addresses can be randomly selected for verification, and no storage is required.
  • the transaction data corresponding to the number address is obtained according to the random number address, and the input address of the transaction data is used as the key for verification. In essence, it is similar to integrity verification.
  • the data storage device verifies the second chain block header data according to the first chain block header data, including verifying whether the accumulated ledger data amount is correct.
  • the data storage device can verify whether the cumulative transaction number and cumulative control number of the first chain block head are equal to the cumulative transaction number and cumulative control number of the second chain block head. If they are equal, the number is correct and the first chain block head is the second
  • the chain block header generates the last block header data in the time segment.
  • the data storage device verifies whether the data is on-chain data by carrying the Merkel tree root hash value in the second chain block header data.
  • the second chain system writes one or more continuous block data of the first chain into the block data of the second chain, including: the second chain system writes one or more of the first chain Two consecutive blocks of data are recombined to generate the Merkel tree root hash value according to the transaction data sequence number sequence and the control data sequence number sequence, and the Merkel tree root hash value is included in the block header of the generated second chain value.
  • the verification by the data storage device whether the data is data on the second chain includes: the data storage device synchronizes the block header of the second chain, according to the Merkel tree root in the block header.
  • the desired value and the authentication path corresponding to the data verify whether the data is data on the second chain.
  • a data verification device in addition to the data storage device that can implement data verification, in order to improve security, a data verification device is added to perform data verification, that is, the data verification device in the foregoing embodiment.
  • the chain structure system further includes: a data verification device, and the method further includes: the data verification device uses part or all of the connection information of the chain in the chain structure as a second key to obtain from the data storage device The data associated with the second key stored on the data storage device verifies whether the data in the second chain has errors according to the acquired data.
  • the data verification device can synchronize the block header of the second chain, and use the cumulative ledger data volume in the block header to generate the number address (use the cumulative control data volume to generate the control data number address, and the cumulative transaction data volume to generate Transaction data number address), according to the number address to obtain part or all of the connection information of the chain as the second key, and obtain the data associated with the second key stored on the data storage device from the data storage device.
  • the control data number address is used as the key to obtain the control data corresponding to the control data number address, and it can also include the Merkel tree authentication path of the control data; the transaction data number address is used as the key to obtain the transaction corresponding to the transaction data number address.
  • the data may also include the Merkel tree authentication path of the transaction data.
  • the preset address of the token issuance data of the control data (referred to as the token issuance address), the preset address of the token recovery data (referred to as the token recycling address) or the preset address of consensus reward data (referred to as the reward address) can be used as
  • the key is used to obtain the data associated with the key stored thereon from the data storage device;
  • the transaction address of the transaction data can be used as the key, and the key is used to obtain the data associated with the key stored on the data storage device.
  • the data verification device obtains data associated with the second key stored on the data storage device from the data storage device, including one or more of the following data: data associated with the second key , Merkel tree certification path, additional verification data, wherein the second key is used as part or all of the output information in the chain structure, or the second key is used as part of the input information in the chain structure Or all; the data verification device synchronizes the block header in the second chain, and combines the block header and the data associated with the second key obtained from the data storage device to perform one of the following verifications Or more:
  • the second key is used as the input information of the acquired data, and when the acquired data includes a transaction amount, verify whether the transaction amount is correct;
  • the second key When the second key is used as the input information of the acquired data, and when the acquired data includes signature information, verify whether the signature information is correct.
  • the first chain is a private chain or a consortium chain
  • the method further includes: the first chain system issues one or more of the following keys to the user: management address master key, transaction address Master key, secret transaction master key, and symmetric encryption master key, where:
  • the management address master key is used to generate the next management address of the user with the current first generation parameter, and all the management addresses of the user form a logical chain;
  • the transaction address master key is used to generate the next receiving transaction address of the user with the current second generation parameter, and all receiving transaction addresses of the user form a logical chain;
  • the secret transaction master key is used to generate the working key of the current encryption and decryption ciphertext transaction amount with the current third generation parameter;
  • the symmetric encryption master key is used to generate the symmetric encryption work key of the user's next encryption and decryption management data with the current fourth generation parameter.
  • the symmetric encryption master key can also be used to generate symmetric encryption work for other data. Key.
  • the first chain system uses the management address master key issued for the user and the generation parameters in the user's previous management data to generate the user's current management address, and in the current management data Write the generation parameters used to generate the next management address of the user.
  • the first chain system may use the symmetric encryption master key issued for the user and the generation parameters in the user's previous management data to generate a symmetric encryption work key to encrypt the user's current management data.
  • the user can use the same key generation method to generate a symmetric encryption working key to decrypt the user's current management data.
  • the method further includes: the first chain system includes the value of the current consensus public key set mapping in the block header of the first chain; the data storage device according to the first chain block header The mapping value of the consensus public key set adopts Merkel tree proof or accumulator proof to verify whether the consensus public key in the second chain block header is valid.
  • the data verification device can also use Merkel tree certification or accumulator certification according to the mapping value of the consensus public key set in the first chain block header to verify that the second chain block header Is the consensus public key valid?
  • An exemplary embodiment herein also provides a chain structure system, as shown in FIG. 8, including: a first chain system 81, a second chain system 82, and a data storage device 83, wherein:
  • the first chain system 81 is configured to, after signing the ledger data, write the signed ledger data into the block data of the first chain;
  • the second chain system 82 is configured to write one or more continuous block data of the first chain into the block data of the second chain after verifying the block data of the first chain;
  • the data storage device 83 is configured to use part or all of the link information of the second chain as the first key, and the data associated with the first key as the value to verify whether the data associated with the first key has Error: After verifying that the data associated with the first key has no error, the data is stored as input data or output data, and the input data and output data stored in the same data storage device are associated according to the same connection information.
  • the first chain system further includes a consensus group
  • the first chain system is further configured to use part or all of the connection information of the chain in the first chain as a third key, data associated with the third key as a value, and assign the value associated with the third key to A consensus group with the same third key as the value, and the data associated with the third key includes transaction data;
  • the consensus group is set to verify the data associated with the third key, including one or more of the following verifications:
  • the consensus group is further configured to store the data associated with the third key as input data or output data after verifying the data associated with the third key.
  • the data associated with the third key is stored as input data, and when the third key is used as the input information in the first chain
  • the data associated with the third key is stored as output data; the input data and output data stored on the same consensus group are associated according to the same connection information.
  • the first chain system is further configured to sequentially number the ledger data, and the block header of the block data corresponding to the ledger data contains the cumulative amount of ledger data; the second chain system It is also set to include the cumulative ledger data amount in the block data in the block header of the block data of the second chain.
  • the data storage device 83 may be, for example, a data storage device as shown in FIG. 2.
  • the data storage device stores the data as input data or output data, including: the first When a key is used as part or all of the output information in the second chain, the data associated with the first key is stored as input data; the first key is used as part or all of the input information in the second chain At this time, the data associated with the first key is stored as output data; the input data and output data stored on the data storage device are associated according to the same connection information.
  • the data storage device verifies whether the data associated with the first key has errors, including one or more of the following verifications:
  • the data associated with the first key includes the transaction amount, verifying whether the transaction amount is correct;
  • the first key When the first key is used as the input information of the ledger data in the second chain, and the data associated with the first key includes signature information, it is verified whether the signature information is correct.
  • the data storage device verifies the integrity of the chain structure in the following manner: the data storage device synchronizes the block header of the second chain, and uses the cumulative ledger in the block header A numbered address is generated from the amount of data, and the integrity of the second chain is verified according to the numbered address.
  • the data storage device is further configured to verify whether the amount of accumulated ledger data in the second chain block header data is correct according to the first chain block header data.
  • the first chain is a private chain or a consortium chain
  • the first chain system is further configured to issue one or more of the following keys to the user: management address master key, transaction address master key Key, secret transaction master key, and symmetric encryption master key.
  • the system may further include a data verification device, and the data verification device may be, for example, a data verification device as shown in FIG. 6.
  • the data verification device is configured to use part or all of the connection information of the chain in the chain structure as a second key, and obtain data stored on the data storage device and associated with the second key from the data storage device , Verifying whether there is an error in the data in the second chain according to the acquired data.
  • the first chain system is further configured to include the value of the current consensus public key set mapping in the block header of the first chain, so that the data storage device or the data verification device is based on the first chain
  • the mapping value of the consensus public key set in the block header adopts Merkel tree proof or accumulator proof to verify whether the consensus public key in the second chain block header is valid.
  • the first chain system is further configured to use the management address master key issued for the user and the generation parameters in the user's previous management data to generate the user's current management address, and Write the generation parameter used to generate the next management address of the user in the current management data.
  • the first key value is the key value used by the data storage device for connection storage
  • the second key value is the key value used by the data verification device when retrieving data from the data storage device
  • the third key value is the first link
  • the consensus group query in the system and the key value used when the consensus group is connected and stored.
  • the first key value, the second key value, and the third key value may be different according to the corresponding chain structure, but all use part or all of the connection information in the chain structure. For example, it can be one or more of the following types: transaction address of transaction data, preset address of token issuance data of control data (referred to as token issuance address), preset address of token recovery data (referred to as token recycling address) ) And the preset address of the consensus reward data (referred to as the reward address).
  • the data associated with the key value is the corresponding transaction data or control data, and may also include the Merkel tree authentication path (referred to as the authentication path) corresponding to the data.
  • the key value can be stored in the management terminal or the client.
  • the chain structure system includes a first chain system, a second chain system, and multiple client (or client) nodes.
  • the client node may include a data storage device.
  • the user-end node of may also include a user-end node as a data verification device.
  • the data associated with the key value also includes the corresponding Merkel tree authentication path, which is the Merkel tree authentication of the transaction data or control data in the second chain path.
  • the present disclosure also provides a type of key value (fourth key value), which can be used for the data storage device to verify the integrity of the ledger data, and can also be used for the data verification device to query the key value.
  • the fourth key value includes one or more of the following information: the number address of the transaction data (generated according to the transaction data number) and the number address of the control data (generated according to the control data number). Can be stored on the client.
  • the data associated with the fourth key value is corresponding transaction data or control data, and may also include a corresponding Merkel tree authentication path. In the above example of the chain structure system, the authentication path associated with the fourth key value is the Merkel tree authentication path of the transaction data or control data in the second chain.
  • the present disclosure also provides a type of key value (the fifth key value), which can be used to query or retrieve the account data chain.
  • the user’s account data chain includes the first account data chain composed of the user’s management data and the The second account data link formed by the user's received transaction data.
  • the management address used to store the management data has an implicit chain structure, thereby forming the first account data link.
  • the transaction address used to store and receive transaction data also has an implicit chain structure, thereby forming a second account data chain.
  • the fifth key value includes a management address for querying management data or a transaction address for querying transaction data.
  • the address used as the key in this article can be an address or a hash value of the address.
  • Merkel tree is a hash binary tree, a data structure used to quickly summarize and verify the integrity of large-scale data.
  • the leaf nodes of the Merkel tree store the hash value of the unit data of the data set, and the hash value of the parent node is obtained through the hash operation between the nodes, and the hash value of the parent node is calculated through layer by layer to form the root node's hash value.
  • Hope value The leaf node can verify whether the leaf node belongs to the element in the data set according to the root hash value and the corresponding authentication path.
  • the number of leaf nodes of the Merkel tree is at most 2 ⁇ n of the tree depth. Even if it contains a large amount of data, a certain leaf node can be quickly verified through a fixed path. For example, if the tree depth is 30, it can contain up to 1073741824 leaf nodes. If a data block is generated in an average of 10 minutes, it can contain 1,789,569 transactions per second. But to verify the data of a leaf node, only 30 hash values are needed to complete the verification. If each hash value is 32 bytes, 960 bytes are required.
  • each client needs to save 10 pieces of data per block, and each client needs to save approximately 525,600 pieces of data a year, and each block is calculated based on the tree depth of 30, the size of the authentication path that needs to be saved is 481MB. If the size of each piece of data is 1KB, the total data size that needs to be saved is 994MB. But in fact, there is no need to save so much data, and the client can clear the previous data after a certain number of years, so that the amount of data that needs to be saved has been kept in a controllable range, even if it is acceptable for mobile devices.
  • the blockchain is composed of block header data and block body data generated in time segments of consecutive shards.
  • the latter block header contains the hash value of the previous block header, thus forming a chain structure of reverse connection.
  • the block header also contains the root hash value of the Merkel tree corresponding to the block body data, so that the block body data can be uniquely mapped.
  • the block body data contains the actual ledger data.
  • the block header uniquely maps the block body data, that is, the consistency of the block header can map the consistency of the block body data. So only need to synchronize the block header data, you can verify whether the ledger data is in the block of the chain and how many confirmations have passed according to the ledger data and the corresponding authentication path, that is, SPV simple payment verification.
  • Ledger data is divided into two parts: transaction data set and control data set.
  • Transaction data set includes actual transaction data; control data set includes but is not limited to one or more types of the following data: user management data, token issuance data , Token recovery data, reward data and announcement data issued by the system.
  • the transaction data is mainly generated by the client, including the unlocking signature of the client, and verified by the management terminal. When it is uploaded, the management terminal assigns a unique serial number that is arranged in sequence (for example, ascending). The serial number is passed through the management terminal together with the transaction data. Endorsement and signature.
  • the control data is generated by the management end of the chain structure system (for example, the first chain system), and is assigned a unique serial number arranged in sequence (for example, ascending) when generated, and is signed by the management end.
  • the transaction data set and the control data set respectively generate the root hash value of the Merkel tree and record it in the block header.
  • the block header will also contain the last transaction data number and the last control data number in the corresponding block body data, and the number is sequentially increasing, which is equivalent to the block header containing all the current cumulative transaction data volume and cumulative control The amount of data.
  • the third layer of users uses a structured peer-to-peer network, such as the Kademlia network protocol.
  • Each client node
  • DHT distributed hash table
  • each node stores part of the ledger data And the corresponding certification path. Since each transaction data and control data has an increasing unique serial number, and the block header will contain the last serial number, which is equivalent to including the current cumulative transaction data volume and cumulative control data volume, each transaction data can be quickly found And the block where the control data is located, combined with the authentication path, the Merkel tree can be used to verify the data.
  • the user searches for his own account data through the account data link.
  • Third-party users and supervisors can also obtain the user's account data through the account data link after the authorized user's master key.
  • the account data chain refers to obtaining an intermediate value K through the user master key and the current generation parameters, and then obtaining the address of the next data from K through other operations, thereby forming a logical chain structure of forward connection.
  • the account data chain enables users to search based on the user's master key in privacy.
  • a user has two account data chains. One of the account data chains, the first account data chain, is composed of the user's management data, and the user retrieves it through the management address master key.
  • the first chain system uses the management address master key issued for the user and the generation parameters in the user's previous management data to generate the current management address of the user, and the current management address is included in the current management data, And write the generation parameters for generating the next management address of the user in the current management data, so that all the management addresses of the user form a logical chain.
  • the management address of the user management data in the control data can be used as the query key value of the first account data link, and the data associated with the key value is the user management data corresponding to the management address.
  • the initial management address generation parameter may be a preset value, such as a user ID.
  • the management address is one-time and unique, so that the purpose of protecting the privacy of the user's identity can be achieved.
  • the first chain system uses the symmetric encryption master key issued for the user and the generation parameters in the user's previous management data to generate a symmetric encryption work key to encrypt the user's current management data.
  • the user can use the same key generation method to generate a symmetric encryption work key to decrypt the user's current management data.
  • the other account data chain consists of the user's received transaction data, and the user retrieves it through the transaction address master key. After the received transaction data is uploaded to the chain, all the received transaction data of the same transaction receiving end will form a logical chain structure. This logical chain is implicit in the generated ledger data.
  • the transaction data is submitted by the user terminal to the management terminal of the first chain system, and the management terminal verifies the transaction data.
  • the transaction data includes the transaction address of the transaction receiving end and the address generation parameters generated during this transaction.
  • the transaction address is generated using the address generation parameters generated by the transaction receiving end when the transaction was last received, and the address generated during this transaction
  • the generation parameter is used to generate the transaction address of the transaction receiving end to receive the transaction next time.
  • the verification of transaction data by the management terminal mainly includes verification of validity, such as verifying the validity of the user status, the validity of the unlocking script, the validity of the transaction amount, and whether the transaction address is a valid address, etc.
  • the management terminal After the transaction data is verified, the management terminal will endorse and sign the transaction data, and the transaction data after the endorsement and signature will be written into the block data of the first chain. After the transaction data is uploaded to the chain, all received transaction data of the same transaction receiving end will form a logical chain structure. This logical chain is implicit in the generated ledger data.
  • the management terminal When the user registers, the management terminal generates the initial address generation parameter (or called the nonce value) for it, and generates the initial receiving transaction address.
  • the initial address generation parameter or called the nonce value
  • all the received transaction data of the user will form a logic
  • the chain is the second account data chain.
  • the management terminal When the same user is issued a new key for generating the transaction address by the management terminal, the management terminal will regenerate an initial address generation parameter for the user, and generate a new initial receiving transaction address from the regenerated initial address generation parameter , The regenerated initial address generation parameter is matched with the issued new key, or is related. After that, when the user acts as the transaction receiving end to make a transaction, all the transaction data received by the user will form a new second account data link.
  • the receiving transaction data of the same transaction receiving end can have one or more logical chain structures.
  • Each newly generated initial address generation parameter will be stored in the user's management data, and the user can search the second account data link by himself according to the initial address generation parameter in the management data.
  • the transaction data containing the same transaction address are sibling nodes in the second account data chain.
  • the transaction data received by the same user can form a logical chain of sibling nodes, thereby It can quickly retrieve all received transaction data on the client side, and because the sent transaction data refers to the received transaction data, all transaction data can be quickly obtained.
  • the transaction address is one-time and unique to different users, so that the purpose of protecting the privacy of the user's identity can be achieved.
  • the transaction address connection information of the second account data chain is hidden in the key value stored in the connection.
  • the user can retrieve the user’s second key value by using the transaction address as the second key value.
  • the transaction address as the second key value may be the user’s current receiving transaction address, which is composed of the user’s transaction address master key and the user’s last received transaction data generated parameters, and the user’s signature Public key generation.
  • the signature key can be locally generated and managed by the client, or it can be managed by a trusted third party. If real-name authentication is required, the public key of the signature key needs to be issued an identity certificate by a trusted CA or be authenticated by eID.
  • the user master key issued by the management terminal includes the management address master key, the transaction address master key, the secret transaction master key, and the symmetric encryption master key.
  • the management address master key is used to generate the address of the first account data chain composed of the user's management data; the transaction address master key is used to generate the address of the second account data chain composed of the user's received transaction data; confidential transactions
  • the master key is used to generate the working key in confidential transactions, which can be used to protect the blinding factor, so that the user can decrypt the ciphertext transaction amount;
  • the symmetric encryption master key is used to generate the symmetric encryption working key, which can be used to protect the management of users Data and other user data.
  • the user master key and the current generation parameter are calculated through the first one-way irreversible function to obtain an intermediate value K, where the management address master key and the first generation parameter generate the intermediate value K1, and the transaction address master key and the second generation parameter are generated
  • the intermediate value K2 the secret transaction master key and the third generation parameter generate an intermediate value K3, and the symmetric encryption master key and the fourth generation parameter generate an intermediate value K4.
  • the generation parameter in each transaction data can be different, and the initial generation parameter can be the user ID.
  • the address of the user’s next management data can be obtained by K1 through the second one-way irreversible function operation; a new public key can be obtained by calculating K2 and the user’s signature public key, for example, a scalar multiplication operation on the elliptic curve can be used, and then The new public key is used to obtain the user's next transaction receiving address through the third one-way irreversible function operation, and the private key corresponding to the new public key can be calculated by K2 and the user’s signature private key, such as limited domain Multiplication operation; K3 obtains the symmetric encryption working key of the next management data through the fourth one-way irreversible function operation; K4 obtains the working key in the current confidential transaction through the fifth one-way irreversible function operation, which can be used to protect blinding factor.
  • K3 obtains the symmetric encryption working key of the next management data through the fourth one-way irreversible function operation
  • K4 obtains the working key in the current confidential transaction through the fifth one-way irreversible function operation, which can
  • the user master key and the current generation parameters can also be calculated through multiple one-way irreversible functions to obtain multiple different intermediate values, and then the intermediate value is calculated one-to-one with multiple signature public keys to obtain multiple new public keys.
  • the new public key generates the multi-signature address of the next receiving transaction.
  • the one-way irreversible functions mentioned above and in this article can all be hash functions or combinations of hash functions, which are explained below using hash functions.
  • the above-mentioned hash functions all use hash functions that are resistant to quantum computing cracking. Even if quantum computing cracks the private key on the elliptic curve, since the public key of the private key is obtained by the user's signature public key and the intermediate value K, it is also necessary to crack the intermediate value K to make the key and the user signature public. In terms of key association, because any user's signature public key can find a K'value to get the public key, it is impossible to find which user's signature public key is calculated, and the signature private key is the same.
  • quantum computing cracks the symmetric encryption work key, but because the symmetric encryption work key is also obtained through the intermediate value K operation, and the K value in each data is different, it is impossible to find the relationship between the data . Therefore, through the user's master key and different generation parameters, combined with the use of a hash function that can resist quantum computing cracking, the data or key can not be found after the data or key is cracked. Associated, it is possible not to leak user privacy. Therefore, in the future, the system will upgrade the cryptographic algorithm with security and anti-quantum computing, and will not leak the user's privacy due to the cracking of the previously disclosed data.
  • the transaction data in this system uses the UTXO model, so each transaction data contains the reference of the unspent output as input and the new unspent output.
  • the way of quoting may be the unspent output address plus the referenced transaction identification (ID), where the transaction ID is the hash value of the quoted transaction data.
  • ID the transaction ID is the hash value of the quoted transaction data.
  • each transaction data has a unique transaction data number, so you can also use the transaction data number to replace the quoted transaction ID, and add the transaction data number according to the output address to uniquely confirm the quoted unspent Output.
  • the new unspent output address is a new address generated based on the generation parameters of the corresponding user's last received transaction, the user's transaction address master key, and the user's signature public key.
  • the transaction amount is protected by a confidential transaction realized by an additive homomorphic commitment or a Pedersen commitment, so that any user can verify that the sum of the transaction amount is equal to the sum of the output in ciphertext, and verify the transaction amount in combination with scope proof It is not less than zero and will not overflow, that is, to verify the validity of the transaction amount.
  • the blinding factor in the confidential transaction is encrypted and protected by the working key generated by the current transaction data generation parameters and the user's secret transaction master key, so the user can decrypt his ciphertext transaction amount.
  • the structured peer-to-peer network on the user side uses a distributed hash table (DHT), and the corresponding value (value) is scattered and stored in the nodes of the network according to the index key (key), and the index key can be used to quickly retrieve the corresponding in the network The value.
  • DHT distributed hash table
  • the transaction address, management address, and the preset address for token issuance or recycling in the system are clearly distinguished by the address prefix, and then the transaction data number and control data number are also extended by similar address methods ( Such as padded 0) and clearly distinguished by prefix (hereinafter referred to as numbered address).
  • the address prefix of the control data number is represented by E
  • the control data with serial number 1 uses E001 as the control data number address
  • the prefix of the transaction data number address is represented by F
  • the transaction data with serial number 1 uses F001 as the transaction data number address.
  • the hash value of the above addresses can be used as the index key. For example, if a certain ledger data has one or more addresses, the hash value of each address will be used as the index key, and the corresponding ledger data and authentication path data will be used as the index key. value, stored in a structured peer-to-peer network.
  • Any user can retrieve the corresponding ledger data and authentication path through the key (above address), combine with the block header data, find the block where the ledger data is located according to the number, and then use the Merkel tree to verify the data.
  • the following uses the address as the index key, which is equivalent to using the hash value of the address as the index key.
  • this system allows multiple values with the same key value, and specifies the storage and retrieval methods for different values of the same key, which is the connected storage (or paired storage) described below the way.
  • the following introduces a way to convert the chain structure into node verification by connecting the storage structure.
  • the block header is connected to (including) the hash value of the previous block header.
  • the value contained in the first block header H1 is 0000, and the hash value of H1 is set as hash(00H1); then the hash value contained in the second block header H2 is hash(00H1), and the hash value of H2 is set
  • the value is hash(00H2); then the hash value contained in the third block header H3 is hash(00H2), and the hash value of H3 is set to hash(00H3).
  • the hash value of the block header is used as the index key, and the hash value of the previous block header included is also used as the index key.
  • the node that stores hash (00H1) will store H1 and H2; the node that stores hash (00H2) will store H2 and H3; and so on, each node will store a pair of data on the chain, and the index key is this All or part of the information of the data pair connection.
  • the connection is the transaction ID and output index, if the transaction ID is used as the key, it is part of the information; if the block header is connected to the hash value of the previous block header, the hash value is used as the key, which is all the information.
  • the hash value of H1 is hash (00H1)
  • the hash value of H2 is hash (00H1)
  • the connection storage also needs to distinguish input data (hereinafter referred to as input) and output data (hereinafter referred to as output), such as the input
  • the key corresponding to H1 is the hash value of the data (can be regarded as the output address)
  • the key corresponding to the output H2 is the hash value of the data connection (can be regarded as the input address). It can be summarized here that the key corresponds to the output address, which is the input data of the connection storage; the key corresponds to the input address, which is the output data of the connection storage.
  • the node storing hash(00Hn) will only store the input data Hn, and the output data will be empty; when the chain newly adds H[n+1], this The node will only contain the output data H[n+1]; and the node storing hash(00H[n+1]) will only store the input data H[n+1], and the output data will be empty.
  • the node storing 0000 will only store H1, and since 0000 is the input address connected to H1, H1 is the output data of the node, and the input data is empty. But because 0000 is a special starting data, that is, it can be identified as the starting connection storage, so the starting connection storage can use a special 0000 data (or empty data) as input.
  • the block head chain has the possibility of forking and connecting the uncle block head, that is, the block head chain may have multiple inputs and multiple outputs. Because the hash value of the uncle block header is different from the hash value of the parent block header, and the hash value storage is also on different nodes, the connection storage of the block header chain will not have multiple input data, but it is bifurcated But it will make related nodes have multiple output data. According to the different key selected as the connection, if it is the hash value of the data, because the hash value is unique (not considering collision), the connected storage will only have one input data; if it is an address, it will be the key according to the selection There may be multiple identical addresses depending on the address, then the connected storage may have multiple input data at this time.
  • the node has only output data but no input data (except for the special initial connection storage), the connection of the chain is wrong; if the node only has input data but no output data, the input data must be connected and stored in the previous node And is the output data.
  • Connected storage means that the node stores one or more input data and one or more corresponding output data, and the node can verify whether the input and output data is correct; there can also be no output data, which means that the connection of the input data is not used or not. Cost, that is, zero output data.
  • the verification of the correctness of the input and output data includes verifying whether the connection of one or more inputs and the corresponding one or more outputs is correct.
  • the output data contains the transaction amount, it is also necessary to verify whether the transaction amount of the output data is correct; if the output data contains signature information, it can also verify whether the signature information of the output data is valid.
  • the transaction amount of the output data is verified.
  • the part of the input amount can come from the output amount of the input data, which can reduce the acquisition of part of the data. Therefore, the chain structure is converted into the connection storage of the node, and the node verifies whether the chain connection is correct. And the way of connecting storage can also make the chain have the ability of two-way retrieval.
  • the above-mentioned block header chain query hash (00H2)
  • the person who retrieves the data can also judge whether it is input data or output data through the retrieved key and the data returned by the node, thereby judging whether the chain connection is correct.
  • the node that is connected to the storage can also verify whether the data stored in the connection is the data on the chain.
  • UTXO data has a Merkel tree authentication path, and UTXO also belongs to a chain structure. The following uses UTXO as an example. Because the UTXO reference method used by this system is the address plus the transaction data number, and the address is the key of the index.
  • transaction data T1 the input addresses are Ad1 and Ad2, and the output addresses are Bd1 and Bd2; transaction data T2, the input addresses are Bd1 and Ed1, and the output addresses are Cd1 and Cd2.
  • T1 and T2 will be stored, where T1 is the input data of the connection storage (because Bd1 is the output address of T1), and T2 is the output data of the connection storage (because Bd1 is the input address of T2).
  • T1 data is the output data of the connection storage; for the nodes storing Cd1 and Cd2, the T2 data is the input data of the connection storage.
  • Each node will verify whether the input and output of its connected storage data is correct.
  • the node storing Bd1 will verify whether there is input data T1, output data T2, whether there is a double spend, and whether the transaction amount of output data T2 is correct, but the input of T2 It also needs to rely on Ed1, so the node storing Bd1 also needs to obtain Ed1 as the output data to be able to verify. Set Ed1 as the output data as T3, so the node storing Bd1 will store T3 and the corresponding authentication path as additional verification data. And verify whether the input amounts of Bd1 and Ed1 are equal to the output amounts of Cd1 and Cd2, that is, whether Bd1+Ed1 is equal to Cd1+Cd2. Similarly, the node storing Ed1 will store input data T3 and output data T2, as well as additional verification data T1, and verify whether the input and output data are correct.
  • the following introduces the token issuance and recovery of this system, that is, the initial transaction data and the end transaction data are also connected and stored, and the relevant nodes can also verify whether the input and output of the connected storage data are correct. Therefore, the UTXO chain is transformed into the connected storage structure of the nodes, and each node verifies whether the connected storage is correct, such as whether there is only output but no input (the initial connected storage will also have special inputs), and whether the input data is the same. Whether the output (ie double spend) and the input and output of the connected storage data are correct, and each transaction data can be verified by the Merkel tree to verify whether it is data on the chain, so the correctness of the entire UTXO ledger can be verified through decentralized nodes Sex.
  • the user can also obtain the two-way search ability by retrieving the address in the network, and can judge whether the chain connection is correct according to whether the data returned by the node is input or output, and can also judge whether the link is unavailable according to the returned data.
  • Expenditure output For example, if user C searches for Ed1 in the network, the node will return data T1, T2, and T3 related to Ed1 and the corresponding authentication path to user C.
  • User C according to Ed1 is the output address of T3, so T3 is the input data; according to Ed1 is the input address of T2, so T2 is the output data; Ed1 is not the address of T1, so T1 is additional verification data.
  • T1, T2, and T3 are all data on the chain, and it can be verified whether the input amount of Bd1 and Ed1 is equal to the output amount of Cd1 and Cd2, so that the correctness of the input and output data can be verified. If the node only returns T2 data, there is only output but no input, and it is judged as a link connection error; if the node only returns T3 data, it means that Ed1 of T3 is not spent.
  • the system token issuance or recovery uses the preset address, and first needs to be published in the control data set in clear text.
  • the issued address is A001
  • the recycled address is B001.
  • the token issuance or recovery information published in the control data set contains the preset address information
  • the node that stores A001 in the network will store the information published in the control data set and A001 as the transaction data of the input reference address. Start transaction data; and the node that stores B001 in the network will store the information released in the control data set, and the transaction data with B001 as the output address, that is, the end transaction data. Therefore, the preset address for the issuance or recovery of the system token is also in line with the characteristics of connected storage. It only uses the preset input or output data. For example, it is not transaction data but the plaintext issuance or recovery information in the control data set. The node can also verify the input and output. Is the data correct?
  • the above example system uses a homogenized token. If a non-homogeneous token is used, it can also meet the characteristics of connected storage and achieve the purpose of verifying the UTXO chain.
  • connection storage enables distributed nodes to verify whether the chain is connected correctly, and in addition, it can also verify whether the length of the chain is correct.
  • the node can calculate all the numbered addresses contained in the block, and then the node can query its own according to each numbered address Whether the network ID matches the key, if there is a corresponding numbered address, the key is stored by yourself, but you don’t have the corresponding data, then you can query the data of the key through the network (for example, first search on the user end node, if not, then use the numbered address as The key is searched on the second-level chain), if it is not found, the integrity of the chain is wrong.
  • the ledger data corresponding to the key is found and the data is verified, it means that the data of the numbered address is correct. If the data is transaction data, according to the above knowledge, the transaction data is connected and stored by the transaction address, and the node can be based on The input of the transaction refers to the address query and verification. In this way, the integrity of the chain can be verified through the numbered address, and the unspent output can be inquired through the network.
  • the ledger data of this system is composed of two parts: transaction data set and control data set. And each control data has a unique control data number, which is sequentially increasing. According to the above, the integrity of the control data can be verified through the numbered address. If an address is only verified by a specific node, that is, the node that verifies a certain transaction data or control data is fixed and known, this will bring a certain risk, so in an exemplary embodiment, the system may choose to increase The user randomly selects the verification method. Because the block header contains all the current cumulative transaction quantity and cumulative control quantity, each node can know the starting number and ending number of the transaction data and control data contained in the block.
  • the client node When the client node synchronizes the block header, it can randomly select and verify the ledger data in the block according to the number address. For example, it can randomly select and verify m1 control data, or randomly select and verify m2 transaction data.
  • the control data has only the signature of the management end, so the user end node only needs to obtain the control data through the control data number address, verify the management end signature, and verify whether the data is on the chain according to the authentication path.
  • To verify the transaction data you need to obtain the transaction data through the transaction data number address, and then query these addresses and verify them according to the input reference address in the transaction data.
  • the address node referenced by the query input returns the connected storage data with input and output data, that is, the input data and output data with the aforementioned association relationship, and can verify the correctness of the input data and output data, and according to The authentication path verifies that the data is on the chain. Since the user side uses a distributed hash table network for retrieval, and each node independently selects the ledger data for verification, it does not know which nodes choose to verify a certain transaction data, and it can avoid a certain transaction data. The disadvantage that the address is only verified by a specific node increases the security.
  • the data on any chain can be converted into a node’s connected storage structure, where the node stores one or more input data and the corresponding zero, one or more output data, and the node can verify the input and output data Whether it is correct or not, the special initial connection storage and end connection storage can also meet the characteristics of the connection storage through the preset input and output data.
  • the connection storage Through the connection storage, the data on any chain is converted into node storage, and then combined with the proof that the stored data is the data on the chain, it can be verified whether the connection of the chain is correct.
  • each node can store part of the ledger data and the corresponding authentication path, and verify whether the input and output data is correct, and the correctness of all the ledger data can be equivalently verified, which is called Equivalence verification. And you can also choose to increase the user's random selection verification method to avoid the shortcomings of a certain address only being verified by a specific node, and increase security.
  • Bitcoin's UTXO input refers to the unspent transaction ID and output index, where the transaction ID is the hash value of the quoted transaction data.
  • the issuance can be regarded as a CoinBase reward transaction created by miners (coin creation transaction, that is, the first transaction data in each block data). Use the transaction ID as the key for retrieval, and the quoted transaction ID as the key for retrieval.
  • the transaction data ID is Tb
  • the input references are Ta[1] and Ta[2], and there are two outputs Tb[1] and Tb[2]
  • the transaction data ID is Tc
  • the input reference is Tb[1]
  • the transaction data ID is Td
  • the input reference is Tb[2]
  • the number in parentheses is the referenced output index.
  • the node that stores Tb will store the input data Tb, and the output data Tc and Td. Because the same transaction ID is not allowed, based on the transaction ID as the key for retrieval, the connected storage will not have multiple input data, but there may be multiple output data.
  • the input references of the two outputs are not the same output index, so they are not double spend.
  • Each transaction data contains the corresponding authentication path data, and the authentication path of the CoinBase reward transaction is the special first transaction data, that is, the initial connection storage.
  • the initial connection storage can also easily verify the correctness of CoinBase reward transactions.
  • the initial connection storage requires all transaction fees of the CoinBase reward exchange in the block body to be verified. If the block The large number of transactions in the body makes verification very difficult, and it is also very difficult for users who retrieve the initial connection storage to verify CoinBase reward transactions.
  • the unspent output of user A may be known by other users B in the same transaction, and the transaction timestamp that quotes the unspent output may also be known by user B, if the transaction is also quoted User A's other unspent output may also be known to user B.
  • users can choose the auxiliary obfuscation scheme provided by the system. For example, the user transfers these unspent outputs to the obfuscated address provided by the system in turn.
  • the obfuscated address is also a logical chain, so the obfuscated address transferred in each time is different, and then another obfuscated address in the system transfers the same amount to
  • the user's new receiving transaction address, and the new receiving transaction address on the UTXO chain has no relationship with the user's previous unspent output, and no information will be leaked.
  • the user's management address is generated by the generation parameters in the previous management data and the management address master key, and the management data is encrypted and protected by the symmetric encryption working key generated by the generation parameters in the previous management data and the symmetric encryption master key.
  • the user's first management data that is, the user's registration management data, uses the user's registration ID as a generation parameter.
  • the user's registration management data includes the initial address generation parameters of the second account data chain composed of the received transaction data, and also includes the user's identity certificate hash value and the user's signature public key, which can be used to confirm the user's identity. Except for user registration management data and user identity certificate update management data that contain user-related information for confirming the user's identity, the remaining ledger data no longer contains user-related information.
  • transaction data can contain user additional information, which may contain user identity information, so user additional information is stored off-chain, and only the hash value of the additional information is recorded on the chain, and user additional information can use the transaction timestamp as Salt value.
  • transaction data can also contain additional contract information.
  • the additional contract information is used to record the associated information of the contract and does not contain the user's identity information, so the additional contract information can be stored on the chain.
  • the user's signature public key is associated with the user identity certificate, so the user identity certificate update management data also contains the user's signature public key update information.
  • the user's other management data may include user master key update information and general management information, none of which will involve the user's identity.
  • the user After the user registers, he finds the registration management data through the registration ID and the management address master key, and decrypts the data with the symmetric encryption working key generated by the registration ID and the symmetric encryption master key, so as to obtain the user’s management data. Account data link. Then, according to the initial generation parameters of the transaction data in the registration management data, the transaction address master key, and the user's signature public key, the second account data chain composed of the user's received transaction data is obtained. According to the above, searching for the receiving transaction address on the user-side network, because of the use of connection storage, the transaction referenced by the receiving transaction address as an input can be obtained, that is, the user's sending transaction.
  • user Alice registers an account with ID Alice on the management terminal through the identity certificate, and the management terminal issues the management address master key, transaction address master key, secret transaction master key, and symmetric encryption master key to account Alice.
  • the account ID name is the default initial generation parameter of the management data.
  • the user generates the registration management address through the account ID name Alice and the management address master key, and then searches for the registration management address on the user-side network, that is, the registration management information of the account Alice can be found, and the account ID name Alice and the symmetric encryption master key are used The generated symmetric encryption working key decrypts the data.
  • the registration management information contains the hash value of the user's identity certificate, which can prove the user's identity, as well as the generation parameters used to generate the address of the next management data and the symmetric encryption working key, and include the initial generation parameters of the receiving transaction address.
  • the user can generate the receiving transaction address through the generation parameters of the last receiving transaction, the transaction address master key and the user’s signature public key, and then look up the address on the user’s network to find the transaction information. And through the generation parameters in the transaction data and the working key generated by the secret transaction master key to decrypt the blinding factor, the ciphertext transaction amount can be decrypted. If Alice needs to transfer money to Bob, she needs to generate the unlocking script through the generation parameters of the last received transaction, the transaction address master key, and the user's signature private key.
  • a user When a user needs to prove the assets of a certain address to a third-party user, he only needs to provide the intermediate value K, the user's identity certificate, and the blinding factor.
  • the third-party user can verify the validity of the identity certificate to confirm the user's identity, and then use K and the user's signature public key to do a scalar multiplication on the elliptic curve to obtain a new public key, and verify that the address generated by the new public key is equal to the address.
  • the scalar multiplication operation on the elliptic curve is one-way, it is impossible to find a K'and the user's signature public key operation to get the public key address of other people (assuming that before the quantum computing cracking occurs, it needs to be updated afterwards to resist the quantum computing cracking In order to provide a valid proof). Then check whether the address is an unspent address through the network, and finally use the blinding factor to decrypt the ciphertext amount.
  • the information provided by the user does not contain the relevant key information, and the third-party user cannot obtain the privacy of the user's other transaction data based on the provided information.
  • the above-mentioned query of unspent addresses is realized through the node's connected storage.
  • the relevant node will return input data and output data; if it is not spent, only input data will be returned without output data.
  • the query method depends on the relevant node.
  • third-party users can also query the information of unspent addresses through the second chain system.
  • the announcement data released by the system are all plain text, such as the announcement information of token issuance or recovery, key algorithm update information, new transaction rule announcement information, and system version update information.
  • each announcement has an announcement type and an incremental serial number.
  • announcement prefix + announcement type + announcement serial number the address of the announcement is composed. Any user can retrieve and verify the announcement on the network through the announcement address.
  • the UTXO chain of the system is connected and stored, and it can verify whether the UTXO chain is correct; the sequentially increasing addresses such as the numbered address are not in a chain relationship, so it is Directly stored, it can be used to verify the integrity of the chain and random selection verification; the management address is not an explicit chain relationship (only the user's master key can obtain the user's first account data chain, and the management address forms an implicit chain Type relationship), as well as the announcement address, etc., are also stored directly.
  • the value corresponding to the directly stored key is unique, and the retrieval returns the corresponding data; the key stored in the connection may correspond to multiple value data, that is, the input and output data of the connection storage, and the retrieval returns all relevant data, including additional verification data.
  • the user side uses distributed hash storage through a structured peer-to-peer network. Each user side only needs to store part of the ledger data, and the corresponding ledger data can be retrieved through the address, and the ledger can be verified using the Merkel tree Whether the data is contained in the block of the chain.
  • An address is generated in a certain way, and the address is identified by the prefix as the receiving address to distinguish the addresses used inside the system.
  • a chain generation object for example, a chain generation node
  • the receiving address will be included.
  • the management end will publish the reward information in plaintext to the control data set.
  • the reward information includes the reward preset address, the reward amount, and the bound receiving address.
  • the reward preset address is similar to the token issued The preset address, such as C001.
  • the input of the transaction is referenced to the reward address C001, and the output is the user's receiving transaction address, so the transaction is on the user's second account data chain.
  • the rewards are divided into two steps: release first and then receive. Among them, release is similar to token issuance, and the reward address is also in line with the characteristics of the above connection storage, but the input is the clear text reward information in the control data set. Therefore, the generation of the participating chain does not need to be registered or authorized in the system, but to receive rewards, you need to register in the system.
  • the chain generation object can also authorize the key of the receiving address to other users, and the other users can receive rewards.
  • the public chain refers to a blockchain system in which anyone can read, send transactions, and participate in consensus. It is a completely decentralized system.
  • the quasi-public chain refers to a system that does not include anyone who can send transactions, and the rest are the same as the public chain, which satisfies the centralization of transactions and the decentralization of ledger data.
  • the following describes the system architecture of the class public chain with the public chain system.
  • A Assume A as a private chain system (S can still regard A as a user), and replace A's transaction data with block data generated by the private chain system, because the private chain can be regarded as the next block connection ( Expends) the output of the previous block, the private chain can be regarded as a UTXO chain, so the block data generated by A is connected to the block data, and cannot be forked (no double spend), that is, it can Consider the UTXO chain of A on the S chain and the private chain of A as equivalent.
  • the S system needs to verify the legitimacy of the A block data, which needs to be connected sequentially and cannot be forked, and also needs to verify the legitimacy of the ledger data in the block.
  • anyone can participate in consensus, read ledger data and verify ledger data, so anyone can verify A's ledger data.
  • the S system can also have extended data, but the extended data does not affect the user's management data and transaction data, nor does it affect the user's account status, so the user does not need to read and Verify the extended data.
  • the function of the extended data is to enable S to interact with A, so that S can partially affect the generation of A data, so the data can only be read by the objects participating in the S consensus and A. For example, before A system releases token issuance or recovery information in the control data, it needs to go through S to vote; or S generates a provable fair random number, and the random number affects the data generated by A system to solve the partial fairness of A system. Sexual issues.
  • Client C does not need to synchronize the block header data of the A private chain, but only needs to synchronize the block header data of the S system, so the block header data of the A private chain can also be stored in the extended data. If there is illegal data generated in the system and the data needs to be able to prove, the relevant data can also be stored in the extended data of the S system. If the system uses consensus algorithms such as POA (Proof Of Activity), the relevant verifier election and verifier list data can also be stored in the extended data.
  • POA Proof Of Activity
  • the user terminal C of the A system needs to pass the transaction data from A to S, and C obtains the transaction data from S.
  • the above-mentioned system S, system A (private chain or consortium chain system), and the client C of system A can be regarded as a kind of public chain application system.
  • anyone can read, verify transactions, and participate in consensus. This refers to reading the data of the S chain, and the client C also synchronizes the block header data of the S chain.
  • the consistent performance of the block header guarantees the consistency of the system state, and the synchronization of the S-chain block header of all clients can ensure that the state of all clients and the system S are consistent.
  • the user only needs to obtain the user master key from the A system (the key does not belong to the chain data), and can retrieve the account data on its own in the structured peer-to-peer network (or S-chain) on the user side, and third-party users and supervisors The user can also retrieve the key after being authorized, and the process does not rely on the A system or other centralized systems. Therefore, the public chain-like application system is verifiable, traceable, and non-tamperable. However, because the user’s transaction data first needs to go through A before it can be chained in S, the public chain-like application system does not solve the fairness of the transaction.
  • Delayable selection priority is different from time priority. It is a method of generating a provably fair random number and then determining the priority based on the random number. Because anyone can participate, it is fair. For example, in a lottery system, the purchaser pays a certain amount and reserves a random number and the prize-receiving address, and then the system S generates a provably fair random number through the consensus object. For example, the scheme of submitting and then disclosing can be used (Commit Reveal) , And to avoid block retention attacks, you can terminate the submission and go through several block confirmations, and then delay the disclosure of related parameters to ensure that the generated random number is unknown in advance and cannot be tampered with.
  • the award After the random number is announced, the award will be judged according to the degree of correlation between the random number reserved by each person and the random number, and then the award can be received through the award address.
  • System A can call related contracts based on the published random number to award rewards to the winning users. The reward will be bound to the relevant contract information of the winning, including quoting the lottery information, quoting the random number reserved by the user and the prize-collecting address, and the amount of the clear text of the prize, generating the corresponding ciphertext amount of the reward to the prize-collecting address, and then from issuing the lottery
  • the corresponding plaintext amount is subtracted from the real-name institution account to ensure that the total amount of tokens in the system has not changed. Therefore, the delayable selection priority is that the system S generates a provably fair random number and delays the disclosure of several blocks, and the system A uses the random number to determine the priority to solve the fairness of such problems.
  • the system is composed of a three-layer two-chain architecture, as shown in Figure 10.
  • the first layer is also the first chain system. It can be a private chain or a consortium chain. It belongs to a centralized system (such as the above system A). It can use a private network and PBFT (Practical Byzantine Fault Tolerance) and other consensus algorithms.
  • PBFT Practical Byzantine Fault Tolerance
  • the main object with a real name is responsible for the system's administrator. Including one or more of the following management: management of users and institutions, issuance or recovery of tokens, issuance of user master keys and system announcements, etc.
  • the system is managed mainly by issuing control data, and then written into the first chain.
  • the transaction data on the user side is verified by the management side and written into the first chain.
  • the block data generated by the first chain will be broadcast to the second layer or the third layer immediately. Because the management terminal has all the user master keys, the management terminal can generate the state tree of the system, and operations such as querying and modifying the user account status of the management terminal are realized through the state tree of the system, and then converted to the underlying UTXO transaction data or control data. The management terminal will verify the transaction data on the client side, and will verify the relevant user identity information. Each transaction data or control data will be assigned a unique serial number that increases sequentially, and the transaction data or control data will be endorsed and signed by the management terminal together with the transaction data or control data. The block header data of the first chain will contain the current cumulative transaction quantity and cumulative control quantity, and the block header data will be signed by the management terminal.
  • the second layer is also the second chain system, which is similar to the public chain (the above system S), and uses an unstructured peer-to-peer network, such as the gossip network protocol, and the algorithm with a longer consensus time.
  • the second layer will verify the block data of the first chain, but because the second layer does not have a user master key, it will only verify transaction data, but will not verify related user identity information, and will not generate system information. State tree. According to the above, the system adopts the UTXO model, and anyone can verify the correctness of the transaction amount in ciphertext.
  • the block data of the second chain is composed of one or more block data sequences of the first chain.
  • the state of any account on the first chain is consistent with the state of the account on the second chain, so the system is asynchronous and homomorphic .
  • the block data of the second chain may be composed of multiple block data sequences of the first chain
  • the ledger data of the first chain block body needs to be reordered to form the ledger data of the second chain block body, including transaction data and Control the data, and then regenerate the root hash value of the Merkel tree and record it in the block header of the second chain.
  • the block header of the second chain will also contain the current cumulative transaction number and cumulative control number.
  • the second chain may also contain extended data, which may be the state data of the second chain system itself, and will not modify the user's state, and the third layer will not synchronize and read the data.
  • extended data may be the state data of the second chain system itself, and will not modify the user's state, and the third layer will not synchronize and read the data.
  • the data can be the voting process of the second chain or the process of generating provably fair random numbers, etc., it can also be the process of the second chain voting to select chain generation nodes, or it can be the data used for attestation.
  • the extended data It will only be read by the first and second layers, and may affect the subsequent blocks generated by the first chain or the second chain.
  • the block header data of the first chain can also be recorded in the extended data of the second chain, which will not affect the user status, but is used as evidence data.
  • the block data generated by the second chain will be broadcast to the third layer.
  • the broadcast data is the block header data, transaction data, control data, and corresponding authentication path data of the second chain.
  • the third layer is the user-side system, which uses a structured peer-to-peer network. For example, you can use the kademlia network protocol to retrieve data through a distributed hash table (DHT).
  • DHT distributed hash table
  • Each user-side node (hereinafter referred to as node) only needs to store part of the ledger data And the corresponding certification path.
  • the third layer passes equivalent verification.
  • Each node verifies part of its own book data, which can equivalently verify all the book data, and then combines each node to independently and randomly select the book data for verification, avoiding a certain address Only verified by specific nodes, which increases security.
  • Each node in the third layer will synchronize the block header data of the second layer, so the third layer and the second layer system state are consistent.
  • the read operations of the user, third-party users, and regulators can be in the second or third layer, and the write operations of transaction data on the user end are linked to the first layer through the management end, so the system is read and write separated of.
  • the first chain can broadcast to the third layer immediately, so the transaction data on the user side can be obtained in time, but the transaction data at this time is not on the second chain, but on the first chain. If it is a small transaction, the client can immediately trust the data released by the management terminal; but if the transaction amount is large, the client can wait for a period of time until the transaction data is on the second chain and confirmed by n blocks. It can be considered that the transaction data is irreversible and cannot be tampered with.
  • the second layer system can choose to verify only the block header data of the first chain, The Merkel tree of the ledger data and the management end of the ledger data are signed, and then the data is uploaded to the chain to generate the block data of the second chain and broadcast to the third layer.
  • the third layer verifies whether the UTXO chain is connected correctly and verifies it Whether the client unlocking signature and transaction amount in each transaction data are correct.
  • each node in the third layer only needs to verify a small amount of ledger data, even if the client uses a multi-signature method and needs to verify whether the ciphertext transaction amount is correct, each node has less burden, even mobile devices can Complete verification.
  • the second layer verifies the signature of the management end, and can also use optimized batch verification of multiple signatures generated by a single signer, which greatly reduces the amount of verification required to participate in the second layer consensus.
  • the chain generation node of the second layer can sequentially distribute the ledger data generated by the first layer to multiple physical devices, and combine the ledger data on these physical devices to generate the Merkel tree.
  • the root hash value that is, the generation and verification of a huge block data containing a lot of ledger data can be completed through multiple physical devices, and the storage can also be distributed to multiple physical devices.
  • this method belongs to linear partition storage, that is, to store a huge block of data, according to the characteristics of the Merkel tree, the number of leaf nodes corresponding to a parent node is Power of 2, so the data is linearly divided into multiple physical devices for storage according to the power of 2, and then the corresponding Merkel tree root hash value can be jointly generated, and the corresponding ledger data can also be generated Certification path. Therefore, the chain generation node of the second layer only needs multiple ordinary physical devices and storage devices, and the amount of verification calculation is also controllable. The devices that actually participate in the consensus generation block header also only need ordinary devices, which greatly reduces participation. The threshold of the second layer of consensus.
  • the above method uses the first generation and then verification method, that is, the second chain is generated first, and then the third layer is verified, because the actual ledger data is uploaded by the first layer system, and the second layer will verify the default The Kerr tree and the signature of the management terminal will not modify the ledger data. Therefore, if the third-level verification ledger data is wrong and it is signed by the management end (the second layer is required to verify whether it is the data of the first chain), the responsible person is the first-level system, and the first-level is the management end with a real name , Which can be dealt with by the supervisor. Because the first layer is a centralized system, if illegal ledger data is generated, the second and third layers cannot be prevented, but they can be verified immediately, and then corresponding measures can be taken.
  • the third layer writes illegal ledger data from the second layer into the certificate data of the extended data of the class public chain, and the first layer system cannot modify the data of the second chain, and anyone whose data is public can Access can be handled by the supervisor. Therefore, although the system cannot guarantee that the data in the time period of the upper chain segment must be correct (because the data is generated by the centralization), it can guarantee that the wrong data is not hidden (verified by the second or third layer) .
  • the data on the second chain and confirmed by n blocks is correct and cannot be tampered with, so it is trustworthy.
  • the first-tier system also uses private chains or alliance chains to reduce and prevent the possibility of data errors.
  • the first chain is not allowed to fork, and the first chain can use consensus algorithms such as PBFT to prevent forks. If the first chain has a fork, the second layer system can detect and write it into the certificate data of the extended data of the public chain, and the supervisor will handle it accordingly.
  • consensus algorithms such as PBFT
  • the first-tier management system can also optimize the processing of massive data that needs to be verified and stored by connecting to storage. For example, a consistent hash algorithm can be used to disperse transaction data into multiple consensus groups based on transaction addresses and transaction IDs, and then use the attribute grouped PBFT (Practical Byzantine Fault Tolerance Algorithm) consensus algorithm to generate the block header of the first chain data.
  • PBFT Practical Byzantine Fault Tolerance Algorithm
  • the PBFT algorithm is a state machine copy replication algorithm. Set the number of sets composed of all copies to N, assuming that the number of invalid copies is F, then N>3F is required. Each node has a copy of the state machine, so the PBFT algorithm can tolerate less than N/3 invalid or malicious nodes. But the disadvantage of PBFT is that it has O(N ⁇ 2) message complexity, so usually N is not very large.
  • the transaction data Before generating the block, use the consistent hash algorithm to map each input address of the transaction data to one of 1 to M, and map the transaction ID, that is, the hash value of the transaction data, to one of 1 to M. Then the transaction data is stored in the mapped consensus group.
  • the input address corresponds to the output data stored in the connection.
  • each output address of the transaction data is mapped to one of 1 to M in the same way, and the token issuance address and the reward address in the control data on the chain are included.
  • the corresponding on-chain data is stored in the mapped consensus group.
  • the output address corresponds to the input data stored in the connection, so the input data stored in the connection storage in the consensus group is the data after the chain, and the consensus group can verify the data through the Merkel tree.
  • the consensus group storage corresponds to input data, then just store it; if the consensus group storage corresponds to output data, you need to find the corresponding input data, and verify the correctness of the input and output, and then form a connected storage; if the consensus group stores Corresponding to the transaction ID, it is necessary to initiate PBFT consensus verification to the consensus group corresponding to the address based on all the input reference addresses of the transaction data. It can be known that if the consensus group corresponding to these addresses passes the verification, it will form a connection storage and return the verification success, and if the verification fails, the verification failure will be returned. According to the above, when the number of successful verifications returned by each address is greater than n*2/3, the transaction data is verified and can be uploaded to the chain.
  • the transaction data is verified and chained by the consensus group corresponding to the transaction ID, and because the transaction ID is unique, it will not be repeated on the chain.
  • the transaction amount can be verified by the consensus group corresponding to the transaction ID. Entering the consensus group corresponding to the reference address only needs to verify whether the connection is correct and the unlocking signature of the client is valid, and the transaction amount is returned Data, no additional verification data is required.
  • each consensus group independently initiated the PBFT consensus on the chain, and each consensus group independently agreed on the transaction data and sequence of its own on-chain set. Then the consensus group No. 1 adds its own on-chain collection quantity to the cumulative quantity, and sends the cumulative quantity message to the consensus group No. 2; then, the consensus group No. 2 adds its own on-chain collection quantity to the cumulative quantity to 3 Consensus group No. sends out the accumulated quantity message; until the last consensus group M, M sends the accumulated quantity message to consensus group No. 1; when consensus group No. 1 receives the accumulated quantity message, it completes a cycle operation, and The transaction data in the loop is combined on the chain.
  • Each consensus group calculates the starting sequence number based on the cumulative number, and then assigns the transaction data and the corresponding order of the on-chain collection to an increasing sequence number and requests a signature (for example, if there are n nodes, a request greater than n*2/3 is required to give a signature ), and finally combine the signed data to generate the root hash value of the Merkel tree. Because it is an independent consensus on the chain, each consensus group can receive a number of messages and then carry out the consensus on the chain, and complete the circular operation through message transmission. The reason why the consensus group can independently agree on the chain is because the input data stored in the connection is the data after the chain, so in the same time segment, there will be no legal transactions quoted between the two.
  • the message complexity of the attribute grouping PBFT consensus algorithm is O(n ⁇ 2), which can tolerate less than n/3 invalid or malicious nodes.
  • the transaction data is also dispersed into M groups, so the final amount of transaction data that can be processed can be greatly increased.
  • the control data of the system is not a UTXO chain.
  • an incremental serial number can be assigned and signed, and then stored and verified linearly according to the serial number, or the Merkel tree root hash value of the control data can be jointly generated.
  • the block header data of the first chain is generated according to the root hash value of the transaction data and the root hash value of the control data, and the corresponding cumulative number. Therefore, the management system of the first chain can optimize the processing of massive amounts of data by connecting storage.
  • the data stored on the third-tier client terminal includes block header data, ledger data, and corresponding authentication path data.
  • the ledger data is actually generated by the management end of the first layer
  • the block header data is generated by the second layer consensus
  • the block header data can also map the consistency of the block body data (ledger data)
  • the block header data can also be confirmed Corresponding authentication path, so the correct synchronization of the block header data is very important to the correctness of the system.
  • the third-tier client does not participate in the second-tier consensus.
  • the third-tier client needs to be correct Synchronize the list of consensus participants, which will increase the burden on the user side. Because the second chain is generated on the basis of verifying the block header of the first chain, the third-layer client can verify the block header of the second chain on the basis of trusting the block header of the first chain. Take the consensus algorithm using mortgage penalty as an example.
  • the consensus object of the second layer can be anonymous, and can use the third-party public chain (a third-party public chain system other than the first chain system and the second chain system) to participate in the consensus. Data, the mortgaged assets will be deducted, as explained below.
  • the management side of the first layer needs to establish a smart contract on the third-party public chain.
  • the function of the contract is that any user can upload the consensus public key (the consensus public key is an asymmetric key generated by the user and can be used to participate in the second-level consensus), and a consensus public key needs to be mortgaged on the third-party public chain A certain amount of token, the mortgaged token is associated with the uploaded consensus public key.
  • the contract will map the consensus public key set composed of all the currently uploaded consensus public keys to a value.
  • the consensus public key set and the mapping method are both public Yes, it is easy to find the proof that the elements in the set exist in the set, but it is difficult to find a proof that the elements in the set do not exist in the set.
  • the block header generated by the first chain contains the value of the current consensus public key set mapping, and can also contain the number of elements in the consensus public key set, and a key represents a fixed equity, that is, one key and one vote.
  • the block header data generated by the second chain will be broadcast to the third layer along with the last block header data corresponding to the first chain.
  • the second chain block header contains all the current cumulative transaction quantity and cumulative control quantity, and the corresponding consensus public key.
  • the second chain block header data is signed by the consensus private key.
  • the third-tier client side synchronizes the block header data of the second chain, can verify the signature of the consensus private key according to the consensus public key, verify the signature of the management end of the first chain block header, and verify the cumulative transaction number of the first chain block header. Whether the cumulative control quantity is equal to the cumulative transaction quantity and the cumulative control quantity of the second chain block header, if they are equal, the quantity is correct and the first chain block header is the last block header data in the second chain block header generation time segment, so the first The mapping value of the consensus public key set in the block header of a chain is the latest in the time segment.
  • the user side can also use Merkel tree proof or accumulator proof according to the mapping value of the consensus public key set in the first chain block header to verify whether the consensus public key in the second chain block header is valid. If the verification is passed, it means the second The chain block header is valid and can be added to the block header of the candidate main chain.
  • the user end can verify the block header of the second chain by trusting the block header of the first chain, without synchronizing the consensus list of the second chain, and can pass the cumulative number of transactions and accumulation of the block header of the first chain
  • the control quantity verifies whether the cumulative transaction quantity and the cumulative control quantity of the second chain block header are correct, so as to ensure that the block header data of the second chain can be synchronized correctly.
  • the second-level public chain-like system can also use consensus algorithms such as POA, so that it does not rely on third-party public chains, but the participating consensus objects need to provide identity certification.
  • the first chain block header may also include the mapping value of the validator list of the POA consensus algorithm and the number of validators, so that the user terminal can correctly synchronize the block header data of the second chain.
  • the second layer system can write the non-compliant block header data of the first chain into the certificate data of the extended data of the similar public chain, and the supervisor will handle it accordingly.
  • the system uses the blockchain to realize the traceability and non-tampering of the ledger data.
  • the UTXO chain realizes the correct connection of transaction data to ensure that the total number of tokens in the system is certain.
  • the account data chain realizes the privacy retrieval of user account data.
  • the user terminal can store and verify part of the ledger data through a structured peer-to-peer network, and the correctness of all ledger data can be equivalently verified.
  • An exemplary embodiment of the present disclosure further provides a computer storage medium that stores a computer program; after the computer program is executed, the method provided by one or more of the foregoing exemplary embodiments can be implemented, for example, Perform one or more of the methods shown in Figure 1, Figure 3, Figure 5, and Figure 7.
  • the computer storage medium includes volatile and nonvolatile, removable and non-removable implemented in any method or technology configured to store information (such as computer-readable instructions, data structures, program modules, or other data) In addition to the medium.
  • 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 cassette, tape, magnetic disk storage or other magnetic storage device, or Set up as any other medium that stores the desired information and can be accessed by the computer.
  • 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 on the memory and capable of running on the processor.
  • the processor implements the data storage device or data verification in the present disclosure when the computer program is executed. The operation performed by the device.
  • a computer device may include: a processor 91, a memory 92, a bus system 93, and a transceiver 94, where the processor 91, the memory 92, and the transceiver 94 pass through
  • the bus system 93 is connected, the memory 92 is configured to store instructions, and the processor 91 is configured to execute the instructions stored in the memory 92 to control the transceiver 94 to send signals.
  • the operation of the second storage module in the aforementioned data storage device may be executed by the transceiver under the control of the processor, and the operation of the first verification module may be executed by the processor.
  • the processor 91 may be a central processing unit (Central Processing Unit, referred to as “CPU” for short), and the processor 91 may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), or off-the-shelf processors. Programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the memory 92 may include a read-only memory and a random access memory, and provides instructions and data to the processor 91. A part of the memory 92 may also include a non-volatile random access memory. For example, the memory 92 may also store device type information.
  • the bus system 93 may also include a power bus, a control bus, a status signal bus, and the like. However, for clear description, all buses are marked as the bus system 93 in FIG. 11.
  • the processing performed by the computer device may be completed by an integrated logic circuit of hardware in the processor 91 or instructions in the form of software. That is, the steps of the method disclosed in the embodiments of the present disclosure may be embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
  • the software module can be located in storage media such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers, etc.
  • the storage medium is located in the memory 92, and the processor 91 reads the information in the memory 92 and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
  • Such software may be distributed on a computer-readable medium, and the computer-readable medium may include a computer storage medium (or a non-transitory medium) and a communication medium (or a transitory medium).
  • the term computer storage medium includes volatile and nonvolatile implementations in any method or technology configured to store information (such as computer-readable instructions, data structures, program modules, or other data). Sexual, removable and non-removable media.
  • Computer storage media include but are not limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or Set up as any other medium that stores the desired information and can be accessed by the computer.
  • communication media usually contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as carrier waves or other transmission mechanisms, and may include any information delivery media. .

Abstract

A data storage method and device for a blockchain structure, a verification method and device for a blockchain structure, a blockchain-structured system and a blockchain structure implementation method, a storage medium, and a computer device. The blockchain structure implementation method comprises: a first blockchain system signing ledger data, and then writing the signed ledger data into block data of a first blockchain; a second blockchain system verifying the block data of the first blockchain, and then writing one piece or multiple continuous pieces of the block data of the first blockchain into block data of a second blockchain; and a data storage device using part or all of connection information in the second blockchain as a first key, verifying that data associated with the first key is errorless, and then storing said data as input data or output data, wherein input data and output data stored in the same data storage device are associated with each other according to the same connection information.

Description

链式结构数据存储、验证、实现方法、系统、装置及介质Chain structure data storage, verification, realization method, system, device and medium 技术领域Technical field
本文涉及但不限于计算机数据处理技术领域,尤指一种链式结构数据存储方法及装置、链式结构验证方法及装置、链式结构系统及实现方法、存储介质及计算机装置。This article relates to, but is not limited to, the field of computer data processing technology, especially a chain structure data storage method and device, a chain structure verification method and device, a chain structure system and implementation method, a storage medium, and a computer device.
背景技术Background technique
目前的去中心化系统例如公有链系统,因为有着公开、透明、可追溯、不可篡改等特点,所以能降低交易参与方之间的信任成本,可作为信任的基础实现价值传递。Current decentralized systems such as public chain systems have the characteristics of openness, transparency, traceability, and non-tamperability, so they can reduce the cost of trust between transaction participants and can be used as the basis for trust to achieve value transfer.
然而,目前的去中心化系统存在以下问题:节点需要存储全部数据才能验证整个账本数据。However, the current decentralized system has the following problem: the node needs to store all the data in order to verify the entire ledger data.
发明概述Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this article. This summary is not intended to limit the scope of protection of the claims.
本文提供一种数据存储方法、链式结构验证方法、链式结构实现方法及系统。This article provides a data storage method, chain structure verification method, chain structure realization method and system.
在一示例性实施例中,本公开提供一种数据存储方法,用于存储链式结构中的数据,所述方法包括:In an exemplary embodiment, the present disclosure provides a data storage method for storing data in a chain structure, and the method includes:
将所述链式结构中链的部分或全部连接信息作为第一键,所述第一键关联的所述链式结构中的数据作为值,将所述数据存储为输入数据或输出数据,同一数据存储装置存储的输入数据和输出数据根据相同的连接信息相关联。Part or all of the connection information of the chain in the chain structure is used as the first key, and the data in the chain structure associated with the first key is used as the value, and the data is stored as input data or output data. The input data and output data stored in the data storage device are associated according to the same connection information.
在一示例性实施例中,本公开还提供一种链式结构验证方法,所述方法包括:In an exemplary embodiment, the present disclosure further provides a chain structure verification method, the method includes:
将所述链式结构中链的部分或全部连接信息作为第一键,所述第一键关联的所述链式结构中的数据作为值,验证所述第一键关联的数据是否有错误, 验证所述第一键关联的数据无错误后,将所述数据存储为输入数据或输出数据。Use part or all of the connection information of the chain in the chain structure as the first key, and use the data in the chain structure associated with the first key as the value to verify whether the data associated with the first key has errors, After verifying that the data associated with the first key has no errors, the data is stored as input data or output data.
在一示例性实施例中,本公开还提供一种链式结构验证方法,所述方法包括:In an exemplary embodiment, the present disclosure further provides a chain structure verification method, the method includes:
将所述链式结构中链的部分或全部连接信息作为第二键,从数据存储装置获取所述数据存储装置存储的与所述第二键关联的数据,根据所述获取的数据验证所述链式结构中的数据是否有错误。Taking part or all of the connection information of the chain in the chain structure as the second key, acquiring data stored in the data storage device and associated with the second key from the data storage device, and verifying the data according to the acquired data Whether there are errors in the data in the chain structure.
在一示例性实施例中,本公开还提供一种链式结构实现方法,所述链式结构系统包括第一链系统、第二链系统和数据存储装置,所述方法包括:In an exemplary embodiment, the present disclosure also provides a method for implementing a chain structure. The chain structure system includes a first chain system, a second chain system, and a data storage device, and the method includes:
所述第一链系统对账本数据签名后,将签名后的账本数据写入第一链的区块数据;After the first chain system signs the ledger data, write the signed ledger data into the block data of the first chain;
所述第二链系统在验证第一链的区块数据后,将所述第一链的一个或多个连续的区块数据写入第二链的区块数据;After verifying the block data of the first chain, the second chain system writes one or more continuous block data of the first chain into the block data of the second chain;
所述数据存储装置将所述第二链中链的部分或全部连接信息作为第一键,所述第一键关联的数据作为值,验证所述第一键关联的数据无错误后,将所述数据存储为输入数据或输出数据,同一数据存储装置存储的输入数据和输出数据根据相同的连接信息相关联。The data storage device uses part or all of the connection information of the chain in the second chain as the first key, and the data associated with the first key as the value. After verifying that the data associated with the first key has no errors, it will The data is stored as input data or output data, and the input data and output data stored in the same data storage device are related according to the same connection information.
在一示例性实施例中,本公开还提供了一种链式结构数据存储装置,所述数据存储装置包括第一存储模块和第二存储模块,其中:In an exemplary embodiment, the present disclosure also provides a chain structure data storage device, the data storage device includes a first storage module and a second storage module, wherein:
所述第一存储模块,设置为将所述链式结构中链的部分或全部连接信息作为第一键存储;The first storage module is configured to store part or all of the connection information of the chain in the chain structure as a first key;
所述第二存储模块,设置为将所述第一键关联的所述链式结构中的数据存储为输入数据或输出数据,同一数据存储装置存储的输入数据和输出数据根据相同的连接信息相关联。The second storage module is configured to store the data in the chain structure associated with the first key as input data or output data, and the input data and output data stored in the same data storage device are related according to the same connection information United.
在一示例性实施例中,本公开还提供了一种链式结构数据验证装置,所述数据验证装置包括键值查找模块、第二验证模块,其中:In an exemplary embodiment, the present disclosure also provides a chain structure data verification device. The data verification device includes a key value search module and a second verification module, wherein:
所述键值查找模块,设置为查找所述链式结构中链的部分或全部连接信息作为第二键;The key value search module is configured to search for part or all of the connection information of the chain in the chain structure as the second key;
所述第二验证模块,设置为从数据存储装置获取所述数据存储装置存储的与所述第二键关联的数据,根据所述获取的数据验证所述链式结构中的数据是否有错误。The second verification module is configured to obtain data associated with the second key stored by the data storage device from a data storage device, and verify whether the data in the chain structure has errors according to the obtained data.
在一示例性实施例中,本公开还提供一种链式结构系统,包括:第一链系统、第二链系统和数据存储装置,其中:In an exemplary embodiment, the present disclosure also provides a chain structure system, including: a first chain system, a second chain system, and a data storage device, wherein:
所述第一链系统,设置为对账本数据签名后,将签名后的账本数据写入第一链的区块数据;The first chain system is configured to, after signing the ledger data, write the signed ledger data into the block data of the first chain;
所述第二链系统,设置为在验证第一链的区块数据后,将所述第一链的一个或多个连续的区块数据写入第二链的区块数据;The second chain system is configured to write one or more continuous block data of the first chain into the block data of the second chain after verifying the block data of the first chain;
所述数据存储装置,设置为将所述第二链中链的部分或全部连接信息作为第一键,所述第一键关联的数据作为值,验证所述第一键关联的数据是否有错误,验证所述第一键关联的数据无错误后,将所述数据存储为输入数据或输出数据,同一数据存储装置存储的输入数据和输出数据根据相同的连接信息相关联。The data storage device is configured to use part or all of the connection information of the chain in the second chain as the first key, and the data associated with the first key as the value, to verify whether the data associated with the first key has errors After verifying that the data associated with the first key has no error, the data is stored as input data or output data, and the input data and output data stored in the same data storage device are associated according to the same connection information.
在一示例性实施例中,本公开还提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于实现上述任意一种方法。In an exemplary embodiment, the present disclosure also provides a computer-readable storage medium that stores computer-executable instructions, and the computer-executable instructions are used to implement any of the foregoing methods.
在一示例性实施例中,本公开还提供一种计算机装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述任意一种方法中的步骤。In an exemplary embodiment, the present disclosure also provides a computer device, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor. The processor implements any of the foregoing when the program is executed. Steps in a method.
本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the present invention will be described in the following description, and partly become obvious from the description, or understood by implementing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the structures specifically pointed out in the specification, claims and drawings.
在阅读并理解了附图和详细描述后,可以明白其他方面。After reading and understanding the drawings and detailed description, other aspects can be understood.
附图概述Brief description of the drawings
附图用来提供对本发明技术方案的进一步理解,并且构成说明书的一部分,与本文的实施例一起用于解释本发明的技术方案,并不构成对本文技术方案的限制。The accompanying drawings are used to provide a further understanding of the technical solutions of the present invention, and constitute a part of the specification. Together with the embodiments herein, they are used to explain the technical solutions of the present invention, and do not constitute a limitation to the technical solutions herein.
图1为一种示例性数据存储方法流程图;Fig. 1 is a flowchart of an exemplary data storage method;
图2为一种示例性数据存储装置结构示意图;Fig. 2 is a schematic structural diagram of an exemplary data storage device;
图3为一种示例性数据验证方法流程图;Figure 3 is a flowchart of an exemplary data verification method;
图4为一种示例性具有验证功能的数据存储装置结构示意图;4 is a schematic diagram of an exemplary data storage device with verification function;
图5为另一种示例性数据验证方法流程图;Figure 5 is a flowchart of another exemplary data verification method;
图6为一种示例性数据验证装置结构示意图;Figure 6 is a schematic structural diagram of an exemplary data verification device;
图7为一种示例性链式结构实现方法流程图;Fig. 7 is a flowchart of an exemplary chain structure realization method;
图8为一种示例性链式结构系统示意图;Figure 8 is a schematic diagram of an exemplary chain structure system;
图9为一种示例性连接存储图,连接信息为Bd1;Fig. 9 is an exemplary connection storage diagram, and the connection information is Bd1;
图10为一种示例性三层二链系统架构图;Figure 10 is an exemplary three-layer two-chain system architecture diagram;
图11为一种示例性计算机设备的结构示意图。Fig. 11 is a schematic structural diagram of an exemplary computer device.
详述Detail
本文描述了多个实施例,但是该描述是示例性的,而不是限制性的,并且对于本领域的普通技术人员来说显而易见的是,在本文所描述的实施例包含的范围内可以有更多的实施例和实现方案。尽管在附图中示出了许多可能的特征组合,并在实施方式中进行了讨论,但是所公开的特征的许多其它组合方式也是可能的。除非特意加以限制的情况以外,任何实施例的任何特征或元件可以与任何其它实施例中的任何其他特征或元件结合使用,或可以替代任何其它实施例中的任何其他特征或元件。A number of embodiments are described herein, but the description is exemplary rather than restrictive, and it is obvious to a person of ordinary skill in the art that there can be more within the scope of the embodiments described herein. Many embodiments and implementation schemes. Although many possible feature combinations are shown in the drawings and discussed in the embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment can be used in combination with any other feature or element in any other embodiment, or can replace any other feature or element in any other embodiment.
本文包括并设想了与本领域普通技术人员已知的特征和元件的组合。本文已经公开的实施例、特征和元件也可以与任何常规特征或元件组合,以形成由权利要求限定的独特的发明方案。任何实施例的任何特征或元件也可以与来自其它发明方案的特征或元件组合,以形成另一个由权利要求限定的独特的发明方案。因此,应当理解,在本文中示出和/或讨论的任何特征可以单独地或以任何适当的组合来实现。因此,除了根据所附权利要求及其等同替换所做的限制以外,实施例不受其它限制。此外,可以在所附权利要求的保 护范围内进行各种修改和改变。Combinations with features and elements known to those of ordinary skill in the art are included and contemplated herein. The embodiments, features, and elements already disclosed herein can also be combined with any conventional features or elements to form a unique inventive solution defined by the claims. Any feature or element of any embodiment can also be combined with features or elements from other invention solutions to form another unique invention solution defined by the claims. Therefore, it should be understood that any of the features shown and/or discussed herein can be implemented individually or in any suitable combination. Therefore, the embodiments are not subject to other restrictions except for the restrictions made according to the appended claims and their equivalents. In addition, various modifications and changes can be made within the protection scope of the appended claims.
此外,在描述具有代表性的实施例时,说明书可能已经将方法和/或过程呈现为特定的步骤序列。然而,在该方法或过程不依赖于本文所述步骤的特定顺序的程度上,该方法或过程不应限于所述的特定顺序的步骤。如本领域普通技术人员将理解的,其它的步骤顺序也是可能的。因此,说明书中阐述的步骤的特定顺序不应被解释为对权利要求的限制。此外,针对该方法和/或过程的权利要求不应限于按照所写顺序执行它们的步骤,本领域技术人员可以容易地理解,这些顺序可以变化,并且仍然保持在本文实施例的精神和范围内。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 depend on the specific order of the steps described herein, the method or process should not be limited to the steps in the specific order described. As those of ordinary skill in the art will understand, other sequence of steps are also possible. Therefore, the specific order of the steps set forth in the specification should not be construed as a limitation on the claims. In addition, the claims for the method and/or process should not be limited to performing their steps in the written order. Those skilled in the art can easily understand that these orders can be changed and still remain within the spirit and scope of the embodiments herein. .
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps shown in the flowcharts of the drawings may 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 may be performed in a different order than here.
本文提出一种私有链与公有链的结合方案,解决私有链数据的可信问题,并且解决部分公平性问题,以及每个用户端只需要存储部分账本数据即可等价验证全部账本数据。This paper proposes a combination of private chain and public chain to solve the credibility problem of private chain data, and solve part of the fairness problem, and each user only needs to store part of the ledger data to equivalently verify all the ledger data.
下面先对本文涉及的概念进行说明。Let's first explain the concepts involved in this article.
token,指区块链上的代币,也称为通证。Token refers to the token on the blockchain, also known as a pass.
CA(Certificate Authority),认证授权。CA (Certificate Authority), authentication and authorization.
eID(electronic Identity),指公民网络电子身份标识,是可信的实名认证方式eID (electronic Identity) refers to the electronic identity of citizens on the Internet, which is a credible real-name authentication method
SPV(Simplified Payment Verification):简单支付验证,通过默克尔树认证路径验证某交易是否包含在链的区块中,并且经过多少个确认。SPV (Simplified Payment Verification): Simple payment verification, which verifies whether a transaction is included in a chain block and how many confirmations have passed through the Merkel tree verification path.
POA(Proof of Authority):权威证明,一种基于身份和声誉的共识算法。POA (Proof of Authority): Proof of Authority, a consensus algorithm based on identity and reputation.
Gossip网络协议:也叫Epidemic Protocol(流行病协议),是非结构化对等网络协议,是Bitcoin等系统采用的网络协议。Gossip network protocol: also called Epidemic Protocol (epidemic protocol), is an unstructured peer-to-peer network protocol, and is a network protocol used by systems such as Bitcoin.
DHT(Distributed Hash Table):分布式哈希表,是一种分布式存储方法。在不需要服务器的情况下,每个客户端负责一小范围的路由,并负责存储一小部分数据,从而实现整个DHT网络的寻址和存储。DHT (Distributed Hash Table): Distributed Hash Table is a distributed storage method. Without a server, each client is responsible for a small range of routing, and is responsible for storing a small part of data, so as to realize the addressing and storage of the entire DHT network.
Kademlia网络协议:是一种分布式哈希表(DHT)网络协议,是结构化对等网络协议,是IPFS等系统采用的网络协议。Kademlia network protocol: is a distributed hash table (DHT) network protocol, a structured peer-to-peer network protocol, and a network protocol adopted by systems such as IPFS.
一致性哈希算法:DHT的一种实现。能够在动态变化的环境中满足平衡性、单调性、分散性和负载。Consistent Hash Algorithm: An implementation of DHT. It can satisfy balance, monotonicity, dispersion and load in a dynamically changing environment.
UTXO(Unspent Transaction Output),未花费的交易输出,引用一个或多个未花费交易输出变为已花费,并且创建一个或多个新的未花费交易输出,并且不断循环向后延伸。根据其连接的方式,形成DAG(Directed Acyclic Graph有向无环图)的链式结构。本文称为UTXO链。UTXO (Unspent Transaction Output), unspent transaction output, refers to one or more unspent transaction outputs that become spent, and creates one or more new unspent transaction outputs, and continues to loop back. According to its connection method, a chain structure of DAG (Directed Acyclic Graph) is formed. This article is called UTXO chain.
公有链,指任何人都可以读取、发送交易和参与共识的区块链,属于完全去中心化的系统。本文实施例中采用的是一种除任何人都可以发送交易外,其余都与公有链系统相同的类公有链系统,满足交易中心化,账本数据去中心化。在本文所述的类公有链系统中,任何人都可以读取、验证交易和参与共识,能够实现可追溯、不可篡改。The public chain refers to a blockchain that anyone can read, send transactions, and participate in consensus. It is a completely decentralized system. In this embodiment, a public chain system that is the same as the public chain system except that anyone can send transactions is adopted to satisfy transaction centralization and decentralization of ledger data. In the public chain system described in this article, anyone can read and verify transactions and participate in consensus, which can be traced and cannot be tampered with.
私有链,指写入权限在一个组织手里的数据链,属于中心化的系统。Private chain refers to a data chain whose write permission is in the hands of an organization, and belongs to a centralized system.
联盟链,指写入权限在多个组织手里的数据链,属于部分去中心化的系统。Consortium chain refers to a data chain whose write permission is in the hands of multiple organizations, and belongs to a partially decentralized system.
本文一示例性实施例提供了一种用于存储链式结构中数据的数据存储方法,如图1所示,包括步骤11-12。An exemplary embodiment of this document provides a data storage method for storing data in a chain structure, as shown in FIG. 1, including steps 11-12.
步骤11,将所述链式结构中链的部分或全部连接信息作为第一键;Step 11. Use part or all of the connection information of the chain in the chain structure as the first key;
步骤12,所述第一键关联的所述链式结构中的数据作为值,将所述数据存储为输入数据或输出数据,同一数据存储装置存储的输入数据和输出数据根据相同的连接信息相关联。Step 12: The data in the chain structure associated with the first key is used as a value, and the data is stored as input data or output data. The input data and output data stored in the same data storage device are related according to the same connection information. United.
一个或一组数据中包含前一个或一组数据中的信息,该信息即为链的连接信息,该连接信息使得前述数据在逻辑上形成一链式结构。One or a group of data contains the information in the previous one or a group of data, which is the connection information of the chain, and the connection information makes the aforementioned data logically form a chain structure.
设置为进行数据存储的装置可采用DHT技术实现。所述装置上存储有作为第一键(也可称为键值或者关键值)的所述链式结构中的连接信息。作为第一键的连接信息可以是该链式结构连接信息的部分也可以是全部。所述第一键例如可以是地址或者地址的哈希值。The device set up for data storage can be implemented using DHT technology. The device stores connection information in the chain structure as a first key (also referred to as a key value or a key value). The connection information as the first key may be part or all of the chain structure connection information. The first key may be, for example, an address or a hash value of the address.
对于所述链式结构中的任一个或一组数据,每个或每组数据包含输入信息和输出信息,其中当前数据的输入信息为数据M的输出信息,该数据M在逻辑上为当前数据的前一数据(上一数据),该当前数据的输入信息或数据M的输出信息属于链的连接信息,当前数据的输出信息为数据N的输入信息,该数据N在逻辑上为当前数据的后一数据(下一数据),该当前数据的输出信息或数据N的输入信息也属于链的连接信息。该链式结构例如为UTXO链,每个交易数据包括引用的未花费输出作为输入信息和新的未花费输出作为输出信息。For any one or a group of data in the chain structure, each or each group of data includes input information and output information, wherein the input information of the current data is the output information of the data M, and the data M is logically the current data The previous data (previous data), the input information of the current data or the output information of the data M belongs to the connection information of the chain, the output information of the current data is the input information of the data N, and the data N is logically the current data The latter data (next data), the output information of the current data or the input information of the data N also belong to the connection information of the chain. The chain structure is, for example, a UTXO chain, and each transaction data includes the referenced unspent output as input information and the new unspent output as output information.
数据存储装置当接收到与第一键值相匹配的数据时,根据所述数据在链式结构中所表示的意义,将所述数据存储为输入数据或输出数据。同一数据存储装置上存储的输入数据和输出数据根据相同的键(即链的连接信息)相关联,此种存储方式可称为连接存储或者数据结对存储。同一数据存储装置上可能存储一组或多组输入数据和输出数据,对于任意一组输入数据和输出数据,该输入数据和输出数据根据相同的连接信息相关联。同一装置上存储的输入数据可以有一个或多个,存储的输出数据也可以有零个(即无输出数据)、或一个或多个。所述链式结构可以是任意具有链式结构特征的链。所述数据存储装置可以是用户端节点也可以是共识组,也可以是其他需要进行连接存储的装置。待存储的数据可以是交易数据,也可以是控制数据,例如可以将控制数据中的代币token发行数据和共识奖励数据存储为输入数据,将控制数据中的token回收数据存储为输出数据。其中对应的键分别为token发行预设地址、共识奖励预设地址、token回收预设地址。When receiving data that matches the first key value, the data storage device stores the data as input data or output data according to the meaning of the data in the chain structure. The input data and output data stored on the same data storage device are related according to the same key (that is, the connection information of the chain). This storage method can be called connection storage or data pair storage. One or more sets of input data and output data may be stored on the same data storage device. For any set of input data and output data, the input data and output data are related according to the same connection information. There can be one or more input data stored on the same device, and there can be zero (ie no output data), or one or more stored output data. The chain structure can be any chain with chain structure characteristics. The data storage device may be a user-end node or a consensus group, or other devices that need to be connected for storage. The data to be stored can be transaction data or control data. For example, the token issuance data and consensus reward data in the control data can be stored as input data, and the token recovery data in the control data can be stored as output data. The corresponding keys are the preset address for token issuance, the preset address for consensus reward, and the preset address for token recovery.
采用此种连接存储可以将庞大的链式结构数据分散存储在多个装置上,以减轻数据存储压力。该种存储方式还便于进行验证。Using this kind of connected storage can disperse and store huge chain structure data on multiple devices to reduce the pressure of data storage. This storage method is also convenient for verification.
在一示例性实施例中,所述第一键作为所述链式结构中输出信息的部分或全部时,将所述第一键关联的数据作为输入数据存储;所述第一键作为所述链式结构中输入信息的部分或全部时,将所述第一健关联的数据作为输出数据存储。In an exemplary embodiment, when the first key is used as part or all of the output information in the chain structure, the data associated with the first key is stored as input data; the first key is used as the When part or all of the input information in the chain structure, the data associated with the first key is stored as output data.
例如,如果第一键为所述链式结构中的输出地址时,则将该第一键关联的数据存储为输入数据,如果第一键为所述链式结构中的输入地址时,则将 该第一键关联的数据存储为输出数据。For example, if the first key is the output address in the chain structure, the data associated with the first key is stored as input data, and if the first key is the input address in the chain structure, the The data associated with the first key is stored as output data.
本实施例中的数据存储装置可以和其他系统结合使用,例如与一个去中心化系统结合,或者与一个中心化系统结合。The data storage device in this embodiment can be used in combination with other systems, for example, with a decentralized system, or with a centralized system.
上述数据存储装置例如可以如图2所示,包括第一存储模块21和第二存储模块22,其中:The above-mentioned data storage device may, for example, as shown in FIG. 2, include a first storage module 21 and a second storage module 22, wherein:
第一存储模块21,设置为将所述链式结构中链的部分或全部连接信息作为第一键存储;The first storage module 21 is configured to store part or all of the connection information of the chain in the chain structure as a first key;
第二存储模块22,设置为将所述第一键关联的所述链式结构中的数据存储为输入数据或输出数据,同一数据存储装置存储的输入数据和输出数据根据相同的连接信息相关联。The second storage module 22 is configured to store the data in the chain structure associated with the first key as input data or output data, and the input data and output data stored in the same data storage device are associated according to the same connection information .
例如,当所述第一键作为所述链式结构中输出信息的部分或全部时,所述第二存储模块22将所述第一键关联的数据作为输入数据存储,当所述第一键作为所述链式结构中输入信息的部分或全部时,所述第二存储模块22将所述第一健关联的数据作为输出数据存储。For example, when the first key is used as part or all of the output information in the chain structure, the second storage module 22 stores the data associated with the first key as input data, and when the first key As part or all of the input information in the chain structure, the second storage module 22 stores the data associated with the first key as output data.
采用此种存储方式,使得整个链式结构可以被多个数据存储装置分段存储,便于检索和验证。With this storage method, the entire chain structure can be segmented by multiple data storage devices, which is convenient for retrieval and verification.
本文一示例性实施例还提供了一种链式结构验证方法,由数据存储装置实现验证,如图3所示,所述方法包括步骤31-33。An exemplary embodiment herein also provides a chain structure verification method, which is verified by a data storage device. As shown in FIG. 3, the method includes steps 31-33.
步骤31,将所述链式结构中链的部分或全部连接信息作为第一键;Step 31, using part or all of the connection information of the chain in the chain structure as the first key;
步骤32,所述第一键关联的所述链式结构中的数据作为值,验证所述第一键关联的数据是否有错误;Step 32: Use the data in the chain structure associated with the first key as a value, and verify whether the data associated with the first key has errors;
步骤33,验证所述第一键关联的数据无错误后,将所述数据存储为输入数据或输出数据。Step 33: After verifying that the data associated with the first key has no errors, store the data as input data or output data.
如前述实施例所述,所述链式结构可以是任意具有链式结构特征的链。所述数据存储装置可以是用户端节点也可以是共识组,也可以是其他需要进行连接存储的装置。待存储的数据可以是交易数据,也可以是控制数据。作 为第一键的连接信息可以是该链式结构连接信息的部分也可以是全部。在本实施例中,由进行数据存储的装置(例如用户端节点)进行链式结构验证。该数据存储装置上存储有作为第一键的该链式结构中的连接信息,因此该数据存储装置在接收与本装置对应的第一键匹配的数据时,对所述数据进行验证,在验证无错误后,再进行连接存储。As described in the foregoing embodiment, the chain structure can be any chain with the characteristics of a chain structure. The data storage device may be a user-end node or a consensus group, or other devices that need to be connected for storage. The data to be stored can be transaction data or control data. The connection information as the first key can be part or all of the chain structure connection information. In this embodiment, the chain structure verification is performed by the device for data storage (for example, the user end node). The data storage device stores the connection information in the chain structure as the first key. Therefore, when the data storage device receives data matching the first key corresponding to the device, it verifies the data. After there is no error, connect to storage again.
以数据为账本数据为例,数据存储装置验证所述账本数据无错误后,判断所述账本数据的输出信息与所述第一键匹配时,将所述账本数据存储为输入数据,判断所述账本数据的输入信息与所述第一键匹配时,将所述账本数据存储为输出数据,同一装置上存储的输入数据和输出数据根据相同的连接信息相关联。同一装置上存储的输入数据可以有一个或多个,存储的输出数据也可以有零个(即无输出数据)、或一个或多个。Taking data as ledger data as an example, after the data storage device verifies that the ledger data has no errors, and when it determines that the output information of the ledger data matches the first key, it stores the ledger data as input data and determines that the When the input information of the ledger data matches the first key, the ledger data is stored as output data, and the input data and output data stored on the same device are associated according to the same connection information. There can be one or more input data stored on the same device, and there can be zero (ie no output data), or one or more stored output data.
本实施例在连接存储时进行验证,可以将对整个链式结构的验证转化为局部验证,由多个数据存储装置分别进行,相当于等价验证全部数据的正确性,采用此种等价验证方式,将验证工作分散到多个装置上,以减轻数据验证的工作量压力。In this embodiment, the verification is performed when the storage is connected, and the verification of the entire chain structure can be converted into partial verification, which is performed separately by multiple data storage devices, which is equivalent to verifying the correctness of all data. This equivalent verification is adopted. In this way, the verification work is distributed to multiple devices to reduce the workload pressure of data verification.
在一示例性实施例中,将所述数据存储为输入数据或输出数据,可以采取以下方式:所述第一键作为所述链式结构中的输出信息的部分或全部时,将所述第一键关联的数据作为输入数据存储;所述第一键作为所述链式结构中的输入信息的部分或全部时,将所述第一键关联的数据作为输出数据存储;本装置上存储的输入数据和输出数据根据相同的连接信息相关联。In an exemplary embodiment, storing the data as input data or output data may be in the following manner: when the first key is used as part or all of the output information in the chain structure, the first key is used as part or all of the output information in the chain structure. The data associated with one key is stored as input data; when the first key is used as part or all of the input information in the chain structure, the data associated with the first key is stored as output data; stored on this device The input data and the output data are related according to the same connection information.
在一示例性实施例中,上述验证所述第一键关联的数据是否有错误,包括以下验证中的一种或多种:In an exemplary embodiment, the foregoing verification of whether the data associated with the first key has errors includes one or more of the following verifications:
验证11,验证所述数据是否为所述链式结构上的数据;Verification 11, verifying whether the data is data on the chain structure;
验证12,所述第一键作为所述链式结构中的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;Verification 12. When the first key is used as the input information in the chain structure, verify whether there is output information that has the same connection information as the input information;
验证13,所述第一键作为所述链式结构中的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;Verification 13, when the first key is used as the input information in the chain structure, verify whether the output information that has the same connection information as the input information has been used;
验证14,所述第一键作为所述链式结构中的输入信息时,且所述第一键 关联的数据包含交易数额时,验证所述交易数额是否正确。Verification 14, when the first key is used as the input information in the chain structure, and the data associated with the first key includes the transaction amount, verify whether the transaction amount is correct.
验证15,所述第一键作为所述链式结构中的输入信息时,且所述第一键关联的数据包含签名信息时,验证所述签名信息是否正确。所述签名信息是产生交易数据的用户端的解锁签名。所述验证签名信息是否正确即验证签名信息是否有效。Verification 15. When the first key is used as the input information in the chain structure, and the data associated with the first key includes signature information, verify whether the signature information is correct. The signature information is the unlocking signature of the user terminal that generates the transaction data. The verification of whether the signature information is correct is to verify whether the signature information is valid.
上述验证序号仅为说明方便,不代表验证顺序。对于上述验证11,如果数据是链式结构上的数据,则验证为无错误;对于验证12,如果存在与所述输入信息具有相同连接信息的输出信息,则验证为无错误;对于验证13,所述与输入信息具有相同连接信息的输出信息未被使用过,则验证为无错误;对于验证14,交易数额正确,则验证为无错误;对于验证15,验证签名信息有效,则验证为无错误。The above verification sequence number is only for convenience of explanation, and does not represent the verification sequence. For the above verification 11, if the data is data on a chain structure, the verification is error-free; for verification 12, if there is output information that has the same connection information as the input information, then the verification is error-free; for verification 13, If the output information that has the same connection information as the input information has not been used, the verification is error-free; for verification 14, the transaction amount is correct, then the verification is error-free; for verification 15, the verification that the signature information is valid, then the verification is no error.
一种示例性的验证过程:所述数据存储装置同步所述链式结构中的区块头数据,所述装置查找本装置是否存储有与所述第一键相关联的输入数据(还可以从所述链式结构中查找),如果没有,则判断为连接错误,如果有,判断所述输入数据的关联连接是否被引用,如果已被引用过,则判断为连接错误;判断所述账本数据的交易数额是否正确,如果正确,则将所述账本数据存储为输出数据,并将输入数据的关联连接标识为已被引用,也即相关联的输出信息将标记为已使用,如果不正确,判断为数据错误,如果正确,如果数据中包含签名信息时,验证所述签名信息是否正确,如果不正确判断为数据错误。所述签名信息例如是产生交易数据的用户端的解锁签名。当验证成功后,与输入信息相关联的输出信息将标记为已使用。An exemplary verification process: the data storage device synchronizes the block header data in the chain structure, and the device searches whether the device stores the input data associated with the first key (you can also download the data from the first key). Search in the chain structure), if not, it is judged as a connection error, if there is, it is judged whether the associated connection of the input data is quoted, if it has been quoted, it is judged as a connection error; judge the account data Whether the transaction amount is correct, if it is correct, store the ledger data as output data, and mark the associated connection of the input data as being referenced, that is, the associated output information will be marked as used. If it is not correct, judge It is a data error. If it is correct, if the data contains signature information, verify whether the signature information is correct, and if it is incorrect, it is judged as a data error. The signature information is, for example, the unlocking signature of the user terminal that generates the transaction data. When the verification is successful, the output information associated with the input information will be marked as used.
在一示例性实施例中,可采用以下方式验证所述数据是否为所述链式结构上的数据:In an exemplary embodiment, the following methods may be used to verify whether the data is data on the chain structure:
同步所述链式结构的区块头数据,根据所述区块头数据中的默克尔树根哈希值和所述数据的认证路径验证所述数据是否为链式结构上的数据。Synchronize the block header data of the chain structure, and verify whether the data is data on the chain structure according to the Merkel tree root hash value in the block header data and the authentication path of the data.
在一示例性实施例中,所述方法还包括:根据数据验证装置的请求,向所述数据验证装置返回本装置存储的与所述链的连接信息关联的数据,包括但不限于以下数据中的一种或多种:输入数据、输出数据、默克尔树认证路径、附加验证数据。In an exemplary embodiment, the method further includes: according to the request of the data verification device, returning to the data verification device the data associated with the connection information of the chain stored by the device, including but not limited to the following data One or more of: input data, output data, Merkel tree certification path, additional verification data.
其中,输入数据可能有一个或多个。输出数据可能没有(即零个)或者有一个或者多个,无输出数据表示输入数据的连接未被使用或未花费。正常情况下,有输入数据才有输出数据,但也不排除出错的情况,只有输出数据,没有输入数据。默克尔树认证路径与输入数据或输出数据对应存在。附加验证数据可能有,也可能没有。附加验证数据用于验证交易数额是否正确,例如UTXO中需要累加全部输入数额和全部输出数额,所以可能需要其它的交易数据才能完成交易数额的验证。附加验证数据也有对应的默克尔树认证路径。Among them, there may be one or more input data. There may be no output data (ie zero) or one or more. No output data means that the connection of the input data is not used or spent. Under normal circumstances, output data is only when there is input data, but it does not rule out the case of errors, only output data, no input data. The Merkel tree certification path exists corresponding to the input data or the output data. Additional verification data may or may not be available. The additional verification data is used to verify whether the transaction amount is correct. For example, in UTXO, all input amounts and all output amounts need to be accumulated, so other transaction data may be required to complete the verification of the transaction amount. The additional verification data also has a corresponding Merkel tree verification path.
为了加强数据的安全性,设置其他装置的验证机制,即由非数据存储装置作为数据验证装置验证所述链式结构中的数据有无错误,被选为数据验证装置的节点从存储装置处获取相关数据,以完成验证。In order to strengthen data security, a verification mechanism for other devices is set up, that is, a non-data storage device is used as a data verification device to verify whether the data in the chain structure has errors, and the node selected as the data verification device obtains it from the storage device Relevant data to complete verification.
本实施例中的数据存储装置可以和其他系统结合使用,例如与一个去中心化系统结合,或者与一个中心化系统结合。The data storage device in this embodiment can be used in combination with other systems, for example, with a decentralized system, or with a centralized system.
上述具有验证功能的数据存储装置例如可以如图4所示,包括第三存储模块41、第一验证模块42和第四存储模块43,其中:The above-mentioned data storage device with verification function may, for example, as shown in FIG. 4, includes a third storage module 41, a first verification module 42, and a fourth storage module 43, wherein:
第三存储模块41,设置为存储所述链式结构中链的部分或全部连接信息作为第一键;The third storage module 41 is configured to store part or all of the connection information of the chain in the chain structure as the first key;
第一验证模块42,设置为验证所述第一键关联的所述链式结构中的数据是否有错误;The first verification module 42 is configured to verify whether the data in the chain structure associated with the first key has errors;
所述第四存储模块43,设置为在所述验证模块42验证无错误后,将所述第一键关联的所述链式结构中的数据存储为输入数据或输出数据。The fourth storage module 43 is configured to store the data in the chain structure associated with the first key as input data or output data after the verification module 42 verifies that there is no error.
例如,所述第三存储模块41的存储方式可与图2中的第一存储模块21相同,所述第四存储模块43的存储方式可与图2中的第二存储模块22相同,该具有验证功能的数据存储装置可在上述图2所示数据存储装置基础上增加第一验证模块42。当所述第一键作为所述链式结构中输出信息的部分或全部时,所述第四存储模块43将所述第一键关联的数据作为输入数据存储,当所述第一键作为所述链式结构中输入信息的部分或全部时,所述第四存储模块43将所述第一健关联的数据作为输出数据存储。For example, the storage mode of the third storage module 41 may be the same as that of the first storage module 21 in FIG. 2, and the storage mode of the fourth storage module 43 may be the same as that of the second storage module 22 in FIG. The data storage device with the verification function can add a first verification module 42 on the basis of the data storage device shown in FIG. 2 described above. When the first key is used as part or all of the output information in the chain structure, the fourth storage module 43 stores the data associated with the first key as input data, and when the first key is used as the input data, When part or all of the input information in the chain structure, the fourth storage module 43 stores the data associated with the first key as output data.
所述第一验证模块42可以进行上述验证11-15中的任意一种或多种,此处不再赘述。The first verification module 42 can perform any one or more of the above-mentioned verifications 11-15, which will not be repeated here.
在一示例性实施例中,所述数据存储装置还可以包括发送模块,其设置为根据其他数据验证装置的请求,向所述数据验证装置返回本装置存储的与所述链的连接信息关联的数据,包括以下数据中的一种或多种:输入数据、输出数据、默克尔树认证路径、附加验证数据。In an exemplary embodiment, the data storage device may further include a sending module, which is configured to return to the data verification device according to a request of another data verification device, the information associated with the connection information of the chain stored by the data verification device. Data includes one or more of the following data: input data, output data, Merkel tree certification path, additional verification data.
采用此种存储和验证方式,使得整个链式结构可以被多个数据存储装置分段存储和等价验证。With this storage and verification method, the entire chain structure can be segmented and verified by multiple data storage devices.
本文一示例性实施例还提供一种链式结构验证方法,由数据验证装置实现,如图5所示,所述方法包括步骤51-52。An exemplary embodiment herein also provides a chain structure verification method, which is implemented by a data verification device. As shown in FIG. 5, the method includes steps 51-52.
步骤51,将所述链式结构中链的部分或全部连接信息作为第二键;Step 51: Use part or all of the connection information of the chain in the chain structure as a second bond;
步骤52,从数据存储装置获取所述数据存储装置上存储的与所述第二键关联的数据(即键对应的值),根据所述获取的数据验证所述链式结构中的数据是否有错误。Step 52: Obtain the data associated with the second key (that is, the value corresponding to the key) stored on the data storage device from the data storage device, and verify whether the data in the chain structure is available according to the acquired data. error.
为了加强数据的安全性,设置其他装置验证机制,即由非数据存储装置验证所述链式结构中的数据有无错误,作为数据验证装置的节点从数据存储装置处获取相关数据,完成验证。所述第二键例如可以是地址或者地址的哈希值。有关链式结构、链式结构中连接信息、输入信息和输出信息的说明参见前述实施例中的描述,此处不再赘述。In order to strengthen data security, other device verification mechanisms are set up, that is, the non-data storage device verifies whether the data in the chain structure has errors, and the node as the data verification device obtains relevant data from the data storage device to complete the verification. The second key may be, for example, an address or a hash value of the address. For the description of the chain structure, the connection information, the input information and the output information in the chain structure, please refer to the description in the foregoing embodiment, which will not be repeated here.
在一示例性实施例中,所述从数据存储装置获取的与所述第二键关联的数据包括但不限于以下一种或多种:所述数据存储装置存储的:与所述第二键关联的数据、默克尔树认证路径、附加验证数据,其中,所述第二键作为所述链式结构中输出信息的部分或全部,或者所述第二键作为所述链式结构中输入信息的部分或全部。当所述第二键作为所述链式结构中输出信息的部分或全部时,所述第二键关联的数据即为所述数据存储装置存储的输入数据;所述第二键作为所述链式结构中输入信息的部分或全部时,所述第二键关联的数据即为所述数据存储装置存储的输出数据。In an exemplary embodiment, the data associated with the second key obtained from the data storage device includes, but is not limited to, one or more of the following: stored by the data storage device: and the second key Associated data, Merkel tree certification path, additional verification data, wherein the second key is used as part or all of the output information in the chain structure, or the second key is used as the input in the chain structure Part or all of the information. When the second key is used as part or all of the output information in the chain structure, the data associated with the second key is the input data stored by the data storage device; the second key is used as the chain When inputting part or all of the information in the formula structure, the data associated with the second key is the output data stored by the data storage device.
所述数据验证装置可同步链式结构的区块头,所述区块头中包含累计账本数据量,所述数据验证装置用所述区块头中的累计账本数据量生成编号地址(用累计控制数据量生成控制数据编号地址,用累计交易数据量生成交易数据编号地址),根据所述编号地址获取链的部分或全部连接信息作为第二键,从所述数据存储装置获取所述数据存储装置上存储的与所述第二键关联的数据。控制数据编号地址作为键获取的是该控制数据编号地址对应的控制数据,还可以包括该控制数据的默克尔树认证路径;交易数据编号地址作为键获取的是该交易数据编号地址对应的交易数据,还可以包括该交易数据的默克尔树认证路径。例如,可将控制数据的代币token发行数据的预设地址(简称token发行地址)、token回收数据的预设地址(简称token回收地址)或共识奖励数据的预设地址(简称奖励地址)作为键,用该键从数据存储装置获取其上存储的与键关联的数据;可将交易数据的交易地址作为键,用该键从数据存储装置获取其上存储的与键关联的数据。The data verification device can synchronize the block header of the chain structure, and the block header contains the cumulative ledger data volume, and the data verification device uses the cumulative ledger data volume in the block header to generate a number address (using cumulative control data volume Generate the control data number address, use the accumulated transaction data volume to generate the transaction data number address), obtain part or all of the connection information of the chain according to the number address as the second key, and obtain the data stored on the data storage device from the data storage device The data associated with the second key. The control data number address is used as the key to obtain the control data corresponding to the control data number address, and it can also include the Merkel tree authentication path of the control data; the transaction data number address is used as the key to obtain the transaction corresponding to the transaction data number address. The data may also include the Merkel tree authentication path of the transaction data. For example, the preset address of the token issuance data of the control data (referred to as the token issuance address), the preset address of the token recovery data (referred to as the token recycling address) or the preset address of consensus reward data (referred to as the reward address) can be used as The key is used to obtain the data associated with the key stored thereon from the data storage device; the transaction address of the transaction data can be used as the key, and the key is used to obtain the data associated with the key stored on the data storage device.
在一示例性实施例中,上述根据所述获取的数据验证所述链式结构中的数据是否有错误,包括:In an exemplary embodiment, the foregoing verification of whether the data in the chain structure has errors based on the acquired data includes:
同步所述链式结构中的区块头数据,结合所述区块头数据与从所述数据存储装置获取的与所述第二键关联的数据,验证所述链式结构中的数据是否有错误。例如包括进行以下验证中的一种或多种:Synchronizing the block header data in the chain structure, combining the block header data and the data associated with the second key obtained from the data storage device, to verify whether the data in the chain structure has errors. For example, including one or more of the following verifications:
验证21,验证所述从数据存储装置获取的与所述第二键关联的值是否为所述链式结构上的数据;Verification 21, verifying whether the value associated with the second key obtained from the data storage device is data on the chain structure;
验证22,所述第二键作为所述获取的数据的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;Verification 22, when the second key is used as the input information of the acquired data, verify whether there is output information that has the same connection information as the input information;
验证23,所述第二键作为所述获取的数据的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;Verification 23, when the second key is used as the input information of the acquired data, verify whether the output information having the same connection information as the input information has been used;
验证24,所述第二键作为所述获取的数据的输入信息时,且所述获取的数据包含交易数额时,验证所述交易数额是否正确;Verification 24, when the second key is used as the input information of the acquired data, and when the acquired data includes the transaction amount, verify whether the transaction amount is correct;
验证25,所述第二键作为所述获取的数据的输入信息时,且所述获取的数据包含签名信息时,验证所述签名信息是否正确。Verification 25, when the second key is used as the input information of the acquired data, and when the acquired data includes signature information, verify whether the signature information is correct.
上述验证序号仅为说明方便,不代表验证顺序。对于上述验证21,如果所述值是链式结构上的数据,则验证为无错误;对于验证22,如果存在与所述输入信息具有相同连接信息的输出信息,则验证为无错误;对于验证23,所述与输入信息具有相同连接信息的输出信息未被使用过,则验证为无错误;对于验证24,交易数额正确,则验证为无错误;对于验证25,验证签名信息有效,则验证为无错误。The above verification sequence number is only for convenience of explanation, and does not represent the verification sequence. For the above verification 21, if the value is data on a chain structure, the verification is error-free; for the verification 22, if there is output information that has the same connection information as the input information, the verification is error-free; for verification 23. If the output information with the same connection information as the input information has not been used, the verification is error-free; for verification 24, if the transaction amount is correct, then the verification is error-free; for verification 25, verify that the signature information is valid, then verify Is error-free.
一种示例性的验证过程:使用默克尔树认证路径验证数据存储装置上存储的输入数据,或者输入数据和输出数据只要有一个数据不为链上的数据,则判断为数据错误;判断如果只有输出数据,则判断为连接错误;判断所述输入数据的关联连接如果被引用过,则判断为连接错误;判断所述输出数据的交易数额如果不正确,则判断为数据错误;判断所述数据中的签名信息(例如产生数据的用户端的解锁签名)如果不正确,则判断为数据错误。An exemplary verification process: use the Merkel tree authentication path to verify the input data stored on the data storage device, or as long as one of the input data and output data is not data on the chain, it is judged as a data error; judge if If there is only output data, it is judged as a connection error; if it is judged that the associated connection of the input data has been quoted, it is judged as a connection error; if it is judged that the transaction amount of the output data is incorrect, it is judged as a data error; If the signature information in the data (for example, the unlocking signature of the user terminal that generates the data) is incorrect, it is judged as a data error.
通过非存储装置验证可以提高系统的安全性,避免仅由固定存储装置验证带来的风险。Through non-storage device verification, the security of the system can be improved, and the risk caused by only fixed storage device verification can be avoided.
上述数据验证装置例如可以如图6所示,包括键值查找模块41和第二验证模块62,其中:The above-mentioned data verification device may, for example, as shown in FIG. 6, include a key value search module 41 and a second verification module 62, where
键值查找模块61,设置为查找所述链式结构中链的部分或全部连接信息作为第二键;The key value search module 61 is configured to search for part or all of the connection information of the chain in the chain structure as the second key;
第二验证模块62,设置为从数据存储装置获取所述数据存储装置存储的与所述第二键关联的数据(即键对应的值),根据所述获取的数据验证所述链式结构中的数据是否有错误。The second verification module 62 is configured to obtain the data associated with the second key (that is, the value corresponding to the key) stored by the data storage device from the data storage device, and verify the data in the chain structure according to the obtained data Are there any errors in the data?
所述第二验证模块62可以进行上述验证21-25中的任意一种或多种,此处不再赘述。The second verification module 62 can perform any one or more of the foregoing verifications 21-25, which will not be repeated here.
采用此种验证机制,通过增加数据验证装置,提高了系统的安全性。By adopting this verification mechanism, the security of the system is improved by adding a data verification device.
本文一示例性实施例还提供了一种链式结构实现方法,所述链式结构系统包括第一链系统、第二链系统和数据存储装置,如图7所示,所述方法包括步骤71-73。An exemplary embodiment of this document also provides a method for implementing a chain structure. The chain structure system includes a first chain system, a second chain system, and a data storage device. As shown in FIG. 7, the method includes step 71 -73.
步骤71,所述第一链系统对账本数据签名后,将签名后的账本数据写入第一链的区块数据;Step 71: After the first chain system signs the ledger data, it writes the signed ledger data into the block data of the first chain;
步骤72,所述第二链系统在验证第一链的区块数据后,将所述第一链的一个或多个连续的区块数据写入第二链的区块数据;Step 72: After verifying the block data of the first chain, the second chain system writes one or more continuous block data of the first chain into the block data of the second chain;
步骤73,所述数据存储装置将所述第二链中链的部分或全部连接信息作为第一键,所述第一键关联的数据作为值,验证所述第一键关联的数据无错误后,将所述数据存储为输入数据或输出数据,同一数据存储装置存储的输入数据和输出数据根据相同的连接信息相关联。Step 73: The data storage device uses part or all of the link information of the second chain as the first key, and the data associated with the first key as the value, and after verifying that the data associated with the first key has no errors , Storing the data as input data or output data, and the input data and output data stored in the same data storage device are associated according to the same connection information.
所述账本数据包括交易数据和/或控制数据。The ledger data includes transaction data and/or control data.
所述第一链为私有链或者联盟链,为由管理端控制的链,第二链与公有链类似,区别在于并非任意数据可以上链。当第一链产生新的区块数据后,会同步到第二链的链生成节点,区块数据验证通过后由第二链的链生成节点根据第二链的共识算法产生新的区块数据。第二链中顺序记录第一链提交的区块数据,第二链上每个区块数据包含的第一链的区块数据的数量可以不固定,也即第二链上每个区块可以包含1至n个第一链的区块数据,数量由第二链的共识算法决定。所以对外的第二链系统上的每个区块数据是由第一链系统的一个或多个区块数据顺序组合而成,因此第一链系统和第二链系统在逻辑状态上是相同的。本实施例使用先生成链后验证的方式,也即先生成第二链,再由第三层的数据存储装置进行验证的方式。实际的账本数据是由第一层即第一链系统上链的,第二层即第二链系统可验证默克尔树和管理端的签名,并不修改账本数据,由第三层的数据存储装置验证账本数据是否有错误。实现交易中心化,账本数据去中心化。第三层的数据存储装置采用连接存储的方式存储并验证数据,每个数据存储装置只需要存储和验证少量数据,即可实现整个链的等价验证,减少每个装置的负担。且第二层的链生成节点可以只验证第一链系统的管理端签名和默克尔树,降低了第二链系统的计算量。The first chain is a private chain or a consortium chain, and is a chain controlled by a management end. The second chain is similar to a public chain, except that not arbitrary data can be chained. When the first chain generates new block data, it will be synchronized to the chain generating node of the second chain. After the block data is verified, the chain generating node of the second chain will generate new block data according to the consensus algorithm of the second chain. . The second chain sequentially records the block data submitted by the first chain. Each block data on the second chain contains the number of block data of the first chain. That is, each block on the second chain can Contains 1 to n block data of the first chain, and the number is determined by the consensus algorithm of the second chain. Therefore, each block data on the external second chain system is composed of one or more block data of the first chain system. Therefore, the logical state of the first chain system and the second chain system are the same. . This embodiment uses the method of first generating the chain and then verifying, that is, the method of first generating the second chain, and then verifying by the third-tier data storage device. The actual ledger data is chained by the first layer, the first chain system, and the second layer, the second chain system, can verify the Merkel tree and the signature of the management end, and does not modify the ledger data, but is stored by the third layer data The device verifies whether there are errors in the ledger data. Realize transaction centralization and decentralization of ledger data. The data storage device on the third layer stores and verifies data in a connected storage manner. Each data storage device only needs to store and verify a small amount of data to achieve equivalent verification of the entire chain, reducing the burden on each device. In addition, the chain generation node of the second layer can only verify the signature of the management end of the first chain system and the Merkel tree, which reduces the calculation amount of the second chain system.
在一示例性实施例中,所述方法还包括:所述第一链系统将所述第一链中链的部分或全部连接信息作为第三键,所述第三键关联的数据作为值,将所述第三键关联的值分配到与所述值具有相同第三键的共识组;例如第一链 系统可在对交易数据签名之前进行上述分配。所述共识组对所述第三键关联的数据进行验证,其中:In an exemplary embodiment, the method further includes: the first chain system uses part or all of the connection information of the chain in the first chain as a third key, and data associated with the third key is used as a value, The value associated with the third key is assigned to a consensus group that has the same third key as the value; for example, the first chain system may perform the above assignment before signing the transaction data. The consensus group verifies the data associated with the third key, where:
所述第三键关联的数据包括交易数据,所述验证包括以下一种或多种:The data associated with the third key includes transaction data, and the verification includes one or more of the following:
所述第三键作为所述交易数据的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;When the third key is used as the input information of the transaction data, verify whether there is output information that has the same connection information as the input information;
所述第三键作为所述交易数据的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;When the third key is used as the input information of the transaction data, verify whether the output information that has the same connection information as the input information has been used;
所述第三键作为所述交易数据的输入信息时,验证所述交易数据的交易数额是否正确;When the third key is used as the input information of the transaction data, verify whether the transaction amount of the transaction data is correct;
所述第三键作为所述交易数据的输入信息时,验证所述交易数据的签名信息(用户端的解锁签名)是否正确。When the third key is used as the input information of the transaction data, it is verified whether the signature information of the transaction data (the unlocking signature of the user terminal) is correct.
上述验证的顺序不限。The order of the above verification is not limited.
一种示例性的验证过程:共识组查找与所述交易数据相连接的输入数据,即第三键作为所述交易数据的输入信息时,查找是否存在与所述输入信息具有相同连接信息的输出信息,如果未查找到,判断为连接错误,如果查找到,判断所述输入数据的关联连接是否被引用,即第三键作为所述交易数据的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过,如果已被引用过或被使用过,则判断为连接错误,如果未被引用过,判断所述交易数据的交易数额是否正确,如果不正确,判断为数据错误,如果正确,判断数据中包含的签名信息(例如产生交易数据的用户端的解锁签名)是否正确,如果不正确,判断为数据错误,如果正确,则将所述交易数据存储为输出数据(即共识组也可以采用上述连接存储方式存储数据),并将所述输入数据的关联连接标识为已被引用,也即相关联的输出信息将标记为已使用。An exemplary verification process: the consensus group searches for input data connected to the transaction data, that is, when the third key is used as the input information of the transaction data, it searches whether there is an output with the same connection information as the input information If the information is not found, it is judged as a connection error. If it is found, it is judged whether the associated connection of the input data is referenced, that is, when the third key is used as the input information of the transaction data, the verification is the same as the input information Whether the output information of the connection information has been used, if it has been quoted or used, it is judged as a connection error, if it has not been quoted, it is judged whether the transaction amount of the transaction data is correct, if not, it is judged as data Error, if it is correct, determine whether the signature information contained in the data (such as the unlocking signature of the user terminal that generates the transaction data) is correct, if it is incorrect, it is determined as the data error, if it is correct, the transaction data is stored as output data (ie The consensus group may also use the above-mentioned connection storage method to store data), and mark the associated connection of the input data as being referenced, that is, the associated output information will be marked as used.
在一示例性实施例中,所述共识组对所述第三键关联的数据进行验证后,进行连接存储时,根据所述数据在第一链中所表示的意义,将所述第三键关联的数据存储为输入数据或输出数据,其中,当所述第三键作为所述第一链中的输出信息的部分或全部时,将所述第三键关联的数据作为输入数据存储,当所述第三键作为所述第一链中的输入信息的部分或全部时,将所述第三键 关联的数据作为输出数据存储;同一共识组上存储的输入数据和输出数据根据相同的连接信息相关联。In an exemplary embodiment, after the consensus group verifies the data associated with the third key, when performing connection storage, according to the meaning of the data in the first chain, the third key The associated data is stored as input data or output data, where, when the third key is part or all of the output information in the first chain, the data associated with the third key is stored as input data, when When the third key is used as part or all of the input information in the first chain, the data associated with the third key is stored as output data; the input data and output data stored on the same consensus group are based on the same connection Information related.
例如,所述共识组如果判断所述交易数据或控制数据的输出信息与所述第三键匹配,则将所述交易数据或控制数据存储为输入数据;如果判断所述交易数据或控制数据的输入信息与所述第三键匹配,将所述交易数据或控制数据存储为输出数据。For example, if the consensus group determines that the output information of the transaction data or control data matches the third key, the transaction data or control data is stored as input data; if the transaction data or control data is determined to be The input information matches the third key, and the transaction data or control data is stored as output data.
第一链系统中包括多个共识组,同一个共识组中的节点对应的健是相同的,如果接收到的交易数据被验证,则连接存储所述交易数据与所述键,如果接收到的控制数据被验证,则连接存储所述键值与控制数据。如果所述数据为所述链式结构中的输出信息,则将所述数据作为输入数据存储;如果所述数据为所述链式结构中的输入信息,则将所述数据作为输出数据存储。同一共识组上存储的输入数据和输出数据具有相同的键,以形成数据连接存储。The first chain system includes multiple consensus groups. The nodes in the same consensus group have the same keys. If the received transaction data is verified, the transaction data and the key are connected and stored. When the control data is verified, the key value and the control data are connected and stored. If the data is output information in the chain structure, the data is stored as input data; if the data is input information in the chain structure, the data is stored as output data. The input data and output data stored on the same consensus group have the same key to form a data connection storage.
在一示例性实施例中,所述数据存储装置对数据的存储与前述实施例中的处理相同:当所述第一键作为所述第二链中的输出信息的部分或全部时,将所述第一键关联的数据作为输入数据存储;当所述第一键作为所述第二链中的输入信息部分或全部时,将所述第一键关联的数据作为输出数据存储;本数据存储装置上存储的输入数据和输出数据根据相同的连接信息相关联。In an exemplary embodiment, the storage of data by the data storage device is the same as the processing in the foregoing embodiment: when the first key is part or all of the output information in the second chain, the The data associated with the first key is stored as input data; when the first key is part or all of the input information in the second chain, the data associated with the first key is stored as output data; this data storage The input data and output data stored on the device are related according to the same connection information.
在一示例性实施例中,所述数据存储装置验证所述第一键关联的数据是否有错误包括以下验证中的一种或多种:In an exemplary embodiment, the verification by the data storage device whether the data associated with the first key has an error includes one or more of the following verifications:
验证31,验证所述第二链的完整性;Verification 31, verifying the integrity of the second chain;
验证32,验证所述数据是否为所述第二链上的数据;Verification 32, verifying whether the data is data on the second chain;
验证33,所述第一键作为所述第二链中账本数据的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;Verification 33, when the first key is used as the input information of the ledger data in the second chain, it is verified whether there is output information that has the same connection information as the input information;
验证34,所述第一键作为所述第二链中账本数据的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;Verification 34, when the first key is used as the input information of the ledger data in the second chain, verify whether the output information that has the same connection information as the input information has been used;
验证35,所述第一键作为所述第二链中账本数据的输入信息时,且所述第一键关联的数据包含交易数额时,验证所述交易数额是否正确。Verification 35: When the first key is used as the input information of the ledger data in the second chain, and the data associated with the first key includes the transaction amount, verify whether the transaction amount is correct.
验证36,所述第一键作为所述第二链中账本数据的输入信息时,且所述 第一键关联的数据包含签名信息时,验证所述签名信息是否正确。Verification 36: When the first key is used as the input information of the ledger data in the second chain, and the data associated with the first key includes signature information, verify whether the signature information is correct.
本实施例中的验证32-36与前述实施例中的验证11-15类似,区别在于本实施例中的验证对象为第二链。The verification 32-36 in this embodiment is similar to the verification 11-15 in the foregoing embodiment, except that the verification object in this embodiment is the second chain.
在一示例性实施例中,所述方法还包括:所述第一链系统按顺序为账本数据编排序号,所述账本数据对应的区块数据的区块头中包含累计账本数据量。所述第二链系统在第二链的区块数据的区块头中包含所述区块数据中的累计账本数据量。In an exemplary embodiment, the method further includes: the first chain system sequentially numbers the ledger data, and the block header of the block data corresponding to the ledger data contains the cumulative amount of the ledger data. The second chain system includes the accumulated book data amount in the block data in the block header of the block data of the second chain.
例如,在将账本数据写入第一链的区块数据时,按第一顺序为交易数据编排序号,按第二顺序为控制数据编排序号,在区块数据的区块头中写入最后一个交易数据的序号和/或最后一个控制数据的序号,使得所述区块头数据中包含累计交易数据量和累计控制数据量。例如,每一共识组接收到前一共识组发送的累计交易数据量后,在所述累计交易数据量的基础上对本共识组待上链的交易数据编排序号,重新计算新的累计交易数据量并发送给下一个共识组;共识组对所述待上链的交易数据编排序号后,所述共识组请求对编排序号后的交易数据进行签名,将被签名的交易数据写入第一链,所述交易数据所在区块的区块头中包含累计了所述交易数据的累计交易数据量。第一链的累计账本数据量包括第一累计交易数据量和/或第一累计控制数据量,第二链中的累计账本数据量包括第二累计交易数据量和/或第二累计控制数据量。所述第二链与第一链异步同态,由于第一链的区块头中包含累计交易数据量和累计控制数据量,因此所述第二链的区块头中也包含相应的累计交易数据量和累计控制数据量。通过在区块头数据中携带累计账本数据量以使数据存储装置能够根据累计账本数据量对第二链进行完整性验证。For example, when writing the ledger data into the block data of the first chain, the transaction data is numbered in the first order, the control data is numbered in the second order, and the last transaction is written in the block header of the block data The serial number of the data and/or the serial number of the last control data makes the block header data include the cumulative transaction data volume and the cumulative control data volume. For example, after each consensus group receives the cumulative transaction data volume sent by the previous consensus group, on the basis of the cumulative transaction data volume, it ranks the transaction data of this consensus group to be chained, and recalculates the new cumulative transaction data volume And send it to the next consensus group; after the consensus group numbers the transaction data to be chained, the consensus group requests to sign the numbered transaction data, and writes the signed transaction data into the first chain, The block header of the block in which the transaction data is located contains the accumulated transaction data amount accumulating the transaction data. The cumulative account data volume of the first chain includes the first cumulative transaction data volume and/or the first cumulative control data volume, and the cumulative account data volume in the second chain includes the second cumulative transaction data volume and/or the second cumulative control data volume . The second chain is asynchronous and homomorphic with the first chain. Since the block header of the first chain contains the accumulated transaction data amount and the accumulated control data amount, the block header of the second chain also contains the corresponding accumulated transaction data amount. And the amount of accumulated control data. By carrying the accumulated book data amount in the block header data, the data storage device can verify the integrity of the second chain according to the accumulated book data amount.
所述数据存储装置可采用以下方式验证所述链式结构的完整性:所述数据存储装置同步所述第二链的区块头,根据所述区块头中的累计账本数据量(累计交易数据量和累计控制数据量)对所述第二链的完整性进行验证。验证完整性时,通过编号地址为键来进行验证。例如,装置根据当前区块头数据中的累计交易数据量和前一区块头数据中的累计交易数据量计算得到当前区块的所有交易数据编号地址,根据当前区块头数据中的累计控制数据量和前一区块头数据中的累计交易数据量计算得到当前区块的所有控制数据编号 地址,判断每个交易数据编号地址如果与本节点分布式哈希表的网络标识匹配,则查找与所述交易数据编号地址对应的交易数据,判断每个控制数据编号地址如果与本节点分布式哈希表的网络标识匹配,则查找与所述控制数据编号地址对应的控制数据,如果找到,则完整性验证通过,如果未找到,完整性验证失败。The data storage device can verify the integrity of the chain structure in the following manner: the data storage device synchronizes the block header of the second chain, and according to the cumulative ledger data volume (accumulated transaction data volume) in the block header And cumulative control data volume) to verify the integrity of the second chain. When verifying the integrity, the numbered address is used as the key to verify. For example, the device calculates all the transaction data number addresses of the current block according to the cumulative transaction data volume in the current block header data and the cumulative transaction data volume in the previous block header data, and according to the cumulative control data volume in the current block header data and the cumulative transaction data volume in the previous block header data. The cumulative transaction data volume in the previous block header data is calculated to obtain all the control data number addresses of the current block, and it is judged that if each transaction data number address matches the network identifier of the node's distributed hash table, then search for the transaction The transaction data corresponding to the data number address is judged if each control data number address matches the network identifier of the distributed hash table of the node, then the control data corresponding to the control data number address is searched, and if found, the integrity verification is performed Pass, if not found, integrity verification fails.
完整性验证是由存储编号地址的数据存储装置进行的验证,可在存储时验证。因为分布式哈希表的特点就是要把数据存储在对应键的节点上,以提供键的检索,所以本身就需要存储键(key)与值(value)。这里因为编号地址是序号,是已知的,所以键已知,也就知道键应该存储在哪些节点上。所以节点只需要同步区块头数据,就知道哪些编号地址的键应该由自己存储,如果节点判断自己需要存储该键的数据,但是没有存储该数据,则在第三层(用户端)或第二层(类公有链)检索该数据,然后进行完整性验证,这样通过节点自己验证,也就能够验证数据的完整性。因为通过区块头的累计数量,节点就能够知道有哪些编号地址。Integrity verification is verification performed by the data storage device storing the numbered address, and can be verified during storage. Because the characteristic of the distributed hash table is to store data on the node corresponding to the key to provide key retrieval, it itself needs to store the key and value. Here, because the numbered address is a sequence number and is known, the key is known, and it is also known on which nodes the key should be stored. Therefore, the node only needs to synchronize the block header data to know which keys of the numbered address should be stored by itself. If the node judges that it needs to store the data of the key, but does not store the data, it will be in the third layer (user side) or second layer. The layer (like public chain) retrieves the data, and then performs integrity verification, so that the integrity of the data can be verified through the node's own verification. Because through the cumulative number of block headers, the node can know which numbered addresses are available.
除了完整性验证外,还可以进行随机验证。随机验证可以是任意节点,不只是存储编号地址的节点,可以随机挑选某些编号地址进行验证,并不需要存储。随机验证时根据随机编号地址获取该编号地址对应的交易数据,将交易数据的输入地址作为键进行验证。本质上与完整性验证类似。In addition to integrity verification, random verification can also be performed. Random verification can be any node, not just a node that stores numbered addresses, some numbered addresses can be randomly selected for verification, and no storage is required. During random verification, the transaction data corresponding to the number address is obtained according to the random number address, and the input address of the transaction data is used as the key for verification. In essence, it is similar to integrity verification.
在一示例性实施例中,所述数据存储装置根据第一链区块头数据验证第二链区块头数据,包括验证累计账本数据量是否正确。数据存储装置可验证第一链区块头的累计交易数量和累计控制数量与第二链区块头的累计交易数量和累计控制数量是否相等,如果相等则说明数量正确并且第一链区块头是第二链区块头产生时间片段内的最后一个区块头数据。In an exemplary embodiment, the data storage device verifies the second chain block header data according to the first chain block header data, including verifying whether the accumulated ledger data amount is correct. The data storage device can verify whether the cumulative transaction number and cumulative control number of the first chain block head are equal to the cumulative transaction number and cumulative control number of the second chain block head. If they are equal, the number is correct and the first chain block head is the second The chain block header generates the last block header data in the time segment.
在一示例性实施例中,通过在第二链区块头数据中携带默克尔树根哈希值以使数据存储装置验证数据是否为链上数据。所述第二链系统将所述第一链的一个或多个连续的区块数据写入第二链的区块数据,包括:所述第二链系统将所述第一链的一个或多个连续的区块数据按照交易数据序号顺序和控制数据序号顺序重新组合分别生成默克尔树根哈希值,并在生成的第二链的区块头中包含所述默克尔树根哈希值。In an exemplary embodiment, the data storage device verifies whether the data is on-chain data by carrying the Merkel tree root hash value in the second chain block header data. The second chain system writes one or more continuous block data of the first chain into the block data of the second chain, including: the second chain system writes one or more of the first chain Two consecutive blocks of data are recombined to generate the Merkel tree root hash value according to the transaction data sequence number sequence and the control data sequence number sequence, and the Merkel tree root hash value is included in the block header of the generated second chain value.
所述数据存储装置验证所述数据是否为所述第二链上的数据,包括:所述数据存储装置同步所述第二链的区块头,根据所述区块头中的默克尔树根哈希值以及所述数据对应的认证路径验证所述数据是否为第二链上的数据。The verification by the data storage device whether the data is data on the second chain includes: the data storage device synchronizes the block header of the second chain, according to the Merkel tree root in the block header. The desired value and the authentication path corresponding to the data verify whether the data is data on the second chain.
在一示例性实施例中,除了数据存储装置可实现数据验证外,为提高安全性,增加数据验证装置进行数据验证,即前述实施例中的数据验证装置。所述链式结构系统还包括:数据验证装置,所述方法还包括:所述数据验证装置将所述链式结构中链的部分或全部连接信息作为第二键,从所述数据存储装置获取所述数据存储装置上存储的与所述第二键关联的数据,根据所述获取的数据验证所述第二链中的数据是否有错误。例如,所述数据验证装置可同步所述第二链的区块头,用所述区块头中的累计账本数据量生成编号地址(用累计控制数据量生成控制数据编号地址,用累计交易数据量生成交易数据编号地址),根据所述编号地址获取链的部分或全部连接信息作为第二键,从所述数据存储装置获取所述数据存储装置上存储的与所述第二键关联的数据。控制数据编号地址作为键获取的是该控制数据编号地址对应的控制数据,还可以包括该控制数据的默克尔树认证路径;交易数据编号地址作为键获取的是该交易数据编号地址对应的交易数据,还可以包括该交易数据的默克尔树认证路径。例如,可将控制数据的代币token发行数据的预设地址(简称token发行地址)、token回收数据的预设地址(简称token回收地址)或共识奖励数据的预设地址(简称奖励地址)作为键,用该键从数据存储装置获取其上存储的与键关联的数据;可将交易数据的交易地址作为键,用该键从数据存储装置获取其上存储的与键关联的数据。In an exemplary embodiment, in addition to the data storage device that can implement data verification, in order to improve security, a data verification device is added to perform data verification, that is, the data verification device in the foregoing embodiment. The chain structure system further includes: a data verification device, and the method further includes: the data verification device uses part or all of the connection information of the chain in the chain structure as a second key to obtain from the data storage device The data associated with the second key stored on the data storage device verifies whether the data in the second chain has errors according to the acquired data. For example, the data verification device can synchronize the block header of the second chain, and use the cumulative ledger data volume in the block header to generate the number address (use the cumulative control data volume to generate the control data number address, and the cumulative transaction data volume to generate Transaction data number address), according to the number address to obtain part or all of the connection information of the chain as the second key, and obtain the data associated with the second key stored on the data storage device from the data storage device. The control data number address is used as the key to obtain the control data corresponding to the control data number address, and it can also include the Merkel tree authentication path of the control data; the transaction data number address is used as the key to obtain the transaction corresponding to the transaction data number address. The data may also include the Merkel tree authentication path of the transaction data. For example, the preset address of the token issuance data of the control data (referred to as the token issuance address), the preset address of the token recovery data (referred to as the token recycling address) or the preset address of consensus reward data (referred to as the reward address) can be used as The key is used to obtain the data associated with the key stored thereon from the data storage device; the transaction address of the transaction data can be used as the key, and the key is used to obtain the data associated with the key stored on the data storage device.
例如,数据验证装置从所述数据存储装置获取所述数据存储装置上存储的与所述第二键关联的数据,包括以下数据中的一种或多种:与所述第二键关联的数据、默克尔树认证路径、附加验证数据,其中,所述第二键作为所述链式结构中输出信息的部分或全部,或者所述第二键作为所述链式结构中输入信息的部分或全部;所述数据验证装置同步所述第二链中的区块头,结合所述区块头与从所述数据存储装置获取的与所述第二键关联的数据,进行以下验证中的一种或多种:For example, the data verification device obtains data associated with the second key stored on the data storage device from the data storage device, including one or more of the following data: data associated with the second key , Merkel tree certification path, additional verification data, wherein the second key is used as part or all of the output information in the chain structure, or the second key is used as part of the input information in the chain structure Or all; the data verification device synchronizes the block header in the second chain, and combines the block header and the data associated with the second key obtained from the data storage device to perform one of the following verifications Or more:
验证所述从数据存储装置获取的与所述第二键关联的数据是否为所述第 二链上的数据;Verifying whether the data associated with the second key obtained from the data storage device is data on the second chain;
所述第二键作为所述获取的数据的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;When the second key is used as the input information of the acquired data, verify whether there is output information that has the same connection information as the input information;
所述第二键作为所述获取的数据的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;When the second key is used as the input information of the acquired data, verify whether the output information having the same connection information as the input information has been used;
所述第二键作为所述获取的数据的输入信息时,且所述获取的数据包含交易数额时,验证所述交易数额是否正确;When the second key is used as the input information of the acquired data, and when the acquired data includes a transaction amount, verify whether the transaction amount is correct;
所述第二键作为所述获取的数据的输入信息时,且所述获取的数据包含签名信息时,验证所述签名信息是否正确。When the second key is used as the input information of the acquired data, and when the acquired data includes signature information, verify whether the signature information is correct.
此处验证部分的说明参见前述实施例中描述,此处不再赘述。For the description of the verification part here, refer to the description in the foregoing embodiment, which will not be repeated here.
在一示例性实施例中,所述第一链为私有链或联盟链,所述方法还包括:第一链系统向用户颁发以下密钥的一个或多个:管理地址主密钥、交易地址主密钥、机密交易主密钥和对称加密主密钥,其中:In an exemplary embodiment, the first chain is a private chain or a consortium chain, and the method further includes: the first chain system issues one or more of the following keys to the user: management address master key, transaction address Master key, secret transaction master key, and symmetric encryption master key, where:
所述管理地址主密钥用于与当前第一生成参数生成所述用户的下一个管理地址,所述用户的所有管理地址形成一逻辑链;The management address master key is used to generate the next management address of the user with the current first generation parameter, and all the management addresses of the user form a logical chain;
所述交易地址主密钥用于与当前第二生成参数生成所述用户的下一个接收交易地址,所述用户的所有接收交易地址形成一逻辑链;The transaction address master key is used to generate the next receiving transaction address of the user with the current second generation parameter, and all receiving transaction addresses of the user form a logical chain;
所述机密交易主密钥用于与当前第三生成参数生成当前加解密密文交易数额的工作密钥;The secret transaction master key is used to generate the working key of the current encryption and decryption ciphertext transaction amount with the current third generation parameter;
所述对称加密主密钥用于与当前第四生成参数生成所述用户的下一个加解密管理数据的对称加密工作密钥,该对称加密主密钥还可以用于生成其它数据的对称加密工作密钥。The symmetric encryption master key is used to generate the symmetric encryption work key of the user's next encryption and decryption management data with the current fourth generation parameter. The symmetric encryption master key can also be used to generate symmetric encryption work for other data. Key.
例如,所述第一链系统使用为用户颁发的管理地址主密钥与所述用户的上一个管理数据中的生成参数生成所述用户的当前的管理地址,并在所述当前的管理数据中写入用于生成所述用户的下一个管理地址的生成参数。所述第一链系统可以使用为用户颁发的对称加密主密钥与所述用户的上一个管理数据中的生成参数生成对称加密工作密钥加密所述用户的当前的管理数据。所述用户可以使用相同的密钥生成方式生成对称加密工作密钥解密所述用户 的当前的管理数据。For example, the first chain system uses the management address master key issued for the user and the generation parameters in the user's previous management data to generate the user's current management address, and in the current management data Write the generation parameters used to generate the next management address of the user. The first chain system may use the symmetric encryption master key issued for the user and the generation parameters in the user's previous management data to generate a symmetric encryption work key to encrypt the user's current management data. The user can use the same key generation method to generate a symmetric encryption working key to decrypt the user's current management data.
在一示例性实施例中,所述方法还包括:所述第一链系统在第一链的区块头中包含当前共识公钥集合映射的值;所述数据存储装置根据第一链区块头中的共识公钥集合的映射值采用默克尔树证明或累加器证明,验证第二链区块头中的共识公钥是否有效。除数据存储装置可进行上述验证外,所述数据验证装置也可以根据第一链区块头中的共识公钥集合的映射值采用默克尔树证明或累加器证明,验证第二链区块头中的共识公钥是否有效。In an exemplary embodiment, the method further includes: the first chain system includes the value of the current consensus public key set mapping in the block header of the first chain; the data storage device according to the first chain block header The mapping value of the consensus public key set adopts Merkel tree proof or accumulator proof to verify whether the consensus public key in the second chain block header is valid. In addition to the data storage device that can perform the above verification, the data verification device can also use Merkel tree certification or accumulator certification according to the mapping value of the consensus public key set in the first chain block header to verify that the second chain block header Is the consensus public key valid?
本文一示例性实施例还提供了一种链式结构系统,如图8所示,包括:第一链系统81、第二链系统82和数据存储装置83,其中:An exemplary embodiment herein also provides a chain structure system, as shown in FIG. 8, including: a first chain system 81, a second chain system 82, and a data storage device 83, wherein:
所述第一链系统81,设置为对账本数据签名后,将签名后的账本数据写入第一链的区块数据;The first chain system 81 is configured to, after signing the ledger data, write the signed ledger data into the block data of the first chain;
所述第二链系统82,设置为在验证第一链的区块数据后,将所述第一链的一个或多个连续的区块数据写入第二链的区块数据;The second chain system 82 is configured to write one or more continuous block data of the first chain into the block data of the second chain after verifying the block data of the first chain;
所述数据存储装置83,设置为将所述第二链中链的部分或全部连接信息作为第一键,所述第一键关联的数据作为值,验证所述第一键关联的数据是否有错误,验证所述第一键关联的数据无错误后,将所述数据存储为输入数据或输出数据,同一数据存储装置存储的输入数据和输出数据根据相同的连接信息相关联。The data storage device 83 is configured to use part or all of the link information of the second chain as the first key, and the data associated with the first key as the value to verify whether the data associated with the first key has Error: After verifying that the data associated with the first key has no error, the data is stored as input data or output data, and the input data and output data stored in the same data storage device are associated according to the same connection information.
在一示例性实施例中,所述第一链系统还包括共识组;In an exemplary embodiment, the first chain system further includes a consensus group;
所述第一链系统还设置为将所述第一链中链的部分或全部连接信息作为第三键,所述第三键关联的数据作为值,将所述第三键关联的值分配到与所述值具有相同第三键的共识组,所述第三键关联的数据包括交易数据;The first chain system is further configured to use part or all of the connection information of the chain in the first chain as a third key, data associated with the third key as a value, and assign the value associated with the third key to A consensus group with the same third key as the value, and the data associated with the third key includes transaction data;
所述共识组设置为对所述第三键关联的数据进行验证,包括以下一种或多种验证:The consensus group is set to verify the data associated with the third key, including one or more of the following verifications:
所述第三键作为所述交易数据的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;When the third key is used as the input information of the transaction data, verify whether there is output information that has the same connection information as the input information;
所述第三键作为所述交易数据的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;When the third key is used as the input information of the transaction data, verify whether the output information that has the same connection information as the input information has been used;
所述第三键作为所述交易数据的输入信息时,验证所述交易数据的交易数额是否正确;When the third key is used as the input information of the transaction data, verify whether the transaction amount of the transaction data is correct;
所述第三键作为所述交易数据的输入信息时,验证所述交易数据的签名信息是否正确。When the third key is used as the input information of the transaction data, it is verified whether the signature information of the transaction data is correct.
在一示例性实施例中,所述共识组还设置为对所述第三键关联的数据进行验证后,将所述第三键关联的数据存储为输入数据或输出数据,其中,当所述第三键作为所述第一链中的输出信息的部分或全部时,将所述第三键关联的数据作为输入数据存储,当所述第三键作为所述第一链中的输入信息的部分或全部时,将所述第三键关联的数据作为输出数据存储;同一共识组上存储的输入数据和输出数据根据相同的连接信息相关联。In an exemplary embodiment, the consensus group is further configured to store the data associated with the third key as input data or output data after verifying the data associated with the third key. When the third key is used as part or all of the output information in the first chain, the data associated with the third key is stored as input data, and when the third key is used as the input information in the first chain In the case of part or all, the data associated with the third key is stored as output data; the input data and output data stored on the same consensus group are associated according to the same connection information.
在一示例性实施例中,所述第一链系统还设置为按顺序为账本数据编排序号,所述账本数据对应的区块数据的区块头中包含累计账本数据量;所述第二链系统还设置为在第二链的区块数据的区块头中包含所述区块数据中的累计账本数据量。In an exemplary embodiment, the first chain system is further configured to sequentially number the ledger data, and the block header of the block data corresponding to the ledger data contains the cumulative amount of ledger data; the second chain system It is also set to include the cumulative ledger data amount in the block data in the block header of the block data of the second chain.
在一示例性实施例中,所述数据存储装置83例如可以是如图2所示的数据存储装置,所述数据存储装置将所述数据存储为输入数据或输出数据,包括:所述第一键作为所述第二链中的输出信息的部分或全部时,将所述第一键关联的数据作为输入数据存储;所述第一键作为所述第二链中的输入信息的部分或全部时,将所述第一键关联的数据作为输出数据存储;本数据存储装置上存储的输入数据和输出数据根据相同的连接信息相关联。In an exemplary embodiment, the data storage device 83 may be, for example, a data storage device as shown in FIG. 2. The data storage device stores the data as input data or output data, including: the first When a key is used as part or all of the output information in the second chain, the data associated with the first key is stored as input data; the first key is used as part or all of the input information in the second chain At this time, the data associated with the first key is stored as output data; the input data and output data stored on the data storage device are associated according to the same connection information.
在一示例性实施例中,所述数据存储装置验证所述第一键关联的数据是否有错误,包括以下验证中的一种或多种:In an exemplary embodiment, the data storage device verifies whether the data associated with the first key has errors, including one or more of the following verifications:
验证所述第二链的完整性;Verify the integrity of the second chain;
验证所述数据是否为所述第二链上的数据;Verifying whether the data is data on the second chain;
所述第一键作为所述第二链中账本数据的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;When the first key is used as the input information of the ledger data in the second chain, verify whether there is output information that has the same connection information as the input information;
所述第一键作为所述第二链中账本数据的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;When the first key is used as the input information of the ledger data in the second chain, verify whether the output information that has the same connection information as the input information has been used;
所述第一键作为所述第二链中账本数据的输入信息时,且所述第一键关联的数据包含交易数额时,验证所述交易数额是否正确;When the first key is used as the input information of the ledger data in the second chain, and the data associated with the first key includes the transaction amount, verifying whether the transaction amount is correct;
所述第一键作为所述第二链中账本数据的输入信息时,且所述第一键关联的数据包含签名信息时,验证所述签名信息是否正确。When the first key is used as the input information of the ledger data in the second chain, and the data associated with the first key includes signature information, it is verified whether the signature information is correct.
在一示例性实施例中,所述数据存储装置采用以下方式验证所述链式结构的完整性:所述数据存储装置同步所述第二链的区块头,用所述区块头中的累计账本数据量生成编号地址,根据所述编号地址对所述第二链的完整性进行验证。In an exemplary embodiment, the data storage device verifies the integrity of the chain structure in the following manner: the data storage device synchronizes the block header of the second chain, and uses the cumulative ledger in the block header A numbered address is generated from the amount of data, and the integrity of the second chain is verified according to the numbered address.
在一示例性实施例中,所述数据存储装置还设置为根据第一链区块头数据验证第二链区块头数据中的累计账本数据量是否正确。In an exemplary embodiment, the data storage device is further configured to verify whether the amount of accumulated ledger data in the second chain block header data is correct according to the first chain block header data.
在一示例性实施例中,所述第一链为私有链或联盟链,所述第一链系统还设置为向用户颁发以下密钥的一个或多个:管理地址主密钥、交易地址主密钥、机密交易主密钥和对称加密主密钥。In an exemplary embodiment, the first chain is a private chain or a consortium chain, and the first chain system is further configured to issue one or more of the following keys to the user: management address master key, transaction address master key Key, secret transaction master key, and symmetric encryption master key.
在一示例性实施例中,所述系统还可包括数据验证装置,所述数据验证装置例如可以是如图6所示的数据验证装置。所述数据验证装置设置为将所述链式结构中链的部分或全部连接信息作为第二键,从所述数据存储装置获取所述数据存储装置上存储的与所述第二键关联的数据,根据所述获取的数据验证所述第二链中的数据是否有错误。In an exemplary embodiment, the system may further include a data verification device, and the data verification device may be, for example, a data verification device as shown in FIG. 6. The data verification device is configured to use part or all of the connection information of the chain in the chain structure as a second key, and obtain data stored on the data storage device and associated with the second key from the data storage device , Verifying whether there is an error in the data in the second chain according to the acquired data.
在一示例性实施例中,所述第一链系统还设置为在第一链的区块头中包含当前共识公钥集合映射的值,以使所述数据存储装置或数据验证装置根据第一链区块头中的共识公钥集合的映射值采用默克尔树证明或累加器证明,验证第二链区块头中的共识公钥是否有效。In an exemplary embodiment, the first chain system is further configured to include the value of the current consensus public key set mapping in the block header of the first chain, so that the data storage device or the data verification device is based on the first chain The mapping value of the consensus public key set in the block header adopts Merkel tree proof or accumulator proof to verify whether the consensus public key in the second chain block header is valid.
在一示例性实施例中,所述第一链系统还设置为使用为用户颁发的管理地址主密钥与所述用户的上一个管理数据中的生成参数生成所述用户的当前管理地址,并在所述当前管理数据中写入用于生成所述用户的下一个管理地址的生成参数。In an exemplary embodiment, the first chain system is further configured to use the management address master key issued for the user and the generation parameters in the user's previous management data to generate the user's current management address, and Write the generation parameter used to generate the next management address of the user in the current management data.
所述链式结构系统中第一链系统、第二链系统、数据存储装置、数据验证装置的功能和效果参见方法中描述,此处不再赘述。For the functions and effects of the first chain system, the second chain system, the data storage device, and the data verification device in the chain structure system, please refer to the description in the method, which will not be repeated here.
下面对本文中提到的键(key,或称为键值、关键值)进行说明:The following describes the keys (key, or key value, key value) mentioned in this article:
第一键值为数据存储装置进行连接存储时使用的键值,所述第二键值为数据验证装置从数据存储装置上检索数据时使用的键值,所述第三键值为第一链系统中进行共识组查询,以及共识组进行连接存储时使用的键值。第一键值、第二键值和第三键值可以依据对应的链式结构的不同而有所差别,但均使用链式结构中的连接信息的部分或者全部。例如可以是以下类型中的一种或多种:交易数据的交易地址,控制数据的代币token发行数据的预设地址(简称token发行地址)、token回收数据的预设地址(简称token回收地址)和共识奖励数据的预设地址(简称奖励地址)。键值关联的数据为对应的交易数据或控制数据,还可以包括数据对应的默克尔树认证路径(简称认证路径)。键值可以存储于管理端或客户端。以上述实施例中的链式结构系统为例,该链式结构系统包括第一链系统、第二链系统和多个用户端(或称客户端)节点,用户端节点可以包括作为数据存储装置的用户端节点,还可以包括作为数据验证装置的用户端节点。对于用户端节点,键值关联的数据除交易数据或控制数据外,还包含对应的默克尔树认证路径,该认证路径为该交易数据或控制数据在第二链中的默克尔树认证路径。The first key value is the key value used by the data storage device for connection storage, the second key value is the key value used by the data verification device when retrieving data from the data storage device, and the third key value is the first link The consensus group query in the system, and the key value used when the consensus group is connected and stored. The first key value, the second key value, and the third key value may be different according to the corresponding chain structure, but all use part or all of the connection information in the chain structure. For example, it can be one or more of the following types: transaction address of transaction data, preset address of token issuance data of control data (referred to as token issuance address), preset address of token recovery data (referred to as token recycling address) ) And the preset address of the consensus reward data (referred to as the reward address). The data associated with the key value is the corresponding transaction data or control data, and may also include the Merkel tree authentication path (referred to as the authentication path) corresponding to the data. The key value can be stored in the management terminal or the client. Taking the chain structure system in the above embodiment as an example, the chain structure system includes a first chain system, a second chain system, and multiple client (or client) nodes. The client node may include a data storage device. The user-end node of may also include a user-end node as a data verification device. For the user-side node, in addition to transaction data or control data, the data associated with the key value also includes the corresponding Merkel tree authentication path, which is the Merkel tree authentication of the transaction data or control data in the second chain path.
本公开还提供一类键值(第四键值),可用于数据存储装置验证账本数据的完整性,还可以用于数据验证装置进行键值的查询。第四键值包括以下信息的一种或多种:交易数据的编号地址(根据交易数据编号生成)和控制数据的编号地址(根据控制数据编号生成)。可以存储于客户端。第四键值关联的数据为对应的交易数据或控制数据,还可以包括对应的默克尔树认证路径。在上述链式结构系统的示例中,第四键值关联的认证路径为该交易数据或控制数据在第二链中的默克尔树认证路径。The present disclosure also provides a type of key value (fourth key value), which can be used for the data storage device to verify the integrity of the ledger data, and can also be used for the data verification device to query the key value. The fourth key value includes one or more of the following information: the number address of the transaction data (generated according to the transaction data number) and the number address of the control data (generated according to the control data number). Can be stored on the client. The data associated with the fourth key value is corresponding transaction data or control data, and may also include a corresponding Merkel tree authentication path. In the above example of the chain structure system, the authentication path associated with the fourth key value is the Merkel tree authentication path of the transaction data or control data in the second chain.
此外,本公开还提供一类键值(第五键值),可用于进行账户数据链的查询或检索,用户的账户数据链包括由所述用户的管理数据组成的第一账户数据链和由所述用户的接收交易数据组成的第二账户数据链。用于存储管理数据的管理地址为隐性链式结构,由此构成第一账户数据链。用于存储接收交易数据的交易地址也为隐性链式结构,由此构成第二账户数据链。第五键 值包括用于查询管理数据的管理地址或用于查询交易数据的交易地址。In addition, the present disclosure also provides a type of key value (the fifth key value), which can be used to query or retrieve the account data chain. The user’s account data chain includes the first account data chain composed of the user’s management data and the The second account data link formed by the user's received transaction data. The management address used to store the management data has an implicit chain structure, thereby forming the first account data link. The transaction address used to store and receive transaction data also has an implicit chain structure, thereby forming a second account data chain. The fifth key value includes a management address for querying management data or a transaction address for querying transaction data.
本文中作为键值的地址可以是地址或者是地址的哈希值。The address used as the key in this article can be an address or a hash value of the address.
下面介绍默克尔树和区块链结构。默克尔树是一种哈希二叉树,是一种用作快速归纳和校验大规模数据完整性的数据结构。默克尔树的叶子节点保存着数据集合的单元数据的哈希值,而节点之间通过哈希运算得到父节点的哈希值,通过一层层往上层计算,最终会形成根节点的哈希值。其中叶子节点可以根据根哈希值,以及对应的认证路径,验证该叶子节点是否属于数据集合中的元素。The following describes the Merkel tree and blockchain structure. Merkel tree is a hash binary tree, a data structure used to quickly summarize and verify the integrity of large-scale data. The leaf nodes of the Merkel tree store the hash value of the unit data of the data set, and the hash value of the parent node is obtained through the hash operation between the nodes, and the hash value of the parent node is calculated through layer by layer to form the root node's hash value. Hope value. The leaf node can verify whether the leaf node belongs to the element in the data set according to the root hash value and the corresponding authentication path.
可以看出,如果默克尔树的叶子节点数量(也即数据集合元素的数量)已知,叶子节点所在的序号(即位置)也已知,则该叶子节点所对应的认证路径的高度和方向是固定且已知的,其中方向是指路径的左右方向。所以也即表示该元素是有序的,不能用不同的认证路径以及高度和方向来替代,也就能加强数据的安全性。It can be seen that if the number of leaf nodes (that is, the number of data set elements) of the Merkel tree is known, and the sequence number (that is, position) of the leaf node is also known, then the height of the authentication path corresponding to the leaf node and The direction is fixed and known, where the direction refers to the left and right direction of the path. Therefore, it means that the element is orderly and cannot be replaced by different authentication paths, heights and directions, and data security can also be strengthened.
默克尔树的叶子节点数量最多是树深度的2^n,即使包含大量的数据,也能通过固定的路径快速验证某个叶子节点。比如树深度为30,则最大能包含1073741824个叶子节点。如果平均10分钟产生一个数据块,则每秒可包含1789569笔交易。但验证某个叶子节点的数据,只需要30个hash值即可完成验证,如果每个hash值为32字节,则需要960字节。如果每个客户端每个区块需要保存10笔数据,每个客户端一年大约需要保存525600笔数据,每个区块都按树深度为30计算,则需要保存的认证路径大小为481MB,如果每笔数据大小为1KB,则需要保存的总数据量大小为994MB。但实际并不需要保存这么多数据,并且一定年限后客户端就可以清除之前的数据,使需要保存的数据量一直保持在可控的范围,即使移动设备也可以接受。The number of leaf nodes of the Merkel tree is at most 2^n of the tree depth. Even if it contains a large amount of data, a certain leaf node can be quickly verified through a fixed path. For example, if the tree depth is 30, it can contain up to 1073741824 leaf nodes. If a data block is generated in an average of 10 minutes, it can contain 1,789,569 transactions per second. But to verify the data of a leaf node, only 30 hash values are needed to complete the verification. If each hash value is 32 bytes, 960 bytes are required. If each client needs to save 10 pieces of data per block, and each client needs to save approximately 525,600 pieces of data a year, and each block is calculated based on the tree depth of 30, the size of the authentication path that needs to be saved is 481MB. If the size of each piece of data is 1KB, the total data size that needs to be saved is 994MB. But in fact, there is no need to save so much data, and the client can clear the previous data after a certain number of years, so that the amount of data that needs to be saved has been kept in a controllable range, even if it is acceptable for mobile devices.
区块链是由连续分片的时间片段内产生的区块头数据和区块体数据组成。其中后一个区块头包含了前一个区块头的哈希值,从而形成反向连接的链式结构。并且区块头还包含了对应区块体数据的默克尔树根哈希值,从而能唯一映射该区块体数据。而区块体数据则包含实际的账本数据。并且因为区块头唯一映射了区块体数据,也即区块头的一致性可以映射区块体数据的一致 性。所以只需要同步区块头数据,就可以根据账本数据和对应的认证路径,验证该账本数据是否在链的区块中,并且经过多少个确认,也即SPV简单支付验证。The blockchain is composed of block header data and block body data generated in time segments of consecutive shards. The latter block header contains the hash value of the previous block header, thus forming a chain structure of reverse connection. And the block header also contains the root hash value of the Merkel tree corresponding to the block body data, so that the block body data can be uniquely mapped. The block body data contains the actual ledger data. And because the block header uniquely maps the block body data, that is, the consistency of the block header can map the consistency of the block body data. So only need to synchronize the block header data, you can verify whether the ledger data is in the block of the chain and how many confirmations have passed according to the ledger data and the corresponding authentication path, that is, SPV simple payment verification.
下面介绍底层数据结构。账本数据分为交易数据集和控制数据集两部分,交易数据集包括实际的交易数据;控制数据集则包括但不限于以下数据的一种或多种类型:用户的管理数据、token的发行数据、token的回收数据、奖励数据和系统发布的公告数据。交易数据主要由客户端产生,包含客户端的解锁签名,并由管理端验证上链,并且上链时,被管理端赋予顺序编排(例如递增)的唯一序号,该序号连同交易数据一起经过管理端的背书签名。控制数据由链式结构系统(例如第一链系统)的管理端产生,产生时赋予顺序编排(例如递增)的唯一序号并经过管理端签名。交易数据集和控制数据集分别生成默克尔树的根哈希值记录在区块头中。区块头中也会包含对应区块体数据中的最后一个交易数据编号和最后一个控制数据编号,并且该编号是顺序递增的,也等同于区块头中包含当前所有的累计交易数据量和累计控制数据量。The following describes the underlying data structure. Ledger data is divided into two parts: transaction data set and control data set. Transaction data set includes actual transaction data; control data set includes but is not limited to one or more types of the following data: user management data, token issuance data , Token recovery data, reward data and announcement data issued by the system. The transaction data is mainly generated by the client, including the unlocking signature of the client, and verified by the management terminal. When it is uploaded, the management terminal assigns a unique serial number that is arranged in sequence (for example, ascending). The serial number is passed through the management terminal together with the transaction data. Endorsement and signature. The control data is generated by the management end of the chain structure system (for example, the first chain system), and is assigned a unique serial number arranged in sequence (for example, ascending) when generated, and is signed by the management end. The transaction data set and the control data set respectively generate the root hash value of the Merkel tree and record it in the block header. The block header will also contain the last transaction data number and the last control data number in the corresponding block body data, and the number is sequentially increasing, which is equivalent to the block header containing all the current cumulative transaction data volume and cumulative control The amount of data.
第三层用户端(包括数据存储装置)使用的是结构化对等网络,比如可以使用Kademlia网络协议。每个用户端(节点)只需要同步区块头数据,而区块体中的账本数据,则会根据分布式哈希表(DHT)由整个网络上的节点分散存储,每个节点存储部分账本数据和对应的认证路径。由于每个交易数据和控制数据都具有一个递增的唯一序号,并且区块头中会包含最后一个序号,相当于包含当前的累计交易数据量和累计控制数据量,所以能够快速查找到每个交易数据和控制数据所在的区块,再结合认证路径,即可使用默克尔树验证该数据。并且因为该区块的默克尔树的叶子节点数量和该数据所对应的序号(即位置)都是已知的,所以认证路径的高度和方向是固定且已知的,不能用不同的认证路径以及高度和方向来替代,加强了数据的安全性。The third layer of users (including data storage devices) uses a structured peer-to-peer network, such as the Kademlia network protocol. Each client (node) only needs to synchronize the block header data, and the ledger data in the block body will be distributed and stored by the nodes on the entire network according to the distributed hash table (DHT), and each node stores part of the ledger data And the corresponding certification path. Since each transaction data and control data has an increasing unique serial number, and the block header will contain the last serial number, which is equivalent to including the current cumulative transaction data volume and cumulative control data volume, each transaction data can be quickly found And the block where the control data is located, combined with the authentication path, the Merkel tree can be used to verify the data. And because the number of leaf nodes of the Merkel tree of the block and the serial number (ie position) corresponding to the data are known, the height and direction of the authentication path are fixed and known, and different authentications cannot be used. The path, height and direction are replaced, which strengthens the security of the data.
用户则是通过账户数据链查找自己的账户数据。而第三方用户和监管者也可以在被授权用户主密钥后通过账户数据链获取该用户的账户数据。账户数据链是指通过用户主密钥与当前生成参数得到一中间值K,再由K经过其它运算得到下一个数据的地址,从而形成正向连接的逻辑链式结构。账户数 据链使用户能够在隐私情况下根据用户主密钥进行检索。一个用户有两条账户数据链,其中一条账户数据链即第一账户数据链由用户的管理数据组成,该用户通过管理地址主密钥进行检索。所述第一链系统使用为用户颁发的管理地址主密钥与所述用户的上一个管理数据中的生成参数生成所述用户的当前管理地址,该当前管理地址被包含在当前管理数据中,并在所述当前管理数据中写入用于生成所述用户的下一个管理地址的生成参数,以使所述用户的所有管理地址形成逻辑链。控制数据中用户管理数据的管理地址可以作为该第一账户数据链的查询键值,该键值关联的数据为管理地址对应的用户管理数据。The user searches for his own account data through the account data link. Third-party users and supervisors can also obtain the user's account data through the account data link after the authorized user's master key. The account data chain refers to obtaining an intermediate value K through the user master key and the current generation parameters, and then obtaining the address of the next data from K through other operations, thereby forming a logical chain structure of forward connection. The account data chain enables users to search based on the user's master key in privacy. A user has two account data chains. One of the account data chains, the first account data chain, is composed of the user's management data, and the user retrieves it through the management address master key. The first chain system uses the management address master key issued for the user and the generation parameters in the user's previous management data to generate the current management address of the user, and the current management address is included in the current management data, And write the generation parameters for generating the next management address of the user in the current management data, so that all the management addresses of the user form a logical chain. The management address of the user management data in the control data can be used as the query key value of the first account data link, and the data associated with the key value is the user management data corresponding to the management address.
初始管理地址生成参数可以是一个预设值,比如用户ID。该管理地址是一次性的,并且都是唯一的,从而可以达到保护用户身份隐私的目的。所述第一链系统使用为用户颁发的对称加密主密钥与所述用户的上一个管理数据中的生成参数生成对称加密工作密钥加密所述用户的当前的管理数据。所述用户可以使用相同的密钥生成方式生成对称加密工作密钥解密所述用户的当前的管理数据。The initial management address generation parameter may be a preset value, such as a user ID. The management address is one-time and unique, so that the purpose of protecting the privacy of the user's identity can be achieved. The first chain system uses the symmetric encryption master key issued for the user and the generation parameters in the user's previous management data to generate a symmetric encryption work key to encrypt the user's current management data. The user can use the same key generation method to generate a symmetric encryption work key to decrypt the user's current management data.
另一条账户数据链即第二账户数据链由用户的接收交易数据组成,该用户通过交易地址主密钥进行检索。所述接收交易数据上链后,同一交易接收端的所有接收交易数据将会形成逻辑链式结构。该逻辑链隐含在生成的账本数据中。The other account data chain, the second account data chain, consists of the user's received transaction data, and the user retrieves it through the transaction address master key. After the received transaction data is uploaded to the chain, all the received transaction data of the same transaction receiving end will form a logical chain structure. This logical chain is implicit in the generated ledger data.
交易数据由用户端提交给第一链系统的管理端,管理端对交易数据进行验证。所述交易数据包括交易接收端的交易地址和本次交易时生成的地址生成参数,交易地址利用所述交易接收端上次接收交易时生成的地址生成参数生成,所述本次交易时生成的地址生成参数用于生成所述交易接收端下次接收交易的交易地址。管理端对交易数据的验证主要包括有效性的验证,例如包括验证用户状态的有效性,解锁脚本的有效性,交易数额的有效性,以及交易地址是否是有效的地址等。交易数据验证通过后,管理端对交易数据进行背书签名,背书签名后的交易数据将被写入第一链的区块数据中。所述交易数据上链后,同一交易接收端的所有接收交易数据将会形成逻辑链式结构。该逻辑链隐含在生成的账本数据中。The transaction data is submitted by the user terminal to the management terminal of the first chain system, and the management terminal verifies the transaction data. The transaction data includes the transaction address of the transaction receiving end and the address generation parameters generated during this transaction. The transaction address is generated using the address generation parameters generated by the transaction receiving end when the transaction was last received, and the address generated during this transaction The generation parameter is used to generate the transaction address of the transaction receiving end to receive the transaction next time. The verification of transaction data by the management terminal mainly includes verification of validity, such as verifying the validity of the user status, the validity of the unlocking script, the validity of the transaction amount, and whether the transaction address is a valid address, etc. After the transaction data is verified, the management terminal will endorse and sign the transaction data, and the transaction data after the endorsement and signature will be written into the block data of the first chain. After the transaction data is uploaded to the chain, all received transaction data of the same transaction receiving end will form a logical chain structure. This logical chain is implicit in the generated ledger data.
用户在注册时管理端为其生成初始地址生成参数(或称为nonce值),并生成起始接收交易地址,该用户作为交易接收端发生交易时,该用户的所有接收交易数据会形成一个逻辑链即第二账户数据链。当同一用户被管理端颁发了用于生成交易地址的新密钥后,管理端会重新为该用户生成一个初始地址生成参数,并由重新生成的初始地址生成参数生成新的起始接收交易地址,所述重新生成的初始地址生成参数与颁发的新密钥是配套的,或者说是相关联的。此后,当该用户作为交易接收端发生交易时,该用户的所有接收交易数据会形成一个新的第二账户数据链。可见同一交易接收端的接收交易数据可有一个或多个逻辑链式结构。每次新生成的初始地址生成参数会存储在用户的管理数据中,用户可以根据管理数据中的初始地址生成参数自行查找第二账户数据链。When the user registers, the management terminal generates the initial address generation parameter (or called the nonce value) for it, and generates the initial receiving transaction address. When the user acts as the transaction receiving terminal to make a transaction, all the received transaction data of the user will form a logic The chain is the second account data chain. When the same user is issued a new key for generating the transaction address by the management terminal, the management terminal will regenerate an initial address generation parameter for the user, and generate a new initial receiving transaction address from the regenerated initial address generation parameter , The regenerated initial address generation parameter is matched with the issued new key, or is related. After that, when the user acts as the transaction receiving end to make a transaction, all the transaction data received by the user will form a new second account data link. It can be seen that the receiving transaction data of the same transaction receiving end can have one or more logical chain structures. Each newly generated initial address generation parameter will be stored in the user's management data, and the user can search the second account data link by himself according to the initial address generation parameter in the management data.
如果有多个针对同一交易接收端的并发交易,即存在多个包含相同交易地址的交易数据,则包含相同交易地址的交易数据在第二账户数据链中互为兄弟节点。If there are multiple concurrent transactions for the same transaction receiving end, that is, there are multiple transaction data containing the same transaction address, the transaction data containing the same transaction address are sibling nodes in the second account data chain.
通过交易数据中包含的用上一次接收交易中的地址生成参数生成的交易地址和用于生成下一次交易地址的地址生成参数,使得同一用户端的接收交易数据形成或有兄弟节点的逻辑链条,从而能够快速检索用户端的所有接收交易数据,且由于发送交易数据是引用接收交易数据,从而能够实现快速获取到所有交易数据。该交易地址是一次性的,对不同用户是唯一的,从而可以达到保护用户身份隐私的目的。Through the transaction address generated by the address generation parameters in the last received transaction and the address generation parameters used to generate the next transaction address contained in the transaction data, the transaction data received by the same user can form a logical chain of sibling nodes, thereby It can quickly retrieve all received transaction data on the client side, and because the sent transaction data refers to the received transaction data, all transaction data can be quickly obtained. The transaction address is one-time and unique to different users, so that the purpose of protecting the privacy of the user's identity can be achieved.
由于交易地址可作为第一键值,所以第二账户数据链的交易地址连接信息是隐藏在连接存储的键值里,用户可以通过将交易地址作为第二键值检索获取所述用户的第二账户数据链。作为第二键值的交易地址可以为所述用户的当前接收交易地址,由所述用户的交易地址主密钥与所述用户的上一个接收交易数据里的生成参数,以及所述用户的签名公钥生成。Since the transaction address can be used as the first key value, the transaction address connection information of the second account data chain is hidden in the key value stored in the connection. The user can retrieve the user’s second key value by using the transaction address as the second key value. Account data link. The transaction address as the second key value may be the user’s current receiving transaction address, which is composed of the user’s transaction address master key and the user’s last received transaction data generated parameters, and the user’s signature Public key generation.
用户端的密钥分为两类,一类是用户端的签名密钥,另一类是由管理端颁发的用户主密钥。签名密钥可由用户端本地生成并管理,也可由可信第三方进行托管。如果需要实名认证,则该签名密钥的公钥需经过可信CA机构 颁发身份证书或经过eID认证。管理端颁发的用户主密钥包括管理地址主密钥、交易地址主密钥、机密交易主密钥和对称加密主密钥。其中管理地址主密钥用于生成由用户的管理数据组成的第一账户数据链的地址;交易地址主密钥用于生成由用户的接收交易数据组成的第二账户数据链的地址;机密交易主密钥用于生成机密交易中的工作密钥,可用于保护盲化因子,使用户可以解密密文交易数额;对称加密主密钥用于生成对称加密工作密钥,可用于保护用户的管理数据和用户的其它数据。There are two types of keys on the user side, one is the signature key on the user side, and the other is the user master key issued by the management side. The signature key can be locally generated and managed by the client, or it can be managed by a trusted third party. If real-name authentication is required, the public key of the signature key needs to be issued an identity certificate by a trusted CA or be authenticated by eID. The user master key issued by the management terminal includes the management address master key, the transaction address master key, the secret transaction master key, and the symmetric encryption master key. The management address master key is used to generate the address of the first account data chain composed of the user's management data; the transaction address master key is used to generate the address of the second account data chain composed of the user's received transaction data; confidential transactions The master key is used to generate the working key in confidential transactions, which can be used to protect the blinding factor, so that the user can decrypt the ciphertext transaction amount; the symmetric encryption master key is used to generate the symmetric encryption working key, which can be used to protect the management of users Data and other user data.
用户主密钥与当前生成参数通过第一单向不可逆函数运算得到一中间值K,其中,管理地址主密钥与第一生成参数生成中间值K1,交易地址主密钥与第二生成参数生成中间值K2,机密交易主密钥与第三生成参数生成中间值K3,对称加密主密钥与第四生成参数生成中间值K4。每个交易数据里的生成参数可以不同,初始生成参数可以是用户ID。可由K1通过第二单向不可逆函数运算得到所述用户的下一个管理数据的地址;由K2与用户的签名公钥运算得到一新的公钥,比如可以使用椭圆曲线上的标量乘法运算,再用新的公钥通过第三单向不可逆函数运算得到所述用户的下一个接收交易的地址,并且该新公钥所对应的私钥可由K2与用户的签名私钥运算得到,比如有限域的乘法运算;由K3通过第四单向不可逆函数运算得到下一个管理数据的对称加密工作密钥;由K4通过第五单向不可逆函数运算得到当前机密交易中的工作密钥,可用于保护盲化因子。用户主密钥与当前生成参数还可以通过多个单向不可逆函数运算得到多个不同的中间值,然后中间值一对一与多个签名公钥运算得到多个新的公钥,再由这些新的公钥生成下一个接收交易的多重签名地址。The user master key and the current generation parameter are calculated through the first one-way irreversible function to obtain an intermediate value K, where the management address master key and the first generation parameter generate the intermediate value K1, and the transaction address master key and the second generation parameter are generated The intermediate value K2, the secret transaction master key and the third generation parameter generate an intermediate value K3, and the symmetric encryption master key and the fourth generation parameter generate an intermediate value K4. The generation parameter in each transaction data can be different, and the initial generation parameter can be the user ID. The address of the user’s next management data can be obtained by K1 through the second one-way irreversible function operation; a new public key can be obtained by calculating K2 and the user’s signature public key, for example, a scalar multiplication operation on the elliptic curve can be used, and then The new public key is used to obtain the user's next transaction receiving address through the third one-way irreversible function operation, and the private key corresponding to the new public key can be calculated by K2 and the user’s signature private key, such as limited domain Multiplication operation; K3 obtains the symmetric encryption working key of the next management data through the fourth one-way irreversible function operation; K4 obtains the working key in the current confidential transaction through the fifth one-way irreversible function operation, which can be used to protect blinding factor. The user master key and the current generation parameters can also be calculated through multiple one-way irreversible functions to obtain multiple different intermediate values, and then the intermediate value is calculated one-to-one with multiple signature public keys to obtain multiple new public keys. The new public key generates the multi-signature address of the next receiving transaction.
上述及本文中的单向不可逆函数都可以是散列函数或散列函数的组合,下文使用散列函数阐述。The one-way irreversible functions mentioned above and in this article can all be hash functions or combinations of hash functions, which are explained below using hash functions.
通过用户主密钥与不同的生成参数得到不同的地址或密钥,还能加强数据的安全性,比如上述散列函数都使用具有能抵抗量子计算破解的散列函数。即使量子计算破解了椭圆曲线上的私钥,但由于该私钥的公钥是通过用户签名公钥与中间值K运算得到的,也即还需要破解中间值K才能把密钥和用户签名公钥关联上,因为任意用户签名公钥都能找到一个K’值运算得到该公钥, 也就不能找到是由哪个用户签名公钥运算得到的,签名私钥也同理。或者量子计算破解了对称加密工作密钥,但由于对称加密工作密钥也都是通过中间值K运算得到,并且每个数据中的K值都是不同的,也就无法找到数据之间的关联。所以通过用户主密钥与不同的生成参数,再结合使用具有能抵抗量子计算破解的散列函数,就能使数据或密钥被破解后无法找到与用户的关联,也无法找到数据之间的关联,也就能够不泄漏用户隐私。所以系统未来升级具有安全保障的抗量子计算的密码算法,并不会由于之前公开的数据被破解而泄露用户的隐私。Obtaining different addresses or keys through the user's master key and different generation parameters can also enhance the security of the data. For example, the above-mentioned hash functions all use hash functions that are resistant to quantum computing cracking. Even if quantum computing cracks the private key on the elliptic curve, since the public key of the private key is obtained by the user's signature public key and the intermediate value K, it is also necessary to crack the intermediate value K to make the key and the user signature public. In terms of key association, because any user's signature public key can find a K'value to get the public key, it is impossible to find which user's signature public key is calculated, and the signature private key is the same. Or quantum computing cracks the symmetric encryption work key, but because the symmetric encryption work key is also obtained through the intermediate value K operation, and the K value in each data is different, it is impossible to find the relationship between the data . Therefore, through the user's master key and different generation parameters, combined with the use of a hash function that can resist quantum computing cracking, the data or key can not be found after the data or key is cracked. Associated, it is possible not to leak user privacy. Therefore, in the future, the system will upgrade the cryptographic algorithm with security and anti-quantum computing, and will not leak the user's privacy due to the cracking of the previously disclosed data.
本系统中的交易数据使用UTXO模型,所以每个交易数据都包含未花费输出的引用作为输入和新的未花费输出。引用的方式可以是未花费输出的地址加上所引用的交易标识(ID),其中交易ID为所引用交易数据的哈希值。但在本系统中,每个交易数据都具有一个唯一的交易数据编号,所以也可以使用交易数据编号替换所引用的交易ID,根据输出地址加上交易数据编号就能唯一确认所引用的未花费输出。以下使用交易数据编号为例说明。新的未花费输出的地址则是根据对应用户的上一个接收交易的生成参数与用户的交易地址主密钥,以及用户的签名公钥生成的新地址。交易数额则是通过加法同态承诺或佩德森承诺实现的机密交易进行保护,使任何用户都可以在密文情况下验证交易数额的输入之和等于输出之和,并结合范围证明验证交易数额都不小于零且不会溢出,也即验证交易数额的有效性。机密交易中的盲化因子则是通过当前交易数据的生成参数与用户的机密交易主密钥生成的工作密钥加密保护,所以用户可以解密自己的密文交易数额。The transaction data in this system uses the UTXO model, so each transaction data contains the reference of the unspent output as input and the new unspent output. The way of quoting may be the unspent output address plus the referenced transaction identification (ID), where the transaction ID is the hash value of the quoted transaction data. But in this system, each transaction data has a unique transaction data number, so you can also use the transaction data number to replace the quoted transaction ID, and add the transaction data number according to the output address to uniquely confirm the quoted unspent Output. The following uses the transaction data number as an example. The new unspent output address is a new address generated based on the generation parameters of the corresponding user's last received transaction, the user's transaction address master key, and the user's signature public key. The transaction amount is protected by a confidential transaction realized by an additive homomorphic commitment or a Pedersen commitment, so that any user can verify that the sum of the transaction amount is equal to the sum of the output in ciphertext, and verify the transaction amount in combination with scope proof It is not less than zero and will not overflow, that is, to verify the validity of the transaction amount. The blinding factor in the confidential transaction is encrypted and protected by the working key generated by the current transaction data generation parameters and the user's secret transaction master key, so the user can decrypt his ciphertext transaction amount.
用户端的结构化对等网络是通过分布式哈希表(DHT),根据索引的key(键)将对应的value(值)分散存储在网络的节点中,可以使用索引key在网络中快速检索对应的value。在本实施例中,将系统中的交易地址、管理地址、token发行或回收使用的预设地址等都通过地址前缀有明确区别,再把交易数据编号和控制数据编号也通过类似地址方式扩展(如补0)并通过前缀明确区别(以下称为编号地址)。比如控制数据编号地址前缀用E表示,序号为1的控制数据用E001作为控制数据编号地址;交易数据编号地址前缀用F表示,序号为1的交易数据用F001作为交易数据编号地址。可以将上 述这些地址的哈希值作为索引的key,比如某个账本数据具有一个或多个地址,则将每个地址的哈希值都作为索引的key,对应的账本数据和认证路径数据作为value,存储在结构化对等网络中。任何用户就可以通过key(上述地址)检索到相应的账本数据和认证路径,再结合区块头数据,根据编号找到账本数据所在的区块,就可以使用默克尔树验证该数据。为简单描述,后文使用地址作为索引的key,这与使用地址的哈希值作为索引的key是等价的。并且与通常DHT的key-value不同,本系统允许有多个value具有相同的key值,并且规定了相同key的不同value的存储与检索方式,也即下面介绍的连接存储(或称结对存储)方式。The structured peer-to-peer network on the user side uses a distributed hash table (DHT), and the corresponding value (value) is scattered and stored in the nodes of the network according to the index key (key), and the index key can be used to quickly retrieve the corresponding in the network The value. In this embodiment, the transaction address, management address, and the preset address for token issuance or recycling in the system are clearly distinguished by the address prefix, and then the transaction data number and control data number are also extended by similar address methods ( Such as padded 0) and clearly distinguished by prefix (hereinafter referred to as numbered address). For example, the address prefix of the control data number is represented by E, the control data with serial number 1 uses E001 as the control data number address; the prefix of the transaction data number address is represented by F, and the transaction data with serial number 1 uses F001 as the transaction data number address. The hash value of the above addresses can be used as the index key. For example, if a certain ledger data has one or more addresses, the hash value of each address will be used as the index key, and the corresponding ledger data and authentication path data will be used as the index key. value, stored in a structured peer-to-peer network. Any user can retrieve the corresponding ledger data and authentication path through the key (above address), combine with the block header data, find the block where the ledger data is located according to the number, and then use the Merkel tree to verify the data. For simple description, the following uses the address as the index key, which is equivalent to using the hash value of the address as the index key. And unlike the usual DHT key-value, this system allows multiple values with the same key value, and specifies the storage and retrieval methods for different values of the same key, which is the connected storage (or paired storage) described below the way.
下面介绍一种通过连接存储结构,将链式结构转化为节点验证的方式。The following introduces a way to convert the chain structure into node verification by connecting the storage structure.
以区块头形成的链为例说明,已知区块头连接(包含)前一个区块头的哈希值。假设第一个区块头H1所包含的值为0000,设H1的哈希值为hash(00H1);则第二个区块头H2所包含的哈希值为hash(00H1),设H2的哈希值为hash(00H2);则第三个区块头H3所包含的哈希值为hash(00H2),设H3的哈希值为hash(00H3)。以区块头的哈希值作为索引key,所包含的前一个区块头的哈希值也作为索引key。则存储hash(00H1)的节点,会存储H1和H2;存储hash(00H2)的节点,会存储H2和H3;以此类推,每个节点都会存储链上的一对数据,并且索引key为该数据对连接的全部或部分信息。例如对于连接是交易ID和输出索引,如果将交易ID作为key,就是部分信息;如果区块头连接的是前一个区块头的哈希值,将哈希值作为key,就是全部信息。下面以哈希值作为key为例进行说明。H1的哈希值为hash(00H1),H2所连接的哈希值为hash(00H1),所以连接存储还需要区分输入数据(以下简称输入)和输出数据(以下简称输出),比如这里输入的H1对应的key(hash(00H1))为数据的哈希值(可看作为输出地址),而输出的H2对应的key为数据连接的哈希值(可看作为输入地址)。这里可以归纳为key对应的是输出地址,则为连接存储的输入数据;key对应的是输入地址,则为连接存储的输出数据。如果链在一直增长,假设当前的最后一个数据为Hn,所以存储hash(00Hn)的节点,只会存储输入数据Hn,而输出数据为空;当链新增加H[n+1]时,该节点才会包含输出的数据H[n+1];而存储hash(00H[n+1]) 的节点,也只会存储输入的数据H[n+1],输出数据为空。存储0000的节点,只会存储H1,并且由于0000是H1所连接的输入地址,所以H1为该节点的输出数据,而输入数据为空。但由于0000是特殊的起始数据,也即能标识为起始连接存储,所以起始连接存储能使用一个特殊的0000数据(或空数据)作为输入。Taking the chain formed by the block header as an example, it is known that the block header is connected to (including) the hash value of the previous block header. Suppose the value contained in the first block header H1 is 0000, and the hash value of H1 is set as hash(00H1); then the hash value contained in the second block header H2 is hash(00H1), and the hash value of H2 is set The value is hash(00H2); then the hash value contained in the third block header H3 is hash(00H2), and the hash value of H3 is set to hash(00H3). The hash value of the block header is used as the index key, and the hash value of the previous block header included is also used as the index key. Then the node that stores hash (00H1) will store H1 and H2; the node that stores hash (00H2) will store H2 and H3; and so on, each node will store a pair of data on the chain, and the index key is this All or part of the information of the data pair connection. For example, if the connection is the transaction ID and output index, if the transaction ID is used as the key, it is part of the information; if the block header is connected to the hash value of the previous block header, the hash value is used as the key, which is all the information. The following takes the hash value as the key as an example for description. The hash value of H1 is hash (00H1), and the hash value of H2 is hash (00H1), so the connection storage also needs to distinguish input data (hereinafter referred to as input) and output data (hereinafter referred to as output), such as the input here The key corresponding to H1 (hash(00H1)) is the hash value of the data (can be regarded as the output address), and the key corresponding to the output H2 is the hash value of the data connection (can be regarded as the input address). It can be summarized here that the key corresponds to the output address, which is the input data of the connection storage; the key corresponds to the input address, which is the output data of the connection storage. If the chain keeps growing, suppose the last data is Hn, so the node storing hash(00Hn) will only store the input data Hn, and the output data will be empty; when the chain newly adds H[n+1], this The node will only contain the output data H[n+1]; and the node storing hash(00H[n+1]) will only store the input data H[n+1], and the output data will be empty. The node storing 0000 will only store H1, and since 0000 is the input address connected to H1, H1 is the output data of the node, and the input data is empty. But because 0000 is a special starting data, that is, it can be identified as the starting connection storage, so the starting connection storage can use a special 0000 data (or empty data) as input.
区块头链有分叉和连接叔区块头的可能,也即区块头链可能出现有多个输入和多个输出的情况。因为叔区块头的哈希值与父区块头的哈希值是不同的,通过哈希值存储也是在不同的节点上,所以区块头链的连接存储不会有多个输入数据,但分叉却会使相关的节点有多个输出数据。根据选择的作为连接的key的不同,如果是数据的哈希值,因为哈希值具有唯一性(不考虑碰撞),则连接存储只会有一个输入数据;如果是地址,根据选择的作为key的地址的不同,可能有多个相同地址的情况,则此时连接存储可能会有多个输入数据。The block head chain has the possibility of forking and connecting the uncle block head, that is, the block head chain may have multiple inputs and multiple outputs. Because the hash value of the uncle block header is different from the hash value of the parent block header, and the hash value storage is also on different nodes, the connection storage of the block header chain will not have multiple input data, but it is bifurcated But it will make related nodes have multiple output data. According to the different key selected as the connection, if it is the hash value of the data, because the hash value is unique (not considering collision), the connected storage will only have one input data; if it is an address, it will be the key according to the selection There may be multiple identical addresses depending on the address, then the connected storage may have multiple input data at this time.
如果节点只有输出数据而没有输入数据(除特殊的起始连接存储外),则该链的连接错误;如果节点只有输入数据而没有输出数据,则该输入数据必定会在上一个节点中连接存储且为输出数据。连接存储是指节点存储一个或多个输入数据和对应的一个或多个输出数据,并且该节点能验证输入、输出数据是否正确;也可以没有输出数据,表示输入数据的连接未被使用或未花费,也即输出数据为零个。其中验证输入输出数据的正确性包括验证一个或多个输入和对应的一个或多个输出的连接是否正确。如果输出数据包含交易数额,还需要验证输出数据的交易数额是否正确;如果输出数据包含签名信息,还可以验证输出数据的签名信息是否有效。比如UTXO结构中,只有输出的数额,输入是引用的地址,所以验证输出数据的交易数额,其中输入数额的部分就可以来自输入数据的输出数额,也即可以减少部分数据的获取。所以也就把链式结构转换为节点的连接存储,并且由节点验证链的连接是否正确。而且连接存储的方式还能使链具有双向检索的能力,比如上述区块头链查询hash(00H2),能获取H2所包含的前一个区块头的哈希值hash(00H1),以及H3的哈希值hash(00H3)。并且检索数据者也可以通过检索的key和节点返回的数据判断是输入数据还是输出数据,从而判断链的连接是否正确。If the node has only output data but no input data (except for the special initial connection storage), the connection of the chain is wrong; if the node only has input data but no output data, the input data must be connected and stored in the previous node And is the output data. Connected storage means that the node stores one or more input data and one or more corresponding output data, and the node can verify whether the input and output data is correct; there can also be no output data, which means that the connection of the input data is not used or not. Cost, that is, zero output data. The verification of the correctness of the input and output data includes verifying whether the connection of one or more inputs and the corresponding one or more outputs is correct. If the output data contains the transaction amount, it is also necessary to verify whether the transaction amount of the output data is correct; if the output data contains signature information, it can also verify whether the signature information of the output data is valid. For example, in the UTXO structure, there is only the amount of output and the input is the referenced address, so the transaction amount of the output data is verified. The part of the input amount can come from the output amount of the input data, which can reduce the acquisition of part of the data. Therefore, the chain structure is converted into the connection storage of the node, and the node verifies whether the chain connection is correct. And the way of connecting storage can also make the chain have the ability of two-way retrieval. For example, the above-mentioned block header chain query hash (00H2), can obtain the hash value hash (00H1) of the previous block header contained in H2, and the hash of H3 The value hash(00H3). And the person who retrieves the data can also judge whether it is input data or output data through the retrieved key and the data returned by the node, thereby judging whether the chain connection is correct.
结合区块链,进行连接存储的节点还可以验证连接存储的数据是否为链上的数据。UTXO数据具有默克尔树认证路径,并且UTXO也属于链式结构,下面以UTXO为例说明。因为本系统使用的UTXO引用方式为地址加上交易数据编号,以地址为索引的key。由于存在并发交易的原因,所以可能有多个相同输出地址的情况,但交易数据编号是不同的,所以本系统根据交易地址的连接存储,是可能出现多个输入和多个输出的情况,但相同地址引用的是不同的交易数据编号,也即多个输入和多个输出数据之间,根据地址加上交易数据编号是一对一的引用,所以并不是双花。比如交易数据T1,其中的输入地址为Ad1和Ad2,输出地址为Bd1和Bd2;交易数据T2,输入地址为Bd1和Ed1,输出地址为Cd1和Cd2。根据上文可知,对于存储Bd1的节点,如图9所示,会存储T1和T2,其中T1为连接存储的输入数据(因为Bd1为T1的输出地址),T2为连接存储的输出数据(因为Bd1为T2的输入地址)。而对于存储Ad1和Ad2的节点,T1数据是连接存储的输出数据;对于存储Cd1和Cd2的节点,T2数据是连接存储的输入数据。每个节点都会验证自己连接存储数据的输入输出是否正确,比如存储Bd1的节点,会验证有无输入数据T1,输出数据T2是否存在双花,输出数据T2的交易数额是否正确,但T2的输入还需要依赖Ed1,所以存储Bd1的节点还需要获取Ed1作为输出的数据才能够验证,设Ed1作为输出的数据为T3,所以存储Bd1的节点,会存储T3以及对应的认证路径作为附加验证数据,并验证Bd1和Ed1的输入数额是否等于Cd1和Cd2的输出数额,即Bd1+Ed1是否等于Cd1+Cd2。同理存储Ed1的节点,会存储输入数据T3和输出数据T2,以及附加验证数据T1,并验证输入输出数据是否正确。Combined with the blockchain, the node that is connected to the storage can also verify whether the data stored in the connection is the data on the chain. UTXO data has a Merkel tree authentication path, and UTXO also belongs to a chain structure. The following uses UTXO as an example. Because the UTXO reference method used by this system is the address plus the transaction data number, and the address is the key of the index. Due to concurrent transactions, there may be multiple identical output addresses, but the transaction data numbers are different, so this system may have multiple inputs and multiple outputs according to the connection storage of the transaction address, but The same address refers to different transaction data numbers, that is, between multiple input and multiple output data, according to the address plus the transaction data number is a one-to-one reference, so it is not a double spend. For example, transaction data T1, the input addresses are Ad1 and Ad2, and the output addresses are Bd1 and Bd2; transaction data T2, the input addresses are Bd1 and Ed1, and the output addresses are Cd1 and Cd2. According to the above, for the node storing Bd1, as shown in Figure 9, T1 and T2 will be stored, where T1 is the input data of the connection storage (because Bd1 is the output address of T1), and T2 is the output data of the connection storage (because Bd1 is the input address of T2). For the nodes storing Ad1 and Ad2, T1 data is the output data of the connection storage; for the nodes storing Cd1 and Cd2, the T2 data is the input data of the connection storage. Each node will verify whether the input and output of its connected storage data is correct. For example, the node storing Bd1 will verify whether there is input data T1, output data T2, whether there is a double spend, and whether the transaction amount of output data T2 is correct, but the input of T2 It also needs to rely on Ed1, so the node storing Bd1 also needs to obtain Ed1 as the output data to be able to verify. Set Ed1 as the output data as T3, so the node storing Bd1 will store T3 and the corresponding authentication path as additional verification data. And verify whether the input amounts of Bd1 and Ed1 are equal to the output amounts of Cd1 and Cd2, that is, whether Bd1+Ed1 is equal to Cd1+Cd2. Similarly, the node storing Ed1 will store input data T3 and output data T2, as well as additional verification data T1, and verify whether the input and output data are correct.
下面介绍本系统的token发行和回收也即起始交易数据和结束交易数据也是连接存储的,并且相关节点也能验证连接存储数据的输入输出是否正确。所以也就把UTXO链转化为节点的连接存储结构,每个节点验证连接存储是否正确,比如是否只有输出而没有输入(起始连接存储也会有特殊的输入),输入数据是否有多个相同输出(即双花),以及连接存储数据的输入输出是否正确,并且每个交易数据都可以通过默克尔树验证是否为链上的数据,因此通过分散的节点即可验证整个UTXO账本的正确性。根据上文可知,用户在 网络中通过检索地址也可以获取双向检索的能力,并且能根据节点返回的数据是输入还是输出,从而判断链的连接是否正确,还可以根据返回的数据判断是否是未花费输出。比如用户C在网络中检索Ed1,节点会将Ed1相关的数据T1、T2和T3以及对应的认证路径返回给用户C。用户C根据Ed1是T3的输出地址,所以T3是输入数据;根据Ed1是T2的输入地址,所以T2是输出数据;Ed1不是T1的地址,所以T1是附加验证数据。根据相关数据的认证路径验证T1、T2和T3都是链上的数据,并且可以验证Bd1和Ed1的输入数额是否等于Cd1和Cd2的输出数额,从而可以验证输入输出数据的正确性。如果节点只返回T2数据,则只有输出而没有输入,判断为链的连接错误;如果节点只返回T3数据,则表示T3的Ed1没有被花费。The following introduces the token issuance and recovery of this system, that is, the initial transaction data and the end transaction data are also connected and stored, and the relevant nodes can also verify whether the input and output of the connected storage data are correct. Therefore, the UTXO chain is transformed into the connected storage structure of the nodes, and each node verifies whether the connected storage is correct, such as whether there is only output but no input (the initial connected storage will also have special inputs), and whether the input data is the same. Whether the output (ie double spend) and the input and output of the connected storage data are correct, and each transaction data can be verified by the Merkel tree to verify whether it is data on the chain, so the correctness of the entire UTXO ledger can be verified through decentralized nodes Sex. According to the above, the user can also obtain the two-way search ability by retrieving the address in the network, and can judge whether the chain connection is correct according to whether the data returned by the node is input or output, and can also judge whether the link is unavailable according to the returned data. Expenditure output. For example, if user C searches for Ed1 in the network, the node will return data T1, T2, and T3 related to Ed1 and the corresponding authentication path to user C. User C according to Ed1 is the output address of T3, so T3 is the input data; according to Ed1 is the input address of T2, so T2 is the output data; Ed1 is not the address of T1, so T1 is additional verification data. According to the authentication path of the relevant data, it is verified that T1, T2, and T3 are all data on the chain, and it can be verified whether the input amount of Bd1 and Ed1 is equal to the output amount of Cd1 and Cd2, so that the correctness of the input and output data can be verified. If the node only returns T2 data, there is only output but no input, and it is judged as a link connection error; if the node only returns T3 data, it means that Ed1 of T3 is not spent.
系统token发行或回收使用的是预设地址,并且首先需要在控制数据集中明文公布。比如发行的地址为A001,回收的地址为B001。因为控制数据集中公布的token发行或回收信息中包含有该预设地址信息,所以网络中存储A001的节点,会存储控制数据集中发布的信息,以及A001作为输入引用地址的交易数据,也即起始交易数据;而网络中存储B001的节点,会存储控制数据集中发布的信息,以及B001作为输出地址的交易数据,也即结束交易数据。所以系统token发行或回收的预设地址,也是符合连接存储的特征,只是使用预设的输入或输出数据,比如不是交易数据而是控制数据集中的明文发行或回收信息,节点也可以验证输入输出数据是否正确。The system token issuance or recovery uses the preset address, and first needs to be published in the control data set in clear text. For example, the issued address is A001, and the recycled address is B001. Because the token issuance or recovery information published in the control data set contains the preset address information, the node that stores A001 in the network will store the information published in the control data set and A001 as the transaction data of the input reference address. Start transaction data; and the node that stores B001 in the network will store the information released in the control data set, and the transaction data with B001 as the output address, that is, the end transaction data. Therefore, the preset address for the issuance or recovery of the system token is also in line with the characteristics of connected storage. It only uses the preset input or output data. For example, it is not transaction data but the plaintext issuance or recovery information in the control data set. The node can also verify the input and output. Is the data correct?
上述举例系统使用的是同质化token,如果使用非同质化token,也是可以符合连接存储的特征,并能达到验证UTXO链的目的。The above example system uses a homogenized token. If a non-homogeneous token is used, it can also meet the characteristics of connected storage and achieve the purpose of verifying the UTXO chain.
上述通过连接存储使分布式节点即可验证链的连接是否正确,此外还可以验证链的长度是否正确。为了验证链的长度是否正确,根据区块头中所包含的累计交易数据量和累计控制数据量,节点能计算出该区块所包含的所有编号地址,然后节点可以根据每个编号地址查询自己的网络标识是否匹配该key,如果有相应的编号地址key是由自己存储,但自己没有相应的数据,则通过网络查询该key的数据(例如先在用户端节点查找,如果没有再将编号地址作为key在第二层链上查找),如果没有找到则说明该链的完整性错误。如果找到了该key对应的账本数据,并验证了该数据,则说明该编号地址的 数据正确,如果该数据是交易数据,根据上述所知,交易数据通过交易地址形成连接存储,该节点可以根据交易的输入引用地址查询和验证。这样就能通过编号地址验证链的完整性,也就能通过网络查询未花费输出。The above connection storage enables distributed nodes to verify whether the chain is connected correctly, and in addition, it can also verify whether the length of the chain is correct. In order to verify that the length of the chain is correct, according to the cumulative transaction data volume and cumulative control data volume contained in the block header, the node can calculate all the numbered addresses contained in the block, and then the node can query its own according to each numbered address Whether the network ID matches the key, if there is a corresponding numbered address, the key is stored by yourself, but you don’t have the corresponding data, then you can query the data of the key through the network (for example, first search on the user end node, if not, then use the numbered address as The key is searched on the second-level chain), if it is not found, the integrity of the chain is wrong. If the ledger data corresponding to the key is found and the data is verified, it means that the data of the numbered address is correct. If the data is transaction data, according to the above knowledge, the transaction data is connected and stored by the transaction address, and the node can be based on The input of the transaction refers to the address query and verification. In this way, the integrity of the chain can be verified through the numbered address, and the unspent output can be inquired through the network.
由于本系统的账本数据是由交易数据集和控制数据集两部分组成。并且每个控制数据中都有唯一的控制数据编号,该编号是顺序递增的,根据上文可知,通过编号地址即可验证控制数据的完整性。如果某个地址只被特定节点验证,也即验证某个交易数据或控制数据的节点是固定并且已知的,这会带来一定的风险,所以在一示例性实施例中,系统可选择增加用户随机选取验证的方式。因为区块头中包含了当前所有的累计交易数量和累计控制数量,所以每个节点都能知道区块中所包含的交易数据和控制数据的起始编号与结束编号。用户端节点在同步区块头时,可以根据编号地址对该区块里的账本数据进行随机选取验证,比如可以随机选取验证m1个控制数据,也可以随机选取验证m2个交易数据。控制数据只有管理端的签名,所以用户端节点只需要通过控制数据编号地址获取到控制数据,验证管理端签名,并根据认证路径验证数据是否在链上。验证交易数据则需要先经过交易数据编号地址获取到交易数据,再根据交易数据里的输入引用地址,查询这些地址并进行验证。根据上文所知,查询输入引用的地址节点返回的是具有输入输出数据的连接存储数据,即前述具有关联关系的输入数据和输出数据,并且能够验证输入数据和输出数据的正确性,以及根据认证路径验证数据是否在链上。由于用户端使用的是分布式哈希表网络进行检索,并且每个节点都是独立随机选取账本数据进行验证,所以并不会知晓某个交易数据被哪些节点选择验证,也就能避免某个地址只被特定节点验证的缺点,增加了安全性。Because the ledger data of this system is composed of two parts: transaction data set and control data set. And each control data has a unique control data number, which is sequentially increasing. According to the above, the integrity of the control data can be verified through the numbered address. If an address is only verified by a specific node, that is, the node that verifies a certain transaction data or control data is fixed and known, this will bring a certain risk, so in an exemplary embodiment, the system may choose to increase The user randomly selects the verification method. Because the block header contains all the current cumulative transaction quantity and cumulative control quantity, each node can know the starting number and ending number of the transaction data and control data contained in the block. When the client node synchronizes the block header, it can randomly select and verify the ledger data in the block according to the number address. For example, it can randomly select and verify m1 control data, or randomly select and verify m2 transaction data. The control data has only the signature of the management end, so the user end node only needs to obtain the control data through the control data number address, verify the management end signature, and verify whether the data is on the chain according to the authentication path. To verify the transaction data, you need to obtain the transaction data through the transaction data number address, and then query these addresses and verify them according to the input reference address in the transaction data. According to the above knowledge, the address node referenced by the query input returns the connected storage data with input and output data, that is, the input data and output data with the aforementioned association relationship, and can verify the correctness of the input data and output data, and according to The authentication path verifies that the data is on the chain. Since the user side uses a distributed hash table network for retrieval, and each node independently selects the ledger data for verification, it does not know which nodes choose to verify a certain transaction data, and it can avoid a certain transaction data. The disadvantage that the address is only verified by a specific node increases the security.
从上文可知,可以把任意链上的数据转化为节点的连接存储结构,其中节点存储一个或多个输入数据和对应的零个、一个或多个输出数据,并且节点能验证输入、输出数据是否正确,特殊的起始连接存储和结束连接存储也可以通过预设的输入和输出数据符合连接存储特征。通过连接存储把任意链上的数据转化为节点存储,再结合证明所存储的数据是链上数据,就能验证链的连接是否正确。以及通过编号地址验证链的完整性,就能使每个节点存储部分账本数据和对应的认证路径,并验证输入、输出数据是否正确,就能 等价验证全部账本数据的正确性,称之为等价验证。并且还可以选择增加用户随机选取验证的方式,避免某个地址只被特定节点验证的缺点,增加了安全性。It can be seen from the above that the data on any chain can be converted into a node’s connected storage structure, where the node stores one or more input data and the corresponding zero, one or more output data, and the node can verify the input and output data Whether it is correct or not, the special initial connection storage and end connection storage can also meet the characteristics of the connection storage through the preset input and output data. Through the connection storage, the data on any chain is converted into node storage, and then combined with the proof that the stored data is the data on the chain, it can be verified whether the connection of the chain is correct. And by verifying the integrity of the chain through the numbered address, each node can store part of the ledger data and the corresponding authentication path, and verify whether the input and output data is correct, and the correctness of all the ledger data can be equivalently verified, which is called Equivalence verification. And you can also choose to increase the user's random selection verification method to avoid the shortcomings of a certain address only being verified by a specific node, and increase security.
再以公有链的UTXO为例说明,比如Bitcoin(比特币)系统。Bitcoin的UTXO输入引用的是未花费交易ID和输出索引,其中交易ID为所引用交易数据的哈希值。可以把发行看作为矿工创建的CoinBase奖励交易(创币交易,也即每个区块体数据中的第一个交易数据)。使用交易ID作为检索的key,引用的交易ID也作为检索的key。比如交易数据ID为Tb,其中的输入引用为Ta[1]和Ta[2],有两个输出Tb[1]和Tb[2];交易数据ID为Tc,其中输入引用为Tb[1];交易数据ID为Td,其中输入引用为Tb[2];括号内数字为引用的输出索引。则存储Tb的节点,会存储输入数据Tb,以及输出数据Tc和Td。因为不允许有相同的交易ID,所以根据交易ID作为检索的key,连接存储不会有多个输入数据,但可能会有多个输出数据。这里的两个输出的输入引用并不是相同的输出索引,所以并不是双花。每个交易数据都包含对应的认证路径数据,并且CoinBase奖励交易的认证路径是特殊的第一个交易数据,也即起始连接存储。在不考虑交易手续费的情况下,每个节点可以容易验证输入、输出数据的正确性,起始连接存储也可以容易验证CoinBase奖励交易的正确性。但考虑实际Bitcoin交易中含有手续费,CoinBase奖励交易是包含出块奖励和交易手续费两部分,所以起始连接存储需要CoinBase奖励交易所在区块体的所有交易手续费才能验证,如果区块体内的交易数量较多,会使验证变得非常困难,检索起始连接存储的用户需要验证CoinBase奖励交易也同样变得非常困难。如果能够仅依赖有限个交易数据验证输入、输出数据的正确性,就能发挥分布式节点连接存储的优点,能通过每个节点存储并验证部分交易数据的正确性,达到验证整个UTXO链的正确性的目的。并且可以通过增加编号地址的方式验证链的完整性。Let's take the UTXO of the public chain as an example, such as the Bitcoin system. Bitcoin's UTXO input refers to the unspent transaction ID and output index, where the transaction ID is the hash value of the quoted transaction data. The issuance can be regarded as a CoinBase reward transaction created by miners (coin creation transaction, that is, the first transaction data in each block data). Use the transaction ID as the key for retrieval, and the quoted transaction ID as the key for retrieval. For example, the transaction data ID is Tb, the input references are Ta[1] and Ta[2], and there are two outputs Tb[1] and Tb[2]; the transaction data ID is Tc, and the input reference is Tb[1] ; The transaction data ID is Td, and the input reference is Tb[2]; the number in parentheses is the referenced output index. Then the node that stores Tb will store the input data Tb, and the output data Tc and Td. Because the same transaction ID is not allowed, based on the transaction ID as the key for retrieval, the connected storage will not have multiple input data, but there may be multiple output data. The input references of the two outputs here are not the same output index, so they are not double spend. Each transaction data contains the corresponding authentication path data, and the authentication path of the CoinBase reward transaction is the special first transaction data, that is, the initial connection storage. Without considering transaction fees, each node can easily verify the correctness of input and output data, and the initial connection storage can also easily verify the correctness of CoinBase reward transactions. However, considering that the actual Bitcoin transaction contains a handling fee, the CoinBase reward transaction includes two parts: the block reward and the transaction fee. Therefore, the initial connection storage requires all transaction fees of the CoinBase reward exchange in the block body to be verified. If the block The large number of transactions in the body makes verification very difficult, and it is also very difficult for users who retrieve the initial connection storage to verify CoinBase reward transactions. If you can only rely on a limited number of transaction data to verify the correctness of the input and output data, you can take advantage of the distributed node connection storage, and you can store and verify the correctness of part of the transaction data through each node to verify the correctness of the entire UTXO chain. Sexual purpose. And the integrity of the chain can be verified by adding a numbered address.
因为本系统使用UTXO模型,所以用户A的未花费输出可能会被同一个交易里的其他用户B知道,引用该未花费输出的交易时间戳也可能会被用户B知道,如果交易里还引用了用户A的其它未花费输出,也可能会被用户B知道。为保证尽可能不泄露任何信息,用户可以选择系统提供的辅助混淆方 案。比如用户将这些未花费输出依次转入系统提供的混淆地址,该混淆地址也是一条逻辑链,所以每次转入的混淆地址都是不同的,然后由系统的另外一个混淆地址转出相同数额到用户新的接收交易地址,而新的接收交易地址在UTXO链上与用户之前的未花费输出没有任何关联,也就能不泄漏任何信息。Because this system uses the UTXO model, the unspent output of user A may be known by other users B in the same transaction, and the transaction timestamp that quotes the unspent output may also be known by user B, if the transaction is also quoted User A's other unspent output may also be known to user B. To ensure that no information is disclosed as much as possible, users can choose the auxiliary obfuscation scheme provided by the system. For example, the user transfers these unspent outputs to the obfuscated address provided by the system in turn. The obfuscated address is also a logical chain, so the obfuscated address transferred in each time is different, and then another obfuscated address in the system transfers the same amount to The user's new receiving transaction address, and the new receiving transaction address on the UTXO chain has no relationship with the user's previous unspent output, and no information will be leaked.
用户的管理地址是通过上一个管理数据中的生成参数与管理地址主密钥生成,管理数据则由上一个管理数据中的生成参数与对称加密主密钥生成的对称加密工作密钥加密保护。而用户的第一个管理数据,也即用户的注册管理数据,使用用户的注册ID作为生成参数。用户的注册管理数据中包含接收交易数据组成的第二账户数据链的初始地址生成参数,还包含用户的身份证书散列值和用户签名公钥,可用于确认用户身份。除用户注册管理数据和用户身份证书更新管理数据中包含有用户关联信息用于确认用户身份外,其余的账本数据里都不再含有用户的关联信息。比如交易数据中可以包含用户附加信息,其中可能会含有用户的身份信息,所以用户附加信息是链下存储,链上只记录附加信息的散列值,并且用户附加信息可以使用交易的时间戳作为盐值。除用户附加信息外,交易数据中还可以包含有合约附加信息,合约附加信息是用于记录合约的关联信息,并不含有用户的身份信息,所以合约附加信息可以是链上存储的。用户的签名公钥与用户身份证书是关联的,所以用户身份证书更新管理数据中也包含用户签名公钥更新信息。用户的其它管理数据可以包含用户主密钥更新信息和普通管理信息,这些信息都不会涉及用户身份。The user's management address is generated by the generation parameters in the previous management data and the management address master key, and the management data is encrypted and protected by the symmetric encryption working key generated by the generation parameters in the previous management data and the symmetric encryption master key. The user's first management data, that is, the user's registration management data, uses the user's registration ID as a generation parameter. The user's registration management data includes the initial address generation parameters of the second account data chain composed of the received transaction data, and also includes the user's identity certificate hash value and the user's signature public key, which can be used to confirm the user's identity. Except for user registration management data and user identity certificate update management data that contain user-related information for confirming the user's identity, the remaining ledger data no longer contains user-related information. For example, transaction data can contain user additional information, which may contain user identity information, so user additional information is stored off-chain, and only the hash value of the additional information is recorded on the chain, and user additional information can use the transaction timestamp as Salt value. In addition to user additional information, transaction data can also contain additional contract information. The additional contract information is used to record the associated information of the contract and does not contain the user's identity information, so the additional contract information can be stored on the chain. The user's signature public key is associated with the user identity certificate, so the user identity certificate update management data also contains the user's signature public key update information. The user's other management data may include user master key update information and general management information, none of which will involve the user's identity.
用户在注册后,通过注册ID与管理地址主密钥找到注册管理数据,并由注册ID与对称加密主密钥生成的对称加密工作密钥解密数据,从而获取到用户的管理数据组成的第一账户数据链。然后根据注册管理数据中的交易数据初始生成参数、交易地址主密钥以及用户的签名公钥获取到用户接收交易数据组成的第二账户数据链。根据上文可知,在用户端网络查找接收交易地址,因为采用连接存储,所以能获取到接收交易地址作为输入引用的交易,也即用户的发送交易。所以通过获取接收交易的第二账户数据链,就能同时获取到用户所有的交易数据。再由交易数据里的生成参数与机密交易主密钥 生成的工作密钥解密盲化因子,从而获取到用户的账户信息。After the user registers, he finds the registration management data through the registration ID and the management address master key, and decrypts the data with the symmetric encryption working key generated by the registration ID and the symmetric encryption master key, so as to obtain the user’s management data. Account data link. Then, according to the initial generation parameters of the transaction data in the registration management data, the transaction address master key, and the user's signature public key, the second account data chain composed of the user's received transaction data is obtained. According to the above, searching for the receiving transaction address on the user-side network, because of the use of connection storage, the transaction referenced by the receiving transaction address as an input can be obtained, that is, the user's sending transaction. Therefore, by obtaining the data link of the second account that receives the transaction, all transaction data of the user can be obtained at the same time. Then decrypt the blinding factor from the generation parameters in the transaction data and the working key generated by the secret transaction master key to obtain the user's account information.
比如用户Alice通过身份证书在管理端注册了ID为Alice的账户,管理端给账户Alice颁发了管理地址主密钥、交易地址主密钥、机密交易主密钥和对称加密主密钥。其中账号ID名称为管理数据的默认初始生成参数。用户通过账户ID名称Alice和管理地址主密钥生成注册管理地址,然后在用户端网络查找该注册管理地址,即能找到账户Alice的注册管理信息,并通过账户ID名称Alice和对称加密主密钥生成的对称加密工作密钥解密数据。注册管理信息中包含了用户身份证书哈希值,可以证明用户的身份,还有生成参数用于生成下一个管理数据的地址和对称加密工作密钥,并包含接收交易地址的初始生成参数,用于生成该用户的第一个接收交易地址。当给账户Alice转账后,用户就能通过上一个接收交易的生成参数、交易地址主密钥和用户的签名公钥生成接收交易地址,然后在用户端网络查找该地址,即能找到交易信息,并通过交易数据中的生成参数和机密交易主密钥生成的工作密钥解密盲化因子,即能解密密文交易数额。如果Alice需要给Bob转账,则需要通过上一个接收交易的生成参数、交易地址主密钥和用户的签名私钥生成解锁脚本。For example, user Alice registers an account with ID Alice on the management terminal through the identity certificate, and the management terminal issues the management address master key, transaction address master key, secret transaction master key, and symmetric encryption master key to account Alice. The account ID name is the default initial generation parameter of the management data. The user generates the registration management address through the account ID name Alice and the management address master key, and then searches for the registration management address on the user-side network, that is, the registration management information of the account Alice can be found, and the account ID name Alice and the symmetric encryption master key are used The generated symmetric encryption working key decrypts the data. The registration management information contains the hash value of the user's identity certificate, which can prove the user's identity, as well as the generation parameters used to generate the address of the next management data and the symmetric encryption working key, and include the initial generation parameters of the receiving transaction address. To generate the user’s first receiving transaction address. After transferring money to the account Alice, the user can generate the receiving transaction address through the generation parameters of the last receiving transaction, the transaction address master key and the user’s signature public key, and then look up the address on the user’s network to find the transaction information. And through the generation parameters in the transaction data and the working key generated by the secret transaction master key to decrypt the blinding factor, the ciphertext transaction amount can be decrypted. If Alice needs to transfer money to Bob, she needs to generate the unlocking script through the generation parameters of the last received transaction, the transaction address master key, and the user's signature private key.
当用户需要向第三方用户证明某个地址的资产时,只需要提供中间值K与用户的身份证书,以及盲化因子即可。第三方用户可以验证身份证书的有效性确认用户身份,然后用K与用户签名公钥做椭圆曲线上的标量乘法运算得到新的公钥,验证新公钥生成的地址等于该地址。因为椭圆曲线上的标量乘法运算具有单向性,因此无法找到一个K’与用户的签名公钥运算得到其他人的公钥地址(假设为量子计算破解出现之前,之后需要更新能抵抗量子计算破解的算法,才能提供有效证明)。再通过网络查询该地址是否是未花费地址,最后使用盲化因子解密密文数额。而用户提供的信息里都不包含相关密钥信息,第三方用户无法根据所提供的信息,获取到用户其它交易数据的隐私。上述查询未花费地址,是通过节点的连接存储实现的。根据上文所述,如果该地址已被花费,则相关节点会返回输入数据和输出数据;未花费则只会返回输入数据而没有输出数据。但该查询方式依赖于相关节点,根据后文将可知,第三方用户也可以通过第二链系统查询未花费地址的信息。When a user needs to prove the assets of a certain address to a third-party user, he only needs to provide the intermediate value K, the user's identity certificate, and the blinding factor. The third-party user can verify the validity of the identity certificate to confirm the user's identity, and then use K and the user's signature public key to do a scalar multiplication on the elliptic curve to obtain a new public key, and verify that the address generated by the new public key is equal to the address. Because the scalar multiplication operation on the elliptic curve is one-way, it is impossible to find a K'and the user's signature public key operation to get the public key address of other people (assuming that before the quantum computing cracking occurs, it needs to be updated afterwards to resist the quantum computing cracking In order to provide a valid proof). Then check whether the address is an unspent address through the network, and finally use the blinding factor to decrypt the ciphertext amount. The information provided by the user does not contain the relevant key information, and the third-party user cannot obtain the privacy of the user's other transaction data based on the provided information. The above-mentioned query of unspent addresses is realized through the node's connected storage. According to the above, if the address has been spent, the relevant node will return input data and output data; if it is not spent, only input data will be returned without output data. However, the query method depends on the relevant node. As will be known later, third-party users can also query the information of unspent addresses through the second chain system.
系统发布的公告数据都是明文,比如token发行或回收的公告信息、密钥算法更新信息、新交易规则发布信息以及系统版本更新信息等。根据公告类型的不同,每个公告都有公告类型和递增的序号,根据公告前缀+公告类型+公告序号,组成公告的地址,任何用户都可以通过公告地址在网络中检索并验证公告。The announcement data released by the system are all plain text, such as the announcement information of token issuance or recovery, key algorithm update information, new transaction rule announcement information, and system version update information. According to the different types of announcements, each announcement has an announcement type and an incremental serial number. According to the announcement prefix + announcement type + announcement serial number, the address of the announcement is composed. Any user can retrieve and verify the announcement on the network through the announcement address.
所以本系统根据交易地址(包括起始交易数据和结束交易数据的特殊地址)的UTXO链是连接存储的,可以验证UTXO链是否正确;编号地址等顺序递增的地址并不是链式关系,所以是直接存储的,可以用于验证链的完整性以及随机选取验证;管理地址不是显性的链式关系(具有用户主密钥才能获取该用户的第一账户数据链,管理地址形成隐性的链式关系),以及公告地址等,也是直接存储的。直接存储的key对应的value具有唯一性,检索返回相应数据;连接存储的key可能对应多个value数据,也即连接存储的输入、输出数据,检索返回相关的所有数据,包括附加验证数据。并且用户端通过结构化对等网络,使用分布式哈希存储方式,每个用户端只需要存储部分账本数据,就可以通过地址检索到对应的账本数据,并且可以使用默克尔树验证该账本数据是否包含在链的区块中。Therefore, the UTXO chain of the system according to the transaction address (including the special address of the initial transaction data and the special address of the end transaction data) is connected and stored, and it can verify whether the UTXO chain is correct; the sequentially increasing addresses such as the numbered address are not in a chain relationship, so it is Directly stored, it can be used to verify the integrity of the chain and random selection verification; the management address is not an explicit chain relationship (only the user's master key can obtain the user's first account data chain, and the management address forms an implicit chain Type relationship), as well as the announcement address, etc., are also stored directly. The value corresponding to the directly stored key is unique, and the retrieval returns the corresponding data; the key stored in the connection may correspond to multiple value data, that is, the input and output data of the connection storage, and the retrieval returns all relevant data, including additional verification data. And the user side uses distributed hash storage through a structured peer-to-peer network. Each user side only needs to store part of the ledger data, and the corresponding ledger data can be retrieved through the address, and the ledger can be verified using the Merkel tree Whether the data is contained in the block of the chain.
系统中也可以有生成链的奖励。为满足类公有链的条件,任何人都可以参与链的生成,并不需要在系统中注册或授权,只需要自行生成一非对称密钥作为领取奖励使用的密钥,将其中的公钥按一定方式生成一个地址,该地址通过前缀标识为领取地址,以区别系统内部使用的地址。当链生成对象(例如链生成节点)参与生成新的区块头时,则会包含该领取地址。当该区块头经过了n个确认后,管理端则会将奖励信息明文发布到控制数据集中,奖励信息包括奖励预设地址、奖励数额和绑定的领取地址,奖励预设地址类似token发行的预设地址,比如为C001。领取奖励时需要在系统中注册,然后生成一个领取奖励交易数据,交易的输入引用为该奖励地址C001,输出则为用户的接收交易地址,所以该交易是在用户的第二账户数据链上,并且需要使用领取地址的私钥生成解锁脚本,才能解锁领取奖励。所以奖励分为先发布后领取两个步骤,其中发布类似token发行,并且奖励地址也是符合上文中连接存储的特征,只是输入是控制数据集中的明文奖励信息。所以参与链 的生成并不需要在系统中注册或授权,但领取奖励则需要在系统中注册。链生成对象也可以将领取地址的密钥授权给其他用户,由其他用户领取奖励。There can also be rewards for generating chains in the system. In order to meet the conditions of a public-like chain, anyone can participate in the generation of the chain, without registration or authorization in the system, but only needs to generate an asymmetric key as the key for receiving rewards, and press the public key in it. An address is generated in a certain way, and the address is identified by the prefix as the receiving address to distinguish the addresses used inside the system. When a chain generation object (for example, a chain generation node) participates in generating a new block header, the receiving address will be included. After n confirmations of the block header, the management end will publish the reward information in plaintext to the control data set. The reward information includes the reward preset address, the reward amount, and the bound receiving address. The reward preset address is similar to the token issued The preset address, such as C001. When receiving rewards, you need to register in the system, and then generate a reward transaction data. The input of the transaction is referenced to the reward address C001, and the output is the user's receiving transaction address, so the transaction is on the user's second account data chain. And it is necessary to use the private key of the receiving address to generate the unlocking script to unlock the receiving reward. Therefore, the rewards are divided into two steps: release first and then receive. Among them, release is similar to token issuance, and the reward address is also in line with the characteristics of the above connection storage, but the input is the clear text reward information in the control data set. Therefore, the generation of the participating chain does not need to be registered or authorized in the system, but to receive rewards, you need to register in the system. The chain generation object can also authorize the key of the receiving address to other users, and the other users can receive rewards.
公有链是指任何人都可以读取、发送交易和参与共识的区块链系统,属于完全去中心化的系统。类公有链是指不包括任何人都可以发送交易外,其余都与公有链相同的系统,满足交易中心化,账本数据去中心化。下面以公有链系统阐述类公有链的系统架构。The public chain refers to a blockchain system in which anyone can read, send transactions, and participate in consensus. It is a completely decentralized system. The quasi-public chain refers to a system that does not include anyone who can send transactions, and the rest are the same as the public chain, which satisfies the centralization of transactions and the decentralization of ledger data. The following describes the system architecture of the class public chain with the public chain system.
假设有一个公有链系统S,其中有一个用户A,A发送的交易数据需满足UTXO的规则,也即要有一个合法的输入引用,并且不能够有双花存在。如果不考虑有多个输入输出的情况,则S链上A的交易数据将形成一条顺序单连接的UTXO链。将A假设为一个私有链系统(S仍可以将A看作为一个用户),并将A的交易数据替换为私有链系统产生的区块数据,因为可将私有链看作为后一个区块连接(花费)了前一个区块的输出,可以把私有链看作为UTXO链,所以A所产生的区块数据连接上一个区块数据,并且不能够分叉(不能够有双花),也即可以把S链上A的UTXO链与A的私有链看作为等价的。当A的区块数据上链时,S系统需要验证A区块数据的合法性,需顺序连接且不能分叉,还需要验证区块里账本数据的合法性。S系统是任何人都可以参与共识,读取账本数据以及验证账本数据,所以任何人也都可以验证A的账本数据。Suppose there is a public chain system S, in which there is a user A, and the transaction data sent by A needs to meet the UTXO rules, that is, there must be a legal input reference, and no double spend can exist. If multiple inputs and outputs are not considered, the transaction data of A on the S chain will form a UTXO chain with a sequential single connection. Assume A as a private chain system (S can still regard A as a user), and replace A's transaction data with block data generated by the private chain system, because the private chain can be regarded as the next block connection ( Expends) the output of the previous block, the private chain can be regarded as a UTXO chain, so the block data generated by A is connected to the block data, and cannot be forked (no double spend), that is, it can Consider the UTXO chain of A on the S chain and the private chain of A as equivalent. When the block data of A is on the chain, the S system needs to verify the legitimacy of the A block data, which needs to be connected sequentially and cannot be forked, and also needs to verify the legitimacy of the ledger data in the block. In the S system, anyone can participate in consensus, read ledger data and verify ledger data, so anyone can verify A's ledger data.
S系统除A的区块数据外,还可以有扩展数据,但该扩展数据并不对用户的管理数据和交易数据产生影响,也不会影响用户的账户状态,所以用户端并不需要读取和验证该扩展数据。扩展数据的作用是使S能够与A进行交互,使S能够部分影响A数据的产生,所以该数据只有参与S共识的对象和A会读取。比如A系统在控制数据中发布token发行或回收的信息之前,需要经过S进行投票;或者由S生成可证公平随机数,通过该随机数影响A系统产生的数据,以解决A系统的部分公平性问题。用户端C并不需要同步A私有链的区块头数据,而只需要同步S系统的区块头数据,所以A私有链的区块头数据也可以存储在扩展数据中。如果系统中有不合法的数据产生,需要能够对数据进行举证时,也可以将相关的数据存储在S系统的扩展数据中。如果系统使用了POA(Proof Of Activity,权威证明)等共识算法,相关验证 者选举和验证者列表的数据也可以存储在扩展数据中。In addition to the block data of A, the S system can also have extended data, but the extended data does not affect the user's management data and transaction data, nor does it affect the user's account status, so the user does not need to read and Verify the extended data. The function of the extended data is to enable S to interact with A, so that S can partially affect the generation of A data, so the data can only be read by the objects participating in the S consensus and A. For example, before A system releases token issuance or recovery information in the control data, it needs to go through S to vote; or S generates a provable fair random number, and the random number affects the data generated by A system to solve the partial fairness of A system. Sexual issues. Client C does not need to synchronize the block header data of the A private chain, but only needs to synchronize the block header data of the S system, so the block header data of the A private chain can also be stored in the extended data. If there is illegal data generated in the system and the data needs to be able to prove, the relevant data can also be stored in the extended data of the S system. If the system uses consensus algorithms such as POA (Proof Of Activity), the relevant verifier election and verifier list data can also be stored in the extended data.
A系统的用户端C,发起的交易数据需要经过A再到S,C从S上获取到交易数据。可以将上述系统S、系统A(私有链或联盟链系统),以及A系统的用户端C,看作一种类公有链应用系统。任何人都可以读取、验证交易,并参与共识。这里是指读取S链的数据,用户端C也同步S链的区块头数据。根据上文可知,区块头的一致性能保证系统状态的一致性,所有用户端同步一致的S链区块头,就能保证所有的用户端以及系统S的状态都是一致的。并且用户端只需要从A系统获取用户主密钥(密钥不属于链数据),就能在用户端的结构化对等网络中(或S链中)自行检索账户数据,而第三方用户和监管者也可以在被授权密钥后自行检索,该过程并不依赖A系统或其它中心化的系统。所以类公有链应用系统是可验证、可追溯、不可篡改的。但因为用户的交易数据首先需要经过A才能在S中上链,所以类公有链应用系统并不解决交易的公平性问题,但对于通常的支付系统,比如在线购买音乐等,购买的顺序并不会对结果有影响,只要合规的交易都能正常上链。并且有一类可延迟选择优先的公平性问题,类公有链应用系统也是可以解决的。The user terminal C of the A system needs to pass the transaction data from A to S, and C obtains the transaction data from S. The above-mentioned system S, system A (private chain or consortium chain system), and the client C of system A can be regarded as a kind of public chain application system. Anyone can read, verify transactions, and participate in consensus. This refers to reading the data of the S chain, and the client C also synchronizes the block header data of the S chain. According to the above, the consistent performance of the block header guarantees the consistency of the system state, and the synchronization of the S-chain block header of all clients can ensure that the state of all clients and the system S are consistent. And the user only needs to obtain the user master key from the A system (the key does not belong to the chain data), and can retrieve the account data on its own in the structured peer-to-peer network (or S-chain) on the user side, and third-party users and supervisors The user can also retrieve the key after being authorized, and the process does not rely on the A system or other centralized systems. Therefore, the public chain-like application system is verifiable, traceable, and non-tamperable. However, because the user’s transaction data first needs to go through A before it can be chained in S, the public chain-like application system does not solve the fairness of the transaction. However, for the usual payment systems, such as online music purchases, the order of purchase is not It will affect the result, as long as the compliant transaction can be normally connected to the chain. And there is a kind of fairness problem that can delay the selection priority, which can also be solved by a public chain-like application system.
可延迟选择优先与时间优先不同,是通过生成可证公平随机数,然后根据该随机数决定优先权的方式,因为是任何人都能够参与,所以是公平的。比如一个彩票系统,购买人支付一定的金额并预留一个随机数以及领奖地址,然后系统S通过共识者对象生成一个可证公平随机数,比如可以使用先提交再披露的方案(Commit Reveal),并且为避免块保留攻击,可以终止提交后先经过若干个区块确认,再延迟披露相关参数,确保生成的随机数事先无人知晓,并且无法被篡改。公布该随机数后,根据每个人预留的随机数与该随机数的相关程度来判断获奖情况,再通过领奖地址领取奖励。系统A可以根据公布的随机数,调用相关合约,给中奖的用户颁发奖励。该奖励会绑定中奖的相关合约信息,包括引用开奖信息、引用用户预留的随机数和领奖地址,以及中奖的明文数额,生成相应密文数额的奖励到领奖地址,然后从发行彩票的实名机构账户中减去相应的明文数额,以保证系统内token总数额没有发生变化。所以可延迟选择优先,是系统S生成一个可证公平随机数,延迟若干个区块公开,系统A通过该随机数来决定优先权,以解决此类问题的公 平性。Delayable selection priority is different from time priority. It is a method of generating a provably fair random number and then determining the priority based on the random number. Because anyone can participate, it is fair. For example, in a lottery system, the purchaser pays a certain amount and reserves a random number and the prize-receiving address, and then the system S generates a provably fair random number through the consensus object. For example, the scheme of submitting and then disclosing can be used (Commit Reveal) , And to avoid block retention attacks, you can terminate the submission and go through several block confirmations, and then delay the disclosure of related parameters to ensure that the generated random number is unknown in advance and cannot be tampered with. After the random number is announced, the award will be judged according to the degree of correlation between the random number reserved by each person and the random number, and then the award can be received through the award address. System A can call related contracts based on the published random number to award rewards to the winning users. The reward will be bound to the relevant contract information of the winning, including quoting the lottery information, quoting the random number reserved by the user and the prize-collecting address, and the amount of the clear text of the prize, generating the corresponding ciphertext amount of the reward to the prize-collecting address, and then from issuing the lottery The corresponding plaintext amount is subtracted from the real-name institution account to ensure that the total amount of tokens in the system has not changed. Therefore, the delayable selection priority is that the system S generates a provably fair random number and delays the disclosure of several blocks, and the system A uses the random number to determine the priority to solve the fairness of such problems.
下面介绍系统的架构,系统是由三层二链架构组成,如图10所示。The following describes the architecture of the system. The system is composed of a three-layer two-chain architecture, as shown in Figure 10.
第一层也是第一链系统,可以是私有链或联盟链,属于中心化的系统(例如上述系统A),可以采用私有网络以及PBFT(Practical Byzantine Fault Tolerance,实用拜占庭容错算法)等共识算法,以满足快速确认和高频交易的需求,由具有实名的主体对象负责,是系统的管理者。包括以下管理的一种或多种:用户和机构的管理、token的发行或回收、用户主密钥的颁发和系统公告等,主要通过发布控制数据实现系统管理,然后写入第一链中。用户端的交易数据通过管理端验证后写入第一链中,第一链生成的区块数据会立即向第二层广播,也可以立即向第三层广播。因为管理端具有所有的用户主密钥,所以管理端能生成系统的状态树,管理端查询和修改用户账户状态等操作是通过系统的状态树实现的,然后转换为底层的UTXO交易数据或控制数据。管理端会验证用户端的交易数据,并且会验证相关的用户身份信息。每个交易数据或控制数据都会被分别赋予顺序递增的唯一序号,连同交易数据或控制数据一起经过管理端的背书签名。第一链的区块头数据中会包含当前的累计交易数量和累计控制数量,并且区块头数据会经过管理端的签名。The first layer is also the first chain system. It can be a private chain or a consortium chain. It belongs to a centralized system (such as the above system A). It can use a private network and PBFT (Practical Byzantine Fault Tolerance) and other consensus algorithms. In order to meet the needs of fast confirmation and high-frequency trading, the main object with a real name is responsible for the system's administrator. Including one or more of the following management: management of users and institutions, issuance or recovery of tokens, issuance of user master keys and system announcements, etc. The system is managed mainly by issuing control data, and then written into the first chain. The transaction data on the user side is verified by the management side and written into the first chain. The block data generated by the first chain will be broadcast to the second layer or the third layer immediately. Because the management terminal has all the user master keys, the management terminal can generate the state tree of the system, and operations such as querying and modifying the user account status of the management terminal are realized through the state tree of the system, and then converted to the underlying UTXO transaction data or control data. The management terminal will verify the transaction data on the client side, and will verify the relevant user identity information. Each transaction data or control data will be assigned a unique serial number that increases sequentially, and the transaction data or control data will be endorsed and signed by the management terminal together with the transaction data or control data. The block header data of the first chain will contain the current cumulative transaction quantity and cumulative control quantity, and the block header data will be signed by the management terminal.
第二层也是第二链系统,是类公有链(上述系统S),采用非结构化对等网络,比如可以使用gossip网络协议,可以采用共识时间较长的算法。第二层会对第一链的区块数据进行验证,但由于第二层并没有用户主密钥,所以只会验证交易数据,而不会验证相关的用户身份信息,也不会生成系统的状态树。根据上文可知,系统采用UTXO模型,并且任何人都可以在密文情况下验证交易数额的正确性。第二链的区块数据是由第一链的一个或多个区块数据顺序组成,第一链上任一账户的状态与第二链上所述账户的状态一致,所以系统是异步同态的。因为第二链的区块数据可能是由多个第一链的区块数据顺序组成,第一链区块体的账本数据需要重新顺序组成第二链区块体的账本数据,包括交易数据和控制数据,然后分别重新生成默克尔树的根哈希值记录在第二链的区块头中,第二链的区块头也会包含当前的累计交易数量和累计控制数量。因为第二链区块体的账本数据重新顺序组成,所以也是满足已知默克尔树的叶子节点数量和节点序号,对应的认证路径的高度和方向 是固定且已知的。第二链还可以包含扩展数据,该数据可以是第二链系统自身的状态数据,并不会修改用户的状态,第三层也不会同步和读取该数据。比如该数据可以是第二链的投票过程或者是生成可证公平随机数的过程等,也可以是第二链投票选取链生成节点的过程,还可以是用于存证的数据,该扩展数据只会由第一层和第二层读取,并且可能会对第一链或第二链后续产生的区块产生影响。第一链的区块头数据也可记录在第二链的扩展数据中,并不会影响用户状态,而是作为存证的数据。第二链生成的区块数据会向第三层广播,广播的数据是第二链的区块头数据、交易数据和控制数据以及对应的认证路径数据等。The second layer is also the second chain system, which is similar to the public chain (the above system S), and uses an unstructured peer-to-peer network, such as the gossip network protocol, and the algorithm with a longer consensus time. The second layer will verify the block data of the first chain, but because the second layer does not have a user master key, it will only verify transaction data, but will not verify related user identity information, and will not generate system information. State tree. According to the above, the system adopts the UTXO model, and anyone can verify the correctness of the transaction amount in ciphertext. The block data of the second chain is composed of one or more block data sequences of the first chain. The state of any account on the first chain is consistent with the state of the account on the second chain, so the system is asynchronous and homomorphic . Because the block data of the second chain may be composed of multiple block data sequences of the first chain, the ledger data of the first chain block body needs to be reordered to form the ledger data of the second chain block body, including transaction data and Control the data, and then regenerate the root hash value of the Merkel tree and record it in the block header of the second chain. The block header of the second chain will also contain the current cumulative transaction number and cumulative control number. Because the ledger data of the second chain block body is recomposed in order, it also satisfies the number of leaf nodes and node serial numbers of the known Merkel tree, and the height and direction of the corresponding authentication path are fixed and known. The second chain may also contain extended data, which may be the state data of the second chain system itself, and will not modify the user's state, and the third layer will not synchronize and read the data. For example, the data can be the voting process of the second chain or the process of generating provably fair random numbers, etc., it can also be the process of the second chain voting to select chain generation nodes, or it can be the data used for attestation. The extended data It will only be read by the first and second layers, and may affect the subsequent blocks generated by the first chain or the second chain. The block header data of the first chain can also be recorded in the extended data of the second chain, which will not affect the user status, but is used as evidence data. The block data generated by the second chain will be broadcast to the third layer. The broadcast data is the block header data, transaction data, control data, and corresponding authentication path data of the second chain.
第三层是用户端系统,采用结构化对等网络,比如可以使用kademlia网络协议,通过分布式哈希表(DHT)检索数据,每个用户端节点(以下简称节点)只需要存储部分账本数据以及对应的认证路径。根据上文可知,第三层通过等价验证,每个节点验证自己的部分账本数据,即可等价验证全部的账本数据,再结合每个节点独立随机选取账本数据进行验证,避免某个地址只被特定节点验证,增加了安全性。第三层的每个节点都会同步第二层的区块头数据,所以第三层与第二层系统状态是一致性的。用户端、第三方用户和监管者的读取操作可以是在第二层或第三层,用户端交易数据的写入操作则是通过管理端在第一层上链,所以系统是读写分离的。并且第一链可以立即向第三层广播,所以用户端的交易数据是能及时获取的,但此时的交易数据是没有上第二链的,只是上了第一链。如果是小额交易,用户端可以立即信任管理端发布的数据;但如果交易数额较大,用户端可以等待一段时间,等该交易数据在第二链上链,并经过n个区块确认,就可以认为该交易数据不可逆且无法被篡改了。The third layer is the user-side system, which uses a structured peer-to-peer network. For example, you can use the kademlia network protocol to retrieve data through a distributed hash table (DHT). Each user-side node (hereinafter referred to as node) only needs to store part of the ledger data And the corresponding certification path. According to the above, the third layer passes equivalent verification. Each node verifies part of its own book data, which can equivalently verify all the book data, and then combines each node to independently and randomly select the book data for verification, avoiding a certain address Only verified by specific nodes, which increases security. Each node in the third layer will synchronize the block header data of the second layer, so the third layer and the second layer system state are consistent. The read operations of the user, third-party users, and regulators can be in the second or third layer, and the write operations of transaction data on the user end are linked to the first layer through the management end, so the system is read and write separated of. And the first chain can broadcast to the third layer immediately, so the transaction data on the user side can be obtained in time, but the transaction data at this time is not on the second chain, but on the first chain. If it is a small transaction, the client can immediately trust the data released by the management terminal; but if the transaction amount is large, the client can wait for a period of time until the transaction data is on the second chain and confirmed by n blocks. It can be considered that the transaction data is irreversible and cannot be tampered with.
由于第二层系统和第三层系统状态是一致性的,并且第三层通过等价验证对全部的账本数据进行了验证,所以第二层系统可以选择只验证第一链的区块头数据、账本数据的默克尔树和账本数据的管理端签名,然后将数据上链生成第二链的区块数据,并向第三层广播,由第三层验证UTXO链的连接是否正确,以及验证每个交易数据里的用户端解锁签名和交易数额是否正确。因为第三层的每个节点只需要验证少量账本数据,所以即使用户端使用多重 签名的方式,并且需要验证密文交易数额是否正确,每个节点的负担都较少,即使是移动设备也能够完成验证。而第二层验证管理端的签名,还可以使用优化的批量验证单个签名者生成的多个签名,大大降低了参与第二层共识所需要验证的计算量。并且根据默克尔树的特点,第二层的链生成节点可以将第一层产生的账本数据,顺序分散到多个物理设备上,将这些物理设备上的账本数据联合生成默克尔树的根哈希值,也即可以通过多个物理设备完成一个含有非常多账本数据的巨大区块体数据的生成和验证,并且存储也可以分散到多个物理设备上。不同于第三层使用分布式哈希表存储的方式,该方式属于线性划分存储,也即把一个巨大区块体数据,根据默克尔树的特点,某个父节点对应的叶子节点数是2的幂次方,所以把数据按2的幂次方个线性划分到多个物理设备上进行存储,然后可以联合生成对应的默克尔树根哈希值,并且还可以生成账本数据对应的认证路径。所以第二层的链生成节点,只需要多个普通的物理设备和存储设备,并且验证的计算量也可控,实际参与共识生成区块头的设备也只需要普通设备即可,大大降低了参与第二层共识的门槛。Since the state of the second layer system and the third layer system are consistent, and the third layer verifies all the ledger data through equivalent verification, the second layer system can choose to verify only the block header data of the first chain, The Merkel tree of the ledger data and the management end of the ledger data are signed, and then the data is uploaded to the chain to generate the block data of the second chain and broadcast to the third layer. The third layer verifies whether the UTXO chain is connected correctly and verifies it Whether the client unlocking signature and transaction amount in each transaction data are correct. Because each node in the third layer only needs to verify a small amount of ledger data, even if the client uses a multi-signature method and needs to verify whether the ciphertext transaction amount is correct, each node has less burden, even mobile devices can Complete verification. The second layer verifies the signature of the management end, and can also use optimized batch verification of multiple signatures generated by a single signer, which greatly reduces the amount of verification required to participate in the second layer consensus. And according to the characteristics of the Merkel tree, the chain generation node of the second layer can sequentially distribute the ledger data generated by the first layer to multiple physical devices, and combine the ledger data on these physical devices to generate the Merkel tree. The root hash value, that is, the generation and verification of a huge block data containing a lot of ledger data can be completed through multiple physical devices, and the storage can also be distributed to multiple physical devices. Different from the third layer using distributed hash table storage, this method belongs to linear partition storage, that is, to store a huge block of data, according to the characteristics of the Merkel tree, the number of leaf nodes corresponding to a parent node is Power of 2, so the data is linearly divided into multiple physical devices for storage according to the power of 2, and then the corresponding Merkel tree root hash value can be jointly generated, and the corresponding ledger data can also be generated Certification path. Therefore, the chain generation node of the second layer only needs multiple ordinary physical devices and storage devices, and the amount of verification calculation is also controllable. The devices that actually participate in the consensus generation block header also only need ordinary devices, which greatly reduces participation. The threshold of the second layer of consensus.
上述方式使用了先生成后验证的方式,也即先生成第二链,再由第三层进行验证的方式,因为实际的账本数据是由第一层系统上链的,第二层会验证默克尔树和管理端的签名,并不会修改账本数据。所以如果第三层验证账本数据错误,并且经过管理端的签名(后面还需第二层验证是否为第一链的数据),责任人是第一层系统,并且第一层是具有实名的管理端,可由监管者进行相应处理。因为第一层是中心化的系统,如果产生了非法的账本数据,第二层和第三层也是无法阻止的,但可以立即验证出来,然后采取相应的措施。比如第三层将非法的账本数据由第二层写入类公有链扩展数据的存证数据中,而第一层系统也是无法修改第二链的数据,并且该数据是公开的任何人都可以访问,就可以由监管者进行相应处理。所以该系统虽然无法保证上链片段所处时间段内的数据一定正确(因为该数据由中心化生成),但却可以保证错误的数据无所遁形(由第二层或第三层验证)。由第二链上链且经过n个区块确认的数据是正确的,并且是无法篡改的,所以是可信任的。而第一层系统也是采用私有链或联盟链,减少和防止数据出错的可能性。并且 根据上述可知,不允许第一链产生分叉,第一链可以采用PBFT等共识算法防止分叉。如果第一链产生分叉,第二层系统能检测出来并写入类公有链扩展数据的存证数据中,由监管者进行相应处理。The above method uses the first generation and then verification method, that is, the second chain is generated first, and then the third layer is verified, because the actual ledger data is uploaded by the first layer system, and the second layer will verify the default The Kerr tree and the signature of the management terminal will not modify the ledger data. Therefore, if the third-level verification ledger data is wrong and it is signed by the management end (the second layer is required to verify whether it is the data of the first chain), the responsible person is the first-level system, and the first-level is the management end with a real name , Which can be dealt with by the supervisor. Because the first layer is a centralized system, if illegal ledger data is generated, the second and third layers cannot be prevented, but they can be verified immediately, and then corresponding measures can be taken. For example, the third layer writes illegal ledger data from the second layer into the certificate data of the extended data of the class public chain, and the first layer system cannot modify the data of the second chain, and anyone whose data is public can Access can be handled by the supervisor. Therefore, although the system cannot guarantee that the data in the time period of the upper chain segment must be correct (because the data is generated by the centralization), it can guarantee that the wrong data is not hidden (verified by the second or third layer) . The data on the second chain and confirmed by n blocks is correct and cannot be tampered with, so it is trustworthy. The first-tier system also uses private chains or alliance chains to reduce and prevent the possibility of data errors. And based on the above, the first chain is not allowed to fork, and the first chain can use consensus algorithms such as PBFT to prevent forks. If the first chain has a fork, the second layer system can detect and write it into the certificate data of the extended data of the public chain, and the supervisor will handle it accordingly.
第一层的管理端系统也可以通过连接存储的方式优化处理需要验证和存储的海量数据。比如可以使用一致性哈希算法,根据交易地址和交易ID,将交易数据分散到多个共识组中,然后再通过属性分组的PBFT(实用拜占庭容错算法)共识算法,生成第一链的区块头数据。The first-tier management system can also optimize the processing of massive data that needs to be verified and stored by connecting to storage. For example, a consistent hash algorithm can be used to disperse transaction data into multiple consensus groups based on transaction addresses and transaction IDs, and then use the attribute grouped PBFT (Practical Byzantine Fault Tolerance Algorithm) consensus algorithm to generate the block header of the first chain data.
PBFT算法是一种状态机副本复制算法。将所有的副本组成的集合的数量设为N,假设失效的副本数量是F,则需要N>3F。每个节点具有一个状态机副本,所以PBFT算法可以容忍小于N/3个无效或者恶意的节点。但PBFT的缺点是具有O(N^2)的消息复杂度,所以通常N不会很大。The PBFT algorithm is a state machine copy replication algorithm. Set the number of sets composed of all copies to N, assuming that the number of invalid copies is F, then N>3F is required. Each node has a copy of the state machine, so the PBFT algorithm can tolerate less than N/3 invalid or malicious nodes. But the disadvantage of PBFT is that it has O(N^2) message complexity, so usually N is not very large.
属性分组的PBFT共识算法,是使用一致性哈希算法,根据数据的属性,将数据分散到多个共识组中,只需要在其中的某一组中进行状态机副本复制。比如将N分为M个共识组,每个共识组中有n个节点,也即N=M*n,并将这些共识组设为1到M序号。The attribute grouping PBFT consensus algorithm uses a consistent hashing algorithm. According to the attributes of the data, the data is distributed to multiple consensus groups, and only a copy of the state machine is required in one of the groups. For example, divide N into M consensus groups, and each consensus group has n nodes, that is, N=M*n, and set these consensus groups as serial numbers from 1 to M.
产生区块之前,使用一致性哈希算法将交易数据的每个输入地址都映射到1到M中的一个,将交易ID也即交易数据的哈希值也映射到1到M中的一个,然后将交易数据存储到所映射的共识组中,根据上文可知,输入地址对应的是连接存储的输出数据。产生区块之后,也即数据上链后,再用同样方式将交易数据的每个输出地址都映射到1到M中的一个,并且包括上链的控制数据中的token发行地址和奖励地址,然后将相应的上链数据存储在所映射的共识组中。根据上文可知,输出地址对应的是连接存储的输入数据,所以共识组存储的连接存储的输入数据是上链后的数据,共识组可以通过默克尔树验证该数据。Before generating the block, use the consistent hash algorithm to map each input address of the transaction data to one of 1 to M, and map the transaction ID, that is, the hash value of the transaction data, to one of 1 to M. Then the transaction data is stored in the mapped consensus group. According to the above, the input address corresponds to the output data stored in the connection. After the block is generated, that is, after the data is on the chain, each output address of the transaction data is mapped to one of 1 to M in the same way, and the token issuance address and the reward address in the control data on the chain are included. Then the corresponding on-chain data is stored in the mapped consensus group. According to the above, the output address corresponds to the input data stored in the connection, so the input data stored in the connection storage in the consensus group is the data after the chain, and the consensus group can verify the data through the Merkel tree.
如果共识组存储对应的是输入数据,则存储即可;如果共识组存储对应的是输出数据,则需要查找对应的输入数据,并且验证输入输出的正确性,然后形成连接存储;如果共识组存储对应的是交易ID,则需要根据交易数据所有的输入引用地址,向地址对应的共识组发起PBFT共识验证。可以知道这些地址对应的共识组如果验证通过,则会形成连接存储,返回验证成功, 如果验证未通过则返回验证失败。根据上文可知,当每个地址返回验证成功的数量都大于n*2/3时,则该交易数据验证通过,可以上链。所以交易数据是由交易ID对应的共识组发起验证和上链的,并且因为交易ID是唯一的,所以不会重复上链。为优化验证交易数额所需的附加验证数据,交易数额可以由交易ID对应的共识组验证,输入引用地址对应的共识组只需要验证连接是否正确,以及用户端解锁签名是否有效,并返回交易数额数据,并不需要附加验证数据。If the consensus group storage corresponds to input data, then just store it; if the consensus group storage corresponds to output data, you need to find the corresponding input data, and verify the correctness of the input and output, and then form a connected storage; if the consensus group stores Corresponding to the transaction ID, it is necessary to initiate PBFT consensus verification to the consensus group corresponding to the address based on all the input reference addresses of the transaction data. It can be known that if the consensus group corresponding to these addresses passes the verification, it will form a connection storage and return the verification success, and if the verification fails, the verification failure will be returned. According to the above, when the number of successful verifications returned by each address is greater than n*2/3, the transaction data is verified and can be uploaded to the chain. Therefore, the transaction data is verified and chained by the consensus group corresponding to the transaction ID, and because the transaction ID is unique, it will not be repeated on the chain. In order to optimize the additional verification data required to verify the transaction amount, the transaction amount can be verified by the consensus group corresponding to the transaction ID. Entering the consensus group corresponding to the reference address only needs to verify whether the connection is correct and the unlocking signature of the client is valid, and the transaction amount is returned Data, no additional verification data is required.
一时间片段后,每个共识组独立发起PBFT共识上链,由每个共识组分别独立共识出自己的上链集合的交易数据以及顺序。然后由1号共识组将自己的上链集合数量加上累计数量,向2号共识组发出累加后的数量消息;然后由2号共识组将自己的上链集合数量加上累计数量,向3号共识组发出累加后的数量消息;直到最后的共识组M,M再向1号共识组发出累加后的数量消息;当1号共识组收到累计数量消息后,则完成一次循环作业,将循环内的交易数据联合上链。每个共识组根据累计数量计算出起始序号,然后将上链集合的交易数据以及对应顺序赋予递增的序号并请求签名(例如n个节点,则需要大于n*2/3的请求才给予签名),最后将签名后的数据联合生成默克尔树的根哈希值。因为是独立共识上链,所以每个共识组可以接收到数量消息后再进行共识上链,通过消息传递完成循环作业。共识组可以独立共识上链的原因,是因为连接存储的输入数据是上链后的数据,所以同一时间片段内,不会出现两个之间相引用的合法交易。After a period of time, each consensus group independently initiated the PBFT consensus on the chain, and each consensus group independently agreed on the transaction data and sequence of its own on-chain set. Then the consensus group No. 1 adds its own on-chain collection quantity to the cumulative quantity, and sends the cumulative quantity message to the consensus group No. 2; then, the consensus group No. 2 adds its own on-chain collection quantity to the cumulative quantity to 3 Consensus group No. sends out the accumulated quantity message; until the last consensus group M, M sends the accumulated quantity message to consensus group No. 1; when consensus group No. 1 receives the accumulated quantity message, it completes a cycle operation, and The transaction data in the loop is combined on the chain. Each consensus group calculates the starting sequence number based on the cumulative number, and then assigns the transaction data and the corresponding order of the on-chain collection to an increasing sequence number and requests a signature (for example, if there are n nodes, a request greater than n*2/3 is required to give a signature ), and finally combine the signed data to generate the root hash value of the Merkel tree. Because it is an independent consensus on the chain, each consensus group can receive a number of messages and then carry out the consensus on the chain, and complete the circular operation through message transmission. The reason why the consensus group can independently agree on the chain is because the input data stored in the connection is the data after the chain, so in the same time segment, there will be no legal transactions quoted between the two.
因此可知,属性分组的PBFT共识算法消息复杂度是O(n^2),可以容忍小于n/3个无效或者恶意的节点。但由于是有M个分组,交易数据也是分散到M个分组中,所以最后能处理的交易数据的数量就能得到较大提高。Therefore, it can be seen that the message complexity of the attribute grouping PBFT consensus algorithm is O(n^2), which can tolerate less than n/3 invalid or malicious nodes. However, since there are M groups, the transaction data is also dispersed into M groups, so the final amount of transaction data that can be processed can be greatly increased.
系统的控制数据不是UTXO链,产生时即可赋予递增的序号并进行签名,然后根据序号线性划分存储和验证,也可以联合生成控制数据的默克尔树根哈希值。最后根据交易数据的根哈希值和控制数据的根哈希值,以及相应的累计数量生成第一链的区块头数据。所以第一链的管理端系统是可以通过连接存储的方式优化处理海量的数据。The control data of the system is not a UTXO chain. When it is generated, an incremental serial number can be assigned and signed, and then stored and verified linearly according to the serial number, or the Merkel tree root hash value of the control data can be jointly generated. Finally, the block header data of the first chain is generated according to the root hash value of the transaction data and the root hash value of the control data, and the corresponding cumulative number. Therefore, the management system of the first chain can optimize the processing of massive amounts of data by connecting storage.
根据上述可知,第三层用户端存储的数据,包括区块头数据、账本数据 以及对应的认证路径数据。账本数据实际是由第一层的管理端生成,区块头数据是由第二层共识生成,并且区块头数据也能映射区块体数据(账本数据)的一致性,而且区块头数据还能确认对应的认证路径,所以区块头数据的正确同步对于系统的正确性非常重要。但第三层用户端并不参与第二层的共识,如果第二层的类公有链系统采用POA(权威证明)等共识算法,或者是抵押惩罚的共识算法,需要第三层用户端能够正确同步共识者列表,这会增加用户端的负担。因为第二链是在经过验证第一链区块头的基础上生成的,所以第三层用户端可以在信任第一链区块头的基础上对第二链的区块头进行验证。以采用抵押惩罚的共识算法为例进行说明。第二层的共识对象可以是匿名的,可以使用第三方公有链(除第一链系统和第二链系统之外的第三方公有链系统)的抵押资产的方式参与共识,如果产生了非法的数据,则会扣除所抵押的资产,下面进行说明。According to the above, the data stored on the third-tier client terminal includes block header data, ledger data, and corresponding authentication path data. The ledger data is actually generated by the management end of the first layer, the block header data is generated by the second layer consensus, and the block header data can also map the consistency of the block body data (ledger data), and the block header data can also be confirmed Corresponding authentication path, so the correct synchronization of the block header data is very important to the correctness of the system. However, the third-tier client does not participate in the second-tier consensus. If the second-tier public chain system adopts consensus algorithms such as POA (Proof of Authority) or a consensus algorithm for mortgage punishment, the third-tier client needs to be correct Synchronize the list of consensus participants, which will increase the burden on the user side. Because the second chain is generated on the basis of verifying the block header of the first chain, the third-layer client can verify the block header of the second chain on the basis of trusting the block header of the first chain. Take the consensus algorithm using mortgage penalty as an example. The consensus object of the second layer can be anonymous, and can use the third-party public chain (a third-party public chain system other than the first chain system and the second chain system) to participate in the consensus. Data, the mortgaged assets will be deducted, as explained below.
首先第一层的管理端需要在第三方的公有链上建立一个智能合约。该合约的功能是任何用户均可上传共识公钥(共识公钥是由用户自己产生的一非对称密钥,可用于参与第二层的共识),一个共识公钥需抵押第三方公有链上一定数额的token,所抵押的token与该上传的共识公钥关联,合约会将当前上传的所有共识公钥组成的共识公钥集合映射为一个值,该共识公钥集合和映射方法都是公开的,能很容易找到集合中元素存在集合中的证明,但很难找到一个不在集合中元素存在集合中的证明,比如可以使用默克尔树证明或累加器证明。其中一个密码学上的累加器是一个单向的隶属函数,它可以用于识别一个候选是否为一个集合的成员,且不会在过程中暴露集合中的成员。第一链产生的区块头中包含当前该共识公钥集合映射的值,还可以包含共识公钥集合中元素的数量,并且一个密钥代表一个固定的权益,即为一密钥一票。第二链产生的区块头数据,会连同第一链对应的最后一个区块头数据对第三层广播。第二链区块头包含当前所有的累计交易数量和累计控制数量,以及对应的共识公钥,第二链区块头数据经过共识私钥的签名。第三层的用户端同步第二链的区块头数据,可根据共识公钥验证该共识私钥的签名,验证第一链区块头的管理端签名,验证第一链区块头的累计交易数量和累计控制数量与第二链区块头的累计交易数量和累计控制数量是否相等,相等则 说明数量正确并且第一链区块头是第二链区块头产生时间片段内的最后一个区块头数据,所以第一链区块头中的共识公钥集合的映射值是该时间片段内最新的。用户端还可以根据第一链区块头中的共识公钥集合的映射值采用默克尔树证明或累加器证明,验证第二链区块头中的共识公钥是否有效,验证通过则说明第二链区块头有效,可以加入候选主链的区块头。这样用户端就能通过信任第一链区块头的基础上对第二链的区块头进行验证,而无需同步第二链的共识者列表,并且可以通过第一链区块头的累计交易数量和累计控制数量验证第二链区块头的累计交易数量和累计控制数量是否正确,以保证能正确同步第二链的区块头数据。First, the management side of the first layer needs to establish a smart contract on the third-party public chain. The function of the contract is that any user can upload the consensus public key (the consensus public key is an asymmetric key generated by the user and can be used to participate in the second-level consensus), and a consensus public key needs to be mortgaged on the third-party public chain A certain amount of token, the mortgaged token is associated with the uploaded consensus public key. The contract will map the consensus public key set composed of all the currently uploaded consensus public keys to a value. The consensus public key set and the mapping method are both public Yes, it is easy to find the proof that the elements in the set exist in the set, but it is difficult to find a proof that the elements in the set do not exist in the set. For example, you can use Merkel tree proof or accumulator proof. One of the cryptographic accumulators is a one-way membership function, which can be used to identify whether a candidate is a member of a set without exposing the members of the set in the process. The block header generated by the first chain contains the value of the current consensus public key set mapping, and can also contain the number of elements in the consensus public key set, and a key represents a fixed equity, that is, one key and one vote. The block header data generated by the second chain will be broadcast to the third layer along with the last block header data corresponding to the first chain. The second chain block header contains all the current cumulative transaction quantity and cumulative control quantity, and the corresponding consensus public key. The second chain block header data is signed by the consensus private key. The third-tier client side synchronizes the block header data of the second chain, can verify the signature of the consensus private key according to the consensus public key, verify the signature of the management end of the first chain block header, and verify the cumulative transaction number of the first chain block header. Whether the cumulative control quantity is equal to the cumulative transaction quantity and the cumulative control quantity of the second chain block header, if they are equal, the quantity is correct and the first chain block header is the last block header data in the second chain block header generation time segment, so the first The mapping value of the consensus public key set in the block header of a chain is the latest in the time segment. The user side can also use Merkel tree proof or accumulator proof according to the mapping value of the consensus public key set in the first chain block header to verify whether the consensus public key in the second chain block header is valid. If the verification is passed, it means the second The chain block header is valid and can be added to the block header of the candidate main chain. In this way, the user end can verify the block header of the second chain by trusting the block header of the first chain, without synchronizing the consensus list of the second chain, and can pass the cumulative number of transactions and accumulation of the block header of the first chain The control quantity verifies whether the cumulative transaction quantity and the cumulative control quantity of the second chain block header are correct, so as to ensure that the block header data of the second chain can be synchronized correctly.
第二层的类公有链系统,也可以采用POA等共识算法,这样可以不依赖第三方的公有链,但需要参与的共识者对象提供身份证明。第一链区块头也可以包含POA共识算法的验证者列表的映射值和验证者的数量,以方便用户端能正确同步第二链的区块头数据。The second-level public chain-like system can also use consensus algorithms such as POA, so that it does not rely on third-party public chains, but the participating consensus objects need to provide identity certification. The first chain block header may also include the mapping value of the validator list of the POA consensus algorithm and the number of validators, so that the user terminal can correctly synchronize the block header data of the second chain.
如果第一链区块头没有按照规则包含正确的共识者公钥集合的映射值,因为该共识者公钥集合的映射值是在第三方公有链的合约中或第二层类公钥链的扩展数据中存储的,都是公开且无法被篡改的。第二层系统可以将第一链的不合规区块头数据写入类公有链扩展数据的存证数据中,由监管者进行相应处理。If the first chain block header does not contain the correct mapping value of the consensus public key set according to the rules, because the mapping value of the consensus public key set is in the contract of the third-party public chain or the extension of the second-level public key chain What is stored in the data is public and cannot be tampered with. The second layer system can write the non-compliant block header data of the first chain into the certificate data of the extended data of the similar public chain, and the supervisor will handle it accordingly.
所以本系统分别使用区块链实现账本数据可溯源、不可篡改,UTXO链实现交易数据的正确连接,确保系统的token总量是一定的,账户数据链实现用户账户数据的隐私检索。并且通过等价验证,使用户端通过结构化对等网络存储和验证部分账本数据,即可等价验证全部账本数据的正确性。Therefore, the system uses the blockchain to realize the traceability and non-tampering of the ledger data. The UTXO chain realizes the correct connection of transaction data to ensure that the total number of tokens in the system is certain. The account data chain realizes the privacy retrieval of user account data. And through equivalence verification, the user terminal can store and verify part of the ledger data through a structured peer-to-peer network, and the correctness of all ledger data can be equivalently verified.
本公开一示例性实施例还提供一种计算机存储介质,所述计算机存储介质存储有计算机程序;所述计算机程序被执行后,能够实现前述一个或多个示例性实施例提供的方法,例如,执行如图1、图3、图5及图7所示方法中的一个或多个。所述计算机存储介质包括在设置为存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、 ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以设置为存储期望的信息并且可以被计算机访问的任何其他的介质。An exemplary embodiment of the present disclosure further provides a computer storage medium that stores a computer program; after the computer program is executed, the method provided by one or more of the foregoing exemplary embodiments can be implemented, for example, Perform one or more of the methods shown in Figure 1, Figure 3, Figure 5, and Figure 7. The computer storage medium includes volatile and nonvolatile, removable and non-removable implemented in any method or technology configured to store information (such as computer-readable instructions, data structures, program modules, or other data) In addition to the medium. 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 cassette, tape, magnetic disk storage or other magnetic storage device, or Set up as any other medium that stores the desired information and can be accessed by the computer.
本公开一示例性实施例还提供了一种计算机装置(或称计算机设备)。所述计算机设备可包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现本公开中数据存储装置或数据验证装置所执行的操作。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 on the memory and capable of running on the processor. The processor implements the data storage device or data verification in the present disclosure when the computer program is executed. The operation performed by the device.
如图11所示,在一个示例中,计算机设备(节点)可包括:处理器91、存储器92、总线系统93和收发器94,其中,该处理器91、该存储器92和该收发器94通过该总线系统93相连,该存储器92设置为存储指令,该处理器91设置为执行该存储器92存储的指令,以控制该收发器94发送信号。例如上述数据存储装置中第二存储模块的操作可由收发器在处理器的控制下执行,第一验证模块的操作可由处理器执行。As shown in FIG. 11, in an example, a computer device (node) may include: a processor 91, a memory 92, a bus system 93, and a transceiver 94, where the processor 91, the memory 92, and the transceiver 94 pass through The bus system 93 is connected, the memory 92 is configured to store instructions, and the processor 91 is configured to execute the instructions stored in the memory 92 to control the transceiver 94 to send signals. For example, the operation of the second storage module in the aforementioned data storage device may be executed by the transceiver under the control of the processor, and the operation of the first verification module may be executed by the processor.
应理解,处理器91可以是中央处理单元(Central Processing Unit,简称为“CPU”),处理器91还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that the processor 91 may be a central processing unit (Central Processing Unit, referred to as “CPU” for short), and the processor 91 may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), or off-the-shelf processors. Programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
存储器92可以包括只读存储器和随机存取存储器,并向处理器91提供指令和数据。存储器92的一部分还可以包括非易失性随机存取存储器。例如,存储器92还可以存储设备类型的信息。The memory 92 may include a read-only memory and a random access memory, and provides instructions and data to the processor 91. A part of the memory 92 may also include a non-volatile random access memory. For example, the memory 92 may also store device type information.
总线系统93除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图11中将所有总线都标为总线系统93。In addition to the data bus, the bus system 93 may also include a power bus, a control bus, a status signal bus, and the like. However, for clear description, all buses are marked as the bus system 93 in FIG. 11.
在实现过程中,该计算机设备所执行的处理可以通过处理器91中的硬件的集成逻辑电路或者软件形式的指令完成。即本公开实施例所公开的方法的步骤可以体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等存储介质中。该存储介质位 于存储器92,处理器91读取存储器92中的信息,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。In the implementation process, the processing performed by the computer device may be completed by an integrated logic circuit of hardware in the processor 91 or instructions in the form of software. That is, the steps of the method disclosed in the embodiments of the present disclosure may be embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor. The software module can be located in storage media such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers, etc. The storage medium is located in the memory 92, and the processor 91 reads the information in the memory 92 and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在设置为存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以设置为存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。A person of ordinary skill in the art can understand that all or some of the steps, functional modules/units in the system, and apparatus in the methods disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. In the hardware implementation, the division between 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 consist of several physical components. The components are executed cooperatively. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, and the computer-readable medium may include a computer storage medium (or a non-transitory medium) and a communication medium (or a transitory medium). As is well known by those of ordinary skill in the art, the term computer storage medium includes volatile and nonvolatile implementations in any method or technology configured to store information (such as computer-readable instructions, data structures, program modules, or other data). Sexual, removable and non-removable media. Computer storage media include but are not limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or Set up as any other medium that stores the desired information and can be accessed by the computer. In addition, as is well known to those of ordinary skill in the art, communication media usually contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as carrier waves or other transmission mechanisms, and may include any information delivery media. .
本领域的普通技术人员应当理解,可以对本文实施例的技术方案进行修改或者等同替换,而不脱离本文技术方案的精神和范围,均应涵盖在本申请的权利要求范围当中。Those of ordinary skill in the art should understand that the technical solutions of the embodiments herein can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions herein, and should be covered by the scope of the claims of this application.

Claims (40)

  1. 一种链式结构数据存储方法,包括:A chain structure data storage method, including:
    将所述链式结构中链的部分或全部连接信息作为第一键,所述第一键关联的所述链式结构中的数据作为值,将所述数据存储为输入数据或输出数据,同一数据存储装置存储的输入数据和输出数据根据相同的连接信息相关联。Part or all of the connection information of the chain in the chain structure is used as the first key, and the data in the chain structure associated with the first key is used as the value, and the data is stored as input data or output data. The input data and output data stored in the data storage device are associated according to the same connection information.
  2. 根据权利要求1所述的数据存储方法,其中,所述将所述数据存储为输入数据或输出数据,包括:The data storage method according to claim 1, wherein the storing the data as input data or output data comprises:
    所述第一键作为所述链式结构中输出信息的部分或全部时,将所述第一键关联的数据作为输入数据存储;所述第一键作为所述链式结构中输入信息的部分或全部时,将所述第一健关联的数据作为输出数据存储。When the first key is used as part or all of the output information in the chain structure, the data associated with the first key is stored as input data; the first key is used as the part of the information input in the chain structure Or all, the data associated with the first key is stored as output data.
  3. 一种链式结构验证方法,包括:A chain structure verification method, including:
    将所述链式结构中链的部分或全部连接信息作为第一键,所述第一键关联的所述链式结构中的数据作为值,验证所述第一键关联的数据是否有错误,验证所述第一键关联的数据无错误后,将所述数据存储为输入数据或输出数据。Use part or all of the connection information of the chain in the chain structure as the first key, and use the data in the chain structure associated with the first key as the value to verify whether the data associated with the first key has errors, After verifying that the data associated with the first key has no errors, the data is stored as input data or output data.
  4. 根据权利要求3所述的链式结构验证方法,其中,所述将所述数据存储为输入数据或输出数据,包括:The chain structure verification method according to claim 3, wherein said storing the data as input data or output data comprises:
    所述第一键作为所述链式结构中的输出信息的部分或全部时,将所述第一键关联的数据作为输入数据存储;所述第一键作为所述链式结构中的输入信息的部分或全部时,将所述第一键关联的数据作为输出数据存储;本装置上存储的输入数据和输出数据根据相同的连接信息相关联。When the first key is used as part or all of the output information in the chain structure, the data associated with the first key is stored as input data; the first key is used as the input information in the chain structure Part or all of the data associated with the first key is stored as output data; the input data and output data stored on the device are associated according to the same connection information.
  5. 根据权利要求3所述的链式结构验证方法,其中,所述验证所述第一键关联的数据是否有错误,包括以下验证中的一种或多种:The chain structure verification method according to claim 3, wherein said verifying whether the data associated with the first key has errors includes one or more of the following verifications:
    验证所述数据是否为所述链式结构上的数据;Verifying whether the data is data on the chain structure;
    所述第一键作为所述链式结构中的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;When the first key is used as the input information in the chain structure, verify whether there is output information that has the same connection information as the input information;
    所述第一键作为所述链式结构中的输入信息时,验证与所述输入信息具 有相同连接信息的输出信息是否被使用过;When the first key is used as the input information in the chain structure, verify whether the output information that has the same connection information as the input information has been used;
    所述第一键作为所述链式结构中的输入信息时,且所述第一键关联的数据包含交易数额时,验证所述交易数额是否正确;When the first key is used as the input information in the chain structure, and the data associated with the first key includes a transaction amount, verifying whether the transaction amount is correct;
    所述第一键作为所述链式结构中的输入信息时,且所述第一键关联的数据包含签名信息时,验证所述签名信息是否正确。When the first key is used as the input information in the chain structure, and the data associated with the first key includes signature information, it is verified whether the signature information is correct.
  6. 根据权利要求4所述的链式结构验证方法,所述方法还包括:The chain structure verification method according to claim 4, the method further comprising:
    根据数据验证装置的请求,向所述数据验证装置返回本装置存储的与所述链的连接信息关联的数据,包括以下数据中的一种或多种:输入数据、输出数据、默克尔树认证路径、附加验证数据。According to the request of the data verification device, the data associated with the connection information of the chain stored by the device is returned to the data verification device, including one or more of the following data: input data, output data, Merkel tree Authentication path, additional authentication data.
  7. 一种链式结构验证方法,包括:A chain structure verification method, including:
    将所述链式结构中链的部分或全部连接信息作为第二键,从数据存储装置获取所述数据存储装置存储的与所述第二键关联的数据,根据所述获取的数据验证所述链式结构中的数据是否有错误。Taking part or all of the connection information of the chain in the chain structure as the second key, acquiring data stored in the data storage device and associated with the second key from the data storage device, and verifying the data according to the acquired data Whether there are errors in the data in the chain structure.
  8. 根据权利要求7所述的链式结构验证方法,其中,所述从数据存储装置获取的与所述第二键关联的数据包括以下一种或多种:与所述第二键关联的数据、默克尔树认证路径、附加验证数据,其中,所述第二键作为所述链式结构中输出信息的部分或全部,或者所述第二键作为所述链式结构中输入信息的部分或全部。The chain structure verification method according to claim 7, wherein the data associated with the second key obtained from the data storage device includes one or more of the following: data associated with the second key, Merkel tree authentication path and additional verification data, wherein the second key is used as part or all of the output information in the chain structure, or the second key is used as part or part of the input information in the chain structure All.
  9. 根据权利要求7所述的链式结构验证方法,其中,所述根据所述获取的数据验证所述链式结构中的数据是否有错误,包括:8. The chain structure verification method according to claim 7, wherein the verifying whether the data in the chain structure has errors according to the acquired data comprises:
    同步所述链式结构中的区块头数据,结合所述区块头数据与从所述数据存储装置获取的与所述第二键关联的数据,进行以下验证中的一种或多种:Synchronize the block header data in the chain structure, combine the block header data with the data associated with the second key obtained from the data storage device, and perform one or more of the following verifications:
    验证所述从数据存储装置获取的与所述第二键关联的数据是否为所述链式结构上的数据;Verifying whether the data associated with the second key obtained from the data storage device is data on the chain structure;
    所述第二键作为所述获取的数据的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;When the second key is used as the input information of the acquired data, verify whether there is output information that has the same connection information as the input information;
    所述第二键作为所述获取的数据的输入信息时,验证与所述输入信息具 有相同连接信息的输出信息是否被使用过;When the second key is used as the input information of the acquired data, verify whether the output information that has the same connection information as the input information has been used;
    所述第二键作为所述获取的数据的输入信息时,且所述获取的数据包含交易数额时,验证所述交易数额是否正确;When the second key is used as the input information of the acquired data, and when the acquired data includes a transaction amount, verify whether the transaction amount is correct;
    所述第二键作为所述获取的数据的输入信息时,且所述获取的数据包含签名信息时,验证所述签名信息是否正确。When the second key is used as the input information of the acquired data, and when the acquired data includes signature information, verify whether the signature information is correct.
  10. 一种链式结构实现方法,所述链式结构系统包括第一链系统、第二链系统和数据存储装置,所述方法包括:A method for realizing a chain structure. The chain structure system includes a first chain system, a second chain system, and a data storage device. The method includes:
    所述第一链系统对账本数据签名后,将签名后的账本数据写入第一链的区块数据;After the first chain system signs the ledger data, write the signed ledger data into the block data of the first chain;
    所述第二链系统在验证第一链的区块数据后,将所述第一链的一个或多个连续的区块数据写入第二链的区块数据;After verifying the block data of the first chain, the second chain system writes one or more continuous block data of the first chain into the block data of the second chain;
    所述数据存储装置将所述第二链中链的部分或全部连接信息作为第一键,所述第一键关联的数据作为值,验证所述第一键关联的数据无错误后,将所述数据存储为输入数据或输出数据,同一数据存储装置存储的输入数据和输出数据根据相同的连接信息相关联。The data storage device uses part or all of the connection information of the chain in the second chain as the first key, and the data associated with the first key as the value. After verifying that the data associated with the first key has no errors, it will The data is stored as input data or output data, and the input data and output data stored in the same data storage device are related according to the same connection information.
  11. 根据权利要求10所述的链式结构实现方法,所述方法还包括:所述第一链系统将所述第一链中链的部分或全部连接信息作为第三键,所述第三键关联的数据作为值,将所述第三键关联的值分配到与所述值具有相同第三键的共识组;所述共识组对所述第三键关联的数据进行验证,其中:The method for implementing a chain structure according to claim 10, the method further comprising: the first chain system uses part or all of the connection information of the chain in the first chain as a third key, and the third key is associated As the value, assign the value associated with the third key to a consensus group that has the same third key as the value; the consensus group verifies the data associated with the third key, where:
    所述第三键关联的数据包括交易数据,所述验证包括以下一种或多种:The data associated with the third key includes transaction data, and the verification includes one or more of the following:
    所述第三键作为所述交易数据的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;When the third key is used as the input information of the transaction data, verify whether there is output information that has the same connection information as the input information;
    所述第三键作为所述交易数据的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;When the third key is used as the input information of the transaction data, verify whether the output information that has the same connection information as the input information has been used;
    所述第三键作为所述交易数据的输入信息时,验证所述交易数据的交易数额是否正确;When the third key is used as the input information of the transaction data, verify whether the transaction amount of the transaction data is correct;
    所述第三键作为所述交易数据的输入信息时,验证所述交易数据的签名 信息是否正确。When the third key is used as the input information of the transaction data, it is verified whether the signature information of the transaction data is correct.
  12. 根据权利要求11所述的链式结构实现方法,所述共识组对所述第三键关联的数据进行验证后,所述方法还包括:According to the chain structure realization method of claim 11, after the consensus group verifies the data associated with the third key, the method further comprises:
    所述共识组将所述第三键关联的数据存储为输入数据或输出数据,其中,当所述第三键作为所述第一链中的输出信息的部分或全部时,将所述第三键关联的数据作为输入数据存储,当所述第三键作为所述第一链中的输入信息的部分或全部时,将所述第三键关联的数据作为输出数据存储;同一共识组上存储的输入数据和输出数据根据相同的连接信息相关联。The consensus group stores the data associated with the third key as input data or output data, wherein when the third key is part or all of the output information in the first chain, the third The data associated with the key is stored as input data. When the third key is part or all of the input information in the first chain, the data associated with the third key is stored as output data; stored on the same consensus group The input data and output data are related according to the same connection information.
  13. 根据权利要求10所述的链式结构实现方法,其中,所述数据存储装置将所述数据存储为输入数据或输出数据,包括:The method for implementing a chain structure according to claim 10, wherein the storing of the data as input data or output data by the data storage device comprises:
    所述第一键作为所述第二链中的输出信息的部分或全部时,将所述第一键关联的数据作为输入数据存储;所述第一键作为所述第二链中的输入信息的部分或全部时,将所述第一键关联的数据作为输出数据存储;本数据存储装置上存储的输入数据和输出数据根据相同的连接信息相关联。When the first key is used as part or all of the output information in the second chain, the data associated with the first key is stored as input data; the first key is used as the input information in the second chain Part or all of the data associated with the first key is stored as output data; the input data and output data stored on the data storage device are associated according to the same connection information.
  14. 根据权利要求10所述的链式结构实现方法,其中,所述数据存储装置验证所述第一键关联的数据是否有错误,包括以下验证中的一种或多种:The method for implementing the chain structure according to claim 10, wherein the data storage device verifies whether the data associated with the first key has errors, including one or more of the following verifications:
    验证所述第二链的完整性;Verify the integrity of the second chain;
    验证所述数据是否为所述第二链上的数据;Verifying whether the data is data on the second chain;
    所述第一键作为所述第二链中账本数据的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;When the first key is used as the input information of the ledger data in the second chain, verify whether there is output information that has the same connection information as the input information;
    所述第一键作为所述第二链中账本数据的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;When the first key is used as the input information of the ledger data in the second chain, verify whether the output information that has the same connection information as the input information has been used;
    所述第一键作为所述第二链中账本数据的输入信息时,且所述第一键关联的数据包含交易数额时,验证所述交易数额是否正确;When the first key is used as the input information of the ledger data in the second chain, and the data associated with the first key includes the transaction amount, verifying whether the transaction amount is correct;
    所述第一键作为所述第二链中账本数据的输入信息时,且所述第一键关联的数据包含签名信息时,验证所述签名信息是否正确。When the first key is used as the input information of the ledger data in the second chain, and the data associated with the first key includes signature information, it is verified whether the signature information is correct.
  15. 根据权利要求10或14所述的链式结构实现方法,所述方法还包括: 所述第一链系统按顺序为账本数据编排序号,所述账本数据对应的区块数据的区块头中包含累计账本数据量;所述第二链系统在第二链的区块数据的区块头中包含所述区块数据中的累计账本数据量。The method for implementing the chain structure according to claim 10 or 14, the method further comprising: the first chain system sequentially numbers the ledger data, and the block header of the block data corresponding to the ledger data contains cumulative Amount of ledger data; the second chain system includes the cumulative amount of ledger data in the block data in the block header of the block data of the second chain.
  16. 根据权利要求15所述的链式结构实现方法,其中,所述数据存储装置验证所述链式结构的完整性,包括:所述数据存储装置同步所述第二链的区块头,用所述区块头中的累计账本数据量生成编号地址,根据所述编号地址对所述第二链的完整性进行验证。The method for implementing a chain structure according to claim 15, wherein the verification of the integrity of the chain structure by the data storage device comprises: the data storage device synchronizes the block header of the second chain, and uses the The cumulative ledger data volume in the block header generates a numbered address, and the integrity of the second chain is verified according to the numbered address.
  17. 根据权利要求15所述的链式结构实现方法,所述方法还包括:The method for implementing the chain structure according to claim 15, the method further comprising:
    所述数据存储装置根据第一链区块头数据验证第二链区块头数据中的累计账本数据量是否正确。The data storage device verifies whether the accumulated book data amount in the second chain block header data is correct according to the first chain block header data.
  18. 根据权利要求10所述的链式结构实现方法,所述方法还包括:The method for implementing the chain structure according to claim 10, the method further comprising:
    所述第一链系统在第一链的区块头中包含当前共识公钥集合映射的值;The first chain system includes the current consensus public key set mapping value in the block header of the first chain;
    所述数据存储装置根据第一链区块头中的共识公钥集合的映射值采用默克尔树证明或累加器证明,验证第二链区块头中的共识公钥是否有效。According to the mapping value of the consensus public key set in the first chain block header, the data storage device verifies whether the consensus public key in the second chain block header is valid by using Merkel tree certification or accumulator certification.
  19. 根据权利要求10所述的链式结构实现方法,其中,所述第二链系统将所述第一链的一个或多个连续的区块数据写入第二链的区块数据,包括:所述第二链系统将所述第一链的一个或多个连续的区块数据按照交易数据序号顺序和控制数据序号顺序重新组合分别生成默克尔树根哈希值,并在生成的第二链的区块头中包含所述默克尔树根哈希值。The method for implementing a chain structure according to claim 10, wherein the second chain system writes one or more continuous block data of the first chain into the block data of the second chain, including: The second chain system recombines one or more consecutive block data of the first chain in the order of transaction data serial number and control data serial number to generate a Merkel tree root hash value, and generates a Merkel tree root hash value. The block header of the chain contains the root hash value of the Merkel tree.
  20. 根据权利要求10所述的链式结构实现方法,According to the chain structure realization method of claim 10,
    所述系统还包括:数据验证装置;The system also includes: a data verification device;
    所述方法还包括:所述数据验证装置将所述链式结构中链的部分或全部连接信息作为第二键,从所述数据存储装置获取所述数据存储装置上存储的与所述第二键关联的数据,根据所述获取的数据验证所述第二链中的数据是否有错误。The method further includes: the data verification device uses part or all of the connection information of the chain in the chain structure as a second key, and obtains the data stored on the data storage device from the data storage device and the second key. According to the data associated with the key, verify whether the data in the second chain has errors according to the acquired data.
  21. 根据权利要求20所述的链式结构实现方法,其中,所述数据验证装置将所述链式结构中链的部分或全部连接信息作为第二键,从所述数据存储装置获取所述数据存储装置上存储的与所述第二键关联的数据,包括:The method for implementing a chain structure according to claim 20, wherein the data verification device uses part or all of the connection information of the chain in the chain structure as the second key to obtain the data storage device from the data storage device. The data associated with the second key stored on the device includes:
    所述数据验证装置同步所述第二链的区块头,用所述区块头中的累计账本数据量生成编号地址,根据所述编号地址获取链的部分或全部连接信息作为第二键,从所述数据存储装置获取所述数据存储装置上存储的与所述第二键关联的数据。The data verification device synchronizes the block header of the second chain, uses the cumulative ledger data volume in the block header to generate a numbered address, and obtains part or all of the chain connection information according to the numbered address as the second key. The data storage device obtains data associated with the second key stored on the data storage device.
  22. 根据权利要求20所述的链式结构实现方法,其中,所述数据验证装置从所述数据存储装置获取所述数据存储装置上存储的与所述第二键关联的数据包括以下数据中的一种或多种:与所述第二键关联的数据、默克尔树认证路径、附加验证数据,其中,所述第二键作为所述链式结构中输出信息的部分或全部,或者所述第二键作为所述链式结构中输入信息的部分或全部;The method for implementing the chain structure according to claim 20, wherein the data that the data verification device obtains from the data storage device and the data associated with the second key stored on the data storage device includes one of the following data One or more types: data associated with the second key, Merkel tree certification path, additional verification data, wherein the second key is part or all of the output information in the chain structure, or the The second key serves as part or all of the input information in the chain structure;
    所述数据验证装置根据所述获取的数据验证所述第二链中的数据是否有错误,包括:The data verification device verifies whether there is an error in the data in the second chain according to the acquired data, including:
    所述数据验证装置同步所述第二链中的区块头,结合所述区块头与从所述数据存储装置获取的与所述第二键关联的数据,进行以下验证中的一种或多种:The data verification device synchronizes the block header in the second chain, and combines the block header and the data associated with the second key obtained from the data storage device to perform one or more of the following verifications :
    验证所述从数据存储装置获取的与所述第二键关联的数据是否为所述第二链上的数据;Verifying whether the data associated with the second key obtained from the data storage device is data on the second chain;
    所述第二键作为所述获取的数据的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;When the second key is used as the input information of the acquired data, verify whether there is output information that has the same connection information as the input information;
    所述第二键作为所述获取的数据的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;When the second key is used as the input information of the acquired data, verify whether the output information having the same connection information as the input information has been used;
    所述第二键作为所述获取的数据的输入信息时,且所述获取的数据包含交易数额时,验证所述交易数额是否正确;When the second key is used as the input information of the acquired data, and when the acquired data includes a transaction amount, verify whether the transaction amount is correct;
    所述第二键作为所述获取的数据的输入信息时,且所述获取的数据包含签名信息时,验证所述签名信息是否正确。When the second key is used as the input information of the acquired data, and when the acquired data includes signature information, verify whether the signature information is correct.
  23. 根据权利要求20所述的链式结构实现方法,所述方法还包括:The method for implementing the chain structure according to claim 20, the method further comprising:
    所述第一链系统在第一链的区块头中包含当前共识公钥集合的映射值;The first chain system includes the mapping value of the current consensus public key set in the block header of the first chain;
    所述数据验证装置根据第一链区块头中的共识公钥集合的映射值采用默克尔树证明或累加器证明,验证第二链区块头中的共识公钥是否有效。The data verification device uses Merkel tree certification or accumulator certification according to the mapping value of the consensus public key set in the first chain block header to verify whether the consensus public key in the second chain block header is valid.
  24. 根据权利要求10所述的链式结构实现方法,According to the chain structure realization method of claim 10,
    其中,所述第一链为私有链或联盟链,Wherein, the first chain is a private chain or a consortium chain,
    所述方法还包括:第一链系统向用户颁发以下密钥的一个或多个:管理地址主密钥、交易地址主密钥、机密交易主密钥和对称加密主密钥,其中:The method further includes: the first chain system issues one or more of the following keys to the user: a management address master key, a transaction address master key, a confidential transaction master key, and a symmetric encryption master key, wherein:
    所述管理地址主密钥用于与当前第一生成参数生成所述用户的下一个管理地址,所述用户的所有管理地址形成逻辑链;The management address master key is used to generate the next management address of the user with the current first generation parameter, and all the management addresses of the user form a logical chain;
    所述交易地址主密钥用于与当前第二生成参数生成所述用户的下一个接收交易地址,所述用户的所有接收交易地址形成逻辑链;The transaction address master key is used to generate the next receiving transaction address of the user with the current second generation parameter, and all receiving transaction addresses of the user form a logical chain;
    所述机密交易主密钥用于与当前第三生成参数生成当前加解密密文交易数额的工作密钥;The secret transaction master key is used to generate the working key of the current encryption and decryption ciphertext transaction amount with the current third generation parameter;
    所述对称加密主密钥用于与当前第四生成参数生成所述用户的下一个加解密管理数据的对称加密工作密钥。The symmetric encryption master key is used to generate the symmetric encryption work key of the user's next encryption and decryption management data with the current fourth generation parameter.
  25. 根据权利要求10或24所述的链式结构实现方法,所述方法还包括:The method for implementing the chain structure according to claim 10 or 24, the method further comprising:
    所述第一链系统使用为用户颁发的管理地址主密钥与所述用户的上一个管理数据中的生成参数生成所述用户的当前管理地址,并在所述当前管理数据中写入用于生成所述用户的下一个管理地址的生成参数。The first chain system uses the management address master key issued for the user and the generation parameters in the user's previous management data to generate the user's current management address, and writes the user's current management address in the current management data Generate the generation parameters of the next management address of the user.
  26. 一种链式结构数据存储装置,包括第一存储模块和第二存储模块,其中:A chain structure data storage device includes a first storage module and a second storage module, wherein:
    所述第一存储模块,设置为将所述链式结构中链的部分或全部连接信息作为第一键存储;The first storage module is configured to store part or all of the connection information of the chain in the chain structure as a first key;
    所述第二存储模块,设置为将所述第一键关联的所述链式结构中的数据存储为输入数据或输出数据,同一数据存储装置存储的输入数据和输出数据根据相同的连接信息相关联。The second storage module is configured to store the data in the chain structure associated with the first key as input data or output data, and the input data and output data stored in the same data storage device are related according to the same connection information United.
  27. 根据权利要求26所述的链式结构数据存储装置,所述数据存储装置还包括第一验证模块,所述第一验证模块设置为验证所述第一键关联的所述链式结构中的数据是否有错误。The chain structure data storage device according to claim 26, the data storage device further comprising a first verification module configured to verify the data in the chain structure associated with the first key Is there an error.
  28. 根据权利要求27所述的链式结构数据存储装置,所述第一验证模块 验证所述第一键关联的数据是否有错误,包括:The chain structure data storage device according to claim 27, wherein the first verification module verifies whether the data associated with the first key has errors, comprising:
    所述第一验证模块执行以下验证操作中的一种或多种:The first verification module performs one or more of the following verification operations:
    验证所述数据是否为所述链式结构上的数据;Verifying whether the data is data on the chain structure;
    所述第一键作为所述链式结构中的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;When the first key is used as the input information in the chain structure, verify whether there is output information that has the same connection information as the input information;
    所述第一键作为所述链式结构中的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;When the first key is used as the input information in the chain structure, verify whether the output information that has the same connection information as the input information has been used;
    所述第一键作为所述链式结构中的输入信息时,且所述第一键关联的数据包含交易数额时,验证所述交易数额是否正确;When the first key is used as input information in the chain structure, and the data associated with the first key includes a transaction amount, verifying whether the transaction amount is correct;
    所述第一键作为所述链式结构中的输入信息时,且所述第一键关联的数据包含签名信息时,验证所述签名信息是否正确。When the first key is used as the input information in the chain structure, and the data associated with the first key includes signature information, it is verified whether the signature information is correct.
  29. 一种链式结构数据验证装置,包括键值查找模块和第二验证模块,其中:A chain structure data verification device includes a key value search module and a second verification module, wherein:
    所述键值查找模块,设置为查找所述链式结构中链的部分或全部连接信息作为第二键;The key value search module is configured to search for part or all of the connection information of the chain in the chain structure as the second key;
    所述第二验证模块,设置为从数据存储装置获取所述数据存储装置存储的与所述第二键关联的数据,根据所述获取的数据验证所述链式结构中的数据是否有错误。The second verification module is configured to obtain data associated with the second key stored by the data storage device from a data storage device, and verify whether the data in the chain structure has errors according to the obtained data.
  30. 根据权利要求29所述的链式结构数据验证装置,其中,所述第二验证模块根据所述获取的数据验证所述链式结构中的数据是否有错误,包括:The chain structure data verification device according to claim 29, wherein the second verification module verifies whether there is an error in the data in the chain structure according to the acquired data, comprising:
    所述数据验证装置同步所述链式结构中的区块头数据,所述第二验证模块结合所述区块头数据与从所述数据存储装置获取的与所述第二键关联的数据,进行以下验证中的一种或多种:The data verification device synchronizes the block header data in the chain structure, and the second verification module combines the block header data with the data associated with the second key acquired from the data storage device to perform the following One or more of verification:
    验证所述从数据存储装置获取的与所述第二键关联的数据是否为所述链式结构上的数据;Verifying whether the data associated with the second key obtained from the data storage device is data on the chain structure;
    所述第二键作为所述获取的数据的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;When the second key is used as the input information of the acquired data, verify whether there is output information that has the same connection information as the input information;
    所述第二键作为所述获取的数据的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;When the second key is used as the input information of the acquired data, verify whether the output information having the same connection information as the input information has been used;
    所述第二键作为所述获取的数据的输入信息时,且所述获取的数据包含交易数额时,验证所述交易数额是否正确;When the second key is used as the input information of the acquired data, and when the acquired data includes a transaction amount, verify whether the transaction amount is correct;
    所述第二键作为所述获取的数据的输入信息时,且所述获取的数据包含签名信息时,验证所述签名信息是否正确。When the second key is used as the input information of the acquired data, and when the acquired data includes signature information, verify whether the signature information is correct.
  31. 一种链式结构系统,包括:第一链系统、第二链系统和数据存储装置,其中:A chain structure system includes: a first chain system, a second chain system and a data storage device, wherein:
    所述第一链系统,设置为对账本数据签名后,将签名后的账本数据写入第一链的区块数据;The first chain system is configured to, after signing the ledger data, write the signed ledger data into the block data of the first chain;
    所述第二链系统,设置为在验证第一链的区块数据后,将所述第一链的一个或多个连续的区块数据写入第二链的区块数据;The second chain system is configured to write one or more continuous block data of the first chain into the block data of the second chain after verifying the block data of the first chain;
    所述数据存储装置,设置为将所述第二链中链的部分或全部连接信息作为第一键,所述第一键关联的数据作为值,验证所述第一键关联的数据是否有错误,验证所述第一键关联的数据无错误后,将所述数据存储为输入数据或输出数据,同一数据存储装置存储的输入数据和输出数据根据相同的连接信息相关联。The data storage device is configured to use part or all of the connection information of the chain in the second chain as the first key, and the data associated with the first key as the value, to verify whether the data associated with the first key has errors After verifying that the data associated with the first key has no error, the data is stored as input data or output data, and the input data and output data stored in the same data storage device are associated according to the same connection information.
  32. 根据权利要求31所述的链式结构系统,其中,所述第一链系统还包括共识组;The chain structure system according to claim 31, wherein the first chain system further comprises a consensus group;
    所述第一链系统还设置为将所述第一链中链的部分或全部连接信息作为第三键,所述第三键关联的数据作为值,将所述第三键关联的值分配到与所述值具有相同第三键的共识组,所述第三键关联的数据包括交易数据;The first chain system is further configured to use part or all of the connection information of the chain in the first chain as a third key, data associated with the third key as a value, and assign the value associated with the third key to A consensus group with the same third key as the value, and the data associated with the third key includes transaction data;
    所述共识组设置为对所述第三键关联的数据进行验证,包括以下一种或多种验证:The consensus group is set to verify the data associated with the third key, including one or more of the following verifications:
    所述第三键作为所述交易数据的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;When the third key is used as the input information of the transaction data, verify whether there is output information that has the same connection information as the input information;
    所述第三键作为所述交易数据的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;When the third key is used as the input information of the transaction data, verify whether the output information that has the same connection information as the input information has been used;
    所述第三键作为所述交易数据的输入信息时,验证所述交易数据的交易数额是否正确;When the third key is used as the input information of the transaction data, verify whether the transaction amount of the transaction data is correct;
    所述第三键作为所述交易数据的输入信息时,验证所述交易数据的签名信息是否正确。When the third key is used as the input information of the transaction data, it is verified whether the signature information of the transaction data is correct.
  33. 根据权利要求32所述的链式结构系统,所述共识组还设置为对所述第三键关联的数据进行验证后,将所述第三键关联的数据存储为输入数据或输出数据,其中,当所述第三键作为所述第一链中的输出信息的部分或全部时,将所述第三键关联的数据作为输入数据存储,当所述第三键作为所述第一链中的输入信息的部分或全部时,将所述第三键关联的数据作为输出数据存储;同一共识组上存储的输入数据和输出数据根据相同的连接信息相关联。According to the chain structure system of claim 32, the consensus group is further configured to store the data associated with the third key as input data or output data after verifying the data associated with the third key, wherein When the third key is used as part or all of the output information in the first chain, the data associated with the third key is stored as input data, and when the third key is used as the first chain When part or all of the input information is stored, the data associated with the third key is stored as output data; the input data and output data stored on the same consensus group are related according to the same connection information.
  34. 根据权利要求31所述的链式结构系统,所述第一链系统还设置为按顺序为账本数据编排序号,所述账本数据对应的区块数据的区块头中包含累计账本数据量;所述第二链系统还设置为在第二链的区块数据的区块头中包含所述区块数据中的累计账本数据量。The chain structure system according to claim 31, the first chain system is further configured to sequentially number the ledger data, and the block header of the block data corresponding to the ledger data contains the cumulative amount of ledger data; The second chain system is also configured to include the cumulative ledger data amount in the block data in the block header of the block data of the second chain.
  35. 根据权利要求31所述的链式结构系统,所述数据存储装置验证所述第一键关联的数据是否有错误,包括以下验证中的一种或多种:The chain structure system according to claim 31, wherein the data storage device verifies whether the data associated with the first key has errors, including one or more of the following verifications:
    验证所述第二链的完整性;Verify the integrity of the second chain;
    验证所述数据是否为所述第二链上的数据;Verifying whether the data is data on the second chain;
    所述第一键作为所述第二链中账本数据的输入信息时,验证是否存在与所述输入信息具有相同连接信息的输出信息;When the first key is used as the input information of the ledger data in the second chain, verify whether there is output information that has the same connection information as the input information;
    所述第一键作为所述第二链中账本数据的输入信息时,验证与所述输入信息具有相同连接信息的输出信息是否被使用过;When the first key is used as the input information of the ledger data in the second chain, verify whether the output information that has the same connection information as the input information has been used;
    所述第一键作为所述第二链中账本数据的输入信息时,且所述第一键关联的数据包含交易数额时,验证所述交易数额是否正确;When the first key is used as the input information of the ledger data in the second chain, and the data associated with the first key includes the transaction amount, verifying whether the transaction amount is correct;
    所述第一键作为所述第二链中账本数据的输入信息时,且所述第一键关联的数据包含签名信息时,验证所述签名信息是否正确。When the first key is used as the input information of the ledger data in the second chain, and the data associated with the first key includes signature information, it is verified whether the signature information is correct.
  36. 根据权利要求31所述的链式结构系统,所述链式结构系统还包括:数据验证装置;所述数据验证装置设置为将所述链式结构中链的部分或全部 连接信息作为第二键,从所述数据存储装置获取所述数据存储装置上存储的与所述第二键关联的数据,根据所述获取的数据验证所述第二链中的数据是否有错误。The chain structure system according to claim 31, the chain structure system further comprising: a data verification device; the data verification device is configured to use part or all of the connection information of the chain in the chain structure as the second key , Obtaining data associated with the second key stored on the data storage device from the data storage device, and verifying whether the data in the second chain has errors according to the obtained data.
  37. 根据权利要求31或36所述的链式结构系统,所述第一链系统还设置为在第一链的区块头中包含当前共识公钥集合映射的值,以使所述数据存储装置或数据验证装置根据第一链区块头中的共识公钥集合的映射值采用默克尔树证明或累加器证明,验证第二链区块头中的共识公钥是否有效。The chain structure system according to claim 31 or 36, the first chain system is also set to include the value of the current consensus public key set mapping in the block header of the first chain, so that the data storage device or data The verification device uses Merkel tree certification or accumulator certification according to the mapping value of the consensus public key set in the first chain block header to verify whether the consensus public key in the second chain block header is valid.
  38. 根据权利要求31所述的链式结构系统,所述第一链系统还设置为使用为用户颁发的管理地址主密钥与所述用户的上一个管理数据中的生成参数生成所述用户的当前管理地址,并在所述当前管理数据中写入用于生成所述用户的下一个管理地址的生成参数。The chain structure system according to claim 31, the first chain system is further configured to use the management address master key issued for the user and the generation parameters in the user's previous management data to generate the user's current Management address, and write the generation parameter used to generate the next management address of the user in the current management data.
  39. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1-2或权利要求3-6或权利要求7-9或权利要求10-25中任一项所述的方法。A computer-readable storage medium storing computer-executable instructions for executing any of claims 1-2 or 3-6 or claims 7-9 or 10-25 The method described in the item.
  40. 一种计算机装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如权利要求1-2或权利要求3-6或权利要求7-9或权利要求10-25中任一项所述方法的步骤。A computer device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor. The processor executes the program as claimed in claim 1-2 or claim 3-6 or right The steps of the method of any one of claims 7-9 or claims 10-25.
PCT/CN2019/128379 2019-12-16 2019-12-25 Data storage method and verification method for blockchain structure, blockchain structure implementation method, blockchain-structured system, device, and medium WO2021120253A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW109119498A TWI749583B (en) 2019-12-16 2020-06-10 Chain structure data storage, verification, realization method, system, device and media

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911294794.6A CN111159288B (en) 2019-12-16 2019-12-16 Method, system, device and medium for storing, verifying and realizing chained structure data
CN201911294794.6 2019-12-16

Publications (1)

Publication Number Publication Date
WO2021120253A1 true WO2021120253A1 (en) 2021-06-24

Family

ID=70557219

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/128379 WO2021120253A1 (en) 2019-12-16 2019-12-25 Data storage method and verification method for blockchain structure, blockchain structure implementation method, blockchain-structured system, device, and medium

Country Status (3)

Country Link
CN (1) CN111159288B (en)
TW (1) TWI749583B (en)
WO (1) WO2021120253A1 (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113746638A (en) * 2021-09-03 2021-12-03 杭州复杂美科技有限公司 NFT storage method, NFT restoration method, computer device, and storage medium
CN113867690A (en) * 2021-12-07 2021-12-31 中移(上海)信息通信科技有限公司 Generation method and device of random number in block chain and block chain link point
CN113904869A (en) * 2021-11-10 2022-01-07 深圳前海微众银行股份有限公司 Method for detecting malicious node in block chain and block chain
CN114124641A (en) * 2021-11-26 2022-03-01 成都质数斯达克科技有限公司 Block chain abnormal service processing method, device, equipment and readable storage medium
CN114547641A (en) * 2022-01-05 2022-05-27 山东浪潮工业互联网产业股份有限公司 Industrial data tracking method, device, equipment and medium based on block chain
CN114584383A (en) * 2022-03-10 2022-06-03 东南大学 Internet of things equipment anonymous identity authentication method based on block chain
CN114915428A (en) * 2022-07-18 2022-08-16 江苏数一科技服务有限公司 Alliance chain suitable for circulation steel is traceed to source
CN114928447A (en) * 2022-02-10 2022-08-19 北京轻信科技有限公司 Data management method and system based on distributed identity
CN115052047A (en) * 2022-01-27 2022-09-13 昆明理工大学 Front-end verification method of Gossip network protocol
CN115118435A (en) * 2022-06-29 2022-09-27 河北工业大学 Private data protection and authorization framework based on double-layer chain
CN115118437A (en) * 2022-08-25 2022-09-27 人民法院信息技术服务中心 Multi-signature verification method, device and equipment based on consistent hash and path certification
WO2023041995A1 (en) * 2021-09-19 2023-03-23 International Business Machines Corporation Privacy-preserving state reference
CN115841285A (en) * 2022-11-28 2023-03-24 浙江百世技术有限公司 Commodity logistics tracing method and system based on block chain
CN113904869B (en) * 2021-11-10 2024-04-19 深圳前海微众银行股份有限公司 Method for detecting malicious nodes in blockchain and blockchain

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111340496B (en) * 2020-05-20 2020-10-27 南京如般量子科技有限公司 Block chain system and method for automatically optimizing historical transaction data
CN111695856A (en) * 2020-06-08 2020-09-22 中设设计集团股份有限公司 Ship information registration method based on block chain intelligent contract
CN112100171B (en) * 2020-08-12 2021-06-25 北京大学 Method and device for establishing content index for random consensus diagram book
CN112035890B (en) * 2020-09-04 2022-08-05 北京邮电大学 Data integrity verification method and device
CN112311772B (en) * 2020-10-12 2022-06-14 华中师范大学 Hyperridge-based cross-domain certificate management system and method
CN114629628B (en) * 2020-12-14 2024-02-27 科大国盾量子技术股份有限公司 Quantum key synchronization method based on Merck algorithm
CN113157693B (en) * 2021-03-21 2023-05-19 贵州大学 Block chain storage optimization scheme for digital currency
CN112907248A (en) * 2021-03-25 2021-06-04 芝麻链(北京)科技有限公司 Data storage transaction method and transaction system based on block chain
KR102650336B1 (en) * 2021-05-04 2024-03-22 계명대학교 산학협력단 Method and apparatus for providing lightweight blockchain using external strorage and pbft consensus algorithm
CN113378236B (en) * 2021-06-02 2022-09-16 浙江数秦科技有限公司 Evidence data online security notarization platform and security method
CN116070285A (en) * 2021-11-04 2023-05-05 京东科技信息技术有限公司 Asynchronous consensus method, device, server and medium based on Bayesian fault tolerance
CN114398206B (en) * 2022-01-06 2022-11-11 北京德风新征程科技有限公司 Information storage method and device, electronic equipment and computer readable medium
CN114666058B (en) * 2022-03-08 2023-06-13 深圳大学 Verification method, device, equipment and storage medium based on multiple signatures

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107180350A (en) * 2017-03-31 2017-09-19 唐晓领 A kind of method of the multi-party shared transaction metadata based on block chain, apparatus and system
CN109242500A (en) * 2018-09-20 2019-01-18 百度在线网络技术(北京)有限公司 Block chain transaction validation verification method, apparatus and storage medium
US20190379646A1 (en) * 2018-06-11 2019-12-12 Fujitsu Limited Delayed-access encryption for blockchain field

Family Cites Families (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
MY123388A (en) * 1999-03-15 2006-05-31 Sony Corp Processing method and apparatus for encrypted data transfer
US20030093695A1 (en) * 2001-11-13 2003-05-15 Santanu Dutta Secure handling of stored-value data objects
US10789373B2 (en) * 2011-10-31 2020-09-29 Reid Consulting Group, Inc. System and method for securely storing and sharing information
US20160098730A1 (en) * 2014-10-01 2016-04-07 The Filing Cabinet, LLC System and Method for Block-Chain Verification of Goods
US10409613B2 (en) * 2015-12-23 2019-09-10 Intel Corporation Processing devices to perform a key value lookup instruction
US10460120B1 (en) * 2016-03-30 2019-10-29 Amazon Technologies, Inc. Policy mediated hierarchical structures in key value stores
US10341105B2 (en) * 2017-06-07 2019-07-02 At&T Intellectual Property I, L.P. Blockchain-based social media history maps
CA3014385A1 (en) * 2017-08-16 2019-02-16 Royal Bank Of Canada Platform for generating authenticated data objects
US10742416B2 (en) * 2017-08-21 2020-08-11 Andrew J. Polcha Fuzzy dataset processing and biometric identity technology leveraging blockchain ledger technology
CN107862215B (en) * 2017-09-29 2020-10-16 创新先进技术有限公司 Data storage method, data query method and device
EP3522089B1 (en) * 2018-01-29 2023-11-29 Panasonic Intellectual Property Corporation of America Control method, controller, data structure, and electric power transaction system
WO2019170617A1 (en) * 2018-03-05 2019-09-12 British Telecommunications Public Limited Company Confirmable authentication method
SG11202006981QA (en) * 2018-03-14 2020-08-28 Jieqian Zheng Block chain data processing method, management terminal, user terminal, conversion device, and medium
CN108647964B (en) * 2018-05-02 2023-07-28 郑杰骞 Block chain data processing method and device and computer readable storage medium
CN108681943B (en) * 2018-05-18 2022-07-12 百度在线网络技术(北京)有限公司 Data processing method, device and equipment of block chain network and storage medium
CN109255056B (en) * 2018-08-16 2021-05-25 北京京东尚科信息技术有限公司 Data reference processing method, device, equipment and storage medium of block chain
CN109726202B (en) * 2018-12-18 2020-11-17 北京新唐思创教育科技有限公司 Block chain data storage method and computer storage medium
CN109903161B (en) * 2019-02-28 2021-11-09 百度在线网络技术(北京)有限公司 Object processing method, device, equipment and medium based on block chain
CN110177109B (en) * 2019-06-04 2020-05-12 北京理工大学 Double-proxy cross-domain authentication system based on identification password and alliance chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107180350A (en) * 2017-03-31 2017-09-19 唐晓领 A kind of method of the multi-party shared transaction metadata based on block chain, apparatus and system
US20190379646A1 (en) * 2018-06-11 2019-12-12 Fujitsu Limited Delayed-access encryption for blockchain field
CN109242500A (en) * 2018-09-20 2019-01-18 百度在线网络技术(北京)有限公司 Block chain transaction validation verification method, apparatus and storage medium

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113746638A (en) * 2021-09-03 2021-12-03 杭州复杂美科技有限公司 NFT storage method, NFT restoration method, computer device, and storage medium
WO2023041995A1 (en) * 2021-09-19 2023-03-23 International Business Machines Corporation Privacy-preserving state reference
CN113904869A (en) * 2021-11-10 2022-01-07 深圳前海微众银行股份有限公司 Method for detecting malicious node in block chain and block chain
CN113904869B (en) * 2021-11-10 2024-04-19 深圳前海微众银行股份有限公司 Method for detecting malicious nodes in blockchain and blockchain
CN114124641A (en) * 2021-11-26 2022-03-01 成都质数斯达克科技有限公司 Block chain abnormal service processing method, device, equipment and readable storage medium
CN114124641B (en) * 2021-11-26 2023-06-02 成都质数斯达克科技有限公司 Block chain exception service processing method, device, equipment and readable storage medium
CN113867690A (en) * 2021-12-07 2021-12-31 中移(上海)信息通信科技有限公司 Generation method and device of random number in block chain and block chain link point
CN113867690B (en) * 2021-12-07 2022-03-04 中移(上海)信息通信科技有限公司 Generation method and device of random number in block chain and block chain link point
CN114547641A (en) * 2022-01-05 2022-05-27 山东浪潮工业互联网产业股份有限公司 Industrial data tracking method, device, equipment and medium based on block chain
CN115052047A (en) * 2022-01-27 2022-09-13 昆明理工大学 Front-end verification method of Gossip network protocol
CN114928447A (en) * 2022-02-10 2022-08-19 北京轻信科技有限公司 Data management method and system based on distributed identity
CN114584383B (en) * 2022-03-10 2024-02-27 东南大学 Block chain-based anonymous identity authentication method for Internet of things equipment
CN114584383A (en) * 2022-03-10 2022-06-03 东南大学 Internet of things equipment anonymous identity authentication method based on block chain
CN115118435A (en) * 2022-06-29 2022-09-27 河北工业大学 Private data protection and authorization framework based on double-layer chain
CN115118435B (en) * 2022-06-29 2024-03-22 河北工业大学 Privacy data protection and authorization framework based on double-layer chain
CN114915428A (en) * 2022-07-18 2022-08-16 江苏数一科技服务有限公司 Alliance chain suitable for circulation steel is traceed to source
CN115118437A (en) * 2022-08-25 2022-09-27 人民法院信息技术服务中心 Multi-signature verification method, device and equipment based on consistent hash and path certification
CN115118437B (en) * 2022-08-25 2022-10-28 人民法院信息技术服务中心 Multi-signature verification method, device and equipment based on consistent hash and path certification
CN115841285A (en) * 2022-11-28 2023-03-24 浙江百世技术有限公司 Commodity logistics tracing method and system based on block chain
CN115841285B (en) * 2022-11-28 2023-09-19 浙江百世技术有限公司 Commodity logistics tracing method and system based on blockchain

Also Published As

Publication number Publication date
CN111159288B (en) 2023-04-28
CN111159288A (en) 2020-05-15
TWI749583B (en) 2021-12-11
TW202125299A (en) 2021-07-01

Similar Documents

Publication Publication Date Title
TWI749583B (en) Chain structure data storage, verification, realization method, system, device and media
TWI706275B (en) System and method for information protection
US20240064007A1 (en) Methods and systems for blockchain-implemented event-lock encryption
JP7109569B2 (en) Digital certificate verification method and its device, computer equipment and computer program
CN110089069B (en) System and method for information protection
CN107070644B (en) Decentralized public key management method and management system based on trust network
Lesavre et al. A taxonomic approach to understanding emerging blockchain identity management systems
CN108647964B (en) Block chain data processing method and device and computer readable storage medium
WO2019174430A1 (en) Block chain data processing method, management terminal, user terminal, conversion device, and medium
US20200193432A1 (en) Method and system for settling a blockchain transaction
KR101569818B1 (en) Entity Network Translation, ENT
Augot et al. Transforming face-to-face identity proofing into anonymous digital identity using the bitcoin blockchain
US10846372B1 (en) Systems and methods for trustless proof of possession and transmission of secured data
US20190295069A1 (en) Systems and methods for integrating cryptocurrency wallet identifiers with digital certificates
CN115176441A (en) Identity-based public key generation protocol
CN111614680B (en) CP-ABE-based traceable cloud storage access control method and system
US20230237437A1 (en) Apparatuses and methods for determining and processing dormant user data in a job resume immutable sequential listing
CN115885498A (en) Threshold signature
CN115136543A (en) Authentication service for use in blockchain networks
TW202231018A (en) Identifying denial-of-service attacks
EP4035326A1 (en) Divisible tokens
CN114747172A (en) Encrypting a link identity
Zhang et al. Redactable transactions in consortium blockchain: Controlled by multi-authority CP-ABE
CN113746630A (en) Block chain certificate management method and device, alliance chain and storage medium
US11856095B2 (en) Apparatus and methods for validating user data by using cryptography

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19956257

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19956257

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19956257

Country of ref document: EP

Kind code of ref document: A1