WO2023020442A1 - 一种区块链的生成方法及装置 - Google Patents

一种区块链的生成方法及装置 Download PDF

Info

Publication number
WO2023020442A1
WO2023020442A1 PCT/CN2022/112541 CN2022112541W WO2023020442A1 WO 2023020442 A1 WO2023020442 A1 WO 2023020442A1 CN 2022112541 W CN2022112541 W CN 2022112541W WO 2023020442 A1 WO2023020442 A1 WO 2023020442A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
type
information
chain node
block chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2022/112541
Other languages
English (en)
French (fr)
Inventor
王东晖
陈晶
刘斐
李凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to EP22857754.0A priority Critical patent/EP4354316A4/en
Publication of WO2023020442A1 publication Critical patent/WO2023020442A1/zh
Anticipated expiration legal-status Critical
Priority to US18/444,769 priority patent/US20240275621A1/en
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q2220/00Business processing using cryptography

Definitions

  • the present application relates to the field of communication technology, and in particular to a block chain generation method and device.
  • the present application provides a block chain generation method and device, which are used to improve the scalability of the block chain and improve the performance of the block chain.
  • the present application provides a block chain generation method, which may include: the first block chain node determines the block type of the first block, and according to the block type of the first block Determine the first block; then the first block chain node sends the first block to the second block chain node; the block type is the first type or the second type; the second block chain node A block chain node and the second block chain node are used to maintain a first block chain, and the first block chain includes at least one block of the first type and at least one block of the second type.
  • the block chain can include at least one block of the first type and at least one block of the second type, which improves the scalability of the block chain, thereby increasing the transaction throughput of the block chain, and further improving Blockchain performance.
  • the first blockchain node determines first information, and obtains the block header of the first block according to the first information; the first information includes one of the following information or multiple items: the preceding block information of the first block, the second type block reference information, block confirmation information, transaction information, or block confirmation cycle.
  • the first block chain node can accurately determine the block header of the first block, and then accurately determine the first block subsequently.
  • the method for the first block chain node to obtain the block header of the first block according to the first information may be: the first block chain node Perform one or more of the following processes: generate a first Merkle tree based on the transaction information or generate a second Merkle tree based on the second type of block reference information; Perform a hash operation on at least one of the first Merkle tree, the pre-block information, or the second Merkle tree to obtain a third Merkle tree; finally, the first block chain The node obtains the block header of the first block according to the root of the third Merkle tree. In this way, the first block chain node can accurately obtain the block header of the first block according to the first information.
  • the method for the first block chain node to determine the block type of the first block may be: the first block chain node performs a block header on the first block hash operation, and determine the block type of the first block according to the result of the hash operation. In this way, the first block chain node can determine whether the block type of the first block is the first type or the second type according to the result of the hash operation on the block header of the first block.
  • the method for the first blockchain node to determine the block type of the first block according to the result of the hash operation may be: when the result of the hash operation is less than or equal to When the first threshold is reached, the first block chain node determines that the block type of the first block is the first type; when the result of the hash operation is greater than the first threshold, and the second When a hash value is smaller than a second threshold, the first blockchain node determines that the block type of the first block is the second type; wherein the first threshold is smaller than the second threshold.
  • the first block chain node can determine whether the block type of the first block is the first type or the second type according to the result of the above hash operation, so that the subsequent determination of the block type of the first block according to the block type of the first block one block.
  • the method for the first block chain node to determine the first block according to the block type of the first block may be: when the block type of the first block is In the second type, the first block includes the transaction information and the first Merkle tree; wherein, the first Merkle tree is determined according to the transaction information; when the first When the block type of the block is the first type, the first block includes one or more of the following information: the preceding block information of the first block, the second type block reference information, or a second Merkle tree; wherein, the second Merkle tree is determined according to the second type block reference information.
  • the first blockchain node can fill the first block with content matching the block type of the first block, thereby obtaining the first block.
  • the blocks of the first type adopt the first consensus
  • the blocks of the second type adopt the second consensus
  • the blocks of the first type refer to the blocks of the second type .
  • the block of the first type and the block of the second type can be obtained by using the same consensus method or different consensus methods according to the situation, and the expansion performance of the block chain can be improved.
  • the present application provides a block chain generation method, which may include: the second block chain node receives the first block from the first block chain node, and determines the first block block type; then the second block chain node performs block verification on the first block according to the block type of the first block, and when the block verification is passed, the first block chain is updated;
  • the block type is the first type or the second type; the first block chain node and the second block chain node are used to maintain the first block chain, and the first block chain includes At least one block of the first type and at least one block of the second type.
  • the block chain can include at least one block of the first type and at least one block of the second type, which improves the scalability of the block chain, thereby increasing the transaction throughput of the block chain, and further improving Blockchain performance.
  • the method for the second block chain node to determine the block type of the first block may be: the second block chain node determines the hash value of the first block ; when the hash value of the first block is less than or equal to the first threshold, the second blockchain node determines that the block type of the first block is the first type; when the second When the hash value of a block is greater than the first threshold and the first hash value is smaller than the second threshold, the second blockchain node determines that the block type of the first block is the A second type; wherein the first threshold is smaller than the second threshold.
  • the second blockchain node can accurately determine the block type of the first block according to the hash value of the first block, and then perform subsequent block verification on the first block based on the determined block type.
  • the method for the second block chain node to determine the block type of the first block may be: the second block chain node receives the block type from the first block chain node The block type of the first block. In this way, the second block chain node can obtain the block type of the first block from the first block chain node, and then perform subsequent block verification on the first block based on the determined block type.
  • the second block chain node Block verification can include one or more of the following verifications: verify whether the membership certificate of the transaction information in the first block is correct; verify whether the transaction in the first block is legal; verify the Whether the first Merkle tree in the first block is correct; or, verify whether the hash value of the block header of the first block is correct.
  • the second blockchain node can verify the first block based on the verification method of the second type of block.
  • the second block chain node may include one or more of the following verifications: verifying whether the membership certificate of the second type block reference information in the first block is correct; verifying the block confirmation information in the first block whether the membership proof of the first block is correct; verify whether the membership proof of the preceding block of the first block is correct; or verify whether the hash value of the block header of the first block is correct.
  • the second blockchain node can verify the first block based on the verification method of the first type of block.
  • the second block chain node when the block type of the first block is the first type, the second block chain node
  • the block verification method may be as follows: the second block chain node verifies whether the second type of block referenced by the first block is correct. In this way, the second blockchain node can verify the first block based on the verification method of the first type of block.
  • the second block chain node saves the first block in the In the local second-type block pool, the second-type blocks included in the second-type block pool are not referenced by any of the first-type blocks.
  • blocks of the first type can refer to blocks of the second type in the block pool of the second type subsequently.
  • the present application also provides a block chain generation device, the block chain generation device may be a first block chain node, and the block chain generation device has the ability to realize the above first aspect or the first
  • the function of the method in each possible design example of an aspect may be implemented by hardware, or may be implemented by executing corresponding software on the hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the structure of the block chain generation device includes a communication unit and a processing unit, and these units can perform the corresponding functions in the above-mentioned first aspect or in each possible design example of the first aspect. For details, see The detailed description in the method example is not repeated here.
  • the structure of the block chain generation device includes a communication interface and a processor, and optionally also includes a memory, and the communication interface is used to send and receive blocks, and to communicate with other
  • the device communicates and interacts, and the processor is configured to support the block chain generation device to execute the corresponding functions in the first aspect or each possible design example of the first aspect.
  • the memory is coupled with the processor, which stores necessary program instructions and data of the block chain generation device.
  • the present application also provides a block chain generation device, the block chain generation device may be a second block chain node, and the block chain generation device has the ability to realize the above-mentioned second aspect or the first
  • the function of the method in each possible design example of two aspects may be implemented by hardware, or may be implemented by executing corresponding software on the hardware.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • the structure of the generating device of the block chain includes a communication unit and a processing unit, and these units can perform the corresponding functions in the above-mentioned second aspect or each possible design example of the second aspect. For details, see The detailed description in the method example is not repeated here.
  • the structure of the block chain generation device includes a communication interface and a processor, and optionally also includes a memory, and the communication interface is used to send and receive blocks, and to communicate with other
  • the device communicates and interacts, and the processor is configured to support the block chain generation device to execute the corresponding functions in the second aspect or each possible design example of the second aspect.
  • the memory is coupled with the processor, which stores necessary program instructions and data of the block chain generation device.
  • the embodiment of the present application provides a system, which may include the first blockchain node and the second blockchain node mentioned above.
  • the embodiments of the present application provide a computer-readable storage medium, the computer-readable storage medium stores program instructions, and when the program instructions are run on the computer, the computer executes the first aspect and its In any possible design, or the method described in the second aspect and any possible design thereof.
  • Exemplary, computer readable storage media may be any available media that can be accessed by a computer.
  • computer readable media may include non-transitory computer readable media, random-access memory (random-access memory, RAM), read-only memory (read-only memory, ROM), electrically erasable In addition to programmable read-only memory (electrically EPROM, EEPROM), CD-ROM or other optical disk storage, magnetic disk storage medium or other magnetic storage device, or can be used to carry or store the desired program code in the form of instructions or data structures and can Any other media accessed by a computer.
  • random-access memory random-access memory
  • read-only memory read-only memory
  • ROM read-only memory
  • CD-ROM or other optical disk storage magnetic disk storage medium or other magnetic storage device, or can be used to carry or store the desired program code in the form of instructions or data structures and can Any other media accessed by a computer.
  • the embodiments of the present application provide a computer program product including computer program codes or instructions, which, when run on a computer, enable the computer to implement the above-mentioned first aspect or any possible design of the first aspect, or The method described in the above second aspect or any possible design of the second aspect.
  • the present application also provides a chip, including a processor, the processor is coupled to a memory, and is used to read and execute program instructions stored in the memory, so that the chip realizes the above first aspect Or any possible design of the first aspect, or the method described in the above second aspect or any possible design of the second aspect.
  • Fig. 1 is a schematic diagram of the architecture of a block chain network provided by the present application.
  • Fig. 2 is a schematic diagram of a blockchain underlying architecture provided by the present application.
  • Fig. 3 is a flow chart of a block chain generation method provided by the present application.
  • FIG. 4 is a schematic diagram of a first block chain provided by the present application.
  • FIG. 5 is a schematic diagram of the generation process of a first block chain provided by the present application.
  • FIG. 6 is a schematic structural diagram of a block chain generation device provided by the present application.
  • FIG. 7 is a structural diagram of a block chain generation device provided by the present application.
  • Embodiments of the present application provide a method and device for generating a block chain, which are used to improve the scalability of the block chain and improve the performance of the block chain.
  • the method and the device described in this application are based on the same technical concept. Since the principles of the method and the device to solve the problem are similar, the implementation of the device and the method can be referred to each other, and the repetition will not be repeated.
  • At least one (individual, species) refers to one (individual, species) or multiple (individuals, species), and multiple (individuals, species) refers to two (individuals, species) species) or more than two items (one, species).
  • Fig. 1 shows a schematic diagram of the architecture of a block chain network applicable to the embodiment of the present application.
  • the blockchain network may include multiple blockchain nodes. Among them, after at least one blockchain node generates a block, it broadcasts the block, and other blockchain nodes verify the block after receiving the block, and update the local blockchain after the verification is passed.
  • the blockchain nodes that generate blocks may also be referred to as competing miners, and the blockchain nodes that receive blocks may be referred to as remaining miners. It should be understood that the above names are just examples, and this application does not limit them.
  • Any blockchain node can be, but not limited to, a server, a personal computer (PC), a network device, or a terminal device; or, any blockchain node can also be a processor or a chip in the above-mentioned equipment , or a functional module.
  • the method involved in the embodiment of the present application is applicable to existing 4G and 5G wireless communication systems and future wireless communication systems.
  • the network device is a device with wireless transceiver function or a chip that can be set on the network device
  • the network device includes but not limited to: evolved node B (evolved Node B, eNB), base station (generation node B, gNB), Radio network controller (radio network controller, RNC), node B (Node B, NB), base station controller (base station controller, BSC), base transceiver station (base transceiver station, BTS), home base station (for example, home evolved NodeB, or home Node B, HNB), baseband unit (baseband unit, BBU), wireless fidelity (wireless fidelity, Wi-Fi) system access point (access point, AP), wireless relay node, wireless back Transmission node, transmission point (transmission and reception point, TRP or transmission point, TP), satellite, high-altitude platform, drone, etc., can also be a network node that constitutes gNB or transmission point, such as a baseband unit (BBU), or, A distributed unit (DU),
  • Terminal equipment may also be called user equipment (user equipment, UE), access terminal, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent or user device.
  • the terminal device in the embodiment of the present application may be a mobile phone (mobile phone), a tablet computer (Pad), a computer with a wireless transceiver function, a virtual reality (virtual reality, VR) terminal device, an augmented reality (augmented reality, AR) terminal Equipment, wireless terminals in industrial control, wireless terminals in self driving, wireless terminals in remote medical, wireless terminals in smart grid, transportation safety ( Wireless terminals in transportation safety, wireless terminals in smart cities, smart wearable devices (smart glasses, smart watches, smart headphones, etc.), wireless terminals in smart homes, drones, etc.
  • VR virtual reality
  • AR augmented reality
  • a terminal device with a wireless transceiver function and a chip that can be installed in the aforementioned terminal device are collectively referred to as a terminal device.
  • FIG. 1 the structure of the block chain network schematic diagram shown in FIG. 1 is only an example, and there may be other layout structures between block chain nodes, which is not limited in this application.
  • FIG. 2 shows a schematic diagram of the underlying architecture of the blockchain to which the blockchain generation method provided by the embodiment of the present application is applicable.
  • the underlying architecture of the blockchain can be a layered architecture, for example, the underlying architecture of the blockchain can include a network layer, a consensus layer, a data layer, a protocol layer and an application layer. in:
  • the network layer can also be called peer-to-peer (P2P) network layer, which can include the following functional modules: P2P networking, network connection management, node status maintenance and data transmission services.
  • P2P peer-to-peer
  • the main purpose of the network layer is to realize information exchange between blockchain nodes.
  • the blockchain network is a P2P network.
  • Each blockchain node can both receive information and produce information.
  • the blockchain nodes maintain communication by maintaining a common blockchain.
  • each blockchain node can create a new block, and after the new block is created, it will notify other blockchain nodes in the form of broadcast, while other blockchain nodes will respond In the past, the blockchain node will be verified, and when the verification is passed, the new block will be added to the blockchain.
  • the consensus layer enables highly dispersed nodes to efficiently reach a consensus on the validity of block data in a decentralized system.
  • the commonly used consensus mechanisms in the blockchain mainly include workload proof, equity proof and share proof.
  • the consensus layer in this application can realize the above functions through an encryption module, a verification module and a consensus module.
  • the encryption method adopted by the encryption module can include but is not limited to secure hash algorithm (secure hash algorithm, SHA), BASE58 encoding method, elliptic curve digital signature algorithm (elliptic curve digital signature algorithm, ECDSA), hash (HASH) algorithm wait.
  • the verification module can perform membership proof, integrity proof and other verifications, such as random number verification and block header hash verification.
  • the main function of the data layer is to design the block and blockchain state, that is, to describe the physical form of blockchain technology.
  • the data layer includes transaction pools, transactions, blocks, blockchains, and databases.
  • the order of establishment of the data layer is as follows: the initial block established first is called the "genesis block", and then the blocks with the same specifications created under the same rules are connected sequentially through a chain structure to form a
  • the main chain as the running time gets longer and longer, new blocks are continuously added to the main chain after being verified.
  • Each block also contains many technologies, such as timestamp technology, which is used to ensure that each block can be connected in chronological order; another example is the hash function, which can prevent transaction information from being easily tamper.
  • blocks may include blocks of the first type and blocks of the second type. For the description of the first type and the second type, refer to the detailed introduction of the following method embodiments, which will not be elaborated here.
  • the protocol layer includes multiple protocol modules supported by the blockchain, such as remote procedure call (remote procedure call, RPC), hypertext transport protocol (hypertext transport protocol, HTTP) and other basic protocols.
  • RPC includes RPC server (RPC server), lightweight data exchange format (JavaScript object notation, JSON) RPC and RPC client (RPC client) based on JavaScript language.
  • Other basic protocols may include user datagram protocol (user datagram protocol, UDP) and/or transmission control protocol (transmission control protocol, TCP), etc.
  • the application layer encapsulates various application scenarios and cases of the blockchain.
  • the application layer includes blockchain-related applications, such as blockchain-based cross-border payment platforms and so on.
  • the block chain generation method provided by the embodiment of the present application can be applied to the block chain network shown in FIG. 1 and the block chain underlying architecture shown in FIG. 2 .
  • the detailed flow of the block chain generation method provided by the embodiment of the present application may include the following steps:
  • Step 301 The first block chain node determines the block type of the first block, and the block type can be the first type or the second type.
  • the first block chain node is used to maintain the first block chain, and the first block chain may include at least one block of the first type and at least one block of the second type.
  • the first block chain can be shown in Figure 4.
  • the first block chain includes a plurality of blocks of the first type and a plurality of blocks of the second type. It should be understood that this does not mean As a limitation of this application.
  • the blocks of the first type may be called strong blocks, and the blocks of the second type may be called weak blocks.
  • the first type of block may adopt the first consensus
  • the second type of block may adopt the second consensus
  • the first type of block refers to the second type of block
  • both the first consensus and the second consensus can be proof-of-work consensus; or, the first consensus can be proof-of-work consensus, and the second consensus can be other consensus than proof-of-work consensus, such as proof-of-stake consensus or Proxy proof-of-stake consensus; or, the first consensus can be other than the workload proof consensus, such as the stake proof consensus or the proxy stake proof consensus, and the second consensus can be the workload proof consensus; or, the first consensus and the second consensus They can all be other consensuses than proof-of-work consensus, such as proof-of-stake consensus or proxy-proof-of-stake consensus.
  • the first block chain node determines the first information, and obtains the block header of the first block according to the first information; wherein, the first information may include one or more of the following information Item: Pre-block information of the first block, reference information of the second type of block, block confirmation information, transaction information, or block confirmation cycle.
  • the pre-block information of the first block may include the following two situations:
  • the pre-block information of the first block includes the information (such as hash value) of the previous block of the first type
  • the pre-block information of the first block includes the information of the previous block of the first type and the block of the second type referenced by it (such as the hash value of each block).
  • the information of the second-type block referenced by the previous first-type block in case a2 is included in the previous first-type block, so regardless of the above-mentioned case a1 and case a2, the first The process of obtaining the block header of the first block by a blockchain node according to the first information can directly use the pre-block information of the first block.
  • the first block chain node obtains the block header of the first block according to the first information
  • the corresponding method may be: the first block chain node performs one or more of the following processing on the first information: generates the first block according to the transaction information A Merkle tree or a second Merkle tree generated based on the reference information of the second type of block; At least one item is hashed to obtain the third Merkle tree; finally, the first block chain node obtains the block header of the first block according to the root of the third Merkle tree.
  • the first blockchain node may construct a Merkle tree for the pre-information of the first block.
  • the first block chain node obtains the block header of the first block according to the first information
  • the corresponding method may be: the first block chain node performs one or more of the following processing on the first information: generates the first block according to the transaction information A Merkle tree, generate a fourth Merkle tree based on the pre-block information, or generate a second Merkle tree based on the reference information of the second type of block; the first block chain node to the first Merkle tree , at least one of the fourth Merkle tree or the second Merkle tree is hashed to obtain the third Merkle tree; finally, the first blockchain node obtains the root of the third Merkle tree The block header of the first block.
  • the fourth Merkle tree when the current block information is the case a1, the fourth Merkle tree contains only one root node information.
  • the preceding block information is case a2
  • the fourth Merkle tree when the information of the second type of block referenced by the previous first type of block is included in the previous first type of block, in the fourth Merkle tree only Contains a root node information; when the information of the second type block referenced in the previous first type block is not included in the previous first type block, the fourth Merkle tree contains multiple Node information.
  • the first Merkle tree can also be called a trade Merkle tree (trade Merkle tree, TrMT); the second Merkle tree can also be called a second type block reference tree or weak Block reference tree (weak block reference Merkle tree, WBRMT); the fourth Merkle tree can also be called the preposition Merkle tree (preposition Merkle tree, PMT); the third Merkle tree can also be called the content tree (content Merkle tree, CMT).
  • TrMT trade Merkle tree
  • TrMT trade Merkle tree
  • PMT weak Block reference Merkle tree
  • PMT preposition Merkle tree
  • CMT content Merkle tree
  • first information may also be called meta-information, and this application does not limit the name of the first information.
  • first block chain node processes the first information and obtains the block header of the first block
  • it can be realized through the meta information processing interface (MetaMsg()), and through the meta information processing interface through the first Information can be obtained from the block header of the first block.
  • MethodaMsg() meta information processing interface
  • the interface names are merely examples and may be named otherwise.
  • the first block chain node determines the block type of the first block
  • the corresponding method may be: the first block chain node performs a hash operation on the block header of the first block, and according to the hash operation The result determines the block type of the first block.
  • the first block chain node determines the block type of the first block according to the result of the hash operation, and the corresponding method may be: when the result of the hash operation is less than or equal to the first threshold, the first block chain The node determines that the block type of the first block is the first type; when the result of the hash operation is greater than the first threshold and the first hash value is less than the second threshold, the first block chain node determines that the first block The block type is the second type; wherein, the first threshold is smaller than the second threshold.
  • the block type of the first block is the first type. It should be understood that when the result of the hash operation is equal to the first threshold, the block type of the first block The block type of the block is the second type, and the application does not limit the classification of "equal to".
  • the first block chain node when the first block chain node performs the hash operation on the first block, the first block chain node may perform multiple hash operations, for example, the first block chain node selects different random numbers (nonce ) to perform a hash operation until the result of the hash operation is obtained.
  • the result of the hash operation may be a finally calculated hash value, which is not limited in this application.
  • the result of the hash operation is 256-bit data
  • the first 74 bits of the result of the hash operation are 0, it is determined that the first block is the first type block, and the current 70 bits are 0 , but when bits 71-74 are not 0, it is determined that the first block is the second type block.
  • the first block chain node performs the above hash operation, and determines the block of the first block according to the result of the hash operation type.
  • the first blockchain node determines the first block, it knows what type of block needs to be determined, and only needs to determine the first block according to the determined block type. Blocks are all that is needed. At this time, the first block chain node does not perform the above-mentioned hash operation and determine the block type of the first block according to the result of the hash operation.
  • the process of performing a hash operation when the first block chain node determines the block type of the first block can be implemented through a workload hash interface (PoWPro()).
  • PoWPro() workload hash interface
  • the first block may be a block other than the first block (ie, the genesis block) in the first blockchain.
  • the genesis block can be generated at the initial stage of blockchain generation, for example, the genesis block for system initialization can be generated through the initialization (Initialize()) interface.
  • Step 302 The first blockchain node determines the first block according to the block type of the first block.
  • step 302 can also be described as the first block chain node generating the first block according to the block type of the first block.
  • the first block chain node determines the first block according to the block type of the first block, and the corresponding method may be: when the block type of the first block is the second type , the first block includes transaction information and the first Merkle tree; wherein, the first Merkle tree is determined according to the transaction information; when the block type of the first block is the first type, the first block Including one or more of the following information: the preceding block information of the first block, the reference information of the second type block, or the second Merkle tree; wherein, the second Merkle tree is based on the second type block The blockquote information is determined.
  • the first block chain node determines the first block according to the block type of the first block, which is based on the block header of the first block and the block type of the first block to divide the block header in the first block Fill the rest of the content.
  • the first type of block has added the second type of block reference information and the second Merkle tree, so that in the first type of block Within a certain period of time, the system can upload multiple referenced blocks of the second type to the chain at the same time, thereby increasing the throughput of blocks/transactions per unit time.
  • the process of the first blockchain node determining the first block according to the block type of the first block can be implemented through the block filling interface (BlockFiling()).
  • BlockFiling() the block filling interface
  • the first block chain node determines the first block, it updates the first block chain.
  • Step 303 the first block chain node sends the first block to the second block chain node, that is, the second block chain node receives the first block from the first block chain node.
  • the first blockchain node sends the first block to the second blockchain node by broadcasting.
  • Step 304 The second blockchain node determines the block type of the first block.
  • the second blockchain node determines the block type of the first block
  • the corresponding method can be: the second block The chain node determines the hash value of the first block; when the hash value of the first block is less than or equal to the first threshold, the second block chain node determines that the block type of the first block is the first type; when When the hash value of the first block is greater than the first threshold and the first hash value is smaller than the second threshold, the second blockchain node determines that the block type of the first block is the second type.
  • the hash value of the first block is the hash value of the block header of the first block.
  • the second block chain node receives the block of the first block from the first block chain node block type, so that the second blockchain node can determine the block type of the first block. That is to say, in this case, when the first blockchain node broadcasts the first block, it also broadcasts the block type of the first block.
  • Step 305 The second blockchain node performs block verification on the first block according to the block type of the first block.
  • the second blockchain node when the block type of the first block is the second type, performs block verification on the first block according to the block type of the first block, which may include the following: One or more verifications:
  • the second block chain node performs block verification on the first block according to the block type of the first block, Can include one or more of the following verifications:
  • the second blockchain node can verify the first type of block through the above verification method.
  • the second block chain node when the block type of the first block is the first type, performs block verification on the first block according to the block type of the first block , for example, may include: the second blockchain node verifies whether the second type of block referenced by the first block is correct.
  • the second blockchain node can verify the first type of block through the above verification method.
  • a cryptographic public-private key pair may be used to connect the reference relationship (that is, the attribution relationship) between the block of the first type and the block of the second type. Furthermore, when the second blockchain node verifies whether the second type of block referenced by the first block is correct, it can be verified by means of a cryptographic public-private key pair.
  • the block verification process performed by the second blockchain node on the first block can be implemented through a block verification interface (VerifyBlock()).
  • VerifyBlock() a block verification interface
  • Step 306 After the block verification is passed, the second blockchain node updates the first blockchain.
  • the second block chain node saves the first block in the local second type area In the block pool, the blocks of the second type included in the block pool of the second type are not referenced by any block of the first type.
  • the first block chain node determines transaction information from the transaction pool, and the transaction information corresponds to the first block chain.
  • the generation process of the first blockchain can be simply summarized as the process shown in Figure 5.
  • the first block chain node determines the transaction information from the transaction pool, and then the first block chain node determines the first block through the method in step 301 and step 302 above, and then the first block chain node converts the first block
  • the block is sent to the second block chain node, and finally the second block chain node performs block verification on the first block through the methods in steps 304 to 306 above.
  • first block chain node broadcasts the first block
  • other block chain nodes may receive the first block besides the second block chain node and perform block verification. It should be understood that the operations of other blockchain nodes are the same as those of the second blockchain node, and reference can be made to the operation of the second blockchain node, which will not be described in detail here.
  • the block chain may include at least one block of the first type and at least one block of the second type, which improves the scalability of the block chain, thereby improving
  • the transaction throughput of the blockchain improves the performance of the blockchain.
  • the block chain generation device 600 may include a communication unit 601 and a processing unit 602 .
  • the communication unit 601 is used for the generation device 600 of the block chain to receive information (message or data) or send information (message or data), such as sending and/or receiving blocks
  • the processing unit 602 is used for Control and manage the actions of the block chain generation device 600.
  • the processing unit 602 may also control the steps performed by the communication unit 601 .
  • the block chain generation device 600 may be the first block chain node in the above embodiment, a processor in the first block chain node, or a chip, or a chip system, or a function modules, etc.; or, the block chain generation device 600 may be the second block chain node in the above embodiment, the processor of the second block chain node, or a chip, or a chip system, or a function modules etc.
  • the block chain generation device 600 when used to realize the function of the first block chain node in the embodiment described in FIG. 3 above, it may include:
  • the processing unit 602 is configured to determine the block type of the first block, and determine the first block according to the block type of the first block; the block type is the first type or the second type;
  • the communication unit 601 is used to send the first block to the second block chain node; the first block chain node and the second block chain node are used to maintain the first block chain, so
  • the first block chain includes at least one block of the first type and at least one block of the second type.
  • the processing unit 602 is further configured to: determine first information, and obtain the block header of the first block according to the first information; the first information includes the following information One or more of: the preceding block information of the first block, the second type of block reference information, block confirmation information, transaction information, or block confirmation cycle.
  • the processing unit 602 when it obtains the block header of the first block according to the first information, it is configured to: perform one or more of the following processing on the first information: according to the transaction information to generate a first Merkle tree or generate a second Merkle tree according to the second type of block reference information; for the first Merkle tree, the pre-block information or the second default At least one item in the Kerr tree is hashed to obtain a third Merkle tree; and the block header of the first block is obtained according to the root of the third Merkle tree.
  • the processing unit 602 when determining the block type of the first block, is configured to: perform a hash operation on the block header of the first block; determine according to the result of the hash operation The block type of the first block.
  • the processing unit 602 determines the block type of the first block according to the result of the hash operation, it is configured to: when the result of the hash operation is less than or equal to a first threshold , determine that the block type of the first block is the first type; when the result of the hash operation is greater than the first threshold and the first hash value is less than a second threshold, determine that the The block type of the first block is the second type; wherein, the first threshold is smaller than the second threshold.
  • the processing unit 602 when determining the first block according to the block type of the first block, is configured to: when the block type of the first block is the In the case of the second type, the first block includes the transaction information and the first Merkle tree; wherein, the first Merkle tree is determined according to the transaction information; when the first block When the block type of the block is the first type, the first block includes one or more of the following information: the preceding block information of the first block, the reference information of the second type block , or a second Merkle tree; wherein, the second Merkle tree is determined according to the second type of block reference information.
  • the blocks of the first type adopt the first consensus
  • the blocks of the second type adopt the second consensus
  • the blocks of the first type refer to the blocks of the second type block.
  • the block chain generation device 600 when used to realize the function of the second block chain node in the embodiment described in FIG. 3 above, it may include:
  • the communication unit 601 is used to receive the first block from the first block chain node; the processing unit 602 is used to determine the block type of the first block, and the block type is the first type or the second block type Two types; and perform block verification on the first block according to the block type of the first block, and update the first block chain after the block verification is passed; the first block chain node and The second block chain node is used to maintain the first block chain, and the first block chain includes at least one block of the first type and at least one block of the second type.
  • the processing unit 602 may be configured to: determine the hash value of the first block; When the hash value of the block is less than or equal to the first threshold, it is determined that the block type of the first block is the first type; when the hash value of the first block is greater than the first threshold, And when the first hash value is smaller than a second threshold, it is determined that the block type of the first block is the second type; wherein, the first threshold is smaller than the second threshold.
  • the communication unit 601 is further configured to receive the block type of the first block from the first block chain node; When the block type is a block, it may be used to: determine the block type of the first block according to the block type of the first block received by the communication unit 601 .
  • the communication unit 601 may be an input-output interface.
  • the processing unit 602 performs partitioning on the first block according to the block type of the first block During block verification, it can be used for one or more of the following verifications:
  • the processing unit 602 processes the first block according to the block type of the first block During block verification, it can be used for one or more of the following verifications:
  • the processing unit 602 processes the first block according to the block type of the first block During block verification, it can be used to: verify whether the second type of block referenced by the first block is correct.
  • the processing unit 602 is further configured to: save the first block in the local No. In the second-type block pool, the second-type blocks included in the second-type block pool are not referenced by any of the first-type blocks.
  • each functional unit in the embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
  • the embodiment of the present application also provides a block chain generation device.
  • the block chain generation device 700 may include a communication interface 701 and a processor 702 .
  • the block chain generation device 700 may also include a memory 703 .
  • the memory 703 can be set inside the block chain generating device 700 , or can be set outside the block chain generating device 700 .
  • the processor 702 can control the communication interface 701 to receive and send information or data, such as blocks.
  • the processor 702 and the memory 703 can also be integrated together.
  • the processor 702 may be a central processing unit (central processing unit, CPU), a network processor (network processor, NP) or a combination of CPU and NP.
  • the processor 702 may further include a hardware chip.
  • the aforementioned hardware chip may be an application-specific integrated circuit (application-specific integrated circuit, ASIC), a programmable logic device (programmable logic device, PLD) or a combination thereof.
  • the aforementioned PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (field-programmable gate array, FPGA), a general array logic (generic array logic, GAL) or any combination thereof.
  • the communication interface 701 , the processor 702 and the memory 703 are connected to each other.
  • the communication interface 701, the processor 702 and the memory 703 are connected to each other through a bus 704;
  • the bus 704 can be a Peripheral Component Interconnect (PCI) bus or an extended industry standard Structure (Extended Industry Standard Architecture, EISA) bus, etc.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in FIG. 7 , but it does not mean that there is only one bus or one type of bus.
  • the memory 703 is used to store programs and the like.
  • a program may include program code including computer operating instructions.
  • the memory 703 may include RAM, and may also include non-volatile memory (non-volatile memory), such as one or more disk memories.
  • the processor 702 executes the application program stored in the memory 703 to realize the above functions, thereby realizing the function of the block chain generation device 700 .
  • the block chain generation device 700 may be the first block chain node in the above embodiment; it may also be the second block chain node in the above embodiment.
  • the communication interface 701 can realize the Transmitting and receiving operations performed by the first blockchain node; the processor 702 can implement other operations performed by the first blockchain node in the embodiment shown in FIG. 3 except for the transmitting and receiving operation.
  • the communication interface 701 can realize the Transmitting and receiving operations performed by the first blockchain node; the processor 702 can implement other operations performed by the first blockchain node in the embodiment shown in FIG. 3 except for the transmitting and receiving operation.
  • the communication interface 701 can realize the Transmitting and receiving operations performed by the second blockchain node; the processor 702 can implement other operations except the transmitting and receiving operations performed by the second blockchain node in the embodiment shown in FIG. 3 .
  • the communication interface 701 can realize the Transmitting and receiving operations performed by the second blockchain node; the processor 702 can implement other operations except the transmitting and receiving operations performed by the second blockchain node in the embodiment shown in FIG. 3 .
  • an embodiment of the present application provides a system, which may include the first block chain node and the second block chain node involved in the above embodiments.
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a computer, the computer can implement the blockchain provided by the above-mentioned method embodiment generate method.
  • the embodiment of the present application also provides a computer program product, the computer program product is used to store a computer program, and when the computer program is executed by a computer, the computer can implement the block chain generation method provided by the above method embodiment.
  • the embodiment of the present application also provides a chip, including a processor, the processor is coupled with the memory, and is used to call the program in the memory so that the chip implements the block chain generation method provided by the above method embodiment.
  • the embodiment of the present application also provides a chip, the chip is coupled with a memory, and the chip is used to implement the block chain generation method provided in the above method embodiment.
  • the memory can also be integrated in the chip.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
  • the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Data Mining & Analysis (AREA)
  • Economics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Technology Law (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种区块链的生成方法及装置,包括:第一区块链节点确定第一区块的区块类型(301),并根据第一区块的区块类型确定第一区块(302);然后第一区块链节点将第一区块发送给第二区块链节点(303);然后第二区块链节点确定第一区块的区块类型(304);然后第二区块链节点根据第一区块的区块类型对第一区块进行区块验证(305);验证通过后,第二区块链节点更新第一区块链(306),区块类型为第一类型或第二类型;第一区块链节点和第二区块链节点用于维护第一区块链,第一区块链包括至少一个第一类型的区块和至少一个第二类型的区块。该区块链的生成方法及装置,提升了区块链的可扩展性和区块链的交易吞吐量,进而提升了区块链的性能。

Description

一种区块链的生成方法及装置
相关申请的交叉引用
本申请要求在2021年08月18日提交中国专利局、申请号为202110949570.5、申请名称为“一种区块链的生成方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种区块链的生成方法及装置。
背景技术
区块链技术作为一种分布式账本技术,由于其具备开放性、透明性和不可纂改性,已经被应用到诸多领域。随着用户数量和访问需求的大幅增加,区块链的处理速度成为性能瓶颈,可扩展性制约了区块链技术的应用和推广,如何提高区块链的可扩展性已成为目前关注的热点问题。
发明内容
本申请提供一种区块链的生成方法及装置,用以提高区块链的可扩展性,提升区块链的性能。
第一方面,本申请提供了一种区块链的生成方法,该方法可以包括:第一区块链节点确定第一区块的区块类型,并根据所述第一区块的区块类型确定所述第一区块;然后所述第一区块链节点将所述第一区块发送给第二区块链节点;所述区块类型为第一类型或第二类型;所述第一区块链节点和所述第二区块链节点用于维护第一区块链,所述第一区块链包括至少一个第一类型的区块和至少一个第二类型的区块。
通过上述方法,区块链中可以包括至少一个第一类型的区块和至少一个第二类型的区块,提升了区块链的可扩展性,从而提升区块链的交易吞吐量,进而提升区块链的性能。
在一个可能的设计中,所述第一区块链节点确定第一信息,并根据所述第一信息得到所述第一区块的区块头;所述第一信息包括以下信息中的一项或多项:所述第一区块的前置区块信息、第二类型区块引用信息、区块确认信息、交易信息、或区块确认周期。这样所述第一区块链节点可以准确地确定所述第一区块的区块头,进而后续准确确定第一区块。
在一个可能的设计中,所述第一区块链节点根据所述第一信息得到所述第一区块的区块头的方法可以为:所述第一区块链节点对所述第一信息进行以下一项或多项处理:根据所述交易信息生成第一默克尔树或根据所述第二类型区块引用信息生成第二默克尔树;所述第一区块链节点对所述第一默克尔树、所述前置区块信息或所述第二默克尔树中的至少一项进行哈希操作,得到第三默克尔树;最后所述第一区块链节点根据所述第三默克尔树的根得到所述第一区块的区块头。这样所述第一区块链节点可以准确地根据第一信息得到第一区块的区块头。
在一个可能的设计中,所述第一区块链节点确定所述第一区块的区块类型的方法可以 为:所述第一区块链节点对所述第一区块的区块头进行哈希操作,并根据所述哈希操作的结果确定所述第一区块的区块类型。这样所述第一区块链节点可以根据对所述第一区块的区块头的哈希操作的结果确定所述第一区块的区块类型是第一类型还是第二类型。
在一个可能的设计中,所述第一区块链节点根据所述哈希操作的结果确定所述第一区块的区块类型的方法可以为:当所述哈希操作的结果小于或等于第一阈值时,所述第一区块链节点确定所述第一区块的区块类型为所述第一类型;当所述哈希操作的结果大于所述第一阈值,且所述第一哈希值小于第二阈值时,所述第一区块链节点确定所述第一区块的区块类型为所述第二类型;其中,所述第一阈值小于所述第二阈值。
通过上述方法,第一区块链节点可以根据上述哈希操作的结果确定第一区块的区块类型是第一类型还是第二类型,以使后续根据第一区块的区块类型确定第一区块。
在一个可能的设计中,所述第一区块链节点根据所述第一区块的区块类型确定所述第一区块的方法可以为:当所述第一区块的区块类型为所述第二类型时,所述第一区块包括所述交易信息以及第一默克尔树;其中,所述第一默克尔树为根据所述交易信息确定的;当所述第一区块的区块类型为所述第一类型时,所述第一区块包括以下一项或多项信息:所述第一区块的前置区块信息、所述第二类型区块引用信息、或第二默克尔树;其中,所述第二默克尔树为根据所述第二类型区块引用信息确定的。这样,第一区块链节点可以将与第一区块的区块类型匹配的内容填充到第一区块,从而得到第一区块。
在一个可能的设计中,所述第一类型的区块采用第一共识,所述第二类型的区块采用第二共识,所述第一类型的区块引用所述第二类型的区块。这样可以根据情况使第一类型的区块和第二类型的区块采用相同的共识方法或不同的共识方法得到,提升区块链的扩展性能。
第二方面,本申请提供了一种区块链的生成方法,该方法可以包括:第二区块链节点从第一区块链节点接收第一区块,并确定所述第一区块的区块类型;然后所述第二区块链节点根据所述第一区块的区块类型对所述第一区块进行区块验证,当区块验证通过后,更新第一区块链;所述区块类型为第一类型或第二类型;所述第一区块链节点和所述第二区块链节点用于维护所述第一区块链,所述第一区块链包括至少一个第一类型的区块和至少一个第二类型的区块。
通过上述方法,区块链中可以包括至少一个第一类型的区块和至少一个第二类型的区块,提升了区块链的可扩展性,从而提升区块链的交易吞吐量,进而提升区块链的性能。
在一个可能的设计中,所述第二区块链节点确定所述第一区块的区块类型的方法可以为:所述第二区块链节点确定所述第一区块的哈希值;当所述第一区块的哈希值小于或者等于第一阈值时,所述第二区块链节点确定所述第一区块的区块类型为所述第一类型;当所述第一区块的哈希值大于所述第一阈值,且所述第一哈希值小于第二阈值时,所述第二区块链节点确定所述第一区块的区块类型为所述第二类型;其中,所述第一阈值小于所述第二阈值。这样,所述第二区块链节点可以根据第一区块的哈希值准确地确定第一区块的区块类型,进而基于确定的区块类型对第一区块进行后续区块验证。
在一个可能的设计中,所述第二区块链节点确定所述第一区块的区块类型的方法可以为:所述第二区块链节点从所述第一区块链节点接收所述第一区块的区块类型。这样,所述第二区块链节点可以从第一区块链节点获取第一区块的区块类型,进而基于确定的区块类型对第一区块进行后续区块验证。
在一个可能的设计中,当所述第一区块的区块类型为所述第二类型时,所述第二区块链节点根据所述第一区块的区块类型对所述第一区块进行区块验证,可以包括如下一项或多项验证:验证所述第一区块中的交易信息的成员证明是否正确;验证所述第一区块中的交易是否合法;验证所述第一区块中第一默克尔树是否正确;或者,验证所述第一区块的区块头的哈希值是否正确。这样第二区块链节点可以基于第二类型的区块的验证方式来验证第一区块。
在一个可能的设计中,当所述第一区块的区块类型为所述第一类型时,所述第二区块链节点根据所述第一区块的区块类型对所述第一区块进行区块验证,可以包括如下一项或多项验证:验证所述第一区块中第二类型区块引用信息的成员证明是否正确;验证所述第一区块中区块确认信息的成员证明是否正确;验证所述第一区块的前置区块的成员证明是否正确;或者,验证所述第一区块的区块头的哈希值是否正确。这样第二区块链节点可以基于第一类型的区块的验证方式来验证第一区块。
在一个可能的设计中,当所述第一区块的区块类型为所述第一类型时,所述第二区块链节点根据所述第一区块的区块类型对所述第一区块进行区块验证的方法可以为:所述第二区块链节点验证所述第一区块引用的第二类型的区块是否正确。这样第二区块链节点可以基于第一类型的区块的验证方式来验证第一区块。
在一个可能的设计中,当所述第一区块的区块类型为所述第二类型时,当区块验证通过后,所述第二区块链节点将所述第一区块保存在本地第二类型区块池中,所述第二类型区块池中包括的第二类型的区块未被任一个所述第一类型的区块引用。这样后续可以使第一类型的区块引用第二类型区块池中的第二类型的区块。
第三方面,本申请还提供了一种区块链的生成装置,所述区块链的生成装置可以是第一区块链节点,该区块链的生成装置具有实现上述第一方面或第一方面的各个可能的设计示例中的方法的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。
在一个可能的设计中,所述区块链的生成装置的结构中包括通信单元和处理单元,这些单元可以执行上述第一方面或第一方面的各个可能的设计示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。
在一个可能的设计中,所述区块链的生成装置的结构中包括通信接口和处理器,可选的还包括存储器,所述通信接口用于收发区块,以及用于与系统中的其他设备进行通信交互,所述处理器被配置为支持所述区块链的生成装置执行上述第一方面或第一方面的各个可能的设计示例中的相应的功能。所述存储器与所述处理器耦合,其保存所述区块链的生成装置必要的程序指令和数据。
第四方面,本申请还提供了一种区块链的生成装置,所述区块链的生成装置可以是第二区块链节点,该区块链的生成装置具有实现上述第二方面或第二方面的各个可能的设计示例中的方法的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。
在一个可能的设计中,所述区块链的生成装置的结构中包括通信单元和处理单元,这些单元可以执行上述第二方面或第二方面的各个可能的设计示例中的相应功能,具体参见方法示例中的详细描述,此处不做赘述。
在一个可能的设计中,所述区块链的生成装置的结构中包括通信接口和处理器,可选 的还包括存储器,所述通信接口用于收发区块,以及用于与系统中的其他设备进行通信交互,所述处理器被配置为支持所述区块链的生成装置执行上述第二方面或第二方面的各个可能的设计示例中的相应的功能。所述存储器与所述处理器耦合,其保存所述区块链的生成装置必要的程序指令和数据。
第五方面,本申请实施例提供了一种系统,可以包括上述提及的第一区块链节点和第二区块链节点。
第六方面,本申请实施例提供的一种计算机可读存储介质,该计算机可读存储介质存储有程序指令,当程序指令在计算机上运行时,使得计算机执行本申请实施例第一方面及其任一可能的设计中,或第二方面及其任一可能的设计中所述的方法。示例性的,计算机可读存储介质可以是计算机能够存取的任何可用介质。以此为例但不限于:计算机可读介质可以包括非瞬态计算机可读介质、随机存取存储器(random-access memory,RAM)、只读存储器(read-only memory,ROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)、CD-ROM或其他光盘存储、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质。
第七方面,本申请实施例提供一种包括计算机程序代码或指令的计算机程序产品,当其在计算机上运行时,使得计算机实现上述第一方面或第一方面任一种可能的设计中,或者上述第二方面或第二方面任一种可能的设计中所述的方法。
第八方面,本申请还提供了一种芯片,包括处理器,所述处理器与存储器耦合,用于读取并执行所述存储器中存储的程序指令,以使所述芯片实现上述第一方面或第一方面任一种可能的设计中,或者上述第二方面或第二方面任一种可能的设计中所述的方法。
上述第三方面至第八方面中的各个方面以及各个方面可能达到的技术效果请参照上述针对第一方面或第一方面中的各种可能方案,或者第二方面或第二方面中的各种可能方案可以达到的技术效果说明,这里不再重复赘述。
附图说明
图1为本申请提供的一种区块链网络的架构示意图;
图2为本申请提供的一种区块链底层架构的示意图;
图3为本申请提供的一种区块链的生成方法的流程图;
图4为本申请提供的一种第一区块链的示意图;
图5为本申请提供的一种第一区块链的生成流程示意图;
图6为本申请提供的一种区块链的生成装置的结构示意图;
图7为本申请提供的一种区块链的生成装置的结构图。
具体实施方式
下面将结合附图对本申请作进一步地详细描述。
本申请实施例提供一种区块链的生成方法及装置,用以提高区块链的可扩展性,提升区块链的性能。其中,本申请所述方法和装置基于同一技术构思,由于方法及装置解决问题的原理相似,因此装置与方法的实施可以相互参见,重复之处不再赘述。
在本申请的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。
在本申请中的描述中,“至少一项(个、种)”是指一项(个、种)或者多项(个、种),多项(个、种)是指两项(个、种)或者两项(个、种)以上。
为了更加清晰地描述本申请实施例的技术方案,下面结合附图,对本申请实施例提供的区块链的生成方法及装置进行详细说明。
图1示出了本申请实施例适用的一种区块链网络的架构示意图。如图1所示,该区块链网络可以包括多个区块链节点。其中,至少一个区块链节点生成一个区块后,广播该区块,其他区块链节点收到该区块后对区块进行区块验证,验证通过后更新本地的区块链。可选的,也可以将生成区块的区块链节点称为竞争矿工,将接收区块的区块链节点称为其余矿工,应理解,上述名称仅是示例,本申请对此不作限定。
任一个区块链节点可以但不限于是服务器、个人电脑(personal computer,PC)、网络设备、或终端设备;或者,任一个区块链节点也可以是上述列举的设备中的处理器、芯片、或一个功能模块。
示例性的,本申请实施例涉及的方法适用于现有的4G、5G无线通信系统和未来的无线通信系统。
其中,网络设备为具有无线收发功能的设备或可设置于该网络设备的芯片,该网络设备包括但不限于:演进型节点B(evolved Node B,eNB)、基站(generation node B,gNB)、无线网络控制器(radio network controller,RNC)、节点B(Node B,NB)、基站控制器(base station controller,BSC)、基站收发台(base transceiver station,BTS)、家庭基站(例如,home evolved NodeB,或home Node B,HNB)、基带单元(baseband unit,BBU),无线保真(wireless fidelity,Wi-Fi)系统中的接入点(access point,AP)、无线中继节点、无线回传节点、传输点(transmission and reception point,TRP或者transmission point,TP)、卫星、高空平台、无人机等,还可以为构成gNB或传输点的网络节点,如基带单元(BBU),或,分布式单元(distributed unit,DU),或者通信系统中承担基站功能的网络设备。
终端设备也可以称为用户设备(user equipment,UE)、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。本申请的实施例中的终端设备可以是手机(mobile phone)、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(virtual reality,VR)终端设备、增强现实(augmented reality,AR)终端设备、工业控制(industrial control)中的无线终端、无人驾驶(self driving)中的无线终端、远程医疗(remote medical)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智能穿戴设备(智能眼镜、智能手表、智能耳机等)、智慧家庭(smart home)中的无线终端、无人机等等,也可以是能够设置于以上设备的芯片或芯片模组(或芯片系统)等。本申请的实施例对应用场景不做限定。本申请中将具有无线收发功能的终端设备及可设置于前述终端设备的芯片统称为终端设备。
需要说明的是,图1示出的区块链网络中区块链节点的数量仅为示例,应理解,还可以包括更多或更少的区块链节点,本申请对此不作限定。
需要说明的是,图1示出的区块链网络的架构示意图的结构也仅仅是示例,区块链节点之间还可以有其他布局结构,本申请对此不作限定。
图2示出了本申请实施例提供的区块链的生成方法适用的区块链底层架构的示意图。如图2所示,该区块链底层架构可以是分层架构,例如该区块链底层架构可以包括网络层、共识层、数据层、协议层和应用层。其中:
网络层也可以称为点对点(peer to peer,P2P)网络层,可以包括如下功能模块:P2P组网、网络连接管理、节点状态维护和数据传输服务。网络层的主要目的是实现区块链节点之间的信息交互。区块链网络是一个P2P网络,每一个区块链节点既能够接受信息,也能够生产信息,区块链节点之间通过维护一个共同的区块链来保持通信。在区块链网络中,每一个区块链节点都可以创造出新的区块,在新区块被创造出以后会通过广播的形式通知其他的区块链节点,而其他区块链节点则反过来会对这个区块链节点进行验证,当验证通过以后,这个新的区块就会被添加到区块链上。
共识层能够让高度分散的节点在去中心化的系统中高效的针对区块数据的有效性达成共识。区块链中比较常用的共识机制主要有工作量证明、权益证明和股份证明三种。示例性的,本申请中共识层可以通过加密模块、验证模块和共识模块实现上述功能。其中,加密模块采用的加密方法可以但不限于包括安全散列算法(secure hash algorithm,SHA)、BASE58编码方式、椭圆曲线数字签名算法(elliptic curve digital signature algorithm,ECDSA)、哈希(HASH)算法等。验证模块可以进行成员证明、完整性证明以及其他验证,其他验证例如随机数验证和区块头的哈希验证等。
数据层的主要作用是主要对于区块和区块链状态进行设计,也即描述区块链技术的物理形式。数据层包括交易池、交易、区块、区块链和数据库。数据层的建立顺序为:首先建立起的一个起始区块被称作是“创世区块”,之后在同样的规则之下创建的规格相同的区块通过一个链式结构依次相连组成一条主链,随着运行时间越来越长,新的区块通过验证后不断被添加到主链上。每一个区块中同时也包含了许多的技术,比如时间戳技术,其作用在于确保每一个区块都可以按时间的顺序相连接;再比如哈希函数,其能够使得交易的信息不被轻易篡改。在本申请中,区块可以包括第一类型的区块和第二类型的区块。第一类型和第二类型的描述可以参见下面方法实施例的详细介绍,此处不详细展开。
协议层包括区块链支持的多个协议模块,例如,远程过程调用(remote procedure call,RPC)、超文本传输协议(hypertext transport protocol,HTTP)和其他基础协议。其中RPC包括RPC服务器(RPC server)、基于JavaScript语言的轻量级的数据交换格式(JavaScript object notation,JSON)RPC和RPC客户端(RPC client)。其他基础协议可以包括用户数据报协议(user datagram protocol,UDP)和/或传输控制协议(transmission control protocol,TCP)等。
应用层封装了区块链的各种应用场景和案例。应用层包括区块链相关应用,例如基于区块链的跨境支付平台等等。
基于上述描述,下面对本申请实施例提供的区块链的生成方法进行详细说明。本申请实施例提供的区块链的生成方法可以应用于图1所示的区块链网络和图2所示的区块链底层架构。参阅图3所示,本申请实施例提供的区块链的生成方法的详细流程可以包括如下步骤:
步骤301:第一区块链节点确定第一区块的区块类型,该区块类型可以为第一类型或第二类型。
其中,第一区块链节点用于维护第一区块链,第一区块链可以包括至少一个第一类型 的区块和至少一个第二类型的区块。例如,第一区块链可以如图4所示,图4中以第一区块链包括多个第一类型的区块和多个第二类型的区块示出,应理解,这并不作为对本申请的限定。
示例性的,第一类型的区块可以称之为强区块,第二类型的区块可以称之为弱区块。
在一种可选的实施方式中,第一类型的区块可以采用第一共识,第二类型的区块可以采用第二共识,第一类型的区块引用所述第二类型的区块。
示例性的,第一共识和第二共识可以均是工作量证明共识;或者,第一共识可以是工作量证明共识,第二共识可以除工作量证明共识以外的其他共识,如股权证明共识或代理股权证明共识;或者,第一共识可以除工作量证明共识以外的其他共识,如股权证明共识或代理股权证明共识,第二共识可以是工作量证明共识;或者,第一共识和第二共识可以均是除工作量证明共识以外的其他共识,如股权证明共识或代理股权证明共识。
在一种可选的实施方式中,第一区块链节点确定第一信息,并根据第一信息得到第一区块的区块头;其中,第一信息可以包括以下信息中的一项或多项:第一区块的前置区块信息、第二类型区块引用信息、区块确认信息、交易信息、或区块确认周期。
可选的,第一区块的前置区块信息可以包括以下两种情况:
情况a1、第一区块的前置区块信息包括前一个第一类型的区块的信息(如哈希值);
情况a2、第一区块的前置区块信息包括前一个第一类型的区块与其引用的第二类型的区块的信息(如各个区块的哈希值)。
在一种示例中,情况a2中前一个第一类型的区块引用的第二类型的区块的信息包含在前一个第一类型的区块中,所以无论上述情况a1和情况a2中,第一区块链节点根据第一信息得到第一区块的区块头的过程均可以直接使用第一区块的前置区块信息。例如,第一区块链节点根据第一信息得到第一区块的区块头,相应方法可以为:第一区块链节点对第一信息进行以下一项或多项处理:根据交易信息生成第一默克尔树或根据第二类型区块引用信息生成第二默克尔树;第一区块链节点对第一默克尔树、前置区块信息或第二默克尔树中的至少一项进行哈希操作,得到第三默克尔树;最后,第一区块链节点根据第三默克尔树的根得到第一区块的区块头。
在另一种示例中,第一区块链节点根据第一信息得到第一区块的区块头的过程中,可以对第一区块的前置信息构造默克尔树。例如,第一区块链节点根据第一信息得到第一区块的区块头,相应方法可以为:第一区块链节点对第一信息进行以下一项或多项处理:根据交易信息生成第一默克尔树、根据前置区块信息生成第四默克尔树、或根据第二类型区块引用信息生成第二默克尔树;第一区块链节点对第一默克尔树、第四默克尔树或第二默克尔树中的至少一项进行哈希操作,得到第三默克尔树;最后,第一区块链节点根据第三默克尔树的根得到第一区块的区块头。
需要说明的是,在该方法中,当前置区块信息为情况a1时,第四默克尔树中仅包含一个根节点信息。当前置区块信息为情况a2时,在前一个第一类型的区块引用的第二类型的区块的信息包含在前一个第一类型的区块中时,第四默克尔树中仅包含一个根节点信息;当在前一个第一类型的区块引用的第二类型的区块的信息没有包含在前一个第一类型的区块中时,第四默克尔树中包含多个节点信息。
示例性的,第一默克尔树也可以称为交易默克尔树(trade Merkle tree,TrMT);第二默克尔树也可以称为第二类型区块引用树或者也可以称为弱区块引用树(weak block  reference Merkle tree,WBRMT);第四默克尔树也可以称为前置默克尔树(preposition Merkle tree,PMT);第三默克尔树也可以称为内容树(content Merkle tree,CMT)。应理解,上述名称仅为示例,还可以有其它命名,本申请对此不作限定。
需要说明的是,上述第一信息也可以称元信息,本申请对于第一信息的名字不作限定。
可选的,上述第一区块链节点对第一信息进行处理并得到第一区块的区块头时,可以通过元信息处理接口(MetaMsg())来实现,通过元信息处理接口通过第一信息可以得到第一区块的区块头。应理解,接口名称仅为示例,可以命名为其他名称。
可选的,第一区块链节点确定第一区块的区块类型,相应方法可以为:第一区块链节点对第一区块的区块头进行哈希操作,并根据哈希操作的结果确定第一区块的区块类型。
示例性的,第一区块链节点根据哈希操作的结果确定第一区块的区块类型,相应方法可以为:当哈希操作的结果小于或等于第一阈值时,第一区块链节点确定第一区块的区块类型为第一类型;当哈希操作的结果大于第一阈值,且第一哈希值小于第二阈值时,第一区块链节点确定第一区块的区块类型为第二类型;其中,第一阈值小于第二阈值。
在上述描述中,当哈希操作的结果等于第一阈值时,第一区块的区块类型为第一类型,应理解,也可以当哈希操作的结果等于第一阈值时,第一区块的区块类型为第二类型,本申请不限定“等于”的情况归类。
其中,在第一区块链节点对第一区块进行哈希操作时,第一区块链节点可以是进行了多次哈希操作,例如第一区块链节点选取不同的随机数(nonce)进行哈希操作,直至得到该哈希操作的结果。示例性的,该哈希操作的结果可以是最终计算得到的一个哈希值,本申请对此不作限定。
例如,假设哈希操作的结果为256比特(bit)的数据,当哈希操作的结果的前74位是0的时候,则确定第一区块为第一类型区块,当前70位是0,但是71-74位不为0的时候,则确定第一区块为第二类型区块。
需要说明的是,上述涉及的第一共识和第二共识均为工作量证明共识时,第一区块链节点进行上述哈希操作,并根据哈希操作的结果确定第一区块的区块类型。当第一共识和第二共识为其他情况时,第一区块链节点在确定第一区块时,已知需要确定什么区块类型的区块,只需根据确定的区块类型确定第一区块即可,此时第一区块链节点不执行上述哈希操作以及根据哈希操作的结果确定第一区块的区块类型的操作。
可选的,第一区块链节点确定第一区块的区块类型时进行哈希操作的过程可以通过工作量哈希接口(PoWPro())来实现。应理解,上述接口名称仅为示例,还可以有其它名称。
可选的,第一区块可以是除第一区块链中第一个区块(即创世区块)以外的区块。其中创世区块可以是在区块链生成初始阶段生成的,例如,可以通过初始化(Initialize())接口来产生系统初始化的创世区块。
步骤302:第一区块链节点根据第一区块的区块类型确定第一区块。
可选的,步骤302也可以描述为第一区块链节点根据第一区块的区块类型生成第一区块。
在一种可选的实施方式中,第一区块链节点根据第一区块的区块类型确定第一区块,相应方法可以为:当第一区块的区块类型为第二类型时,第一区块包括交易信息以及第一默克尔树;其中,第一默克尔树为根据交易信息确定的;当第一区块的区块类型为第一类型时,第一区块包括以下一项或多项信息:第一区块的前置区块信息、第二类型区块引用 信息、或第二默克尔树;其中,第二默克尔树为根据第二类型区块引用信息确定的。
其中,第一区块链节点根据第一区块的区块类型确定第一区块,是基于第一区块的区块头以及第一区块的区块类型对第一区块中除区块头以外的部分进行内容填充。
需要说明的是,目前现有的区块没有区分区块类型,但是第二类型的区块包括的内容与现有区块包括的内容类似。而第一类型区块包括的内容与现有的区块包括的内容不同,例如可以如下表1所示:
表1第一类型的区块和现有的区块的内容对比
Figure PCTCN2022112541-appb-000001
由上述表1可以看出,相比于现有的区块,第一类型的区块新增了第二类型区块引用信息和第二默克尔树,这样在第一类型的区块的时间内,系统可以同时将多个被引用的第二类型的区块上链,从而提升单位时间区块/交易的吞吐量。
可选的,第一区块链节点根据第一区块的区块类型确定第一区块的过程可以通过区块填充接口(BlockFiling())实现。应理解,上述接口名称仅为示例,还可以有其它名称。
可选的,第一区块链节点确定第一区块后,更新第一区块链。
步骤303:第一区块链节点将第一区块发送给第二区块链节点,也即第二区块链节点从第一区块链节点接收第一区块。
可选的,第一区块链节点通过广播的方式将第一区块发送给第二区块链节点。
步骤304:第二区块链节点确定第一区块的区块类型。
在第一种可能的情况下,当第一共识和第二共识均为工作量证明共识时,第二区块链节点确定第一区块的区块类型,相应方法可以为:第二区块链节点确定第一区块的哈希值;当第一区块的哈希值小于或者等于第一阈值时,第二区块链节点确定第一区块的区块类型为第一类型;当第一区块的哈希值大于第一阈值,且第一哈希值小于第二阈值时,第二区块链节点确定第一区块的区块类型为第二类型。
同理,“等于”也可以归类于第二类型。
其中,第一区块的哈希值即为第一区块的区块头的哈希值。
在第二种可能的情况下,当第一共识和第二共识为除均为工作量证明共识以外的共识时,第二区块链节点从第一区块链节点接收第一区块的区块类型,由此第二区块链节点即可确定第一区块的区块类型。也就是说,在这种情况下,第一区块链节点在广播第一区块时,同时广播了第一区块的区块类型。
步骤305:第二区块链节点根据第一区块的区块类型对第一区块进行区块验证。
在一种示例中,当第一区块的区块类型为第二类型时,第二区块链节点根据第一区块的区块类型对第一区块进行区块验证,可以包括如下一项或多项验证:
验证第一区块中的交易信息的成员证明是否正确;
验证第一区块中的交易是否合法;
验证第一区块中第一默克尔树是否正确;或者
验证第一区块的区块头的哈希值是否正确。
在一种可选的实施方式中,当第一区块的区块类型为第一类型时,第二区块链节点根据第一区块的区块类型对第一区块进行区块验证,可以包括如下一项或多项验证:
验证第一区块中第二类型区块引用信息的成员证明是否正确;
验证第一区块中区块确认信息的成员证明是否正确;
验证第一区块的前置区块的成员证明是否正确;
验证第一区块的区块头的哈希值是否正确。
可选的,当第一共识为工作量证明共识时,第二区块链节点可以通过上述验证方法来验证第一类型的区块。
在另一种可选的实施方式中,当第一区块的区块类型为第一类型时,第二区块链节点根据第一区块的区块类型对第一区块进行区块验证,例如可以包括:第二区块链节点验证第一区块引用的第二类型的区块是否正确。
可选的,当第一共识不为工作量证明共识时,第二区块链节点可以通过上述验证方法来验证第一类型的区块。
示例性的,第一类型的区块和第二类型的区块之间可以利用密码学公私钥对连接两者的引用关系(也即归属关系)。进而,在第二区块链节点验证第一区块引用的第二类型的区块是否正确时,可以采用密码学公私钥对的方式来验证。
可选的,第二区块链节点对第一区块进行的区块验证的过程可以通过区块验证接口(VerifyBlock())实现。应理解,上述接口名称仅为示例,还可以有其它名称。
步骤306:当区块验证通过后,第二区块链节点更新第一区块链。
在一种可选的实施方式中,当第一区块的区块类型为第二类型时,当区块验证通过后,第二区块链节点将第一区块保存在本地第二类型区块池中,该第二类型区块池中包括的第二类型的区块未被任一个第一类型的区块引用。
需要说明的是,第一区块链节点在确定第一区块之前从交易池中确定交易信息,该交易信息对应第一区块链。
基于上述描述,第一区块链的生成流程可以简单概括为如图5所示的流程。例如,第一区块链节点从交易池中确定交易信息,然后第一区块链节点通过上述步骤301和步骤302中的方法确定第一区块,之后第一区块链节点将第一区块发送给第二区块链节点,最后第二区块链节点通过上述步骤304到步骤306中的方法对第一区块进行区块验证。
需要说明的是,在第一区块链节点广播第一区块之后,除了第二区块链节点,可能还有其他区块链节点接收到该第一区块,并进行区块验证。应理解,其他区块链节点的操作与第二区块链节点的操作相同,可以参考第二区块链节点的操作,此处不再详细描述。
采用本申请实施例提供的区块链的生成方法,区块链中可以包括至少一个第一类型的区块和至少一个第二类型的区块,提升了区块链的可扩展性,从而提升区块链的交易吞吐量,进而提升区块链的性能。
基于以上实施例,本申请实施例还提供了一种区块链的生成装置,参阅图6所示,区块链的生成装置600可以包括通信单元601和处理单元602。其中,所述通信单元601用于所述区块链的生成装置600接收信息(消息或数据)或发送信息(消息或数据),例如发送和/或接收区块,所述处理单元602用于对所述区块链的生成装置600的动作进行控制 管理。所述处理单元602还可以控制所述通信单元601执行的步骤。
示例性地,该区块链的生成装置600可以是上述实施例中的第一区块链节点、所述第一区块链节点中的处理器,或者芯片,或者芯片系统,或者是一个功能模块等;或者,该区块链的生成装置600可以是上述实施例中的第二区块链节点、所述第二区块链节点的处理器,或者芯片,或者芯片系统,或者是一个功能模块等。
在一个实施例中,所述区块链的生成装置600用于实现上述图3所述的实施例中第一区块链节点的功能时,可以包括:
所述处理单元602用于确定第一区块的区块类型,根据所述第一区块的区块类型确定所述第一区块;所述区块类型为第一类型或第二类型;所述通信单元601用于将所述第一区块发送给第二区块链节点;所述第一区块链节点和所述第二区块链节点用于维护第一区块链,所述第一区块链包括至少一个第一类型的区块和至少一个第二类型的区块。
在一种可选的实施方式中,所述处理单元602还用于:确定第一信息,根据所述第一信息得到所述第一区块的区块头;所述第一信息包括以下信息中的一项或多项:所述第一区块的前置区块信息、第二类型区块引用信息、区块确认信息、交易信息、或区块确认周期。
示例性的,所述处理单元602在根据所述第一信息得到所述第一区块的区块头时,用于:对所述第一信息进行以下一项或多项处理:根据所述交易信息生成第一默克尔树或根据所述第二类型区块引用信息生成第二默克尔树;对所述第一默克尔树、所述前置区块信息或所述第二默克尔树中的至少一项进行哈希操作,得到第三默克尔树;根据所述第三默克尔树的根得到所述第一区块的区块头。
可选的,所述处理单元602在确定所述第一区块的区块类型时,用于:对所述第一区块的区块头进行哈希操作;根据所述哈希操作的结果确定所述第一区块的区块类型。
一种示例中,所述处理单元602在根据所述哈希操作的结果确定所述第一区块的区块类型时,用于:当所述哈希操作的结果小于或等于第一阈值时,确定所述第一区块的区块类型为所述第一类型;当所述哈希操作的结果大于所述第一阈值,且所述第一哈希值小于第二阈值时,确定所述第一区块的区块类型为所述第二类型;其中,所述第一阈值小于所述第二阈值。
在一种可能的方式中,所述处理单元602在根据所述第一区块的区块类型确定所述第一区块时,用于:当所述第一区块的区块类型为所述第二类型时,所述第一区块包括所述交易信息以及第一默克尔树;其中,所述第一默克尔树为根据所述交易信息确定的;当所述第一区块的区块类型为所述第一类型时,所述第一区块包括以下一项或多项信息:所述第一区块的前置区块信息、所述第二类型区块引用信息、或第二默克尔树;其中,所述第二默克尔树为根据所述第二类型区块引用信息确定的。
在一种可选的实施方式中,所述第一类型的区块采用第一共识,所述第二类型的区块采用第二共识,所述第一类型的区块引用所述第二类型的区块。
在另一个实施例中,所述区块链的生成装置600用于实现上述图3所述的实施例中第二区块链节点的功能时,可以包括:
所述通信单元601用于从第一区块链节点接收第一区块;所述处理单元602用于确定所述第一区块的区块类型,所述区块类型为第一类型或第二类型;以及根据所述第一区块的区块类型对所述第一区块进行区块验证,当区块验证通过后,更新第一区块链;所述第 一区块链节点和所述第二区块链节点用于维护所述第一区块链,所述第一区块链包括至少一个第一类型的区块和至少一个第二类型的区块。
在一种可选的实施方式中,所述处理单元602在确定所述第一区块的区块类型时,可以用于:确定所述第一区块的哈希值;当所述第一区块的哈希值小于或者等于第一阈值时,确定所述第一区块的区块类型为所述第一类型;当所述第一区块的哈希值大于所述第一阈值,且所述第一哈希值小于第二阈值时,确定所述第一区块的区块类型为所述第二类型;其中,所述第一阈值小于所述第二阈值。
在另一种可选的实施方式中,所述通信单元601还用于从所述第一区块链节点接收所述第一区块的区块类型;所述处理单元602在确定所述第一区块的区块类型时,可以用于:根据所述通信单元601接收的所述第一区块的区块类型确定所述第一区块的区块类型。
在一些示例中,通信单元601可以是输入输出接口。
一种示例中,当所述第一区块的区块类型为所述第二类型时,所述处理单元602在根据所述第一区块的区块类型对所述第一区块进行区块验证时,可以用于进行如下一项或多项验证:
验证所述第一区块中的交易信息的成员证明是否正确;
验证所述第一区块中的交易是否合法;
验证所述第一区块中第一默克尔树是否正确;或者
验证所述第一区块的区块头的哈希值是否正确。
另一种示例中,当所述第一区块的区块类型为所述第一类型时,所述处理单元602在根据所述第一区块的区块类型对所述第一区块进行区块验证时,可以用于进行如下一项或多项验证:
验证所述第一区块中第二类型区块引用信息的成员证明是否正确;
验证所述第一区块中区块确认信息的成员证明是否正确;
验证所述第一区块的前置区块的成员证明是否正确;
验证所述第一区块的区块头的哈希值是否正确。
又一种示例中,当所述第一区块的区块类型为所述第一类型时,所述处理单元602在根据所述第一区块的区块类型对所述第一区块进行区块验证时,可以用于:验证所述第一区块引用的第二类型的区块是否正确。
可选的,当所述第一区块的区块类型为所述第二类型时,所述处理单元602还用于:当区块验证通过后,将所述第一区块保存在本地第二类型区块池中,所述第二类型区块池中包括的第二类型的区块未被任一个所述第一类型的区块引用。
需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。在本申请的实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个 实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
基于以上实施例,本申请实施例还提供了一种区块链的生成装置,参阅图7所示,区块链的生成装置700可以包括通信接口701和处理器702。可选的,所述区块链的生成装置700中还可以包括存储器703。其中,所述存储器703可以设置于所述区块链的生成装置700内部,还可以设置于所述区块链的生成装置700外部。其中,所述处理器702可以控制所述通信接口701接收和发送信息或数据,如区块等。处理器702和存储器703还可以集成在一起。
所述处理器702可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP)或者CPU和NP的组合。所述处理器702还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(application-specific integrated circuit,ASIC),可编程逻辑器件(programmable logic device,PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(complex programmable logic device,CPLD),现场可编程逻辑门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。
其中,所述通信接口701、所述处理器702和所述存储器703之间相互连接。可选的,所述通信接口701、所述处理器702和所述存储器703通过总线704相互连接;所述总线704可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图7中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
在一种可选的实施方式中,所述存储器703,用于存放程序等。程序可以包括程序代码,该程序代码包括计算机操作指令。所述存储器703可能包括RAM,也可能还包括非易失性存储器(non-volatile memory),例如一个或多个磁盘存储器。所述处理器702执行所述存储器703所存放的应用程序,实现上述功能,从而实现区块链的生成装置700的功能。
示例性地,该区块链的生成装置700可以是上述实施例中的第一区块链节点;还可以是上述实施例中的第二区块链节点。
在一个实施例中,所述区块链的生成装置700在实现图3所示的实施例中第一区块链节点的功能时,通信接口701可以实现图3所示的实施例中的由第一区块链节点执行的收发操作;处理器702可以实现图3所示的实施例中由第一区块链节点执行的除收发操作以外的其他操作。相关详细描述可以参见上述图3所示的实施例中的相关描述,此处不再详细介绍。
在另一个实施例中,所述区块链的生成装置700在实现图3所示的实施例中第二区块链节点的功能时,通信接口701可以实现图3所示的实施例中的由第二区块链节点执行的收发操作;处理器702可以实现图3所示的实施例中由第二区块链节点执行的除收发操作以外的其他操作。相关详细描述可以参见上述图3所示的实施例中的相关描述,此处不再详细介绍。
基于以上实施例,本申请实施例提供了一种系统,该系统可以包括上述实施例涉及的第一区块链节点和第二区块链节点等。
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质用于存储计算机程序,该计算机程序被计算机执行时,所述计算机可以实现上述方法实施例提供的区块链的生成方法。
本申请实施例还提供一种计算机程序产品,所述计算机程序产品用于存储计算机程序,该计算机程序被计算机执行时,所述计算机可以实现上述方法实施例提供的区块链的生成方法。
本申请实施例还提供一种芯片,包括处理器,所述处理器与存储器耦合,用于调用所述存储器中的程序使得所述芯片实现上述方法实施例提供的区块链的生成方法。
本申请实施例还提供一种芯片,所述芯片与存储器耦合,所述芯片用于实现上述方法实施例提供的区块链的生成方法。或者,存储器还可以集成于芯片中。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (33)

  1. 一种区块链的生成方法,其特征在于,包括:
    第一区块链节点确定第一区块的区块类型,所述区块类型为第一类型或第二类型;
    所述第一区块链节点根据所述第一区块的区块类型确定所述第一区块;
    所述第一区块链节点将所述第一区块发送给第二区块链节点;所述第一区块链节点和所述第二区块链节点用于维护第一区块链,所述第一区块链包括至少一个第一类型的区块和至少一个第二类型的区块。
  2. 如权利要求1所述的方法,其特征在于,所述方法还包括:
    所述第一区块链节点确定第一信息,所述第一信息包括以下信息中的一项或多项:所述第一区块的前置区块信息、第二类型区块引用信息、区块确认信息、交易信息、或区块确认周期;
    所述第一区块链节点根据所述第一信息得到所述第一区块的区块头。
  3. 如权利要求2所述的方法,其特征在于,所述第一区块链节点根据所述第一信息得到所述第一区块的区块头,包括:
    所述第一区块链节点对所述第一信息进行以下一项或多项处理:根据所述交易信息生成第一默克尔树或根据所述第二类型区块引用信息生成第二默克尔树;
    所述第一区块链节点对所述第一默克尔树、所述前置区块信息或所述第二默克尔树中的至少一项进行哈希操作,得到第三默克尔树;
    所述第一区块链节点根据所述第三默克尔树的根得到所述第一区块的区块头。
  4. 如权利要求2或3所述的方法,其特征在于,所述第一区块链节点确定所述第一区块的区块类型,包括:
    所述第一区块链节点对所述第一区块的区块头进行哈希操作;
    所述第一区块链节点根据所述哈希操作的结果确定所述第一区块的区块类型。
  5. 如权利要求4所述的方法,其特征在于,所述第一区块链节点根据所述哈希操作的结果确定所述第一区块的区块类型,包括:
    当所述哈希操作的结果小于或等于第一阈值时,所述第一区块链节点确定所述第一区块的区块类型为所述第一类型;
    当所述哈希操作的结果大于所述第一阈值,且所述第一哈希值小于第二阈值时,所述第一区块链节点确定所述第一区块的区块类型为所述第二类型;
    其中,所述第一阈值小于所述第二阈值。
  6. 如权利要求2-5任一项所述的方法,其特征在于,所述第一区块链节点根据所述第一区块的区块类型确定所述第一区块,包括:
    当所述第一区块的区块类型为所述第二类型时,所述第一区块包括所述交易信息以及第一默克尔树;其中,所述第一默克尔树为根据所述交易信息确定的;
    当所述第一区块的区块类型为所述第一类型时,所述第一区块包括以下一项或多项信息:所述第一区块的前置区块信息、所述第二类型区块引用信息、或第二默克尔树;其中,所述第二默克尔树为根据所述第二类型区块引用信息确定的。
  7. 如权利要求1-6任一项所述的方法,其特征在于,所述第一类型的区块采用第一共识,所述第二类型的区块采用第二共识,所述第一类型的区块引用所述第二类型的区块。
  8. 一种区块链的生成方法,其特征在于,包括:
    第二区块链节点从第一区块链节点接收第一区块;
    所述第二区块链节点确定所述第一区块的区块类型,所述区块类型为第一类型或第二类型;
    所述第二区块链节点根据所述第一区块的区块类型对所述第一区块进行区块验证;
    当区块验证通过后,所述第二区块链节点更新第一区块链;所述第一区块链节点和所述第二区块链节点用于维护所述第一区块链,所述第一区块链包括至少一个第一类型的区块和至少一个第二类型的区块。
  9. 如权利要求8所述的方法,其特征在于,所述第二区块链节点确定所述第一区块的区块类型,包括:
    所述第二区块链节点确定所述第一区块的哈希值;
    当所述第一区块的哈希值小于或者等于第一阈值时,所述第二区块链节点确定所述第一区块的区块类型为所述第一类型;
    当所述第一区块的哈希值大于所述第一阈值,且所述第一哈希值小于第二阈值时,所述第二区块链节点确定所述第一区块的区块类型为所述第二类型;
    其中,所述第一阈值小于所述第二阈值。
  10. 如权利要求8所述的方法,其特征在于,所述第二区块链节点确定所述第一区块的区块类型,包括:
    所述第二区块链节点从所述第一区块链节点接收所述第一区块的区块类型。
  11. 如权利要求8-10任一项所述的方法,其特征在于,当所述第一区块的区块类型为所述第二类型时,所述第二区块链节点根据所述第一区块的区块类型对所述第一区块进行区块验证,包括如下一项或多项验证:
    验证所述第一区块中的交易信息的成员证明是否正确;
    验证所述第一区块中的交易是否合法;
    验证所述第一区块中第一默克尔树是否正确;或者
    验证所述第一区块的区块头的哈希值是否正确。
  12. 如权利要求8或9所述的方法,其特征在于,当所述第一区块的区块类型为所述第一类型时,所述第二区块链节点根据所述第一区块的区块类型对所述第一区块进行区块验证,包括如下一项或多项验证:
    验证所述第一区块中第二类型区块引用信息的成员证明是否正确;
    验证所述第一区块中区块确认信息的成员证明是否正确;
    验证所述第一区块的前置区块的成员证明是否正确;
    验证所述第一区块的区块头的哈希值是否正确。
  13. 如权利要求8或10所述的方法,其特征在于,当所述第一区块的区块类型为所述第一类型时,所述第二区块链节点根据所述第一区块的区块类型对所述第一区块进行区块验证,包括:
    所述第二区块链节点验证所述第一区块引用的第二类型的区块是否正确。
  14. 如权利要求8-13任一项所述的方法,其特征在于,当所述第一区块的区块类型为所述第二类型时,所述方法还包括:
    当区块验证通过后,所述第二区块链节点将所述第一区块保存在本地第二类型区块池 中,所述第二类型区块池中包括的第二类型的区块未被任一个所述第一类型的区块引用。
  15. 一种区块链的生成装置,应用于第一区块链节点,其特征在于,包括:
    处理单元,用于确定第一区块的区块类型,所述区块类型为第一类型或第二类型;以及根据所述第一区块的区块类型确定所述第一区块;
    通信单元,用于将所述第一区块发送给第二区块链节点;所述第一区块链节点和所述第二区块链节点用于维护第一区块链,所述第一区块链包括至少一个第一类型的区块和至少一个第二类型的区块。
  16. 如权利要求15所述的装置,其特征在于,所述处理单元还用于:
    确定第一信息,所述第一信息包括以下信息中的一项或多项:所述第一区块的前置区块信息、第二类型区块引用信息、区块确认信息、交易信息、或区块确认周期;
    根据所述第一信息得到所述第一区块的区块头。
  17. 如权利要求16所述的装置,其特征在于,所述处理单元在根据所述第一信息得到所述第一区块的区块头时,用于:
    对所述第一信息进行以下一项或多项处理:根据所述交易信息生成第一默克尔树或根据所述第二类型区块引用信息生成第二默克尔树;
    对所述第一默克尔树、所述前置区块信息或所述第二默克尔树中的至少一项进行哈希操作,得到第三默克尔树;
    根据所述第三默克尔树的根得到所述第一区块的区块头。
  18. 如权利要求16或17所述的装置,其特征在于,所述处理单元在确定所述第一区块的区块类型时,用于:
    对所述第一区块的区块头进行哈希操作;
    根据所述哈希操作的结果确定所述第一区块的区块类型。
  19. 如权利要求18所述的装置,其特征在于,所述处理单元在根据所述哈希操作的结果确定所述第一区块的区块类型时,用于:
    当所述哈希操作的结果小于或等于第一阈值时,确定所述第一区块的区块类型为所述第一类型;
    当所述哈希操作的结果大于所述第一阈值,且所述第一哈希值小于第二阈值时,确定所述第一区块的区块类型为所述第二类型;
    其中,所述第一阈值小于所述第二阈值。
  20. 如权利要求16-19任一项所述的装置,其特征在于,所述处理单元在根据所述第一区块的区块类型确定所述第一区块时,用于:
    当所述第一区块的区块类型为所述第二类型时,所述第一区块包括所述交易信息以及第一默克尔树;其中,所述第一默克尔树为根据所述交易信息确定的;
    当所述第一区块的区块类型为所述第一类型时,所述第一区块包括以下一项或多项信息:所述第一区块的前置区块信息、所述第二类型区块引用信息、或第二默克尔树;其中,所述第二默克尔树为根据所述第二类型区块引用信息确定的。
  21. 如权利要求15-20任一项所述的装置,其特征在于,所述第一类型的区块采用第一共识,所述第二类型的区块采用第二共识,所述第一类型的区块引用所述第二类型的区块。
  22. 一种区块链的生成装置,应用于第二区块链节点,其特征在于,包括:
    通信单元,用于从第一区块链节点接收第一区块;
    处理单元,用于确定所述第一区块的区块类型,所述区块类型为第一类型或第二类型;以及根据所述第一区块的区块类型对所述第一区块进行区块验证,当区块验证通过后,更新第一区块链;所述第一区块链节点和所述第二区块链节点用于维护所述第一区块链,所述第一区块链包括至少一个第一类型的区块和至少一个第二类型的区块。
  23. 如权利要求22所述的装置,其特征在于,所述处理单元在确定所述第一区块的区块类型时,用于:
    确定所述第一区块的哈希值;
    当所述第一区块的哈希值小于或者等于第一阈值时,确定所述第一区块的区块类型为所述第一类型;
    当所述第一区块的哈希值大于所述第一阈值,且所述第一哈希值小于第二阈值时,确定所述第一区块的区块类型为所述第二类型;
    其中,所述第一阈值小于所述第二阈值。
  24. 如权利要求22所述的装置,其特征在于,所述通信单元,还用于:
    从所述第一区块链节点接收所述第一区块的区块类型;
    所述处理单元在确定所述第一区块的区块类型时,用于:
    根据所述通信单元接收的所述第一区块的区块类型确定所述第一区块的区块类型。
  25. 如权利要求22-24任一项所述的装置,其特征在于,当所述第一区块的区块类型为所述第二类型时,所述处理单元在根据所述第一区块的区块类型对所述第一区块进行区块验证时,用于进行如下一项或多项验证:
    验证所述第一区块中的交易信息的成员证明是否正确;
    验证所述第一区块中的交易是否合法;
    验证所述第一区块中第一默克尔树是否正确;或者
    验证所述第一区块的区块头的哈希值是否正确。
  26. 如权利要求22或23所述的装置,其特征在于,当所述第一区块的区块类型为所述第一类型时,所述处理单元在根据所述第一区块的区块类型对所述第一区块进行区块验证时,用于进行如下一项或多项验证:
    验证所述第一区块中第二类型区块引用信息的成员证明是否正确;
    验证所述第一区块中区块确认信息的成员证明是否正确;
    验证所述第一区块的前置区块的成员证明是否正确;
    验证所述第一区块的区块头的哈希值是否正确。
  27. 如权利要求22或24所述的装置,其特征在于,当所述第一区块的区块类型为所述第一类型时,所述处理单元在根据所述第一区块的区块类型对所述第一区块进行区块验证时,用于:
    验证所述第一区块引用的第二类型的区块是否正确。
  28. 如权利要求22-27任一项所述的装置,其特征在于,当所述第一区块的区块类型为所述第二类型时,所述处理单元还用于:
    当区块验证通过后,将所述第一区块保存在本地第二类型区块池中,所述第二类型区块池中包括的第二类型的区块未被任一个所述第一类型的区块引用。
  29. 一种区块链的生成装置,其特征在于,包括存储器,处理器,其中:
    所述存储器用于存储计算机指令;
    所述处理器与存储器耦合,用于调用所述存储器中的计算机指令使得所述区块链的生成装置执行如权利要求1-7任一项所述的方法。
  30. 一种区块链的生成装置,其特征在于,包括存储器,处理器,其中:
    所述存储器用于存储计算机指令;
    所述处理器与存储器耦合,用于调用所述存储器中的计算机指令使得所述区块链的生成装置执行如权利要求8-14任一项所述的方法。
  31. 如权利要求15-30任一项所述的装置,其特征在于,所述装置为芯片。
  32. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机可执行指令,所述计算机可执行指令在被所述计算机调用时用于使所述计算机执行上述权利要求1-7中任一项所述的方法,或者执行上述权利要求8-14中任一项所述的方法。
  33. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机如执行权利要求1-7中任一项所述的方法,或者执行如权利要求8-14中任一项所述的方法。
PCT/CN2022/112541 2021-08-18 2022-08-15 一种区块链的生成方法及装置 Ceased WO2023020442A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP22857754.0A EP4354316A4 (en) 2021-08-18 2022-08-15 METHOD AND APPARATUS FOR GENERATING BLOCKCHAIN
US18/444,769 US20240275621A1 (en) 2021-08-18 2024-02-19 Blockchain generation method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110949570.5 2021-08-18
CN202110949570.5A CN115708118A (zh) 2021-08-18 2021-08-18 一种区块链的生成方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/444,769 Continuation US20240275621A1 (en) 2021-08-18 2024-02-19 Blockchain generation method and apparatus

Publications (1)

Publication Number Publication Date
WO2023020442A1 true WO2023020442A1 (zh) 2023-02-23

Family

ID=85212458

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/112541 Ceased WO2023020442A1 (zh) 2021-08-18 2022-08-15 一种区块链的生成方法及装置

Country Status (4)

Country Link
US (1) US20240275621A1 (zh)
EP (1) EP4354316A4 (zh)
CN (1) CN115708118A (zh)
WO (1) WO2023020442A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118843114A (zh) * 2024-07-04 2024-10-25 中国石油大学(华东) 一种轻量级动态安全关联双层无人机区块链构建方法与装置

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018207975A1 (ko) * 2017-05-12 2018-11-15 주식회사 써트온 블록체인 시스템 및 블록체인 생성 방법
WO2019190226A1 (ko) * 2018-03-28 2019-10-03 주식회사 엑스블록시스템즈 블록체인 시스템
CN110597820A (zh) * 2019-09-19 2019-12-20 腾讯科技(深圳)有限公司 基于区块链的信息处理方法、装置、存储介质和设备
CN110851536A (zh) * 2019-11-19 2020-02-28 南昌航空大学 一种具有主从区块的区块链构建方法
CN111209339A (zh) * 2020-01-03 2020-05-29 腾讯科技(深圳)有限公司 区块同步方法、装置、计算机以及存储介质
CN111541756A (zh) * 2020-04-17 2020-08-14 腾讯科技(深圳)有限公司 区块生成方法、装置、节点设备及存储介质
CN112585930A (zh) * 2020-09-11 2021-03-30 华为技术有限公司 数据存储的方法、装置以及系统
CN113259130A (zh) * 2021-06-21 2021-08-13 腾讯科技(深圳)有限公司 一种交易数据处理方法、装置、设备以及介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10567177B2 (en) * 2017-06-26 2020-02-18 Sony Corporation Media channel monitoring to prove content presentation
US11652604B2 (en) * 2020-11-12 2023-05-16 Paypal, Inc. Blockchain data compression and storage

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018207975A1 (ko) * 2017-05-12 2018-11-15 주식회사 써트온 블록체인 시스템 및 블록체인 생성 방법
WO2019190226A1 (ko) * 2018-03-28 2019-10-03 주식회사 엑스블록시스템즈 블록체인 시스템
CN110597820A (zh) * 2019-09-19 2019-12-20 腾讯科技(深圳)有限公司 基于区块链的信息处理方法、装置、存储介质和设备
CN110851536A (zh) * 2019-11-19 2020-02-28 南昌航空大学 一种具有主从区块的区块链构建方法
CN111209339A (zh) * 2020-01-03 2020-05-29 腾讯科技(深圳)有限公司 区块同步方法、装置、计算机以及存储介质
CN111541756A (zh) * 2020-04-17 2020-08-14 腾讯科技(深圳)有限公司 区块生成方法、装置、节点设备及存储介质
CN112585930A (zh) * 2020-09-11 2021-03-30 华为技术有限公司 数据存储的方法、装置以及系统
CN113259130A (zh) * 2021-06-21 2021-08-13 腾讯科技(深圳)有限公司 一种交易数据处理方法、装置、设备以及介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4354316A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118843114A (zh) * 2024-07-04 2024-10-25 中国石油大学(华东) 一种轻量级动态安全关联双层无人机区块链构建方法与装置

Also Published As

Publication number Publication date
EP4354316A4 (en) 2024-09-25
CN115708118A (zh) 2023-02-21
US20240275621A1 (en) 2024-08-15
EP4354316A1 (en) 2024-04-17

Similar Documents

Publication Publication Date Title
US20230076669A1 (en) Broker-based bus protocol and multi-client architecture
US10834206B2 (en) Broker-based bus protocol and multi-client architecture
EP3777028B1 (en) Generating and linking private transaction identifiers to distributed data repositories
CN108616596A (zh) 基于动态授权和网络环境感知的区块链自适应共识方法
WO2021203853A1 (zh) 密钥生成方法、装置、设备及介质
CN112600678B (zh) 一种数据处理方法、装置、设备及存储介质
CN112150141A (zh) 一种区块链共识方法、装置和系统
JP2005301527A (ja) Webサービス・システム、リクエスタ、soapメッセージ用中間処理装置、リクエスタのリクエスト用soapメッセージ処理方法、リクエスタのレスポンス用soapメッセージ処理方法、soapメッセージ用中間処理装置のリクエスト用soapメッセージ処理方法、soapメッセージ用中間処理装置のレスポンス用soapメッセージ処理方法、及びプログラム
WO2024141094A1 (zh) 一种分布式加解密方法、装置、系统及介质
CN110188563A (zh) 一种信任数据更新方法及装置
WO2017000272A1 (zh) 一种无线系统接入控制方法及装置
US12245034B2 (en) Secure and trusted peer-to-peer offline communication systems and methods
CN115361455B (zh) 一种数据传输存储方法、装置以及计算机设备
US20240419537A1 (en) Data processing method based on blockchain network and related product
WO2023020442A1 (zh) 一种区块链的生成方法及装置
WO2024007855A1 (zh) 一种基于区块链的数据处理方法、设备以及可读存储介质
CN112615838A (zh) 一种可扩展的区块链跨链通信方法
WO2024007689A1 (zh) 共识网络的数据处理方法、装置、程序产品、设备和介质
CN116806038A (zh) 一种去中心化的计算机数据共享方法及装置
CN118714139A (zh) 区块链网络的共识处理方法、装置、设备和存储介质
CN116846625A (zh) 通信方法、通信装置、电子设备及计算机存储介质
WO2024164249A1 (zh) 一种身份管理方法及装置
WO2022237794A1 (zh) 一种报文传输方法及装置
CN117997520A (zh) 一种基于区块链的数据处理方法、设备以及可读存储介质
Yang et al. Ari: A P2P optimization for blockchain systems

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: 22857754

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022857754

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022857754

Country of ref document: EP

Effective date: 20240110

NENP Non-entry into the national phase

Ref country code: DE