CN113987598A - Block migration method and device - Google Patents

Block migration method and device Download PDF

Info

Publication number
CN113987598A
CN113987598A CN202111315785.8A CN202111315785A CN113987598A CN 113987598 A CN113987598 A CN 113987598A CN 202111315785 A CN202111315785 A CN 202111315785A CN 113987598 A CN113987598 A CN 113987598A
Authority
CN
China
Prior art keywords
block
chain
source
block chain
intelligent contract
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.)
Pending
Application number
CN202111315785.8A
Other languages
Chinese (zh)
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.)
Shanghai Ant Chuangjiang Information Technology Co ltd
Original Assignee
Alipay Hangzhou Information Technology 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202111315785.8A priority Critical patent/CN113987598A/en
Publication of CN113987598A publication Critical patent/CN113987598A/en
Priority to PCT/CN2022/128538 priority patent/WO2023078200A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Bioethics (AREA)
  • Mathematical Physics (AREA)
  • Fuzzy Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Probability & Statistics with Applications (AREA)
  • Health & Medical Sciences (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The present disclosure provides a method and an apparatus for migrating a block, where the block is a first block to be migrated to a target block chain in a source block chain, and the method is applied to a block link point of the target block chain, where the target block chain has a first intelligent contract stored thereon, and the first intelligent contract is used for managing the block in the source block chain, and the method includes: receiving a first call request of the first intelligent contract, the first call request including the first block in the source block chain; verifying the authenticity of the first block using the first smart contract; and if the authenticity verification of the first block is passed, storing the first block to the target block chain.

Description

Block migration method and device
Technical Field
The present disclosure relates to the field of block chaining technologies, and in particular, to a block migration method and apparatus.
Background
A block migration technique based on a Trusted Execution Environment (TEE) server is currently provided. The stored blocks are migrated from the blockchain system to the blockchain system if needed. The TEE server first pulls the block to be migrated from the blockchain system, and then verifies the authenticity of the acquired block to be migrated, wherein the authenticity of the block is used for indicating whether the block is a block which is really stored in the blockchain system. After the TEE server confirms that the authenticity of the block to be migrated passes, the block to be migrated may be stored to the blockchain system. Of course, in some cases, if all blocks in the blockchain system need to be migrated to the blockchain system, the blocks in the blockchain system may be migrated and stored to the blockchain system one by one using the method described above. Accordingly, the user can query the migrated tiles in the blockchain system through the blockchain system.
In the above migration scheme, the authenticity of the tile may be verified by verification logic built into the TEE server. However, this way of verifying the authenticity of the tile is not visible to the user, who cannot know what the verification logic in the TEE server that verifies the authenticity of the tile contains, from what aspects the authenticity of the tile is verified, and what is more, the user cannot determine whether the TEE server verifies the authenticity of the tile. Therefore, the user cannot trust the authenticity of the block migrated by the above migration method to a large extent.
Disclosure of Invention
In view of the above, embodiments of the present disclosure are directed to a method and an apparatus for migrating a block, so as to improve transparency of a method for verifying authenticity of the block during a block migration process.
In a first aspect, a method for migrating a block, where the block is a first block to be migrated to a target block chain in a source block chain, is applied to a block link point of the target block chain, where the target block chain has a first intelligent contract stored thereon, and the first intelligent contract is used for managing the block in the source block chain, and the method includes: receiving a first call request of the first intelligent contract, the first call request including the first block in the source block chain; verifying the authenticity of the first block using the first smart contract; and if the authenticity verification of the first block is passed, storing the first block to the target block chain.
In a second aspect, a migration method of a block is provided, where the block is a first block in a source block chain to be migrated to a target block chain, the target block chain has a first intelligent contract stored thereon, and the first intelligent contract is used for managing a block in the source block chain forwarded by a forwarding device, and the method is applied to the forwarding device, and the method includes: obtaining the first block from the source block chain; sending a first invocation request of the first intelligent contract to the target blockchain node, the first invocation request including the first block.
In a third aspect, a device for migrating a block is provided, where the block is a first block in a source block chain to be migrated to a target block chain, the device is a block link point in the target block chain, and a first intelligent contract is stored on the target block chain, where the first intelligent contract is used to manage the block in the source block chain, and the device includes: a receiving module, configured to receive a first call request of the first intelligent contract, where the first call request includes the first block in the source block chain; the processing module is used for verifying the authenticity of the first block by utilizing the first intelligent contract; the processing module is further configured to store the first block to the target block chain if the authenticity of the first block is verified.
In a fourth aspect, a migration apparatus for a block is provided, where the block is a first block to be migrated to a target block chain in a source block chain, the target block chain has a first intelligent contract stored thereon, and the first intelligent contract is used to manage the block in the source block chain forwarded by a forwarding device, and the apparatus is applied to the forwarding device, and the apparatus includes: an obtaining module, configured to obtain the first block from the source block chain; a sending module, configured to send a first invocation request of the first intelligent contract to the target block chain node, where the first invocation request includes the first block.
In a fifth aspect, there is provided a block migration apparatus, including a memory and a processor, where the memory stores executable code, and the processor is configured to execute the executable code to implement the method according to the first aspect or the second aspect.
A sixth aspect provides a computer readable storage medium having stored thereon executable code which, when executed, is capable of implementing a method as described in the first or second aspect.
In a seventh aspect, there is provided a computer program product comprising executable code which, when executed, is capable of implementing a method as described in the first or second aspect.
The authenticity of the block is verified by deploying the first intelligent contract in the target block chain, so that a user can check the verification method for verifying the authenticity of the block by inquiring the first intelligent contract deployed in the target block chain, the transparency of the verification method is improved, and the trust degree of the user on the migration process is improved.
Drawings
Fig. 1 is a schematic diagram of a blockchain system suitable for use in the embodiments of the present disclosure.
Fig. 2 is a schematic diagram of a structure of a block to which the present disclosure is applicable.
Fig. 3 is a diagram illustrating a conventional migration scenario of a block.
FIG. 4 presents a schematic view of a migrated scenario to which embodiments of the present disclosure are applicable.
Fig. 5 is a flowchart of a block migration method according to an embodiment of the disclosure.
FIG. 6 presents a schematic view of a first intelligent contract of an embodiment of the present disclosure.
Fig. 7 is a schematic diagram of a migration scenario of a block according to another embodiment of the present disclosure.
Fig. 8 is a flowchart of a block migration method according to another embodiment of the disclosure.
Fig. 9 is a schematic diagram of a block migration apparatus according to an embodiment of the disclosure.
Fig. 10 is a schematic diagram of a block migration apparatus according to an embodiment of the disclosure.
Fig. 11 is a schematic block diagram of an apparatus of another embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. To facilitate understanding of aspects of the present disclosure, a blockchain system to which the present disclosure is applicable and some terms to which the present disclosure relates will be described below with reference to fig. 1.
Block chain system
Fig. 1 is a schematic diagram of a blockchain system suitable for use in the embodiments of the present disclosure. The blockchain system 100 shown in fig. 1 includes blockchain nodes 110 and user nodes 120.
A Blockchain (Blockchain) system is a typical distributed collaborative system, and multiple parties jointly maintain an ever-increasing distributed data record, and the data of the record protects the content and the time sequence through a cryptographic technology, so that any party is difficult to tamper, repudiate and counterfeit.
In a blockchain system, data (e.g., transaction information, transaction execution results, etc.) may be encapsulated in the form of blocks (blocks). The tiles may be linked to each other by a forward application to form a "chain," i.e., a chain of tiles. Typically, we call the one block in the chain of blocks that precedes the current block the "previous block" and the one block in the chain of blocks that follows the current block the "subsequent block". The blocks are described below with reference to fig. 2, and for brevity, will not be described again.
Typically, the blockchain user node 120 may communicate with the blockchain node 110 through a client. In some cases, the user node 120 may send data that needs to be uplinked to the associated blockchain node or nodes 110 in a Transaction (Transaction) submitting manner. A transaction can be understood as a transaction request on the blockchain, which is used to carry the structure of specific business operation data.
It should be noted that all the change operations for the world state on the blockchain can be completed based on the transaction. The world state may be understood as the storage state of the blockchain accounts, including the basic storage state of all accounts and the internal storage state of the contract accounts. A contract platform may be understood as a transactional "state machine," and the world states describe the current basic storage state that may change into another new world state upon execution of an intelligent contract.
Accordingly, after verifying the authenticity of the data, the blockchain node 110 may broadcast the data to each blockchain node 110 in a network-wide broadcast manner. Thus, each blockchain node 110 has a full amount of consistent data recorded.
In some implementations, the blockchain node 110 may be a device with computing capabilities, such as a server, a server group, a blockchain chip, and the like, wherein the server group may be centralized or distributed. In other implementations, the server may also be a server that provides services for a cloud platform.
In some implementations, the user node 120 may be a device with computing capabilities, e.g., a server, a terminal, a mobile terminal, etc.
Block
As introduced above, a block chain is a chain storage structure, and a block is a data element in the chain storage structure. A block chain may be understood as a unidirectional chain structure formed by blocks interconnected with each other. Typically, we call the first block in the block chain the "starting block" or "initial block".
In general, each chunk may record basic data such as a hash value of a previous chunk, transaction information in a current chunk, and a hash of the current chunk. Fig. 2 shows the structure of a block to which the embodiment of the present disclosure is applicable. Referring to fig. 2, the above block 200 may be divided into two parts: block header 210 and block body 220.
The block header 210 may contain basic information of the current block to ensure that the current block can correctly enter the block chain. In some implementations, the block header 20 may record a block Hash (Hash) value of a block immediately preceding the current block. The chunk hash value of the previous chunk may be recorded in the "prevBlockHash" field in the chunk header 210. In other implementations, the block header 20 may also record the block height of the current block. The block height is referred to as "block height" for short, and is used to identify the position of the block in the block chain. Typically, the starting block has a block height of 0.
The field block 220 may be used to record transaction information, including transaction amount and transaction data.
Consensus mechanism
The consensus mechanism can be understood as how to achieve consensus among all accounting nodes to identify the validity of a record, which is both a means of identification and a means of tamper prevention. The block chain provides four different consensus mechanisms, is suitable for different application scenarios, and balances efficiency and safety.
The consensus mechanism of the block chain has the characteristics of 'few obedience majority' and 'human-equal', wherein the 'few obedience majority' does not completely refer to the number of nodes, and can also be the computing power, the number of shares or other characteristic quantities which can be compared by a computer. "equal people" means that when the nodes meet the condition, all the nodes have the right to give priority to the consensus result, are directly identified by other nodes, and finally possibly become the final consensus result. Taking bitcoins as an example, workload proofs are used that it is possible to falsify a record that does not exist only if accounting nodes that control more than 51% of the total network are involved. When enough nodes are added to the blockchain, the method is basically impossible, and therefore the possibility of counterfeiting is eliminated.
The trust of the block chain is mainly embodied in that users distributed in the block chain do not need to trust another party of the transaction or trust a centralized mechanism, and the transaction can be realized only by trusting a software system under a block chain protocol. The premise of this trust is the consensus mechanism (consensus) of the blockchain, that is, in a mutually untrusted market, a sufficient requirement for each node to agree is that each node, considering the maximization of its own interest, will spontaneously and honestly obey the rules preset in the protocol, determine the authenticity of each record, and finally record the record determined to be authentic into the blockchain. In other words, if the nodes have independent interests and compete with each other, the nodes are almost impossible to collude to cheat you, which is especially evident when the nodes have a common reputation in the network. The blockchain technology just applies a set of consensus-based mathematical algorithm to establish a 'trust' network between machines, so that brand-new credit creation is performed through technical endorsements rather than centralized credit organizations.
Today's consensus mechanisms for blockchains can be divided into Proof Of workload (PoW), Proof Of rights and interests (equity), Proof Of shares (equity), Proof Of pool verification, and Practive Byzantine (PBFT).
Intelligent contract (Smart Contracts)
An intelligent contract is a set of commitments defined in digital form, including agreements on which contract participants can execute the commitments. In other words, a smart contract may be understood as a piece of program deployed on a computer system, and the smart contract may be automatically executed when a trigger condition of the smart contract is satisfied.
The presence of blockchains provides technical support for the implementation of intelligent contracts. The smart contract is written into the block chain in a digital form, and the characteristics of the block chain technology ensure that the whole process of storing, reading and executing the smart contract is transparent, traceable and not easy to modify. On the other hand, a set of state machine system can be constructed by the block chain self-contained consensus algorithm, so that the intelligent contract can run efficiently.
In some implementations, the user can invoke the intelligent contract by submitting a transaction to the blockchain system, set the data recorded in the intelligent contract, and store the set intelligent contract in the blockchain. Accordingly, when a specific condition of the intelligent contract is triggered, the block chain nodes can execute the intelligent contract and record the execution result of the intelligent contract and the execution state of the intelligent contract.
At present, various industries and some fields in the industry (for example, finance, public welfare, insurance, cross-border payment, etc.) build different blockchain systems according to their own industry structures, and record valuable information and assets in the industry or industry on the blockchain systems.
However, in some scenarios, information and assets of any one industry cannot be completely isolated, and there is often a business requirement for cross-industry collaboration. Therefore, information and assets recorded in the blockchain system need to be migrated between the blockchain systems, or in other words, blocks stored in the blockchain system need to be migrated between the blockchain systems. This means that there is a need for a "trusted connection technology" that can truly and reliably migrate a block in one blockchain network to another blockchain network, and ensure that the contents of the block cannot be tampered with during the process of migrating the block. In this way, the participants in the other blockchain network can trust the migrated block and use the migrated block for business cooperation.
In other scenarios, the blockchain system needs to be upgraded, but for some reason (e.g., the upgraded blockchain system no longer supports the blockchain format supported by the blockchain system before the upgrade), the upgrade cannot be performed with the blockchain stored, or online upgrade cannot be performed. Therefore, in order to upgrade a blockchain system, blocks stored in the blockchain system need to be migrated to another blockchain system. This also means that there is a need for a "trusted connection technology" that can truly and reliably migrate a block in a blockchain network to be upgraded to another blockchain network, and ensure that the contents of the block cannot be tampered during the process of migrating the block. In this way, the blockchain network to be upgraded can be upgraded, and the user can continue to use the migrated blockchain system through another blockchain system.
In order to meet the requirement of cross-chain migration of blocks in various scenes, a block migration technology based on a Trusted Execution Environment (TEE) server is provided at present. As described below in connection with fig. 3.
In the scenario illustrated in fig. 3, it is assumed that a block of storage needs to be migrated from the blockchain system 310 to the blockchain system 320. The TEE server 330 first pulls the to-be-migrated block from the blockchain system 310 and then verifies the authenticity of the acquired to-be-migrated block, wherein the authenticity of the block is used to indicate whether the block is a block that is actually stored in the blockchain system 310. After the TEE server confirms that the authenticity of the to-be-migrated block passes, the to-be-migrated block may be stored to the blockchain system 320. Of course, in some cases, if it is desired to migrate all blocks in blockchain system 310 to blockchain system 320, then the blocks in blockchain system 310 may be migrated and stored to blockchain system 320 one by one using the methods described above. Accordingly, a user may query the migrated tiles in the blockchain system 310 through the blockchain system 320.
In the above migration scheme, the authenticity of the tile may be verified by verification logic built into the TEE server. However, this way of verifying the authenticity of the tile is not visible to the user, who cannot know what the verification logic in the TEE server that verifies the authenticity of the tile contains, from what aspects the authenticity of the tile is verified, and what is more, the user cannot determine whether the TEE server verifies the authenticity of the tile. Therefore, the user cannot trust the authenticity of the block migrated by the above migration method to a large extent.
In order to avoid the above problems, the transparency of the method for verifying the authenticity of the block in the block migration process is improved, the disclosure provides a block migration method, in the scene of migrating the block from a source block chain to a target block chain, the authenticity of the block is verified by deploying a first intelligent contract in the target block chain, in this way, a user can check the verification method for verifying the authenticity of the block by inquiring the first intelligent contract deployed in the target block chain, the transparency of the verification method is favorably improved, and the trust degree of the user on the migration process is improved. It should be noted that, for convenience of description, the current block in the migration process is hereinafter referred to as a "first block".
Before describing the method of the embodiment of the present disclosure with reference to fig. 5, a migration scenario applicable to the embodiment of the present disclosure is described with reference to fig. 4. It should be noted that the source blockchain 410 and the target blockchain 420 shown in fig. 4 may be blockchains in the blockchain system shown in fig. 1, and for brevity, the related contents may be referred to above, and are not described herein again.
Referring to fig. 4, assume that a first block needs to be migrated from source blockchain 410 to target blockchain 420, and that a first intelligent contract 421 is deployed on target blockchain 420, where first intelligent contract 421 is used to manage the blocks in source blockchain 410.
Fig. 5 is a flowchart of a block migration method according to an embodiment of the disclosure. The method shown in fig. 5 includes steps S510 to S530. The steps shown in fig. 5 may be performed by block link points in the target block chain 420.
In step S510, a first invocation request for a first smart contract 421 is received.
In some implementations, the first call request is for requesting that the first tile be migrated from source blockchain 410 to target blockchain 420. The first call request includes the first tile in the source chain of tiles 410.
In step S520, the authenticity of the first block is verified using the first smart contract 421.
The authenticity of the first block is used to indicate whether the first block is a block stored in the source block chain 410. In some implementations, the authenticity of the first tile may be verified based on the legitimacy of the first tile. In other implementations, the authenticity of the first tile may be verified based on the legitimacy of the blockchain node to which the first tile belongs. In other implementations, the authenticity of the first tile may be verified based on the data content in the first tile. The method for verifying the authenticity of the first block will be described in detail below, and for brevity, will not be described in detail here.
In step S530, if the authenticity verification of the first block passes, the first block is stored to the target block chain 420.
If the authenticity verification of the first tile passes, the first tile may be considered to be the tile stored in source tile chain 410 to some extent, at which point the first tile may be stored in destination tile chain 420. In other words, the first block is persisted into the target block chain 420.
In some cases, the authenticity verification of the first chunk described above may not pass, i.e., the first chunk may not be a chunk stored in source chunk chain 410, at which point the calling process of first intelligent contract 421 may end. Or, the call of first intelligent contract 421 this time is ended. That is, the above method further includes: in step S540, if the authenticity verification of the first block fails, the calling process of the first smart contract 421 ends.
As described above, the authenticity of the first tile needs to be verified to ensure that the first tile is a tile in source chain of tiles 410. The following describes four ways of verifying the authenticity of the first tile, respectively.
In the first verification method, the authenticity of the first block may be verified based on whether the first block is a subsequent block of the block that has been successfully migrated. For convenience of description, the block that has been successfully migrated is referred to as a "second block" hereinafter.
That is, the target block chain 420 stores the second block migrated from the source block chain 410, and the second block is the previous block of the first block in the source block chain 410, in this case, the step S520 includes: whether the first block is a successor of the second block is determined by using the first intelligent contract 421 to verify the authenticity of the first block.
As described above with respect to blocks, if a first block is a successor of a second block, the block header of the first block is recorded with the block hash value of the second block. Then, in some implementations, the chunk hash value of the second chunk may be recorded using the first intelligent contract 421, and the chunk hash value of the second chunk is compared with the chunk hash value of the second chunk recorded in the first chunk, and if the chunk hash value of the second chunk recorded in the first intelligent contract 421 is the same as the chunk hash value of the second chunk recorded in the first chunk, the first chunk may be considered as a successor of the second chunk, that is, the authenticity verification of the first chunk is passed. Conversely, if the chunk hash value of the second chunk recorded in the first smart contract 421 is not the same as the chunk hash value of the second chunk recorded in the first chunk, the first chunk may be considered not to be a successor of the second chunk, i.e., the authenticity verification of the first chunk is not passed.
It should be noted that the chunk hash value of the second chunk recorded by the first intelligent contract 421 may be recorded during the process of migrating the second chunk. For example, the forwarding device mentioned below may obtain the second chunk during the process of migrating the second chunk, that is, after the forwarding device pulls the second chunk from the source chunk chain, the chunk hash value in the second chunk is read out, and sent to the first intelligent contract 421 in the target chunk chain.
In verifying the authenticity of the first tile using verification mode one, if the first tile is the first tile in the source tile chain 410, then it may not be possible to use verification mode one. To avoid this problem, information of the starting block of the source block chain 410 may be recorded in the first intelligent contract 421 so that other blocks in the subsequent source block chain 410 may verify the authenticity of the block using the first verification method described above. In some implementations, information for the starting block in source block chain 410 may be entered during initialization of first intelligent contract 421.
The information of the starting block may include a block hash value of the starting block. Of course, in some cases, the above-mentioned starting block information may also include the block content of the starting block, so as to verify whether the block hash value of the starting block recorded in the first intelligent contract 421 is obtained based on the block content of the starting block, which is beneficial to improving the authenticity of the starting block information.
And in the second verification mode, the authenticity of the first block can be verified based on the maximum value of the block hash value agreed by the block link points.
Typically, each blockchain node in a blockchain network will agree on a maximum value for the hashes of the chunks, limiting the hashes of the chunks in the blockchain system to not exceed the maximum value for the hashes of the chunks. Based on this, in the embodiments of the present disclosure, the authenticity of the first tile may be verified using the maximum value of the tile hash value.
That is, the first intelligent contract 421 records the maximum value of the hash value of the block agreed by the node of the block chain in the active block chain 410, and the step S520 may include determining whether the hash value of the block of the first block is smaller than the maximum value of the hash value of the block by using the first intelligent contract 421, so as to verify the authenticity of the first block.
In some implementations, the chunk hash value of the second chunk may be compared to the maximum value of the chunk hash value using the first smart contract 421, and if the chunk hash value of the second chunk is smaller than the maximum value of the chunk hash value, the chunk hash value of the first chunk may be considered to satisfy the convention of the chunk chain node in the source chunk chain 410, and the authenticity verification of the first chunk is passed. Conversely, if the chunk hash value of the second chunk is greater than the maximum value of the chunk hash values, it may be considered that the chunk hash value of the first chunk does not satisfy the convention of the chunk chain node in the source chunk chain 410, i.e., the authenticity verification of the first chunk fails.
It should be noted that the maximum value of the chunk hash value recorded by the first intelligent contract 421 may be recorded during the initialization process of the first intelligent contract 421.
And the verification method III can verify the authenticity of the first block based on the block link point to which the first block belongs in the source block chain.
That is to say, the block chain node storing the first block in the source block chain 410 is the first block chain node, the first block is a block digitally signed by the block chain node to which the first block belongs, and the public key of the first block chain node is recorded in the first intelligent contract 421. The step S520 may include: and judging whether the digital signature of the first block is the digital signature of the first block chain node or not by using the first intelligent contract 421 based on the public key of the first block chain node so as to verify the authenticity of the first block.
In some implementations, first intelligent contract 421 may also be invoked to inform first intelligent contract 421 of the blockchain node to which the first block to be migrated belongs in the source blockchain, i.e., the first blockchain node above. In this way, the first smart contract 421 may verify the authenticity of the first chunk based on the public key of the first chunk chain node of the record and the digital signature on the first chunk. If the public key of the first block chain node recorded by the first intelligent contract 421 matches the digital signature on the first block, the first block can be considered as a block transmitted by the first block chain node, and the authenticity verification of the first block passes. Conversely, if the public key of the first block chain node recorded by the first intelligent contract 421 does not match the digital signature on the first block, the first block may be considered not to be the block transmitted by the first block chain node, and the authenticity verification of the first block is not passed.
It should be noted that the public key of the first blockchain node in the source blockchain may be entered during initialization of the first intelligent contract 421.
In other implementations, the first intelligent contract 421 may also record public keys of some or all of the blockchain nodes in the active blockchain, so as to verify the authenticity of the block during the migration of the blocks of different blockchain nodes. Of course, the public key of some or all of the above blockchain nodes may also be entered during initialization of first intelligent contract 421.
And a fourth verification mode, verifying the authenticity of the first block based on the transaction information of the blocks stored by the link points of other blocks in the source block chain.
In practical situations, there may be a block chain bifurcation in the source block chain 410, that is, there may be a situation where a plurality of blocks recording different transaction information compete for the position of the same block. But only one block contends for the block high and is commonly recognized by the blockchain nodes in the entire source blockchain 410. For example, tile 1 and tile 2 in the source blockchain 410 are at the position of competition block height 2 at the same time, and tile 1 records the contents of transaction 1, transaction 3 and transaction 5, and tile 2 records the contents of transaction 2, transaction 4 and transaction 6. Finally, only Block 1 competes for the location of Block 2 and is commonly recognized by all of the blockchain nodes in the source blockchain 410.
In the above scenario, although the block 2 is not commonly recognized by all the block chain nodes in the source block chain 410, the hash value of the block 2 is smaller than the maximum hash value agreed in the source block chain 410, and the hash value of the block at the block 1 higher position is recorded in the block 2, if the hash value of the block 2 is bad, the data signature is performed on the block 2, and after the block 2 is migrated to the target block chain node 420, the authenticity of the block 2 is verified by using any one of the verification methods from the first verification method to the third verification method, and the obtained verification result is passed. In this case, the verification method cannot verify that the block 2 is not actually a block identified in the source block chain 410.
Therefore, in order to improve the accuracy of block authenticity verification. The embodiment of the disclosure further provides a verification method for block authenticity. That is, the first transaction information of the third block stored by the second block link point in the active block chain 410 is recorded in the first intelligent contract 421, and the block height of the third block in the active block chain 410 is the same as the block height of the first block. The step S520 further includes: the first transaction information is compared with the transaction information recorded in the first block by using the first intelligent contract 421, so as to verify the authenticity of the first block.
If the first transaction information is identical to the content of the transaction information recorded in the first tile, it can be understood that the first tile is a tile that is identified in the source tile chain 410, the authenticity verification of the first tile is passed. Conversely, if the first transaction information is different from the content of the transaction information recorded in the first tile, it can be understood that the first tile is a tile that is not commonly recognized by the source blockchain node 410, the authenticity verification of the first tile does not pass.
It should be noted that the first transaction information and/or the transaction information recorded in the first block may be obtained during the migration process of the corresponding block. For example, the first transaction information may be acquired by the forwarding device in the process of migrating the third block, that is, after the forwarding device pulls the third block from the source block chain, the first transaction information in the third block is read out and sent to the first intelligent contract 421 in the target block chain. Correspondingly, the transaction information recorded in the first block may also be acquired by the forwarding device in the process of migrating the first block, that is, after the forwarding device pulls the first block from the source block chain, the transaction information in the first block is read out and sent to the first intelligent contract 421 in the target block chain.
In general, in order to further improve the accuracy of verifying the authenticity of a block, the transaction information recorded in the block at the corresponding position stored in each block chain node in the source block chain may be compared by using the first intelligent contract 421, and the authenticity verification of the block is passed only when the transaction information in the blocks at the corresponding position stored in a preset number of block chain nodes is the same, and the block recorded with the transaction information is determined to be the block commonly recognized in the source block chain 410. The above-mentioned correspondingly positioned blocks can be understood as blocks having the same block height.
For example, in the first intelligent contract 421, it is specified that when the transaction information of the block records in the corresponding position where one third of the block link points in the source block chain 410 are stored is the same, the block records of the transaction information may be considered to be identified. Assuming that there are 3000 blockchain nodes in the source blockchain 410 in total and the block height of the block 3 is 4, at this time, based on the provision of the first intelligent contract 421, if the transaction information recorded in the block 3 with the block height of 4 is identical in the 1000 blockchain nodes in the source blockchain 410, the block 3 recording the transaction information may be considered as the real block in the source blockchain 410, that is, the authenticity verification of the block passes.
It should be noted that, if a plurality of blocks with different transaction information records occur in the comparison process of the block chain nodes that do not reach the preset number, and the block heights of the blocks are the same, at this time, the contents recorded by the plurality of blocks can be all retained, and in the process of verifying the corresponding blocks in the subsequent other block chain nodes, the numbers corresponding to the blocks with different transaction information are respectively recorded until the number of the block chain nodes corresponding to the block with a certain transaction information record reaches the preset number, and then the authenticity verification of the block with the transaction information is considered to pass.
For example, when the authenticity verification is performed on the block 2 in the first block chain node in the source block chain 410 by adopting the fourth verification method, the transaction information recorded in the block 2 is the transaction information 1. By adopting the fourth verification method, when the authenticity of the block 2 in the second block chain node in the source block chain 410 is verified, the transaction information recorded in the block 2 is the transaction information 2. At this time, since the transaction information recorded in the block 2 stored in the link point of the other block in the source block chain is unknown, the transaction information 1 and the transaction information 2 may be respectively retained, and in the subsequent process of verifying the authenticity of the block 2 in the link node of the other block in the source block chain 410, the number of the link node of the block corresponding to each transaction information is recorded, and after the number of the link point of the block reaches the preset number, the block 2 of the transaction information is used as the real block recorded in the source block chain 410, that is, the authenticity verification of the block passes.
It should be noted that the total number of nodes in the source block chain and/or the preset number may be set during the initialization process of the first intelligent contract 421. Of course, the above parameters may also be specified in the process of invoking the first smart contract 421, which is not limited by the embodiment of the present disclosure.
In addition, the preset number may be specified based on a consensus mechanism in the source block chain, for example, when the consensus mechanism adopted in the source block chain 410 is PBFT, the preset number may be one third of the total number of block chain nodes in the source block chain 410. For another example, when the adopted consensus mechanism is PoW, the preset number may be one half of the total number of blockchain nodes in the source blockchain 410. Of course, in the embodiment of the present disclosure, the preset number may also be set based on experience, and the embodiment of the present disclosure does not limit this.
In the above, the first verification manner to the fourth verification manner are introduced, and it should be noted that, in the embodiment of the present disclosure, the four verification manners may be used in combination with each other, for example, the first verification manner and the second verification manner may be used in combination. For example, the first verification method, the third verification method, and the fourth verification method may be used in combination. For the sake of brevity, embodiments of the present disclosure are not listed here. In addition, for the convenience of understanding, the flow of the method used in combination with the above 4 verification methods will be described below with reference to fig. 8.
In addition, it should be noted that, in the case that the four verification methods can also be used in combination with each other, the sequence of the verification methods is not limited in the embodiment of the present disclosure. For example, verify condition one may precede verify condition two. As another example, verify condition three may precede verify condition two.
To facilitate a user's query of tiles in source blockchain 410, a query interface may be set in first intelligent contract 421 for a user invocation of target blockchain 420. Namely, the above method further comprises: a second invocation request for the first intelligent contract 421 is received from a user node of the target blockchain 420, the second invocation request being for querying a block in the source blockchain 410 stored in the target blockchain 420.
It should be noted that the blocks in the source block chain 410 stored in the target block chain 420 may be blocks that have been verified for authenticity. In some implementations, in order to prevent a block chain bifurcation from existing in the source block chain 410, a block on a shorter chain after the bifurcation in the source block chain (i.e., without consensus) is migrated to the target block chain, which results in a user querying a block on the shorter chain on the target block chain, the above query service may be provided for a block with a block height of (N-i) in the source block chain after the block with a block height of N is passed through the authenticity verification process in the first intelligent contract 421, so as to ensure the reliability of the query. Wherein N, i are positive integers, and N is greater than i. In some cases, the above i may be set to 6 empirically. That is, after the block with the block height of i passes the authenticity verification, the query service of the block with the block height of N-i is provided, which is beneficial to reducing the possibility that the user can find the block on the shorter chain.
For ease of understanding, the contents of a first smart contract of an embodiment of the present disclosure are described below in connection with FIG. 6. FIG. 6 is a schematic diagram of a first intelligent contract in an embodiment of the disclosure. Referring to fig. 6, a first smart contract may include a transport block (represented by "transferBlock") interface and a query block (represented by "queryBlock") interface.
The transport block interface described above may be used to upload blocks in source block chain 410. That is, the first call request in the above can be understood as calling the transport block interface. When the transport Block interface is called, in addition to the Block to be uploaded (indicated by "Block"), a Block chain node (indicated by "node") for storing the Block needs to be specified.
The query block interface described above may be used to query blocks that have passed authenticity verification. That is, the second invocation request above may be understood as invoking the query block interface. When the query block interface is called, an index (denoted by "blockNumber") of a block to be queried needs to be specified.
The persistent data of the first smart contract includes a Block List (denoted by "List < Block >"), Block link point information in the source Block chain (denoted by "Map < node, NodeInfo >"). Wherein, the list records the blocks which pass the authenticity verification. The block chain node information may include an identification of the block chain node (denoted by "node") and a public key of the block chain node (denoted by "NodeInfo").
In some implementations, there is no direct communication between the source blockchain 410 and the destination blockchain 420 to migrate the first block, and at this time, a forwarder may be provided between the source blockchain 410 and the destination blockchain 420 to migrate the first block from the source blockchain 410 to the destination blockchain 420. That is, the forwarding device acquires the block to be migrated from the source block chain 410, and then sends the first call request to the block link point of the target block chain 420. Thus, step S510 described above may include receiving a first invocation request for first smart contract 421 from a forwarding device for migrating a first tile from source blockchain 410 to target blockchain 420.
In some implementations, the forwarding device may obtain the first tile from the source tile chain 410 by using a pull-block parsing method. In other implementations, the forwarding device may obtain the first block by calling a block query interface of a block chain node of the target block chain 420. The embodiment of the present disclosure does not limit the manner in which the forwarding device acquires the first block.
In other implementations, the forwarding device may be a device with processing functionality, for example, a server, a terminal device, an ore machine, or the like. It should be noted that, in the embodiment of the present disclosure, since the authenticity of the first block is verified by using the first smart contract, the authenticity of the block recorded in the target block chain is ensured. The solution of the embodiments of the present disclosure is not as strongly dependent on whether the forwarding device is a TEE server or not, as compared to conventional block migration solutions. Of course, if the security during the block migration process is further improved, the forwarding device may also be configured as a TEE server.
To avoid forwarding devices doing bad and causing a block migration failure, multiple forwarding devices may be placed between the source blockchain 410 and the target blockchain 420 to migrate a first block from the source blockchain 410 to the target blockchain 420. Of course, if cost saving is a concern, a forwarding device may be disposed between the source blockchain 410 and the destination blockchain 420.
In some implementations, to encourage forwarding devices to migrate tiles from the source blockchain 410 to the target blockchain 420, a reward mechanism may be provided. In some implementations, forwarding devices may be rewarded in a chained manner. For example, the rewards may be stored in an on-chain account (e.g., the account that created the first smart contract) and distributed to the on-chain account corresponding to the forwarding device based on the migration success rate and/or the number of blocks successfully migrated per forwarding device. The factors referred to by the reward mechanism are not particularly limited by this disclosure, and the reward points may also be distributed based on, for example, the number of times the forwarding device invokes the first smart contract.
In other implementations, the forwarding devices may also be rewarded in a chain-down manner. For example, the migration success rate and/or the number of blocks successfully migrated for each forwarding device may be recorded on the chain, and then the bonus money may be issued to the corresponding down-chain account of the forwarding device under the chain based on these records. The factors referred to by the reward mechanism are not particularly limited by this disclosure, and the reward points may also be distributed based on, for example, the number of times the forwarding device invokes the first smart contract.
The method of the embodiment of the present disclosure is described above with reference to fig. 1 to 6, and for convenience of understanding, the following describes a block migration method flow of the embodiment of the present disclosure by taking the migration block 1 as an example with reference to fig. 7 to 8. Referring to fig. 7, assume that block 1 is stored at block chain node 1 in source block chain 710, and block 1 has a block height of 2. Forwarding device 730 is used to migrate tile 1 from source blockchain 710 to target blockchain 720. Accordingly, intelligent contract 1 is deployed in target blockchain 720, and intelligent contract 1 is used to manage the blocks in source blockchain 710.
Fig. 8 is a flowchart of a block migration method according to another embodiment of the disclosure. The method shown in fig. 8 includes steps S810 to S820.
In step S810, smart contract 1 is initialized in target blockchain 720.
The above-described process of initializing the smart contract 1 includes recording starting block information of the source blockchain 710, all blockchain link point information of the source blockchain 710, and a maximum value of the blockhash value agreed by the source blockchain 710 in the smart contract 1. The starting block information may include a block hash value of the starting block and the starting block content. The block link point information includes an identifier of a block link node and a public key of the block link node.
In step S820, the forwarding device 730 acquires block 1 from block chain node 1 in the source block chain.
In some implementations, the forwarding device 730 may query for block 1 by calling a block query interface of the blockchain node 1. Accordingly, the full transaction information in block 1 may be obtained. In addition, the block 1 is a block digitally signed with a private key via the block chain node 1.
In step S830, the forwarding device 730 will send a call request 1 of the intelligent contract 1 to the block link point in the target block chain 720.
In some implementations, forwarding device 730 may invoke the transport block interface of intelligent contract 1 by invoking request 1 to send tile 1 to target tile chain 720.
In step S840, the block link point of the target block chain 720 verifies the authenticity of block 1 using the smart contract 1.
In some implementations, the block link point verifies whether block 1 is a successor to block 0 based on verification mode one using intelligent contract 1. Where block 0 is the last block of block 1 in source block chain 710. If the block 1 is a successor of the block 0, the authenticity of the block 1 is continuously verified by adopting a verification mode two. If block 1 is not a successor to block 0, the intelligent contract 1 call ends.
If block 1 is a successor to block 0, verify that the block hash value for block 1 is less than the maximum value of the block hash value agreed upon by the source blockchain 710. And if the block hash value of the block 1 is smaller than the maximum value of the block hash value, continuously verifying the authenticity of the block 1 by adopting a verification mode III. If the block hash value of the block 1 is greater than or equal to the maximum value of the block hash value, the calling of the intelligent contract 1 is finished.
And if the block hash value of the block 1 is smaller than the maximum value of the block hash value, verifying whether the block link point to which the block 1 belongs is the block link node 1 by adopting a third verification method. And if the digital signature of the block 1 is matched with the public key of the block chain node 1, continuously verifying the authenticity of the block 1 by adopting a verification mode IV. If the digital signature of the block 1 does not match the public key of the block chain node 1, the calling of the intelligent contract 1 is finished.
And if the digital signature of the block 1 is matched with the public key of the block chain node 1, verifying whether the transaction information in the block 1 is the same as the transaction information recorded in the block 1' by adopting a fourth verification mode. Wherein, the block 1 'is a block stored in the block chain node 2 in the source block chain 710 and having the same block height as the block 1, and the block 1' has passed the authenticity verification process of the block. If the transaction information recorded in the block 1 is the same as the transaction information recorded in the block 1', the authenticity verification of the block 1 is passed, and step S850 is performed. If the transaction information recorded in the block 1 is different from the transaction information recorded in the block 1', the calling of the intelligent contract 1 is finished.
In step S850, the first block is persisted into smart contract 1 of target blockchain 420.
In step S860, the block nodes of the target block chain 720 are queried by using the smart contract 1 to determine whether the stored blocks 1 transmitted by the predetermined number of block nodes in the source block chain 710 are received.
If so, it can be understood that the block 1 is a commonly known block in the source block chain 710, step S870 is performed. If not, the standby forwarding device 730 continues to migrate the block 1 stored by the other block link points in the source block chain 710, step S880.
In step S870, the blocks of the already commonly recognized blocks are raised by +1 in the smart contract 1, and block 1 is added in the block list in the smart contract 1.
It should be noted that, the process of forwarding a certain block in the embodiment of the present disclosure is described above with reference to fig. 4 to 5, and if all blocks in the source block chain are to be migrated, the above process may be performed cyclically until all blocks in the source block chain are migrated. For brevity, no further detailed description is provided herein.
In addition, as described above, in the process of verifying the authenticity of a block, the whole transaction information contained in a certain block needs to be maintained, so as to perform the fourth verification method. It should be noted that, in order to save the storage space, in the case that the transaction information recorded in the block is the same, only one copy of the full data of the block may be recorded. Of course, in the embodiment of the present disclosure, the transaction information of the block stored in each block link point in the source block chain may also be recorded.
Method embodiments of the present disclosure are described in detail above in conjunction with fig. 1-8, and apparatus embodiments of the present disclosure are described in detail below in conjunction with fig. 9-11. It is to be understood that the description of the method embodiments corresponds to the description of the apparatus embodiments, and therefore reference may be made to the preceding method embodiments for parts not described in detail.
Fig. 9 is a schematic diagram of a block migration apparatus according to an embodiment of the disclosure. Wherein a block is a first block to be migrated to a target block chain in a source block chain, the apparatus is a block link point in the target block chain, the target block chain has a first intelligent contract stored thereon, and the first intelligent contract is used for managing the block in the source block chain, and the apparatus 900 includes: a receiving module 910 and a processing module 920.
A receiving module 910, configured to receive a first call request of the first intelligent contract, where the first call request includes the first block in the source block chain;
a processing module 920, configured to verify authenticity of the first block by using the first smart contract;
the processing module 920 is further configured to store the first block to the target block chain if the authenticity verification of the first block passes.
In one possible implementation, the target block chain stores a second block migrated from the source block chain, the second block being a last block of the first block in the source block chain,
the processing module is further configured to determine whether the first block is a successor of the second block by using the first intelligent contract, so as to verify authenticity of the first block.
In a possible implementation manner, the first intelligent contract records a maximum value of a block hash value agreed by a block chain node in the source block chain, and the processing module is further configured to determine, by using the first intelligent contract, whether the block hash value of the first block is smaller than the maximum value of the block hash value, so as to verify the authenticity of the first block.
In a possible implementation manner, a block chain node in the source block chain, where the first block is stored, is a first block chain node, where the first block is a block digitally signed by a block chain node to which the first block belongs, and a public key of the first block chain node is recorded in the first intelligent contract, and the processing module is further configured to determine, by using the first intelligent contract and based on the public key of the first block chain node, whether a digital signature of the first block is a digital signature of the first block chain node, so as to verify the authenticity of the first block.
In a possible implementation manner, the first intelligent contract records first transaction information of a third block stored by a second block link point in the active block chain, and a block height of the third block in the active block chain is the same as a block height of the first block, and the processing module is further configured to compare the first transaction information with the transaction information recorded by the first block by using the first intelligent contract to verify authenticity of the first block.
In a possible implementation manner, the receiving module is further configured to receive, from a user node of the target block chain, a second invocation request of the first intelligent contract, where the second invocation request is used to query a block in the source block chain stored in the target block chain.
In a possible implementation manner, the receiving module is further configured to receive the first invocation request of the first intelligent contract from a forwarding device, where the forwarding device is configured to migrate the first block from the source block chain to the target block chain.
In a possible implementation manner, the forwarding device is one of a plurality of forwarding devices, and the plurality of forwarding devices are configured to migrate the first block from the source block chain to the target block chain.
In a possible implementation manner, the processing module is further configured to end the invoking process of the first intelligent contract if the authenticity verification of the first block fails.
Fig. 10 is a schematic diagram of a block migration apparatus according to an embodiment of the disclosure. The block is a first block to be migrated to a target block chain in a source block chain, and a first intelligent contract is stored in the target block chain and used for managing the block in the source block chain forwarded by forwarding equipment. The apparatus 1000 in fig. 10 is applied to the forwarding device, and includes an obtaining module 1010 and a sending module 1020.
An obtaining module 1010, configured to obtain the first block from the source block chain;
a sending module 1020, configured to send a first invocation request of the first intelligent contract to the target blockchain node, where the first invocation request includes the first block.
Fig. 11 is a schematic block diagram of an apparatus of another embodiment of the present disclosure. The terminal 1100 shown in fig. 11 may include: memory 1111, processor 1120, input/output interface 1130, transceiver 1140. The memory 1111 is used for storing instructions, the processor 1120 is used for executing the instructions stored in the memory 1120, so as to control the input/output interface 1130 to receive input data and information, output data such as operation results, and control the transceiver 1140 to transmit signals.
The processor 1120 is configured to determine a dedicated transmission resource for transmitting the scheduling request SR;
the transceiver 1140 is configured to transmit the SR to a network device on the dedicated transmission resource determined by the determining unit.
It should be understood that, in the embodiment of the present disclosure, the processor 1120 may adopt a general-purpose Central Processing Unit (CPU), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits, which are used to execute related programs to implement the technical solutions provided by the embodiments of the present disclosure.
It is also understood that the transceiver 1140, also referred to as a communication interface, enables communication between the terminal 1100 and other devices or communication networks using transceiver means such as, but not limited to, transceivers.
The memory 1111, which may include both read-only memory and random access memory, provides instructions and data to the processor 1120. A portion of processor 1120 may also include non-volatile random access memory. For example, the processor 1120 may also store information of device types.
In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 1120. The method for requesting uplink transmission resources disclosed in connection with the embodiments of the present disclosure may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 1111, and the processor 1120 reads the information in the memory 1111 and performs the steps of the above method in combination with the hardware thereof. To avoid repetition, it is not described in detail here.
It should be understood that, in the embodiments of the present disclosure, the processor may be a Central Processing Unit (CPU), and the processor may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should be understood that in the embodiments of the present disclosure, "B corresponding to a" means that B is associated with a, from which B can be determined. It should also be understood that determining B from a does not mean determining B from a alone, but may be determined from a and/or other information.
It should be understood that the term "and/or" herein is merely one type of association relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that, in various embodiments of the present disclosure, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the disclosure are, in whole or in part, generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be read by a computer or a data storage device including one or more available media integrated servers, data centers, and the like. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a Digital Versatile Disk (DVD)), or a semiconductor medium (e.g., a Solid State Disk (SSD)), among others.
The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present disclosure, and all the changes or substitutions should be covered within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (22)

