CN110675148A - Synchronization method and system for verification node set and electronic equipment - Google Patents

Synchronization method and system for verification node set and electronic equipment Download PDF

Info

Publication number
CN110675148A
CN110675148A CN201910860632.8A CN201910860632A CN110675148A CN 110675148 A CN110675148 A CN 110675148A CN 201910860632 A CN201910860632 A CN 201910860632A CN 110675148 A CN110675148 A CN 110675148A
Authority
CN
China
Prior art keywords
block chain
blockchain
block
synchronization
timer
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.)
Granted
Application number
CN201910860632.8A
Other languages
Chinese (zh)
Other versions
CN110675148B (en
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.)
Hangzhou Rivtower Technology Co Ltd
Original Assignee
Cryptape 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 Cryptape Co ltd filed Critical Cryptape Co ltd
Priority to CN201910860632.8A priority Critical patent/CN110675148B/en
Publication of CN110675148A publication Critical patent/CN110675148A/en
Application granted granted Critical
Publication of CN110675148B publication Critical patent/CN110675148B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/409Device specific authentication in transaction processing
    • G06Q20/4097Device specific authentication in transaction processing using mutual authentication between devices and transaction partners

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The embodiment of the specification relates to a synchronization method, a system and an electronic device for verifying a node set, which comprises the following steps: after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, starting a timer by the first block chain; in the timing time period of the timer, the relay synchronizes the verification node set of the current latest block of the second block chain to the first block chain; if the synchronization is successful, the first block chain restarts the timer; if the synchronization fails, the relay re-executes the synchronization operation; if the timer times out, the first blockchain suspends cross-chain transactions, waiting for synchronization. Therefore, the trust of the relay is decoupled, the effective synchronization of the verification node set is realized through the timer in the block chain and the condition of the updating synchronization mechanism, and the safety of the cross-chain is ensured.

Description

