Multi-signature cross-chain method and system based on Raft consensus
Through Raft consensus and multi-signature modules, the problem that the relay chain cannot guarantee the correctness of the proof is solved, decentralized cross-chain transaction verification and storage is realized, and the reliability and security of cross-chain transactions are improved.
Patent Information
- Application Number
- CN202210976393.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-15
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-08-15
AI Technical Summary
In the prior art, the relay chain cannot effectively ensure the correctness of the proof generated by the bridging chain, and there is a risk of bridging chain doing evil, and additional relay chains are needed for storage, resulting in waste of resources.
The Raft consensus module is used to agree on cross-chain transactions, and the proof is generated and verified through the multi-signature module, the final proof is combined using the leader node, and the signature validity is verified by the smart contract, and finally stored on the chain.
It realizes the reliability and security of cross-chain transactions, provides decentralized proof storage and verification, avoids additional relay chain resource consumption, and improves the credibility and consistency of cross-chain transactions.
Smart Images

Figure CN115439110B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a multi-signature cross-chain method and system based on Raft consensus. Background Art
[0002] Existing technologies use the relay chain as a transaction verification platform, handing over the verification of proofs generated by the bridge to contracts on the relay chain. However, this verification method cannot guarantee the correctness of the proofs generated by the bridge, which still poses the risk of malicious bridge operations. In this case, even if the relay chain verifies the proof, it cannot guarantee that the transmitted transaction has actually been recorded on the chain, leaving only the bridge to trust. In this case, the relay chain serves more as a decentralized storage service, storing the proofs transmitted by the bridge on the relay chain.
[0003] In contrast to the relay chain cross-chain solution, which uses a complete chain for proof storage and verification, a multi-signature solution addresses the reliability issues of the bridge and utilizes multiple signatures during the proof generation process. This decentralized verification process for transactions is decentralized, ensuring the reliability of the verification results to a certain extent. Furthermore, the verification results are stored on the other chain, which not only reliably stores the proof but also eliminates the need for a dedicated relay chain for proof storage, making it a simpler solution. Furthermore, to ensure that all nodes in the multi-signature module sign the same cross-chain transaction, the Raft consensus module is used to reach consensus on transactions sent to the bridge. The master node in Raft is responsible for collecting signatures and sending cross-chain transactions to the corresponding target chain.
[0004] Patent document CN111489154A (application number: 201910083349.9) discloses a cross-chain transaction method based on multi-signature, which is characterized by comprising the following steps: (1) creating an asset account based on multi-signature on the alliance blockchain; (2) the user performs cross-chain asset buying and selling operations in the trading market interface; (3) after the buyer and seller of the transaction reach a consensus, the transaction matching system verifies it and then sends it to the cross-chain transaction system; (4) the cross-chain transaction system performs a secondary verification on the transaction information, then signs the transaction, completes the multi-signature operation, and finally sends the transaction information to the corresponding blockchain for consensus; (5) when an abnormal transaction occurs, for transactions that fail on both sides, the cross-chain transaction system will resend the transaction information. For transactions that fail on one side, the alliance chain will mark the abnormal transaction and freeze the extra profit account; the extra profit user can choose to reverse the transaction or resend the failed transaction information to restore the frozen account balance. Summary of the Invention
[0005] In view of the defects in the prior art, the purpose of the present invention is to provide a multi-signature cross-chain method and system based on Raft consensus.
[0006] According to the present invention, a multi-signature cross-chain system based on Raft consensus is provided, comprising:
[0007] Raft consensus module: Receives cross-chain transactions and synchronizes them to all nodes in the network. Nodes in the network then perform Raft consensus on the cross-chain transactions.
[0008] Multi-signature module: A leader node is randomly elected based on all nodes in the network. The leader node generates corresponding proofs based on cross-chain transactions after Raft consensus, and broadcasts the generated proofs to all nodes in the network. When the number of generated proofs meets the preset value, the proofs of all nodes are combined into a final proof, and the generated final proof is synchronized to all nodes in the network. The nodes in the network perform Raft consensus on the final proof.
[0009] Multi-signature verification module: Verifies the validity of the final proof after Raft consensus based on the smart contract on the chain;
[0010] Proof storage on-chain module: The leader node stores the final proof that is valid after verification on-chain.
[0011] Preferably, in the multi-signature module, a corresponding proof is generated based on the cross-chain transaction after the Raft consensus, and the structure of the proof includes: the cross-chain transaction hash, the execution result of the cross-chain transaction, and the result of the multi-signature.
[0012] Preferably, in the multi-signature module,
[0013] Multi-signature module M1: The leader node obtains the transaction hash based on the cross-chain transaction after Raft consensus;
[0014] Multi-signature module M2: obtains the transaction receipt through the transaction hash and generates the corresponding signature;
[0015] Multi-signature module M3: combines the transaction hash, the transaction execution result in the transaction receipt, and the node's signature to generate proof and broadcast it to all nodes in the network;
[0016] Multi-signature module M4: The leader node listens to the proofs broadcast by all nodes in the network. When the number of proofs generated meets the preset value, the proofs of all nodes are combined into a final proof, and the generated final proof is synchronized to all nodes in the network. The nodes in the network perform Raft consensus on the final proof.
[0017] Preferably, the final proof includes: the signature field of the final proof includes the signatures of all monitored nodes.
[0018] Preferably, in the multi-signature verification module, a smart contract deployed on the chain is used to verify whether the number of signatures in the final proof is greater than or equal to a threshold, and the validity of the signature is verified using the public key.
[0019] Preferably, when nodes in the network perform Raft consensus on cross-chain transactions through the Raft consensus module, the transactions are broadcast using P2P broadcasting.
[0020] According to the present invention, a multi-signature cross-chain method based on Raft consensus is provided, comprising:
[0021] Step S1: The Raft consensus module receives the cross-chain transaction and synchronizes the received cross-chain transaction to all nodes in the network. The nodes in the network perform Raft consensus on the cross-chain transaction;
[0022] Step S2: The multi-signature module randomly selects a leader node based on all nodes in the network. The leader node generates corresponding proofs based on cross-chain transactions after Raft consensus, and broadcasts the generated proofs to all nodes in the network. When the number of generated proofs meets the preset value, the proofs of all nodes are combined into a final proof, and the generated final proof is synchronized to all nodes in the network. The nodes in the network perform Raft consensus on the final proof.
[0023] Step S3: The multi-signature verification module verifies the validity of the final proof after Raft consensus based on the smart contract on the chain;
[0024] Step S4: Based on the Proof storage module, the leader node stores the final proof that is valid after verification on the chain.
[0025] Preferably, the step S2 adopts:
[0026] Step S2.1: The leader node obtains the transaction hash based on the cross-chain transaction after Raft consensus;
[0027] Step S2.2: Obtain the transaction receipt through the transaction hash and generate the corresponding signature;
[0028] Step S2.3: Combine the transaction hash, the transaction execution result in the transaction receipt, and the node's signature to generate a proof and broadcast it to all nodes in the network;
[0029] Step S2.4: The leader node listens to the proofs broadcast by all nodes in the network. When the number of proofs generated meets the preset value, the proofs of all nodes are combined into a final proof and the generated final proof is synchronized to all nodes in the network. The nodes in the network perform Raft consensus on the final proof.
[0030] The proof structure includes: cross-chain transaction hash, cross-chain transaction execution result, and multi-signature result.
[0031] Preferably, the step S3 adopts: the multi-signature verification module verifies whether the number of signatures in the final proof is greater than or equal to a threshold through the smart contract deployed on the chain, and uses the public key to verify the validity of the signature.
[0032] Preferably, when nodes in the network perform Raft consensus on cross-chain transactions through the Raft consensus module, the transactions are broadcast using P2P broadcasting.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] 1. The multi-signature technology of this invention provides a credible proof of the execution results of cross-chain transactions during the execution process of cross-chain transactions. The Raft consensus technology provides the security and reliability of the cross-chain system. This invention is a reliable and universal solution for cross-chain systems.
[0035] 2. The present invention uses the Raft consensus module to ensure that transactions and proofs of transactions are consistent across all nodes in the network, demonstrating the reliability of proofs through decentralization.
[0036] 3. This invention provides a decentralized and credible proof of the execution results of cross-chain transactions through a multi-signature module in conjunction with a Raft consensus module. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:
[0038] Figure 1 Schematic diagram of a multi-signature cross-chain system based on Raft consensus. DETAILED DESCRIPTION
[0039] The present invention will be described in detail below with reference to specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those skilled in the art, several changes and improvements can be made without departing from the scope of the present invention. These all fall within the scope of protection of the present invention.
[0040] Example 1
[0041] According to the present invention, a multi-signature cross-chain system based on Raft consensus is provided, such as Figure 1 As shown in the figure, after a cross-chain transaction is executed, it is sent to the Raft consensus module. Nodes in the network reach consensus on the transaction, and the multi-signature module generates a corresponding proof for the consensus transaction. The leader subscribes to transactions generated on the blockchain to obtain transaction receipts. It constructs a proof based on the transaction execution results in the transaction receipts. After collecting enough proof signatures, it assembles a final proof and submits it to the Raft consensus module for further consensus. After consensus is reached, the leader stores the proof on-chain. Before the on-chain smart contract executes and stores it, the signature validity is verified using the public key. The final proof then verifies whether the number of signatures meets the multi-signature threshold. If both the signature and the threshold are verified, the multi-signature verification succeeds. The final proof effectively proves that the cross-chain transaction execution result has been verified by multiple nodes, providing a decentralized proof of the cross-chain transaction execution result.
[0042] More specifically, the multi-signature cross-chain system based on Raft consensus includes: Raft consensus module, multi-signature module, Proof storage and chain module and multi-signature verification module. The specific framework diagram is as follows Figure 1 As shown;
[0043] The Raft consensus module first synchronizes cross-chain transactions sent by users and sends them to all nodes in the network, ensuring that all nodes perform multi-signatures based on the same cross-chain transaction. After collecting enough signatures, it reaches consensus on the generated proof. The Raft consensus module can decentralizedly prove the execution results of cross-chain transactions, with multiple nodes proving that the cross-chain transaction has successfully or failed on the source chain. It is a decentralized consensus solution for transaction results.
[0044] More specifically, the Raft consensus module reaches consensus on cross-chain transactions sent from the network, and ultimately reaches consensus on the generated proofs. It uses a decentralized approach to convince nodes in the distributed network that the cross-chain transaction was successfully executed on the chain. This is a reliable and fully decentralized cross-chain transaction consensus method that provides reliability for the system.
[0045] The multi-signature module generates corresponding proofs based on transactions after Raft consensus. The proof structure includes the cross-chain transaction hash, the execution result of the cross-chain transaction, and the result of the multi-signature. After receiving the cross-chain transaction, the node first uses the sent transaction hash to obtain the transaction receipt on the chain and generate the corresponding signature. The transaction hash, the execution result of the transaction in the transaction receipt, and the node's signature are combined to generate a proof and broadcast it to all nodes in the network. The leader will monitor the proofs broadcast by nodes in the network. If a sufficient threshold of proofs is collected, the leader will finally combine the proofs of all nodes into a final proof. The signature field of this proof includes the signatures of all monitored nodes, and the leader will reach a consensus on this final proof again. This can ensure the consistency of the proof and improve the security of the proof.
[0046] More specifically, in the multi-signature module, each node signs the transaction sent by the consensus module and generates a corresponding proof. This proof verifies the execution result of the cross-chain transaction. Furthermore, the entire multi-signature module maintains a common signature threshold. Once the leader has collected a sufficient number of signatures, it assembles a final proof and initiates another consensus on this proof. This final proof, which passes consensus, represents the execution result of the cross-chain transaction and serves as proof that the cross-chain transaction was actually executed on-chain, enhancing the security of the cross-chain process.
[0047] The multi-signature verification module is deployed in the smart contract on the chain to verify whether the number of signatures in the proof is greater than or equal to the threshold. Performing multi-signature verification before storing the proof on the chain can further improve the reliability of the proof.
[0048] The Proof Storage Chain module stores the verified proof on the chain by the leader. Users can query the transaction proof of the corresponding cross-chain transaction on the chain, which improves the reliability of the proof. Storing the proof on the target chain and the source chain of the cross-chain provides an effective proof for subsequent nodes on the chain to verify the validity of the cross-chain transaction, which improves the credibility of the cross-chain process.
[0049] The multi-signature cross-chain system based on Raft consensus provided by the present invention can be implemented by following the steps and procedures of the multi-signature cross-chain method based on Raft consensus provided by the present invention. Those skilled in the art can understand the multi-signature cross-chain method based on Raft consensus as a preferred example of a multi-signature cross-chain system based on Raft consensus.
[0050] The present invention can be applied to a decentralized cross-chain system to prove the credibility of the execution results of cross-chain transactions. The cross-chain system needs to verify the execution results of the cross-chain transaction on the source chain before executing the corresponding operation on the target chain. For example, if the cross-chain transaction is successfully executed on the source chain, the next transaction can be sent to the target chain. If the execution fails, the transaction on the source chain needs to be rolled back. It can be seen that the execution of the next cross-chain transaction depends on the execution proof of the previous transaction. Therefore, the cross-chain system is extremely dependent on the proof of the execution result of the transaction, that is, proof. The use of a multi-signature cross-chain solution based on Raft consensus provides a decentralized proof generation solution, and the use of a multi-signature cryptographic solution also provides proof of the credibility of the proof.
[0051] Those skilled in the art will appreciate that, in addition to implementing the system, device, and various modules provided by the present invention in purely computer-readable program code, it is entirely possible to implement the same program in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, embedded microcontrollers, and the like by logically programming the method steps. Therefore, the system, device, and various modules provided by the present invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; the modules for implementing various functions can also be considered both software programs for implementing the method and structures within the hardware component.
[0052] The above describes specific embodiments of the present invention. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art may make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. The embodiments of this application and the features in the embodiments may be combined with each other in any manner unless there is a conflict.
Claims
1. A multi-signature cross-chain system based on Raft consensus, characterized by: include: Raft consensus module: Receives cross-chain transactions and synchronizes them to all nodes in the network. Nodes in the network then perform Raft consensus on the cross-chain transactions. Multi-signature module: A leader node is randomly elected based on all nodes in the network. The leader node generates corresponding proofs based on cross-chain transactions after Raft consensus, and broadcasts the generated proofs to all nodes in the network. When the number of generated proofs meets the preset value, the proofs of all nodes are combined into a final proof, and the generated final proof is synchronized to all nodes in the network. The nodes in the network perform Raft consensus on the final proof. Multi-signature verification module: Verifies the validity of the final proof after Raft consensus based on the smart contract on the chain; Proof storage on-chain module: The leader node stores the final proof that is valid after verification on-chain.
2. The multi-signature cross-chain system based on Raft consensus according to claim 1 is characterized in that: In the multi-signature module, a corresponding proof is generated based on the cross-chain transaction after the Raft consensus. The structure of the proof includes: the cross-chain transaction hash, the execution result of the cross-chain transaction, and the result of the multi-signature.
3. The multi-signature cross-chain system based on Raft consensus according to claim 1 is characterized in that: In the multi-signature module, Multi-signature module M1: The leader node obtains the transaction hash based on the cross-chain transaction after Raft consensus; Multi-signature module M2: obtains the transaction receipt through the transaction hash and generates the corresponding signature; Multi-signature module M3: combines the transaction hash, the transaction execution result in the transaction receipt, and the node's signature to generate proof and broadcast it to all nodes in the network; Multi-signature module M4: The leader node listens to the proofs broadcast by all nodes in the network. When the number of proofs generated meets the preset value, the proofs of all nodes are combined into a final proof, and the generated final proof is synchronized to all nodes in the network. The nodes in the network perform Raft consensus on the final proof.
4. The multi-signature cross-chain system based on Raft consensus according to claim 1 is characterized in that: The final proof includes: the signature field of the final proof includes the signatures of all monitored nodes.
5. The multi-signature cross-chain system based on Raft consensus according to claim 1 is characterized in that: In the multi-signature verification module, the smart contract deployed on the chain verifies whether the number of signatures in the final proof is greater than or equal to the threshold, and uses the public key to verify the validity of the signature.
6. The multi-signature cross-chain system based on Raft consensus according to claim 1 is characterized in that: When nodes in the network conduct Raft consensus on cross-chain transactions through the Raft consensus module, they broadcast the transactions using P2P broadcasting.
7. A multi-signature cross-chain method based on Raft consensus, characterized by: include: Step S1: The Raft consensus module receives the cross-chain transaction and synchronizes the received cross-chain transaction to all nodes in the network. The nodes in the network perform Raft consensus on the cross-chain transaction; Step S2: The multi-signature module randomly selects a leader node based on all nodes in the network. The leader node generates corresponding proofs based on cross-chain transactions after Raft consensus, and broadcasts the generated proofs to all nodes in the network. When the number of generated proofs meets the preset value, the proofs of all nodes are combined into a final proof, and the generated final proof is synchronized to all nodes in the network. The nodes in the network perform Raft consensus on the final proof. Step S3: The multi-signature verification module verifies the validity of the final proof after Raft consensus based on the smart contract on the chain; Step S4: Based on the Proof storage module, the leader node stores the final proof that is valid after verification on the chain.
8. The multi-signature cross-chain method based on Raft consensus according to claim 7 is characterized in that: The step S2 adopts: Step S2.1: The leader node obtains the transaction hash based on the cross-chain transaction after Raft consensus; Step S2.2: Obtain the transaction receipt through the transaction hash and generate the corresponding signature; Step S2.3: Combine the transaction hash, the transaction execution result in the transaction receipt, and the node's signature to generate a proof and broadcast it to all nodes in the network; Step S2.4: The leader node listens to the proofs broadcast by all nodes in the network. When the number of proofs generated meets the preset value, the proofs of all nodes are combined into a final proof and the generated final proof is synchronized to all nodes in the network. The nodes in the network perform Raft consensus on the final proof. The proof structure includes: cross-chain transaction hash, cross-chain transaction execution result, and multi-signature result.
9. The multi-signature cross-chain method based on Raft consensus according to claim 7 is characterized in that: The step S3 adopts: the multi-signature verification module verifies whether the number of signatures in the final proof is greater than or equal to the threshold through the smart contract deployed on the chain, and uses the public key to verify the validity of the signature.
10. The multi-signature cross-chain method based on Raft consensus according to claim 7 is characterized in that: When nodes in the network conduct Raft consensus on cross-chain transactions through the Raft consensus module, they broadcast the transactions using P2P broadcasting.
Citation Information
Patent Citations
Cross-chain transaction method based on multiple signatures
CN111489154A
Resource cross-chain transfer method and device, computer equipment and storage medium
CN111681003A
Cross-chain transaction method for block chain heterogeneous chain
CN112150284A