1. A method for transferring a block, wherein the block is a first block to be transferred to a target block chain in a source block chain, the method is applied to a block chain link point of the target block chain, a first intelligent contract is stored on the target block chain, and the first intelligent contract is used for managing the block in the source block chain,
the method comprises the following steps:
receiving a first call request of the first intelligent contract, the first call request including the first block in the source block chain;
verifying the authenticity of the first block using the first smart contract;
and if the authenticity verification of the first block is passed, storing the first block to the target block chain.
2. The method of claim 1, the target blockchain storing a second block migrated from the source blockchain, the second block being a last block of the first block in the source blockchain,
the verifying the authenticity of the first block using the first smart contract comprises:
and judging whether the first block is a successor of the second block or not by using the first intelligent contract so as to verify the authenticity of the first block.
3. The method according to claim 1 or 2, wherein the first intelligent contract records the maximum value of the block hash value agreed by the block chain nodes in the source block chain,
the verifying the authenticity of the first block using the first smart contract comprises:
and judging whether the block hash value of the first block is smaller than the maximum value of the block hash value by using the first intelligent contract so as to verify the authenticity of the first block.
4. The method according to any one of claims 1-3, wherein the blockchain node in the source blockchain that stores the first block is a first blockchain node, the first block is a block digitally signed by the blockchain node to which the first block belongs, and the public key of the first blockchain node is recorded in the first smart contract,
the verifying the authenticity of the first block using the first smart contract comprises:
and judging whether the digital signature of the first block is the digital signature of the first block chain node or not by utilizing the first intelligent contract based on the public key of the first block chain node so as to verify the authenticity of the first block.
5. The method according to any one of claims 1-4, wherein the first intelligent contract records first transaction information of a third block stored by a second block link point in the source block chain, wherein the block height of the third block is the same as the block height of the first block in the source block chain,
the verifying the authenticity of the first block using the first smart contract comprises:
and comparing the first transaction information with the transaction information recorded in the first block by using the first intelligent contract so as to verify the authenticity of the first block.
6. The method of any one of claims 1-5, further comprising:
receiving a second call request of the first intelligent contract from a user node of the target blockchain, wherein the second call request is used for inquiring blocks in the source blockchain stored in the target blockchain.
7. The method of any of claims 1-6, the receiving a first invocation request for the first intelligent contract, comprising:
receiving the first invocation request of the first intelligent contract from a forwarding device, the forwarding device being configured to migrate the first block from the source block chain to the target block chain.
8. The method of claim 7, the forwarding device being one of a plurality of forwarding devices for migrating the first tile from the source chain of tiles to the target chain of tiles.
9. The method of any one of claims 1-8, further comprising:
and if the authenticity verification of the first block is not passed, ending the calling process of the first intelligent contract.
10. A migration method of a block, wherein the block is a first block to be migrated to a target block chain in a source block chain, the target block chain is stored with a first intelligent contract, the first intelligent contract is used for managing the block in the source block chain forwarded by a forwarding device, and the method is applied to the forwarding device,
the method comprises the following steps:
obtaining the first block from the source block chain;
sending a first invocation request of the first intelligent contract to the target blockchain node, the first invocation request including the first block.
11. A block migration device, the block is a first block to be migrated to a target block chain in a source block chain, the device is a block link point in the target block chain, the target block chain is stored with a first intelligent contract, the first intelligent contract is used for managing the block in the source block chain,
the device comprises:
a receiving module, configured to receive a first call request of the first intelligent contract, where the first call request includes the first block in the source block chain;
the processing module is used for verifying the authenticity of the first block by utilizing the first intelligent contract;
the processing module is further configured to store the first block to the target block chain if the authenticity of the first block is verified.
12. The apparatus of claim 11, the target blockchain storing a second block migrated from the source blockchain, the second block being a last block of the first block in the source blockchain,
the processing module is further configured to determine whether the first block is a successor of the second block by using the first intelligent contract, so as to verify authenticity of the first block.
13. The apparatus according to claim 11 or 12, wherein the first intelligent contract records the maximum value of the block hash value agreed by the block chain node in the source block chain,
the processing module is further configured to determine, by using the first intelligent contract, whether the block hash value of the first block is smaller than the maximum value of the block hash value, so as to verify the authenticity of the first block.
14. The apparatus according to any one of claims 11-13, wherein a block chain node in the source block chain that stores the first block is a first block chain node, the first block is a block digitally signed by a block chain node to which the first block belongs, and a public key of the first block chain node is recorded in the first smart contract,
the processing module is further configured to determine, by using the first intelligent contract, based on the public key of the first block chain node, whether the digital signature of the first block is the digital signature of the first block chain node, so as to verify the authenticity of the first block.
15. The apparatus according to any one of claims 11-14, wherein the first intelligent contract records therein first transaction information of a third block stored by a second block link point in the source block chain, the block height of the third block in the source block chain being the same as the block height of the first block,
the processing module is further configured to compare the first transaction information with the transaction information recorded in the first block by using the first intelligent contract, so as to verify the authenticity of the first block.
16. The apparatus of any of claims 11-15, the receiving means further to
Receiving a second call request of the first intelligent contract from a user node of the target blockchain, wherein the second call request is used for inquiring blocks in the source blockchain stored in the target blockchain.
17. The apparatus of any of claims 11-16, the receiving module further to receive the first invocation request for the first smart contract from a forwarding device, the forwarding device to migrate the first block from the source block chain to the target block chain.
18. The apparatus of claim 17, the forwarding device being one of a plurality of forwarding devices configured to migrate the first tile from the source chain of tiles to the target chain of tiles.
19. The apparatus of any of claims 11-18, the processing module further to end the invoking process of the first smart contract if the authenticity verification of the first tile fails.
20. A migration apparatus of a block, the block is a first block to be migrated to a target block chain in a source block chain, the target block chain is stored with a first intelligent contract, the first intelligent contract is used for managing the block in the source block chain forwarded by a forwarding device, the apparatus is applied to the forwarding device,
the device comprises:
an obtaining module, configured to obtain the first block from the source block chain;
a sending module, configured to send a first invocation request of the first intelligent contract to the target block chain node, where the first invocation request includes the first block.
21. A block migration apparatus comprising a memory having executable code stored therein and a processor configured to execute the executable code to implement the method of any one of claims 1-9.
22. A block migration apparatus comprising a memory having executable code stored therein and a processor configured to execute the executable code to implement the method of claim 10.
CN202111315785.8A 2021-11-08 2021-11-08 Block migration method and device Pending CN113987598A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111315785.8A CN113987598A (en) 2021-11-08 2021-11-08 Block migration method and device
PCT/CN2022/128538 WO2023078200A1 (en) 2021-11-08 2022-10-31 Block migration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111315785.8A CN113987598A (en) 2021-11-08 2021-11-08 Block migration method and device