Synchronization method and system for verification node set and electronic equipment
Technical Field
The embodiment of the specification relates to the technical field of networks, in particular to a synchronization method and system for a verification node set and an electronic device.
Background
When a common identification chain (assumed to be a block chain A) based on Byzantine fault tolerance is subjected to chain crossing, a hand chain (assumed to be a block chain B) needs to synchronize and save a verification node set of the block chain A; and the effective synchronization of the verification node set is the guarantee of cross-chain safety.
In the process of chain crossing, the verification node set of the blockchain A can change along with time, and when the verification node set synchronously stored by the blockchain B is inconsistent with the blockchain A, the chain crossing is easy to attack. For example, at some point, the set of verification nodes for blockchain a is {1,2,3,4}, and blockchain B holds the set of verification nodes for blockchain a as {1,2,3,4 }; then, when the verification node set of the blockchain A is changed from {1,2,3,4} to {1,5,6,7 }; block chain B is not updated synchronously in time, and is still {1,2,3,4 }. In the consensus process based on Byzantine fault tolerance, the consensus can be realized if the verification nodes exceeding 2/3 are honest; but after the verification node is replaced, there may be any behavior, in other words, the nodes 2,3,4 of the blockchain a may be dishonest at this time. But the set of verification nodes recorded by blockchain B is still {1,2,3,4}, and the cross-chain transactions signed by verification nodes exceeding 2/3 in the set are all valid. If the node 2,3,4 with the changed blockchain a signs the fake cross-chain transaction and forwards the fake cross-chain transaction to the blockchain B, the fake cross-chain transaction will take effect in the blockchain B.
In order to avoid the above attack, in the current cross-chain process, the relay can synchronize the verification node set. However, it is considered that the relay may not forward the message that the verification node set of blockchain a is changed, so that the verification node set recorded by blockchain B is inconsistent with the current verification node set of blockchain a, thereby causing a cross-chain attack.
Disclosure of Invention
Embodiments of the present specification provide a synchronization method, system and electronic device for verifying a node set, so as to solve the problem of cross-link insecurity caused by relay operation badness in the prior art.
In order to solve the above technical problem, the embodiments of the present specification adopt the following technical solutions:
in a first aspect, a synchronization method for verifying a node set is provided, and is applied in a blockchain cross-chain transaction process, the method includes:
after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, starting a timer by the first block chain;
within the timing time period of the timer, the relay synchronizes the verification node set of the current latest block of the second block chain to the first block chain;
if the synchronization is successful, the first block chain restarts a timer;
if the synchronization fails, the relay re-executes the synchronization operation;
if the timer times out, the first blockchain suspends cross-chain transactions and waits for synchronization.
In a second aspect, provide
A synchronization system for verifying a set of nodes for use during a blockchain cross-chain transaction, the system comprising: a first block chain, a second block chain and a relay; wherein,
the first block chain is used for starting a timer after the first block chain initially synchronizes the verification node set of the latest block of the second block chain;
the relay is configured to synchronize the verification node set of the current latest block of the second block chain to the first block chain within the timing time period of the timer;
the first blockchain is further used for restarting the timer if the synchronization is successful;
the relay is also used for re-executing the synchronization operation if the synchronization fails;
the first blockchain is further used for suspending cross-chain transaction and waiting for synchronization if the timer is overtime.
In a third aspect, an electronic device is provided, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor to:
after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, starting a timer by the first block chain;
within the timing time period of the timer, the relay synchronizes the verification node set of the current latest block of the second block chain to the first block chain;
if the synchronization is successful, the first block chain restarts a timer;
if the synchronization fails, the relay re-executes the synchronization operation;
if the timer times out, the first blockchain suspends cross-chain transactions and waits for synchronization.
In a fourth aspect, a computer-readable storage medium is provided that stores one or more programs that, when executed by an electronic device that includes a plurality of application programs, cause the electronic device to:
after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, starting a timer by the first block chain;
within the timing time period of the timer, the relay synchronizes the verification node set of the current latest block of the second block chain to the first block chain;
if the synchronization is successful, the first block chain restarts a timer;
if the synchronization fails, the relay re-executes the synchronization operation;
if the timer times out, the first blockchain suspends cross-chain transactions and waits for synchronization.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
according to the technical scheme, after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, the first block chain starts a timer; in the timing time period of the timer, the relay synchronizes the verification node set of the current latest block of the second block chain to the first block chain; if the synchronization is successful, the first block chain restarts the timer; if the synchronization fails, the relay re-executes the synchronization operation; if the timer times out, the first blockchain suspends cross-chain transactions, waiting for synchronization. Therefore, the trust of the relay is decoupled, the effective synchronization of the verification node set is realized through the timer in the block chain and the condition of the updating synchronization mechanism, and the safety of the cross-chain is ensured.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present specification, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative efforts.
Fig. 1 is a schematic diagram illustrating steps of a synchronization method for verifying a node set according to an embodiment of the present disclosure.
Fig. 2 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification.
Fig. 3 is a schematic structural diagram of a synchronization system for verifying a node set according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the embodiments in the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
Considering that in the current chain crossing scheme based on the relay implementation, both the consensus chain and the hand chain (i.e. two objects of the chain crossing) need to grant a large trust cost to the relay, which results in the possibility of the relay being malicious. Therefore, the embodiment of the present specification provides a new synchronization scheme for a verification node set, which decouples trust of relays, and implements effective synchronization of the verification node set through a timer in a blockchain and an update synchronization mechanism condition, thereby ensuring cross-chain security.
Example one
Referring to fig. 1, a schematic diagram of steps of a synchronization method for verifying a node set provided in an embodiment of the present specification, where the synchronization method may be applied in a blockchain cross-chain transaction process, and the method may include the following steps:
step 102: after the first blockchain initially synchronizes the set of verification nodes for the latest block of the second blockchain, the first blockchain starts a timer.
It should be understood that in the embodiments of the present specification, when the first blockchain initially synchronizes the set of verification nodes of the newest block of the second blockchain, it may be specifically implemented as: the first blockchain records a set of verification nodes of the latest block of the second blockchain acquired by an own operator.
In specific implementation, an operator of a first blockchain as a bracelet acquires a verification node set of a second blockchain as a consensus chain, and triggers the first blockchain to record an initial value as a current verification node set of the second blockchain in an input manner, for example, the initial value can be recorded in a certain storage space and is recorded as sync _ vs. After the first blockchain initially synchronizes the set of verification nodes of the latest block of the second blockchain, the first blockchain starts a timer whose timing period may be set to a countdown, e.g., …..5, 4, 3, 2, 1; a normal timing scheme may also be provided, for example, 1,2,3,4, 5 …. The description is not intended to limit the scope of the invention. The timing period of the timer can be recorded as a first period, for example, denoted by timeV.
It should be understood that, in the embodiment of the present specification, in the second blockchain, the verification nodes in the verification node set are obtained by the respective nodes through competitive election in a manner of paying a deposit. When the verification node in the verification node set in the second blockchain is changed, the deposit of the replaced verification node cannot be unlocked and returned immediately, and a delay time is required to be recorded as a second time period, which may be represented by, for example, time s.
In fact, when the transaction set is submitted, the second blockchain records the timestamp of the block generation, for example, timestamp pa, and the hash value calculated by all the verification nodes in the current verification node set through the hash algorithm, for example, may be recorded as vs _ hash. Wherein the timestamp may be on the order of milliseconds or seconds; when the hash value is calculated by the hash algorithm, the hash value may be obtained by performing various processing (e.g., combining) based on all the verification nodes in the verification node set; moreover, the hash algorithm may be any usable hash algorithm, and this specification does not limit this.
Similarly, the first block chain also records the timestamp of block generation, for example, denoted as timestamp b.
It is to be understood that the first time period should be less than the second time period, i.e., timeV < timeS.
Step 104: within the timing time period of the timer, the relay synchronizes the verification node set of the current latest block of the second block chain to the first block chain;
if the synchronization is successful, step 106 is performed, and if the synchronization is failed, step 108 is performed.
Optionally, in an embodiment of this specification, in a timing period of a timer of a first block chain, relaying synchronization of a verification node set of a current latest block of the second block chain to the first block chain specifically includes: the relay synchronizes the transaction corresponding to the verification node set change in the second blockchain to the first blockchain; and synchronizing the set of verification nodes of the current latest block in the second block chain to the first block chain.
Therefore, when the set of the relay synchronous verification nodes is used, the transaction corresponding to the updated verification node in the second blockchain is synchronized to the first blockchain, specifically, a label of the synchronous transaction is used, so that when the cross-chain transaction is executed, the first blockchain can use the updated set of the verification node to process the correct transaction.
Optionally, in an embodiment of the present specification, the condition that the first blockchain synchronization is successful includes:
the absolute value of the difference between a first timestamp of the current latest block in the first block chain when generated and a second timestamp of the current latest block in the second block chain when generated is not more than a time threshold; and the number of the first and second groups,
and the hash value corresponding to the verification node set recorded in the first block chain is equal to the hash value recorded in the block head of the second block chain synchronized to the first block chain.
The above condition is considered to be that, during inter-chain, it is only necessary to verify that at least 2/3 verification nodes in the node set are honest and effective, in other words, after the first blockchain synchronizes the verification node set in the second blockchain, when the inter-chain transaction is performed, the verification nodes in the verification node set of the first blockchain are completely the same as the verification nodes in the current verification node set of the second blockchain, or the verification nodes in the verification node set of the first blockchain are nearly the same as the verification nodes in the current verification node set of the second blockchain, but at least 2/3 verification nodes are guaranteed to be the same, which is guaranteed by the difference between the timestamps when the blocks are generated. Meanwhile, the comparison of the hash values can ensure that the transaction executed by the first blockchain is the transaction corresponding to the verification node set updated by the second blockchain of the first blockchain.
Thus, it should be appreciated that the above time threshold may ensure that at least 2/3 of the set of authentication nodes in the first blockchain are identical to the authentication nodes in the second blockchain current set of authentication nodes when the cross-chain transaction is performed.
Optionally, in an embodiment of the present specification, the time threshold is not greater than a difference between the first time period and the second time period; the second time period is a time period from the time when the node serving as the verification node in the second block chain is replaced to the time when the node competitively selects the verification node, the payment of the deposit is refunded; the first time period is a timing time period of a timer in the first blockchain.
Step 106: the first blockchain restarts a timer.
Therefore, the first block chain can be ensured to be always synchronized to the updated verification node set in the second block chain, and the cross-chain safety is improved.
Step 108: the relay re-performs the synchronization operation.
During a timing period, before synchronization is not successful, the relay will repeatedly perform synchronization operation until synchronization is successful or timing is over.
Step 110: if the timer times out, the first blockchain suspends cross-chain transactions and waits for synchronization.
If the timer is over time, the first blockchain suspends the cross-chain transaction, because there is no way to ensure that the synchronization is at least 2/3 honest and effective verification nodes, in order to ensure the cross-chain security, the cross-chain transaction needs to be suspended, and after the operator of the first blockchain re-initializes the latest verification node set of the second blockchain, the cross-chain transaction is executed.
In the above scheme, if the relay forwards the message within the timed period of the timer, the set of authentication nodes of the first blockchain is updated, then it is safe to cross the chain. The reason is that: in the initial synchronization state, the verification node set stored in the first block chain is consistent with that in the second block chain; during the timeev time, the set of verification nodes of the second blockchain changes but is not synchronized to the first blockchain, at which point the set of verification nodes has a short inconsistency. Because timeV < timeS, the deposit of the replaced verification node of the second block chain is not unlocked, and the replaced verification node cannot forge cross-chain transaction, the cross-chain is safe; after the timeV time, the relay has updated the first blockchain, at which point the set of verification nodes is consistent or nearly consistent, so it is still secure across the chain. If the relay update times out, at which point the set of authentication nodes of the first blockchain may be inconsistent with the latest set of authentication nodes of the second blockchain (the inconsistent ratio of authentication nodes is at least greater than 1/3), then there may be a security problem. At the moment, the first block chain suspends the cross-chain transaction in time, so that the safety problem is avoided. After the operator of the first blockchain re-initially synchronizes the latest verification node set of the second blockchain, the verification node sets are kept consistent, and chain crossing can be safely continued.
According to the technical scheme, after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, the first block chain starts a timer; in the timing time period of the timer, the relay synchronizes the verification node set of the current latest block of the second block chain to the first block chain; if the synchronization is successful, the first block chain restarts the timer; if the synchronization fails, the relay re-executes the synchronization operation; if the timer times out, the first blockchain suspends cross-chain transactions, waiting for synchronization. Therefore, the trust of the relay is decoupled, the effective synchronization of the verification node set is realized through the timer in the block chain and the condition of the updating synchronization mechanism, and the safety of the cross-chain is ensured.
Example two
Fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Referring to fig. 2, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (peripheral component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 2, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the shared resource access control device on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, starting a timer by the first block chain;
within the timing time period of the timer, the relay synchronizes the verification node set of the current latest block of the second block chain to the first block chain;
if the synchronization is successful, the first block chain restarts a timer;
if the synchronization fails, the relay re-executes the synchronization operation;
if the timer times out, the first blockchain suspends cross-chain transactions and waits for synchronization.
The synchronization method for verifying node sets disclosed in the embodiment of fig. 1 in this specification can be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present specification may be embodied directly in a hardware decoding processor, or in a combination of hardware and software modules in the decoding 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 a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the method in fig. 1, and implement the functions of the synchronization system for verifying a node set in the embodiment shown in fig. 1, which are not described herein again in this specification.
Of course, besides the software implementation, the electronic device of the embodiment of the present disclosure does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
According to the technical scheme, after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, the first block chain starts a timer; in the timing time period of the timer, the relay synchronizes the verification node set of the current latest block of the second block chain to the first block chain; if the synchronization is successful, the first block chain restarts the timer; if the synchronization fails, the relay re-executes the synchronization operation; if the timer times out, the first blockchain suspends cross-chain transactions, waiting for synchronization. Therefore, the trust of the relay is decoupled, the effective synchronization of the verification node set is realized through the timer in the block chain and the condition of the updating synchronization mechanism, and the safety of the cross-chain is ensured.
EXAMPLE III
Embodiments of the present specification also propose a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, are capable of causing the portable electronic device to perform the method of the embodiment shown in fig. 1, and in particular for performing the method of:
after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, starting a timer by the first block chain;
within the timing time period of the timer, the relay synchronizes the verification node set of the current latest block of the second block chain to the first block chain;
if the synchronization is successful, the first block chain restarts a timer;
if the synchronization fails, the relay re-executes the synchronization operation;
if the timer times out, the first blockchain suspends cross-chain transactions and waits for synchronization.
According to the technical scheme, after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, the first block chain starts a timer; in the timing time period of the timer, the relay synchronizes the verification node set of the current latest block of the second block chain to the first block chain; if the synchronization is successful, the first block chain restarts the timer; if the synchronization fails, the relay re-executes the synchronization operation; if the timer times out, the first blockchain suspends cross-chain transactions, waiting for synchronization. Therefore, the trust of the relay is decoupled, the effective synchronization of the verification node set is realized through the timer in the block chain and the condition of the updating synchronization mechanism, and the safety of the cross-chain is ensured.
Example four
Fig. 3 is a schematic structural diagram of a synchronization system 300 for verifying a node set according to an embodiment of the present disclosure. Referring to FIG. 3, in one software implementation, a system 300 for verifying synchronization of a set of nodes may include: a first blockchain 302, a second blockchain 304, and a relay 306; wherein,
the first blockchain 302 is configured to start a timer after the first blockchain 302 initially synchronizes the verification node set of the latest block of the second blockchain 304;
the relay 306 is configured to synchronize the set of verification nodes of the current latest block of the second blockchain 304 to the first blockchain 302 within the timing period of the timer;
the first blockchain 302 is further configured to restart a timer if the synchronization is successful;
the relay 306 is further configured to re-execute the synchronization operation if the synchronization fails;
the first blockchain 302 is further configured to suspend a cross-chain transaction and wait for synchronization if the timer expires.
Optionally, the first blockchain 302, when initially synchronizing the verification node set of the latest block of the second blockchain 304, is specifically configured to: recording a set of verification nodes of the latest block of the second block chain acquired by an own operator.
In a specific implementation manner of the embodiment of this specification, when synchronizing the set of verification nodes adjacent to the latest block of the second blockchain 304 to the first blockchain 302, the relay 306 is specifically configured to: synchronizing the transaction corresponding to the verification node set change in the second blockchain to the first blockchain; and synchronizing the updated set of verification nodes in the second blockchain to the first blockchain.
In another specific implementation manner of the embodiment of the present specification, the conditions met by successful synchronization include:
the absolute value of the difference between a first timestamp of the current latest block in the first block chain when generated and a second timestamp of the current latest block in the second block chain when generated is not more than a time threshold;
and the hash value corresponding to the verification node set recorded in the first block chain is equal to the hash value recorded in the block head of the second block chain synchronized to the first block chain.
In another particular implementation of the embodiments of the present description, the time threshold is not greater than a difference between the first time period and the second time period;
the first time period is a time period from the time when a node serving as a verification node in the first block chain is replaced to the time when the node competitively selects the verification node, and the payment is refunded;
the second time period is a timing time period of a timer in the second blockchain.
According to the technical scheme, after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, the first block chain starts a timer; in the timing time period of the timer, the relay synchronizes the verification node set of the current latest block of the second block chain to the first block chain; if the synchronization is successful, the first block chain restarts the timer; if the synchronization fails, the relay re-executes the synchronization operation; if the timer times out, the first blockchain suspends cross-chain transactions, waiting for synchronization. Therefore, the trust of the relay is decoupled, the effective synchronization of the verification node set is realized through the timer in the block chain and the condition of the updating synchronization mechanism, and the safety of the cross-chain is ensured.
It should be understood that the synchronization system for verifying a node set according to the embodiment of the present disclosure may also perform the method performed by the apparatus (or device) for packaging a transaction in fig. 1, and implement the functions of the synchronization system for verifying a node set according to the embodiment shown in fig. 1, which are not described herein again.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present specification shall be included in the protection scope of the present specification.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

Claims (12)

1. A synchronization method for verifying node sets is applied to a block chain cross-chain transaction process, and comprises the following steps:
after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, starting a timer by the first block chain;
within the timing time period of the timer, the relay synchronizes the verification node set of the current latest block of the second block chain to the first block chain;
if the synchronization is successful, the first block chain restarts a timer;
if the synchronization fails, the relay re-executes the synchronization operation;
if the timer times out, the first blockchain suspends cross-chain transactions and waits for synchronization.
2. The method of claim 1, wherein the first blockchain initially synchronizes a set of verification nodes for a latest block of the second blockchain, comprising:
the first blockchain records a set of verification nodes of the latest block of the second blockchain acquired by an own operator.
3. The method of claim 1, wherein relaying synchronization of the set of verification nodes of the latest block of the second blockchain to the first blockchain comprises:
the relay synchronizes the transaction corresponding to the verification node set change in the second blockchain to the first blockchain; and the number of the first and second groups,
synchronizing the set of verification nodes of the latest block in the second blockchain to the first blockchain.
4. The method of claim 3, the condition met by the synchronization success comprising:
the absolute value of the difference between a first timestamp of the current latest block in the first block chain when generated and a second timestamp of the current latest block in the second block chain when generated is not more than a time threshold;
and the hash value corresponding to the verification node set recorded in the first block chain is equal to the hash value recorded in the block head of the second block chain synchronized to the first block chain.
5. The method of claim 4, the time threshold being no greater than a difference between the first time period and the second time period;
the second time period is a time period from the time when the node serving as the verification node in the second block chain is replaced to the time when the node competitively selects the verification node, the payment of the deposit is refunded;
the first time period is a timing time period of a timer in the first blockchain.
6. A synchronization system for verifying a set of nodes for use during a blockchain cross-chain transaction, the system comprising: a first block chain, a second block chain and a relay; wherein,
the first block chain is used for starting a timer after the first block chain initially synchronizes the verification node set of the latest block of the second block chain;
the relay is configured to synchronize the verification node set of the current latest block of the second blockchain to the first blockchain within the timing time period of the timer;
the first blockchain is further used for restarting the timer if the synchronization is successful;
the relay is also used for re-executing the synchronization operation if the synchronization fails;
the first blockchain is further used for suspending cross-chain transaction and waiting for synchronization if the timer is overtime.
7. The system of claim 6, wherein the first blockchain, when initially synchronizing the set of verification nodes for the newest block of the second blockchain, is specifically configured to:
recording a set of verification nodes of the latest block of the second block chain acquired by an own operator.
8. The system of claim 6, wherein the relay, when synchronizing the set of verification nodes for the current latest block of the second blockchain to the first blockchain, is specifically configured to:
synchronizing the transaction corresponding to the verification node set change in the second blockchain to the first blockchain; and the number of the first and second groups,
synchronizing a set of verification nodes of a block in the second blockchain that is adjacent to a newest block to the first blockchain.
9. The system of claim 8, the condition satisfied by the synchronization success comprising:
the absolute value of the difference between a first timestamp of the current latest block in the first block chain when generated and a second timestamp of the current latest block in the second block chain when generated is not more than a time threshold;
and the hash value corresponding to the verification node set recorded in the first block chain is equal to the hash value recorded in the block head of the second block chain synchronized to the first block chain.
10. The system of claim 9, the time threshold being no greater than a difference between the first time period and the second time period;
the second time period is a time period from the time when the node serving as the verification node in the second block chain is replaced to the time when the node competitively selects the verification node, the payment of the deposit is refunded;
the first time period is a timing time period of a timer in the first blockchain.
11. An electronic device, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor to:
after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, starting a timer by the first block chain;
in the timing time period of the timer, the relay synchronizes the verification node set of the adjacent latest block of the second block chain to the first block chain;
if the synchronization is successful, the first block chain restarts a timer;
if the synchronization fails, the relay re-executes the synchronization operation;
if the timer times out, the first blockchain suspends cross-chain transactions and waits for synchronization.
12. A computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to:
after the first block chain initially synchronizes the verification node set of the latest block of the second block chain, starting a timer by the first block chain;
in the timing time period of the timer, the relay synchronizes the verification node set of the adjacent latest block of the second block chain to the first block chain;
if the synchronization is successful, the first block chain restarts a timer;
if the synchronization fails, the relay re-executes the synchronization operation;
if the timer times out, the first blockchain suspends cross-chain transactions and waits for synchronization.
CN201910860632.8A 2019-09-11 2019-09-11 Synchronization method and system for verification node set and electronic equipment Active CN110675148B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910860632.8A CN110675148B (en) 2019-09-11 2019-09-11 Synchronization method and system for verification node set and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910860632.8A CN110675148B (en) 2019-09-11 2019-09-11 Synchronization method and system for verification node set and electronic equipment

Publications (2)

Publication Number Publication Date
CN110675148A true CN110675148A (en) 2020-01-10
CN110675148B CN110675148B (en) 2022-03-11

Family

ID=69077804

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910860632.8A Active CN110675148B (en) 2019-09-11 2019-09-11 Synchronization method and system for verification node set and electronic equipment

Country Status (1)

Country Link
CN (1) CN110675148B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111431903A (en) * 2020-03-25 2020-07-17 北京创世智链信息技术研究院 Cross-link relay method, device and computer readable storage medium
CN113645278A (en) * 2021-07-23 2021-11-12 湖南大学 Cross-chain message transmission method, device and storage medium of block chain
CN114584247A (en) * 2022-03-04 2022-06-03 北京小马睿行科技有限公司 Time synchronization method, detection device and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107888562A (en) * 2017-10-13 2018-04-06 布比(北京)网络技术有限公司 Interconnect serobila architecture
CN109189853A (en) * 2018-08-08 2019-01-11 众安信息技术服务有限公司 Method of data synchronization and device between a kind of block chain
CN109635165A (en) * 2018-12-06 2019-04-16 北京磁云数字科技有限公司 Data summarization method, device, equipment and medium based on tree-like block chain network
CN109919615A (en) * 2019-03-01 2019-06-21 上海分布信息科技有限公司 Across chain data interactive method and across chain data interaction system based on block chain
CN110032436A (en) * 2019-04-04 2019-07-19 杭州秘猿科技有限公司 Support the block chain of pause and starting common recognition method, system and electronic equipment
CN110084601A (en) * 2019-04-30 2019-08-02 杭州复杂美科技有限公司 Parallel chain main chain stateful transaction synchronous method, equipment and storage medium
CN110175912A (en) * 2019-04-08 2019-08-27 西安西电链融科技有限公司 Across the chain assets transfer method of block chain, block chain information terminal based on the committee
CN110223178A (en) * 2019-06-06 2019-09-10 杭州趣链科技有限公司 It is a kind of for alliance's chain across catenary system and across chain method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107888562A (en) * 2017-10-13 2018-04-06 布比(北京)网络技术有限公司 Interconnect serobila architecture
CN109189853A (en) * 2018-08-08 2019-01-11 众安信息技术服务有限公司 Method of data synchronization and device between a kind of block chain
CN109635165A (en) * 2018-12-06 2019-04-16 北京磁云数字科技有限公司 Data summarization method, device, equipment and medium based on tree-like block chain network
CN109919615A (en) * 2019-03-01 2019-06-21 上海分布信息科技有限公司 Across chain data interactive method and across chain data interaction system based on block chain
CN110032436A (en) * 2019-04-04 2019-07-19 杭州秘猿科技有限公司 Support the block chain of pause and starting common recognition method, system and electronic equipment
CN110175912A (en) * 2019-04-08 2019-08-27 西安西电链融科技有限公司 Across the chain assets transfer method of block chain, block chain information terminal based on the committee
CN110084601A (en) * 2019-04-30 2019-08-02 杭州复杂美科技有限公司 Parallel chain main chain stateful transaction synchronous method, equipment and storage medium
CN110223178A (en) * 2019-06-06 2019-09-10 杭州趣链科技有限公司 It is a kind of for alliance's chain across catenary system and across chain method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄方蕾: ""联盟区块链中成员动态权限管理方法的设计与实现"", 《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111431903A (en) * 2020-03-25 2020-07-17 北京创世智链信息技术研究院 Cross-link relay method, device and computer readable storage medium
CN111431903B (en) * 2020-03-25 2022-08-09 北京新创智链科技有限公司 Cross-link relay method, device and computer readable storage medium
CN113645278A (en) * 2021-07-23 2021-11-12 湖南大学 Cross-chain message transmission method, device and storage medium of block chain
CN114584247A (en) * 2022-03-04 2022-06-03 北京小马睿行科技有限公司 Time synchronization method, detection device and system

Also Published As

Publication number Publication date
CN110675148B (en) 2022-03-11

Similar Documents

Publication Publication Date Title
CN110675148B (en) Synchronization method and system for verification node set and electronic equipment
CN108648078B (en) Transaction preprocessing method and device and electronic equipment
CN107395557B (en) Service request processing method and device
CN110648136B (en) Consensus and transaction synchronous parallel processing method and device and electronic equipment
US11429599B2 (en) Method and apparatus for updating database by using two-phase commit distributed transaction
JP6557323B2 (en) Data storage in case of database failure
CN110659256B (en) Multi-computer room synchronization method, computing device and computer storage medium
WO2020108419A1 (en) Block confirmation method, device and storage medium
CN111698244B (en) Method and device for rapidly participating in consensus of newly added nodes and electronic equipment
CN113806143B (en) Remote disaster recovery method, system and electronic equipment
CN112887436B (en) Consensus method, consensus node and block chain system of pipeline mode
US20200193430A1 (en) Determining generation time for blockchain data
CN112988470B (en) Consensus method, consensus node and system in alliance chain
CN112035418A (en) Multi-computer room synchronization method, computing device and computer storage medium
CN112991067B (en) Block chain consensus method, device and system
CN108710658B (en) Data record storage method and device
CN109062731B (en) Idempotent control method and device during database switching
CN110162569A (en) Data processing method, device and computer equipment based on GG synchronized process
CN115098231A (en) Cross-data-center transaction processing method, device and equipment
CN110599139B (en) Block output method and device in block chain consensus algorithm
CN113760519B (en) Distributed transaction processing method, device, system and electronic equipment
CN109271277B (en) Access method, device and system after database downtime
CN111030826A (en) Certificate revocation method and device for block chain network and electronic equipment
CN106375354B (en) Data processing method and device
CN113779155B (en) Block chain transaction processing method, device and equipment

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
GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20200110

Assignee: Hangzhou Xita Technology Co.,Ltd.

Assignor: CRYPTAPE Co.,Ltd.

Contract record no.: X2022330000063

Denomination of invention: A synchronization method, system and electronic equipment for verifying node set

Granted publication date: 20220311

License type: Common License

Record date: 20220406

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231213

Address after: 10/F, Guotou Building, No. 398 Shaoxing Road, Gongshu District, Hangzhou City, Zhejiang Province, 310000

Patentee after: Hangzhou Xita Technology Co.,Ltd.

Address before: Room 1301, block a, Huaxing Times Square, 478 Wensan Road, Xihu District, Hangzhou City, Zhejiang Province, 310013

Patentee before: CRYPTAPE Co.,Ltd.