The present application claims priority of chinese patent application entitled "blockchain standard application model and method for applying same" filed by chinese patent office on 28/8/2018 with application number 201810986825.3, the entire contents of which are incorporated herein by reference.
Disclosure of Invention
The application provides a block chain parallel chain maintenance method and a block chain parallel chain, which can be used for solving the problem that in the prior art, a public chain cannot acquire block data in an access chain block chain, so that cross-chain transaction between different block chain networks cannot be realized.
In a first aspect, the present application provides a method for maintaining a parallel chain of a blockchain, where the method includes:
determining a block to be synchronized in an access chain block chain;
generating a parallel chain block which accords with a common chain standard form, wherein the parallel chain block comprises block data of the block to be synchronized;
adding the parallel chain blocks into a parallel chain block chain for a common chain to read the block data of the block to be synchronized from the parallel chain block chain.
Optionally, the generating a parallel chain block conforming to a common chain specification form includes:
generating an index identifier and an access link block identifier, wherein the index identifier is used for indicating block data in a block to be synchronized, and the access link block identifier is used for indicating the block to be synchronized in an access link block chain;
generating a block header conforming to a public link specification form, wherein the block header comprises the index identifier, the access link block identifier and a parallel link block identifier, and the parallel link block identifier is used for indicating a parallel link block in a parallel link block chain;
and copying the block data of the block to be synchronized to a position behind the block head to generate the parallel chain block.
Optionally, the generating a parallel chain block conforming to a common chain specification form includes:
generating an index identifier and an access link block identifier, wherein the index identifier is used for indicating block data of a block to be synchronized, and the access link block identifier is used for indicating the block to be synchronized in an access link block chain;
generating a block head which accords with a public chain standard form, wherein the block head comprises a parallel chain block identifier which is used for indicating a parallel chain block in a parallel chain block chain;
adding an access chain block identity to a location after the block header;
adding an index identifier to a position behind the access chain block identifier according to the type of the block data, wherein the type of the block data comprises transaction information, state information, receipt information and data information;
and converting the block data into data in a form meeting the public chain specification, and adding the data to a position behind the index identifier to generate the parallel chain block.
Optionally, after the generating the parallel chain block conforming to the common chain specification form, the method further includes:
and sending summary information corresponding to the block data to the public link so that the public link reads the block data of the block to be synchronized from the parallel link block chain according to the summary information, wherein the summary information comprises an access link block identifier, a parallel link block identifier and an index identifier corresponding to the block data.
Optionally, the determining a block to be synchronized in an access chain block chain includes:
determining the current block number in an access chain block chain as m;
determining the first m-n blocks in the access chain block chain as common identification blocks, wherein n is a preset numerical value, the common identification blocks are blocks which have obtained common identification of access chain link points in the access chain block chain, and n is a positive integer greater than 0;
and determining the block with unsynchronized block data in the consensus block as the block to be synchronized according to the access chain block identifier in the parallel chain block chain.
Optionally, the number of the to-be-synchronized blocks is k, where k is a positive integer greater than or equal to 2;
the generating of the parallel chain block conforming to the common chain specification form comprises:
and generating a parallel chain block which accords with the public chain standard form every other preset time length, wherein the preset time length is k times of the time length required by the access chain generation block.
Optionally, the method further comprises:
and periodically selecting a parallel chain maintainer node from the nodes of the parallel chain, wherein the parallel chain maintainer node is used for generating a parallel chain block.
In a second aspect, the present application provides a parallel chain of blocks, the parallel chain being composed of common nodes of a common chain and an access chain, the parallel chain including a parallel chain maintainer node periodically selected from the nodes of the parallel chain;
the parallel chain maintainer node is used for determining a block to be synchronized in an access chain block chain; generating a parallel chain block which accords with a common chain standard form, wherein the parallel chain block comprises block data of the block to be synchronized; adding the parallel chain blocks into a parallel chain block chain for a common chain to read the block data of the block to be synchronized from the parallel chain block chain.
In the present application, a maintainer node in a parallel chain generates a parallel chain block that conforms to the common chain specification form and includes block data of a block to be synchronized in an access chain block chain in the parallel chain block. Because the parallel chain node is a public chain node, the parallel chain is a child chain of the public chain. The sub-chain is part of the public chain, and is consistent with the public chain on the node and the network system, so that the blockchain in the sub-chain can be directly accessed by the public chain. Therefore, when cross-chain transaction related to the access chain is carried out, the public chain can read the block data of the access chain from the parallel chain blocks according to the way of reading the sub-chain block data, so that the cross-chain transaction can be realized.
Detailed Description
Reference will now be made in detail to embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. They are merely examples of methods consistent with certain aspects of the present application, as detailed in the claims.
In the technical solution provided in the present application, a blockchain network refers to a point-to-point network formed by nodes that maintain blockchains. The blockchain network enables distributed storage, public consensus, digital encryption, transaction accounting, and authentication of the maintained blockchain. One block includes a plurality of block data, and the plurality of blocks form a block chain. The blockchain or blockchain blockdata in blockchain blocks is data recorded by nodes maintaining the blockchain according to transactions and generated results when transactions occur in the blockchain network. The blocks are also called data blocks, such as parallel chain data blocks, common chain data blocks, and so on. The block data includes various types for indicating transaction-specific contents, results, statuses, and the like, such as transaction information, status information, receipt information, and data information. The transaction information is used to indicate the specific content of the transaction. For example, if user a transfers 300 rmb to user b, the nodes of the blockchain may generate a transaction message. The transaction information records the transaction content of transferring 300 RMB from A to B. The status information is used to indicate the status of the transaction. For example, user a transfers 300 rmb to user b. In the process of transferring 300 RMB money from A to B, in order to indicate that the transfer is in progress, the nodes of the blockchain generate a bar of status information for recording that the transfer transaction is in progress. Receipt information is used to indicate the outcome of the transaction. For example, user A transferred 300 RMB to user B, the account of user A was reduced by 300 RMB. Accordingly, the node of the block chain generates a receipt message for recording the account balance of the user A after transferring 300 RMB out of the account. The data information is used to indicate data stored by the blockchain network. The blockchain network has the function of distributed storage. The nodes maintaining the blockchain can perform distributed storage on data to be stored by users. When the data is stored, the nodes of the block chain generate data information for recording the stored data. It should be noted that the above explanations of the transaction information, status information, receipt information and data information are only exemplary and explanatory explanations of the block data type, and are not intended to limit the present application. The block data includes other types of information in addition to the above four types. This is not listed in this application.
Each node in the blockchain network may be a physical node, such as a terminal, a server, or a virtual node. And the nodes in the same block chain network are communicated with and maintain the operation of the block chain network based on the same consensus mechanism.
The public, access, and parallel chains referred to in this application all refer to different blockchain networks that conform to blockchain technology. In the technical scheme provided by the application, a public chain is used as a basic network platform and is composed of a plurality of public chain link points, and the access of a plurality of block chain networks can be accepted. The blockchain network accessing the public chain is called an access chain, such as the existing blockchain network bitcoin, ether house, etc., or an industry chain and a alliance chain developed by some industries, even a private chain built for achieving a certain service requirement. These existing blockchains, industry chains, federation chains, and private chains generally cannot connect directly to public chains. Thus, in the present application, the public link and the access link may be connected by a parallel link.
In this application, a parallel chain consists of common nodes of a public chain and an access chain. Since the nodes of the parallel chain are common nodes of the public chain and the access chain, the parallel chain has functions of both the public chain and the access chain, and both block chains are stored. Illustratively, as shown in fig. 1, a schematic diagram of a network architecture between a public chain, an access chain, and a parallel chain is shown. Parallel link node 101, which is a common node for both public link 11 and access link 12, is capable of communicating with both public link node 111 and access link node 121.
In this application, the cross-chain transactions to which a public chain refers may include: transactions that occur between the access and public chains, such as inquiry transactions, access transactions, and synchronization transactions. For such cross-link transactions, the public link needs to acquire the chunk data in the access link chunk chain because the public link directly transacts with the access link. The cross-link transactions involved in the public link may also include transactions that are relayed or forwarded by the public link. In such a cross-chain transaction, one access chain acts as an initiator of the transaction and the other access chain acts as a target of the transaction. Illustratively, access chain a is to pay its own credentials a in exchange for credentials B of another access chain B. For this cross-link transaction, access link a cannot directly transact with access link B, and information and data related to the transaction need to be transferred through public link C. In order to ensure that the cross-link transaction can be completed smoothly, the public link C needs to determine whether the access link a and the access link B can complete the transaction contents which need to be completed in the cross-link transaction, for example, whether the access link a can pay the voucher a required by the transaction. Therefore, the public chain needs to acquire block data in the blockchains of both parties of the transaction. Therefore, no matter the cross-link transaction between different access links or the cross-link transaction between the public link and the access link, the public link needs to acquire the block data recorded in the access link block chain to complete the cross-link transaction.
As can be seen from the above, in order to complete the cross-link transaction, the public link needs to acquire the block data recorded in the access link block chain in the cross-link transaction. However, the public link and the access link are two different block link networks, and due to differences between the two block links, such as different consensus mechanisms, different communication mechanisms, and the like, even if the parallel link stores the two block links, the public link cannot directly acquire the block data in the access link block link from the parallel link. Therefore, the present application provides a method for maintaining a parallel chain of block chains, so that a public chain can acquire block data in a block chain of an access chain from the parallel chain by maintaining the parallel chain.
Referring to fig. 2, a schematic flow chart of a method for maintaining a parallel chain of a blockchain according to the present invention is exemplarily shown. The method comprises the following steps.
In step S20, a to-be-synchronized block in the access link block chain is determined.
In the application, a public chain can acquire block data in an access chain block chain from a parallel chain block chain through maintenance of the parallel chain, namely maintenance of the parallel chain block chain. Thus, the parallel chain requires first determining the parallel chain maintainer node responsible for maintaining the parallel chain. The parallel chain maintainer node is used for maintaining parallel chain related transactions, such as generating blocks, recording cross-chain transactions and the like. In the embodiment of the present application, there are two ways to determine a parallel chain maintainer node among nodes of a parallel chain.
In one possible embodiment, the nodes of the parallel chain are all parallel chain maintainer nodes. All the nodes are set as parallel chain maintainer nodes by the parallel chain, so that the nodes of the parallel chain can participate in maintenance of the parallel chain, and the nodes of each parallel chain have the right of acquiring benefits.
In another possible embodiment, the parallel chain maintainer node is periodically selected from the nodes of the parallel chain. The selected parallel chain maintainer node maintains the parallel chain in the next cycle. And the parallel chain maintainer node of the current period selects the parallel chain maintainer node of the next period, and the parallel chain maintainer node of the current period does not act as the parallel chain maintainer node of the next period. Therefore, the node serving as the maintainer is in dynamic change, and the fixed node is not used as the parallel chain maintainer node, so that the possibility of breaking the parallel chain is reduced, and the safety of the parallel chain can be improved. In addition, part of nodes in the parallel chain are selected as parallel maintainer nodes, so that the whole network operation of parallel chain maintenance is avoided, and the running efficiency of the parallel chain can be improved. The duration of the period is longer than the duration required by selecting the parallel chain maintainer node and shorter than the duration required by breaking the parallel chain maintainer node. By limiting the period duration, the selection can be completed in the period, and the possibility that the parallel chain maintainer node is broken is reduced. For the selection mode, the parallel chain maintainer node in the current period can be randomly selected, can be selected according to the operation efficiency of each parallel chain node, can be selected according to the safety performance of each parallel chain node, and the like. The embodiment of the present application is not particularly limited with respect to the selection manner.
After the parallel chain maintainer node is selected, the parallel chain maintainer node of the current period determines a block to be synchronized in the access chain block chain. In order for the public link to acquire the block data in the access link block chain from the parallel link block chain, the parallel link needs to synchronize the block data in the access link block chain to its own parallel link block, that is, add the block data of the access link to the parallel link block generated by the parallel link maintainer node. The block to be synchronized refers to an access link block to which block data is not synchronized to a parallel link block.
Since the parallel chain stores the access chain block chain and the parallel chain link point itself is also the access chain node, the parallel chain maintainer node can directly obtain the block and the block data in the access chain block chain. When the block to be synchronized is determined, the parallel chain maintainer node determines the block data which is not synchronized to the parallel chain block chain from the block data of the access chain block chain, and then takes the access chain block to which the block data belongs as the block to be synchronized.
In step S21, a parallel chain block conforming to the common chain specification is generated.
The parallel chain maintainer node generates a parallel chain block that conforms to the common chain specification form. When generating a parallel chain block, the parallel chain maintainer node adds the block data in the block to be synchronized in the generated parallel chain block. For generating parallel chain blocks, the embodiments of the present application provide two ways.
First, directly use the block data in the block to be synchronized as part of the content in the parallel chain block. Specifically, the parallel chain maintainer node first generates an index identifier and an access chain block identifier. The index identifier is used for indicating the block data in the block to be synchronized. The block to be synchronized may include a plurality of block data. For each block data in the block to be synchronized, the parallel chain maintainer node generates an index identifier. The index identification of a block data indicates the block data. The public chain or the parallel chain can determine the corresponding block data according to the index identification. For example, one piece of block data is transaction information of one transaction, and the parallel chain maintainer node performs hash operation on the transaction information to obtain a hash value corresponding to the transaction information. The hash value is the index identifier. The access link block identifier is used for indicating a block to be synchronized in the access link block chain. Each time a parallel chain maintainer node generates a parallel chain block, a plurality of blocks to be synchronized can be synchronized. For each block to be synchronized, the parallel chain maintainer node generates a corresponding access chain block identifier. For example, the access link block id may be a block sequence number of a block to be synchronized in the access link block chain, or a combination of the block sequence number and a block hash value.
The parallel chain maintainer node then generates a block header that conforms to the common chain specification form. The block header is the block header of the parallel chain block to be generated by the parallel chain maintainer node. The block head comprises index marks of each block data in the blocks to be synchronized, access link block marks and parallel link block marks corresponding to the blocks to be synchronized. Similar to the access chain block id, the parallel chain block id may be a block sequence number of the parallel chain block, or a combination of the block sequence number and a block hash value. After generating the block head, the parallel chain maintainer node directly copies the block data in the block to be synchronized to the position behind the block head to generate the parallel chain block.
Illustratively, as shown in fig. 3, the blocks to be synchronized are the 500 th and 501 th blocks in the access link block chain a: block 30 and block 31. Each of the two blocks to be synchronized includes 2 block data: t1, T2, and T3, T4. The parallel chain maintainer node generates the 250 th block in parallel chain block chain B: block 32. When generating block 32, the parallel chain maintainer node needs to synchronize the block data of block 30 and block 31 into block 32. In the block 32, the block header 321 includes index identifiers of 4 block data. The 4 index identifiers are 4 hash values, which are: t1-hash, T2-hash, T3-hash, and T4-hash. The block header 321 further includes an access link block id corresponding to the block 30 and an access link block id corresponding to the block 31. In this example, the access chain chunk identification is a combination of the chunk sequence number and the chunk hash value. Thus, the access chain block identities for two blocks are: "500 + A-Block 500-hash", and "501 + A-Block 501-hash". The block header 321 also includes an access chain block id corresponding to the block 32: "250 + B-Block 250-hash". After generating the chunk header 321, the parallel chain maintainer node directly copies the chunk data in the chunks 30 and 31 to a position after the chunk header 321, and finally generates the parallel chain chunk 32.
And secondly, the parallel chain maintainer node deconstructs and reorganizes the block to be synchronized to generate a block of which the public chain can directly read data. Specifically, the parallel chain maintainer node similarly generates an index identifier and an access chain block identifier first. However, at the time of generating the block header, the parallel chain maintainer node adds only the parallel chain block identity, and adds the access chain block identity to a position after the block header. In addition, for the index identifier, the parallel chain maintainer node adds the corresponding index identifier to the position behind the access chain block identifier according to the type of each block data. For example, at a position after the access link block identifier, the parallel link maintainer node adds an index identifier of each transaction information; secondly, adding index identifiers of each piece of state information; thirdly, adding index marks of the receipt information; finally, index identification of each data information is added. After the index identifier is added to the parallel chain maintainer node, the block data is converted into data in a form meeting the public chain specification, and the data is added to the position behind the index identifier to generate a parallel chain block.
Illustratively, as shown in fig. 4, the blocks to be synchronized are the 500 th and 501 th blocks in the access link block chain a: block 40 and block 41. Each block to be synchronized includes 4 types of block data, which are: transaction information E1 and E2, status information F1 and F2, receipt information G1 and G2, and data information H1 and H2. The parallel chain maintainer node generates the 250 th block in parallel chain block chain B: block 42. When block 42 is generated, the parallel chain maintainer node needs to synchronize the block data of block 40 and block 41 into block 42. The block 42 sequentially includes: block header 421, access link block identification 422: the "500 + A-Block 500-hash" and "501 + A-Block 501-hash", the index identification 423 of the transaction information E1 and E2: e1-hash and E2-hash, index of status information F1 and F2 identifies 424: f1-hash and F2-hash, index identification 425 of receipt information G1 and G2: g1-hash and G2-hash, index identification 426 of data information H1 and H2: h1-hash and H2-hash, and 8 blocks of data converted to conform to the public chain specification: transaction information e1 and e2, status information f1 and f2, receipt information g1 and g2, and data information h1 and h 2. The block header 421 includes the parallel chain block identifier corresponding to the block 42: "250 + B-Block 250-hash".
By the two methods, the block data in the block to be synchronized can be synchronized into the parallel chain block chain which can be accessed by the public chain. In both the first and second ways, when the public link reads the block data, the parallel link block where the block data is located is determined by the parallel link block identifier, the access link block where the block data belongs in the access link is verified by the access link block identifier, and finally the block data is determined and read by the index identifier. However, in the parallel chain block generated in the first method, since the block data is directly copied from the access chain block at the time of reading, the public chain needs to read the block data according to the data reading rule of the access chain. For the parallel chain block generated in the second way, when reading, the public chain can directly read the block data because the block data is converted into the data in the form of meeting the public chain specification.
For the first mode, the parallel chain maintainer node can generate the parallel chain blocks more quickly and efficiently. However, the speed of reading block data by the public chain is slow, which reduces the efficiency of cross-chain transaction. For the second approach, the parallel chain maintainer node generates parallel chain blocks less efficiently. However, the speed of reading the block data by the public chain is faster than that of reading the block data by the public chain, so that the efficiency of cross-chain transaction can be improved.
It should be noted that, in addition to various identification and block data associated with the block to be synchronized, the parallel chain block may also include information and data associated with the parallel chain itself. Such as transaction information related to cross-chain transactions, smart contracts deployed on parallel chains, and so forth.
In one possible implementation, the parallel chain maintainer node generates only one parallel chain chunk at a time. K blocks to be synchronized can be synchronized in one parallel chain block. k is a positive integer greater than or equal to 2. Thus, each time a parallel chain block is generated, the parallel chain maintainer node synchronizes a maximum of 2 blocks to be synchronized. If the value of k is greater than 2, when a parallel chain block is generated each time, the block data required to be synchronized by the parallel chain maintainer node is excessive, which reduces the efficiency of generating the parallel chain block. Moreover, when a parallel chain block includes too many blocks of data to access the chain block, the public chain needs to spend too much time searching in the parallel chain block when reading a certain block of data, which affects the efficiency of cross-chain transaction. Specifically, the parallel chain maintainer node may generate a parallel chain block that meets the public chain specification form every preset time. The preset duration is k times of the duration required by the access link generation block. For example, the time required for generating the block by the access chain is 10 minutes. Then, if the parallel chain block includes block data of 3 blocks to be synchronized, the parallel chain maintainer node generates a parallel chain block every 30 minutes. The parallel chain maintainer node can control the number of blocks synchronized at a time by controlling the generation frequency of the parallel chain blocks.
In step S22, a parallel chain block is added to the parallel chain block chain.
After the parallel chain block is generated, the parallel chain maintainer node adds the parallel chain block to the parallel chain block chain and synchronizes in the parallel chain to obtain the consensus of other parallel chain nodes.
In conducting a cross-chain transaction, a public chain needs to acquire one or more blocks of data of an access chain. For any block data, the public chain needs to read the block data according to a set of summary information. The summary information set comprises a parallel chain block identifier for determining a parallel chain block where the block data belongs, an access chain block identifier for verifying the access chain block where the block data belongs, and an index identifier of the block data. Therefore, before reading a block of data, the public link needs to obtain a set of summary information corresponding to the block of data. In contrast, since the public link can directly access the parallel link block chain, the public link can periodically acquire the summary information corresponding to each block data stored in the parallel link block chain. In other embodiments, after the parallel chain maintainer node generates a parallel chain block, the summary information corresponding to each data in the parallel chain block is sent to the public chain.
Further, as shown in fig. 5, in the step S20, the parallel chain maintainer node determining the to-be-synchronized block in the access link block chain includes the following sub-steps:
s201, determining the current block number in the access chain block chain to be m.
S202, determining the first m-n blocks in the access chain block chain as the common blocks.
S203, determining the block whose block data is not synchronized in the consensus block as the block to be synchronized according to the access chain block identifier in the parallel chain block chain.
Firstly, a parallel chain maintainer node is used as a node in an access chain, and the current block number in the access chain block chain is determined to be m. For example, if the access chain is generating the 10005 th block in its own block chain, then m is determined to have a value of 10005.
Since there is usually more than one maintainer node in a blockchain network that has accounting rights, it is possible that different maintainer nodes generate different blocks for the same number of blocks. Then, different block chains occur in the same block chain network because blocks on the same bit number are different. At this time, the blockchain network uses its own consensus mechanism to make all nodes obtain consensus, and only one of the different blockchains is identified, thereby ensuring the uniqueness of the maintained blockchains. The consensus block refers to a block in the access link block chain that has obtained a consensus for all access link points. Once a block has acquired knowledge of all nodes, the block is not overwritten or changed.
The parallel chain maintainer node needs to ensure that the synchronized block data is accurate and does not change, so the synchronized block data is the block data of the common identification block. Since the number of blocks in the access link blockchain is increasing, and it takes a certain time for the blockchain to get common knowledge in the nodes. Therefore, the access link block chain acquired by the parallel chain maintainer node may include blocks that have not acquired node identity. However, the parallel chain maintainer node can determine that the first m-n blocks in the access chain block chain are consensus blocks. n is a value preset according to practical experience and is a positive integer greater than 0. For different access chains, the specific value of n is different due to different numbers of nodes, different durations for generating blocks, and different consensus mechanisms. For example, in the Etherhouse blockchain, n has a value of 10; in the blockchain of bitcoins, n has a value of 6.
Illustratively, n has a value of 6. The maintainer node determines that the current number of blocks in the access link blockchain is 10005, it can determine that the first 9999 blocks in the access link blockchain are consensus blocks.
After the consensus blocks in the access chain are determined, the parallel chain maintainer node determines the consensus blocks of which the block data is not synchronized according to the access chain block identification included in each block in the parallel chain block chain. For example, the first 9999 blocks in the access chain of blocks are consensus blocks. The parallel chains have synchronized the first 9997 access chain blocks. Then the access chain block identification indicating the first 9997 access chain blocks is included in each parallel chain block. The parallel chain maintainer node can determine that the 9998 th and 9999 th access chain blocks have no corresponding access chain block identifiers, and then the parallel chain maintainer node takes the two blocks as blocks to be synchronized.
In the present application, a maintainer node in a parallel chain generates a parallel chain block that conforms to the common chain specification form and includes block data of a block to be synchronized in an access chain block chain in the parallel chain block. Because the parallel chain node is a public chain node, the parallel chain is a child chain of the public chain. The sub-chain is part of the public chain, and is consistent with the public chain on the node and the network system, so that the blockchain in the sub-chain can be directly accessed by the public chain. Therefore, when cross-chain transaction related to the access chain is carried out, the public chain can read the block data of the access chain from the parallel chain blocks according to the way of reading the sub-chain block data, so that the cross-chain transaction can be realized.
The application also provides a block chain parallel chain, which consists of common nodes of a public chain and an access chain and comprises parallel chain maintainer nodes periodically selected from the nodes of the parallel chain. The parallel chain can be used to implement the above-described method examples
The parallel chain maintainer node is used for determining a block to be synchronized in an access chain block chain; generating a parallel chain block which accords with a common chain standard form, wherein the parallel chain block comprises block data in a block to be synchronized; and adding the parallel chain blocks into the parallel chain block chain so that the common chain can read the block data of the block to be synchronized from the parallel chain block chain.
In a possible implementation, the parallel chain maintainer node is specifically configured to:
generating an index identifier and an access link block identifier, wherein the index identifier is used for indicating block data in a block to be synchronized, and the access link block identifier is used for indicating the block to be synchronized in an access link block chain; generating a block head conforming to a public link standard form, wherein the block head comprises an index identifier, an access link block identifier and a parallel link block identifier, and the parallel link block identifier is used for indicating a parallel link block in a parallel link block chain; and copying the block data of the block to be synchronized to the position behind the block head to generate a parallel chain block.
In another possible implementation, the parallel chain maintainer node is specifically configured to: generating an index identifier and an access link block identifier, wherein the index identifier is used for indicating block data in a block to be synchronized, and the access link block identifier is used for indicating the block to be synchronized in an access link block chain; generating a block head which accords with a public chain standard form, wherein the block head comprises a parallel chain block identifier which is used for indicating a parallel chain block in a parallel chain block chain; adding an access chain block identity to a position behind a block header; adding an index identifier to a position behind an access link block identifier according to the type of block data, wherein the type of the block data comprises transaction information, state information, receipt information and data information; and converting the block data into data in a form meeting the public chain specification, and adding the data to a position behind the index identifier to generate a parallel chain block.
In the parallel chain of blocks provided by the present application, a maintainer node in the parallel chain generates a parallel chain block conforming to the common chain specification form and includes block data of a block to be synchronized in an access chain block chain in the parallel chain block. Because the parallel chain node is a public chain node, the parallel chain is a child chain of the public chain. The sub-chain is part of the public chain, and is consistent with the public chain on the node and the network system, so that the blockchain in the sub-chain can be directly accessed by the public chain. Therefore, when cross-chain transaction related to the access chain is carried out, the public chain can read the block data of the access chain from the parallel chain blocks according to the way of reading the sub-chain block data, so that the cross-chain transaction can be realized.
Those skilled in the art will clearly understand that the techniques in the embodiments of the present application may be implemented by way of software plus a required general hardware platform. Based on such understanding, the technical solutions in the embodiments of the present application may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present application.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to what has been described above and shown in the accompanying drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Further, in the description of the present application, "a plurality" means two or more than two unless otherwise specified. In addition, in order to facilitate clear description of technical solutions of the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same items or similar items having substantially the same functions and actions. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.