Publications (1)

Publication Number Publication Date
CN113987598A true CN113987598A (en) 2022-01-28

Family

ID=79747223

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111315785.8A Pending CN113987598A (en) 2021-11-08 2021-11-08 Block migration method and device

Country Status (2)

Country Link
CN (1) CN113987598A (en)
WO (1) WO2023078200A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023078200A1 (en) * 2021-11-08 2023-05-11 支付宝(杭州)信息技术有限公司 Block migration

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102542631B1 (en) * 2019-04-18 2023-06-13 라인플러스 주식회사 Method and system for verifying blockchain data stored in a storage format different from blockchain
CN111275422A (en) * 2020-01-22 2020-06-12 腾讯科技(深圳)有限公司 Data transfer method, device and equipment based on block chain
CN111309711A (en) * 2020-03-13 2020-06-19 财付通支付科技有限公司 Cross-block-chain data migration method, device, equipment and storage medium
CN111769957B (en) * 2020-09-02 2020-12-15 百度在线网络技术(北京)有限公司 Block chain cross-chain query method, device, equipment and storage medium
CN113987598A (en) * 2021-11-08 2022-01-28 支付宝(杭州)信息技术有限公司 Block migration method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023078200A1 (en) * 2021-11-08 2023-05-11 支付宝(杭州)信息技术有限公司 Block migration

Also Published As

Publication number Publication date
WO2023078200A1 (en) 2023-05-11

Similar Documents

Publication Publication Date Title
CN110443704B (en) Method and device for sending resources in cross-link mode
CN112003703B (en) Method and device for transmitting authenticatable message across chains
TWI710979B (en) Cross-block chain interaction method, device, system, and electronic equipment
CN108881187B (en) Cross-link data transmission method and device suitable for permission link scene
KR20210128452A (en) Computer-implemented systems and methods for implementing transfers via blockchain networks.
CN112087502B (en) Method, device and equipment for processing request and storage medium
CN112613877B (en) Intelligent contract triggering method and device applied to block chain network and related equipment
CN112202564B (en) Transaction transfer method and device, electronic equipment and readable storage medium
KR20220066823A (en) Blockchain - based phishing prevention system, apparatus, and method thereof
CN113689216A (en) Cross-chain transaction processing method and device, equipment, storage medium and program product
WO2023078200A1 (en) Block migration
CN112269915B (en) Service processing method, device, equipment and storage medium
CN110784324B (en) Node admission method and device
CN112615868B (en) Method and device for transmitting authenticatable message across chains
CN111461878A (en) Block chain transaction processing method and system based on intelligent contracts outside chains
CN113472781B (en) Service acquisition method, server and computer readable storage medium
CN115913734A (en) User authority management method, device and equipment applied to alliance chain
CN114301912A (en) Information interaction method and device based on block chain
CN110585717B (en) Information processing method and device
CN115967508A (en) Data access control method and device, equipment, storage medium and program product
CN113362064A (en) Multiple signature method, computer device, and storage medium
WO2019205023A1 (en) Blockchain-based data management method and related system
CN113313584B (en) Service processing method and processing device
CN112837043B (en) Block chain-based data processing method and device and electronic equipment
CN112202734B (en) Service processing method, electronic device and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240228

Address after: Room 1408, No. 447 Nanquan North Road, China (Shanghai) Pilot Free Trade Zone, Pudong New Area, Shanghai, 200120

Applicant after: Shanghai Ant Chuangjiang Information Technology Co.,Ltd.

Country or region after: China

Address before: 310000 801-11 section B, 8th floor, 556 Xixi Road, Xihu District, Hangzhou City, Zhejiang Province

Applicant before: Alipay (Hangzhou) Information Technology Co.,Ltd.

Country or region before: China