Sharded blockchain secure cross-shard view conversion method and device
By using the Byzantine fault-tolerant algorithm in the sharded blockchain system to generate cross-shard view conversion proofs, replace the malicious leader and prevent it from censoring transactions, the problem of malicious leader attacks in the sharded blockchain system is solved, and system activity and consistency are achieved. sexual protection.
Patent Information
- Application Number
- CN202111204972.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-15
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-10-15
AI Technical Summary
In a sharded blockchain system, malicious leaders may attack between shards, resulting in transaction review and reduced system activity. It is difficult for existing cross-shard transaction processing methods to effectively prevent such attacks.
Generate cross-shard view conversion proof through a Byzantine fault-tolerant algorithm, replace malicious leaders, and prevent them from reviewing transactions through active view conversion to ensure system consistency and activity.
Effectively resist cross-shard transaction review attacks, ensure system activity and consistency, prevent malicious leaders from destroying transaction processing, and ensure that transactions uploaded by users are processed within a certain period of time.
Smart Images

Figure CN114140233B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security technology, and in particular to a method and device for secure cross-shard view conversion of a sharded blockchain. Background Art
[0002] Blockchain technology combines cryptography, distributed systems, computer science and other technologies to establish an open and reliable ledger in an untrusted environment. The transparency, immutability, decentralization and privacy protection characteristics of blockchain make it have very broad and profound application value in many fields, such as the Internet of Things, finance, supply chain, e-commerce, e-government, digital healthcare, etc.
[0003] The blockchain consensus mechanism fundamentally determines the security and performance of the entire blockchain system. The blockchain consensus mechanism constrains the behavior of participating nodes in the network through certain established rules. All participating nodes achieve a consistent view of the blockchain through mutual communication and calculation, and store it locally. The current blockchain consensus mechanism can be mainly divided into a blockchain consensus mechanism based on proof of work, a blockchain consensus mechanism based on equity, a blockchain consensus mechanism using a single committee, and a sharded blockchain consensus mechanism. The blockchain consensus mechanism usually needs to meet two important characteristics, namely consistency and activity. Consistency means that all honest nodes have exactly the same view of the ledger. Consistency can be divided into two types, weak consistency and strong consistency. Weak consistency means that a certain number of blocks at the end of the blockchain need to be removed to obtain a consistent view of the honest nodes, that is, the views of the honest nodes on the end blocks of the blockchain may be different. The blocks obtained by removing a certain number of blocks at the end are usually called stable blocks. Strong consistency means that no end blocks need to be removed, and the honest nodes have exactly the same view of the entire blockchain. Activity means that the transactions uploaded by users will be processed by the blockchain system after a period of time. The processing here refers to acceptance or rejection. Legal transactions will be accepted by all honest nodes after a period of time and appear on the blockchain. The time from when a transaction is submitted by a user to when it appears on a stable block of the blockchain is usually called the transaction confirmation time. The number of transactions that the entire blockchain system can process per unit time (usually calculated per second) is called transaction throughput. Transaction throughput and transaction confirmation time are important indicators for evaluating the performance of blockchain systems. To achieve large-scale and in-depth applications of blockchain, it is necessary to design and implement a blockchain consensus mechanism with high transaction throughput and low transaction confirmation time.
[0004] Sharded blockchain has great potential in improving transaction throughput and reducing transaction confirmation time. Sharded blockchain combines sharding technology in the database field with blockchain technology to achieve communication, computing and storage sharding. Communication sharding refers to the nodes participating in the protocol in the network being divided into different shards, and each shard node usually only needs to communicate within the shard; computing sharding refers to the transactions or transactions in the network being assigned to different shards, and shard nodes usually only need to process transactions within the shard; storage sharding refers to the shard nodes only need to maintain and store the blockchain corresponding to the shard. Sharded blockchain can achieve scalability of transaction processing capabilities. When the number of nodes in the network increases, the transaction processing capacity of the entire network can be improved by increasing the number of shards. A complete sharded blockchain includes multiple components, such as shard member selection, random number generation, intra-shard consensus algorithm, cross-shard communication, shard reconfiguration, etc. Among them, intra-shard consensus algorithm and cross-shard communication are the most basic parts.
[0005] Within each shard, an in-shard consensus algorithm is needed to handle different types of proposals. In-shard consensus algorithms are represented by Byzantine fault-tolerant algorithms, which can achieve strong consistency. Strong consistency means that once a transaction appears on the blockchain, it can be recognized as a legal transaction with a high probability, without waiting for the block to reach a certain depth. Between different shards, some kind of cross-shard communication method is needed to handle cross-shard transactions. Cross-shard transactions refer to transactions whose transaction inputs are managed by more than one shard. In sharded blockchains, the number of cross-shard transactions usually accounts for a large proportion.
[0006] At present, most cross-shard transaction processing methods are based on a two-phase commitment protocol. The protocol includes a preparation phase and a commitment phase. First, the client uploads the transaction to all relevant shards. The shard where the transaction input is located is usually called the input shard, and the shard where the transaction output is located is usually called the output shard. In the preparation phase, all input shards need to run the on-chip consensus algorithm to generate a proof that the transaction input is available. This proof is usually called an input availability proof. The input shard locks the available input at this time to prevent other transactions from spending it and prevent double-spending attacks. Next, the input shard sends the generated input availability proof to each relevant shard, including the input shard and the output shard. In the commitment phase, after receiving all the relevant availability proofs for the transaction, the shard can determine whether the transaction is legal. If all the inputs of the transaction are available, then the transaction is legal. If one or more inputs of the transaction are unavailable, then the transaction is illegal. For legal transactions, the output shard runs the on-chip consensus algorithm to write the transaction to the output shard blockchain. Similarly, the input shard needs to run the on-chip consensus algorithm to confirm the legality of the transaction and spend the input of the legal transaction. For illegal transactions, the output shard rejects the transaction; the input shard unlocks the previously locked input for use in subsequent transactions.
[0007] In the two-phase commitment protocol, the transmission of transaction input availability between shards is very important. Usually, a trusted coordinator is responsible for information transmission between shards. In practice, the work of the coordinator cannot be undertaken by all shard members, because that would violate the principle of communication sharding and reduce the scalability of the system. Therefore, it is usually the leader of each shard who plays the role of coordinator. In this case, the coordinator may have malicious behavior. Studying the attacks that leaders may launch in cross-shard transactions and how to prevent such attacks are important issues that sharded blockchains need to solve. Summary of the invention
[0008] The present application aims to solve one of the technical problems in the related art at least to some extent.
[0009] To this end, the first purpose of this application is to propose a method for secure cross-shard view conversion of a sharded blockchain.
[0010] The second purpose of this application is to propose a sharded blockchain secure cross-shard view conversion device.
[0011] The third objective of the present application is to provide an electronic device.
[0012] A fourth object of the present application is to provide a non-transitory computer-readable storage medium.
[0013] To achieve the above-mentioned purpose, the first aspect embodiment of the present application provides a sharded blockchain secure cross-shard view conversion method, which is used to replace the sharded blockchain leader, wherein the method includes the following steps: respectively confirming the system model, shard members and leaders, and the consensus algorithm within the shard to complete the initialization process; generating a cross-shard view conversion proof of malicious behavior of any input shard leader through a Byzantine fault tolerance algorithm; after the input shard member where the malicious leader is located receives the cross-shard view conversion proof, performing a view conversion through the Byzantine fault tolerance algorithm within the shard to replace the malicious leader, and preventing the shard leader of itself from reviewing transactions through active view conversion.
[0014] Optionally, in an embodiment of the present application, the system model, shard members and leaders, and the intra-shard consensus algorithm are respectively confirmed to complete the initialization process, including: confirming the shard blockchain network model and the adversary model, wherein the adversary computing power does not exceed a preset security threshold; confirming the shard members and the shard leaders, wherein the identities of the shard members are issued by a certification authority, and the shard members are updated at preset intervals and serve as shard leaders in a rotating manner; confirming the intra-shard consensus algorithm, wherein a practical Byzantine fault-tolerant algorithm is adopted in the shard, so that the shard leader broadcasts the proposal to the shard members, and the shard members vote after local verification.
[0015] Optionally, in an embodiment of the present application, the cross-shard view conversion proof of malicious behavior of any input shard leader is generated by the Byzantine fault-tolerant algorithm, including: after the user uploads the transaction to the relevant shard member, the input shard member runs the Byzantine fault-tolerant algorithm to determine whether the transaction is available in the input of the current shard, and generates an availability proof to other relevant shards, and the output shard member checks whether the availability proofs of all shards are received, completing the two-stage commitment-preparation; for the relevant shards that have not sent the availability proof, the output shard leader constructs and signs the cross-shard view conversion message, broadcasts it within the shard, and for the leader who has not proposed the cross-shard conversion, the output shard member initiates the intra-shard view conversion, and completes the cross-shard view conversion-proposal; the output shard member sends an availability proof request to the leader of the relevant shard that has not sent the availability proof, wherein if it is still not received, it is regarded as a malicious leader and votes in favor of the cross-shard view conversion, otherwise the two-stage commitment preparation is performed to complete the input availability proof request; the output shard leader collects votes to construct a cross-shard view conversion commitment proof, and completes the Byzantine algorithm-commitment.
[0016] Optionally, in an embodiment of the present application, after the input shard member where the malicious leader is located receives the cross-shard view conversion proof, the view conversion is performed through the intra-shard Byzantine fault tolerance algorithm to replace the malicious leader, and the active view conversion is used to prevent the leader of its own shard from reviewing transactions, including: the output shard leader sends the proof to the relevant input shard members, wherein the input shard member verifies the legitimacy, and if the verification is passed, initiates the intra-shard view conversion to replace the leader, and completes the cross-shard view conversion proof transmission; the input shard member constructs a view conversion confirmation message and sends it to the new leader, wherein the new leader of the input shard collects the confirmation message to construct a new view message, and broadcasts it within the shard to enter the next view, completing the cross-shard view conversion; in the preparation stage of the two-phase commitment protocol, the input shard member performs the intra-shard view conversion to replace the leader who did not initiate the proposal, and in the commitment stage of the two-phase commitment protocol, the input shard member performs the intra-shard view conversion to replace the leader who did not send the unlock or spend transaction, and the output shard member performs the intra-shard view conversion to replace the leader who did not send the acceptance or rejection proof, completing the intra-shard active view conversion.
[0017] To achieve the above-mentioned purpose, the second aspect embodiment of the present application provides a sharded blockchain secure cross-shard view conversion device for replacing a sharded blockchain leader, wherein the device includes: an initialization module, which is used to confirm the system model, shard members and leaders, and the consensus algorithm within the shard respectively to complete the initialization process; a cross-shard view conversion proof generation module, which is used to generate a cross-shard view conversion proof of malicious behavior of any input shard leader through a Byzantine fault tolerance algorithm; a cross-shard view conversion module, which is used to perform a view conversion through the Byzantine fault tolerance algorithm within the shard after the input shard member where the malicious leader is located receives the cross-shard view conversion proof, replace the malicious leader, and prevent its own shard leader from reviewing transactions through active view conversion.
[0018] Optionally, in an embodiment of the present application, the initialization process module is specifically used to include: confirming the shard blockchain network model and the adversary model, wherein the adversary computing power does not exceed a preset security threshold; confirming the shard members and the shard leaders, wherein the identities of the shard members are issued by a certification authority, and the shard members are updated at preset intervals and serve as shard leaders in a rotating manner; confirming the consensus algorithm within the shard, wherein a practical Byzantine fault-tolerant algorithm is adopted within the shard, so that the shard leader broadcasts the proposal to the shard members, and the shard members vote after local verification.
[0019] Optionally, in an embodiment of the present application, the cross-shard view conversion proof generation module is specifically used to: after a user uploads a transaction to a relevant shard member, the input shard member runs a Byzantine fault-tolerant algorithm to determine whether the transaction is available in the input of the current shard, and generates an availability proof to other relevant shards, and the output shard member checks whether the availability proofs of all shards are received, completing the two-stage commitment-preparation; for the relevant shards that have not sent the availability proof, the output shard leader constructs a cross-shard view conversion message and signs it, and broadcasts it within the shard, and for the leader who has not proposed a cross-shard conversion, the output shard member initiates an intra-shard view conversion to complete the cross-shard view conversion-proposal; the output shard member sends an availability proof request to the leader of the relevant shard that has not sent the availability proof, wherein if it is still not received, it is regarded as a malicious leader and votes in favor of the cross-shard view conversion, otherwise two-stage commitment preparation is performed to complete the input availability proof request; the output shard leader collects votes to construct a cross-shard view conversion commitment proof to complete the Byzantine algorithm-commitment.
[0020] Optionally, in an embodiment of the present application, the cross-shard view conversion module is specifically used to: the output shard leader sends the certificate to the relevant input shard member, wherein the input shard member verifies the legitimacy, and if the verification is passed, initiates the intra-shard view conversion to replace the leader, and completes the cross-shard view conversion certificate transmission; the input shard member constructs a view conversion confirmation message and sends it to the new leader, wherein the new leader of the input shard collects the confirmation message to construct a new view message, and broadcasts it within the shard to enter the next view, completing the cross-shard view conversion; in the preparation stage of the two-phase commitment protocol, the input shard member performs an intra-shard view conversion to replace the leader who did not initiate the proposal, and in the commitment stage of the two-phase commitment protocol, the input shard member performs an intra-shard view conversion to replace the leader who did not send an unlock or spend transaction, and the output shard member performs an intra-shard view conversion to replace the leader who did not send an acceptance or rejection certificate, completing the active view conversion within the shard.
[0021] To achieve the above-mentioned purpose, the third aspect embodiment of the present application provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the sharded blockchain secure cross-shard view conversion method as described in the above embodiment.
[0022] To achieve the above-mentioned objectives, the fourth aspect embodiment of the present application provides a non-temporary computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the sharded blockchain secure cross-shard view conversion method as described in the above embodiment.
[0023] The sharded blockchain secure cross-shard view conversion method and device of the embodiment of the present application have the following beneficial effects:
[0024] 1) It can resist cross-shard transaction censorship attacks. When an input shard leader behaves honestly within its shard but engages in malicious behavior between shards, the shard leader will not be reported and replaced. When the input shard leader receives a transaction, it runs the Byzantine fault-tolerant algorithm to generate a proof of availability for the transaction input, but does not send the proof to the corresponding shard. This behavior is called cross-shard transaction censorship. In this case, the malicious shard leader behaves honestly within the shard, so members within the shard will not be aware of its malicious behavior between shards, and therefore will not initiate a view conversion to replace the leader. The malicious leader can not process some transactions, destroying the activity of the system. The malicious leader can be replaced through the cross-shard view conversion technology.
[0025] 2) The proposed cross-shard view conversion technology can ensure the activity of the system. When the leader behaves maliciously between shards, that is, does not provide the input availability proof to other related shards, the members of other related shards can jointly generate a proof of the leader's malicious behavior and send it to the shard members corresponding to the leader. The shard members verify the legitimacy of the proof and initiate an intra-shard view conversion to replace the malicious leader. On this basis, the transactions uploaded by users in the system will be processed after a certain period of time, ensuring the activity of the system.
[0026] 3) It can ensure the consistency of the sharded blockchain system. The committee in each shard generates proof of transaction input availability and proof of leader malicious behavior by running the Byzantine fault-tolerant algorithm, and writes legal transactions into the blockchain. As long as the proportion of honest nodes in each shard committee exceeds the safety threshold (usually 2 / 3 or 1 / 2, determined by the Byzantine algorithm of different network models), it can ensure that the blockchain generated by each shard is consistent, and the blockchains generated by multiple shards will not conflict, ensuring the consistency of the entire sharded blockchain system.
[0027] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0029] Figure 1 A flowchart of a sharded blockchain secure cross-shard view conversion method provided according to an embodiment of the present application;
[0030] Figure 2 A logic diagram for executing a sharded blockchain secure cross-shard view conversion method according to an embodiment of the present application;
[0031] Figure 3 A flowchart of a practical Byzantine fault-tolerant algorithm using aggregate signature technology provided according to an embodiment of the present application;
[0032] Figure 4 A cross-slice view conversion flow chart provided according to an embodiment of the present application;
[0033] Figure 5 A flowchart of active view conversion provided according to an embodiment of the present application;
[0034] Figure 6 This is an example diagram of a sharded blockchain secure cross-shard view conversion device according to an embodiment of the present application;
[0035] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0036] Reference numerals: initialization module-100, cross-slice view conversion proof generation module-200, cross-slice view conversion module-300, memory-701, processor-702 and communication interface-703. DETAILED DESCRIPTION
[0037] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0038] Before introducing the specific scheme of the present application, the terms in the present application are first explained.
[0039] This application combines the Byzantine fault tolerance algorithm and sharded blockchain technology. The solution of this application includes four entities: (1) User: The user generates transactions according to his own needs and sends them to the shard members related to the transaction. The user can confirm the legitimacy of the transaction based on the information on the blockchain. (2) Shard: The participating members of the sharded blockchain are divided into different shards. Each shard is responsible for maintaining its own blockchain. The system contains a total of m shards. (3) Shard Members: Each shard contains u members. The shard members run the Byzantine fault tolerance algorithm in the shard to process proposals. The proposal type may be a transaction or a proof of availability of transaction inputs. Shard members may be honest or malicious. (4) Shard Leader: The shard leader is the leader of the Byzantine fault tolerance algorithm in the shard. It is responsible for initiating proposals to be processed in each round, and according to the specific requirements of the Byzantine fault tolerance algorithm, collects and calculates the messages of the shard members, and generates proofs for each round through methods such as aggregate signatures. At the same time, the shard leader acts as the coordinator of communication between shards and is responsible for forwarding inter-shard messages, which are mainly proof of transaction input availability.
[0040] In order to ensure that when a shard leader exhibits malicious behavior, the malicious leader can be replaced through shard view conversion to ensure the activity of the system in processing transactions, this application divides the entire process into three stages. The first stage is the initialization stage, which includes system model confirmation, shard member and leader confirmation, and intra-shard consensus algorithm confirmation.
[0041] Phase 1 includes: Step 1: System model confirmation: Confirm the network model, assuming it is a synchronous network. Confirm the adversary model, and the adversary's computing power does not exceed the security threshold. Step 2: Shard member and shard leader confirmation: The identity of the shard member is issued by a unified CA. Shard members are updated regularly and serve as shard leaders in a rotating manner. Step 3: Confirmation of the consensus algorithm within the shard: The practical Byzantine fault-tolerant algorithm is used within the shard. The shard leader broadcasts the proposal to the shard members, and the shard members verify it locally and vote.
[0042] The second phase is the cross-shard view conversion proof generation phase, which includes two-stage commitment-preparation, cross-shard view conversion-proposal, input availability proof request, and Byzantine algorithm-commitment steps. The transaction output shard generates a cross-shard view conversion proof of malicious behavior of a certain input shard leader through the Byzantine fault-tolerant algorithm.
[0043] Phase 2 includes: Step 4: Two-phase commitment-preparation: The user uploads the transaction to the relevant shard members, the input shard checks and generates AC to other relevant shards, and the output shard members check whether the AC of all shards has been received. Step 5: Cross-shard view conversion-proposal: For the relevant shards that have not sent AC, the output shard leader constructs a cross-shard view conversion message and signs it, and broadcasts it within the shard. For the leader who has not proposed a cross-shard conversion, the output shard member initiates an intra-shard view conversion. Step 6: Input availability proof request: The output shard member sends an AC request to the leader of the relevant shard that has not sent AC. If it is still not received, it is regarded as a malicious leader and votes in favor of the cross-shard view conversion; otherwise, two-phase commitment preparation is performed. Step 7: Byzantine algorithm-commitment: The output shard leader collects votes to construct a cross-shard view conversion commitment proof.
[0044] The third phase is the cross-shard view conversion phase, which includes the transmission of cross-shard view conversion proof, cross-shard view conversion, and active view conversion within the shard. After the input shard member where the malicious leader is located receives the legal cross-shard view conversion proof, it replaces the malicious leader through the intra-shard Byzantine fault tolerance algorithm view conversion, and prevents its own shard leader from reviewing transactions through active view conversion.
[0045] Phase 3 includes: Step 8: Transmission of cross-shard view conversion proof: The output shard leader sends the proof to the relevant input shard members. The input shard members verify the legitimacy. If the verification passes, they initiate an intra-shard view conversion to replace the leader. Step 9: Cross-shard view conversion: The input shard members construct a view conversion confirmation message and send it to the new leader. The new leader of the input shard collects confirmation messages to construct a new view message and broadcasts it within the shard to enter the next view. Step 10: Active view conversion within the shard: In the preparation phase of the two-phase commitment protocol, the input shard members perform an intra-shard view conversion to replace the leader who did not initiate the proposal. In the commitment phase of the two-phase commitment protocol, the input shard members perform an intra-shard view conversion to replace the leader who did not send the unlock or spend transaction. The output shard members perform an intra-shard view conversion to replace the leader who did not send the acceptance or rejection proof.
[0046] The solution of this application is described in detail below.
[0047] Figure 1 This is a flowchart of a sharded blockchain secure cross-shard view conversion method provided according to an embodiment of the present application.
[0048] like Figure 1 As shown, the sharded blockchain secure cross-shard view conversion method is used for sharded blockchain leader replacement, including the following steps:
[0049] In step S1, the system model, shard members and leaders, and the intra-shard consensus algorithm are confirmed respectively to complete the initialization process.
[0050] In an embodiment of the present application, the system model, shard members and leaders, and the intra-shard consensus algorithm are confirmed respectively to complete the initialization process, including: confirming the shard blockchain network model and the adversary model, wherein the adversary computing power does not exceed a preset security threshold; confirming the shard members and shard leaders, wherein the identities of the shard members are issued by a certification authority, and the shard members are updated at preset intervals and serve as shard leaders in a rotating manner; confirming the intra-shard consensus algorithm, wherein a practical Byzantine fault-tolerant algorithm is used in the shard, so that the shard leader broadcasts the proposal to the shard members, and the shard members vote after local verification.
[0051] Specifically, the initialization process of this application includes three steps: system model confirmation, shard member and shard leader confirmation, and shard consensus algorithm confirmation, specifically:
[0052] Step 1: System model confirmation: First, the sharded blockchain network model needs to be confirmed. The network model determines the way messages are transmitted in the network. This sharded blockchain system adopts a synchronous network model, and messages in the network are transmitted in rounds. At the same time, the system model also includes an adversary model to limit the adversary's computing power. The adversary's computing power cannot exceed a certain threshold. Within each shard, malicious nodes are controlled by the adversary, and the ratio of the number of malicious nodes controlled by the adversary to the total number of nodes in the shard cannot exceed a certain security threshold to ensure the security of the consensus algorithm within the shard.
[0053] Step 2: Shard members and shard leaders confirm. The number of shards included in the system needs to be confirmed. Members of each shard need to confirm their identities through identity authentication, and a unified organization will issue them a public key for authentication. A certain method needs to be used to select a shard leader in each shard. The shard leader is used to initiate proposals, collect messages, calculate signatures, etc. in the consensus within the shard.
[0054] Step 3: Confirmation of consensus algorithm within the shard. Each shard needs to run a certain state machine replication algorithm to handle different types of proposals. The Practical Byzantine Fault Tolerance algorithm is used within the shard to handle transactions and transaction input availability. The Practical Byzantine Fault Tolerance algorithm meets consistency and activity. Consistency means that honest members can maintain a consistent view of the blockchain, and activity means that transactions uploaded by users will be processed after a certain period of time.
[0055] In step S2, a cross-shard view transition proof of malicious behavior of any input shard leader is generated through the Byzantine fault tolerance algorithm.
[0056] In an embodiment of the present application, a cross-shard view conversion proof of malicious behavior of any input shard leader is generated through a Byzantine fault-tolerant algorithm, including: after a user uploads a transaction to a relevant shard member, the input shard member runs a Byzantine fault-tolerant algorithm to determine whether the transaction is available in the input of the current shard, and generates an availability proof to other relevant shards, and the output shard member checks whether the availability proofs of all shards are received, completing a two-stage commitment-preparation; for the relevant shards that have not sent an availability proof, the output shard leader constructs a cross-shard view conversion message and signs it, broadcasts it within the shard, and for the leader who has not proposed a cross-shard conversion, the output shard member initiates an intra-shard view conversion to complete a cross-shard view conversion-proposal; the output shard member sends an availability proof request to the leader of the relevant shard that has not sent an availability proof, wherein if it is still not received, it is regarded as a malicious leader and votes in favor of the cross-shard view conversion, otherwise a two-stage commitment preparation is performed to complete the input availability proof request; the output shard leader collects votes to construct a cross-shard view conversion commitment proof to complete the Byzantine algorithm-commitment.
[0057] Specifically, the generation of cross-shard view conversion proof includes four steps: the transaction output shard member runs the Byzantine fault tolerance algorithm to generate a proof of malicious behavior of a certain input shard leader through two-stage commitment-preparation, cross-shard view conversion-proposal and input availability proof request. Specifically:
[0058] Step 4: Two-phase commitment-preparation: The user uploads transaction tx to the members of the relevant shards. The input shards of transaction tx are S1 and S2, and the output shard is S3. As the input shard of transaction tx, the input shard member runs the Byzantine fault tolerance algorithm to determine whether the input of the transaction is available in the current shard, and generates an availability proof AC, which is sent to all other relevant shards, including input and output shards. AC contains information about whether the input of transaction tx is available and its proof. At time T bft After +Δ, each relevant shard should receive the corresponding AC. If the members of the output shard have not received the availability proof of a shard at this time, it is determined that the shard leader has performed a cross-shard transaction censorship attack, and a cross-shard view conversion operation needs to be initiated to replace the leader.
[0059] Step 5: Cross-shard view conversion - Proposal: As output shard S c The honest leader L c , if the transaction tx time T is received bft After +Δ, no data is received from shard S c′ The transaction input availability proof AC, then the leader L c Construct cross-shard view conversion message m csvc , and sign it to get <m csvc >. Leader L c The signed message <m csvc >In the current shard S c As an honest member of the output shard, if T after receiving the transaction tx bft +2Δ time, no follow-up from the current leader L c Upon receiving a cross-shard view conversion message about transaction tx, the honest member will initiate an intra-shard view conversion operation, i.e., the view conversion in the Byzantine fault tolerance algorithm, to replace the current shard S. c leader.
[0060] Step 6: Enter the availability proof request: as shard S c Members of the , received a valid cross-slice view conversion message m csvc Afterwards, to shard S c′ Leader L c′ Send a request to return the input availability proof AC for transaction tx. After 2Δ time, if there is still no c′ If AC is received, Lc′ If the leader is a malicious leader, the shard member votes for the cross-shard view transition. Otherwise, the leader L c′ The availability proof AC of the transaction tx is sent, and the shard member broadcasts AC within the shard and processes the transaction tx through the normal two-phase commitment protocol.
[0061] Step 7: Byzantine Algorithm - Commitment: If in step 6, shard S c The member has not learned from the leader L within 2Δ time c′ Upon receiving a valid response, the member changes the view to the message m in the Byzantine algorithm. csvc Conduct preparation vote and commitment vote. After two rounds of voting, the shard leader L c Able to collect 2f+1 valid votes <m vote >, and use these voting information to construct the cross-slice view conversion commitment proof csvc-CC. csvc-CC contains 2f+1 valid signature information. Here, the aggregate signature or threshold signature method can also be used to aggregate the 2f+1 signatures into 1 total signature.
[0062] In step S3, after the input shard member where the malicious leader is located receives the cross-shard view conversion proof, it performs view conversion through the intra-shard Byzantine fault tolerance algorithm to replace the malicious leader, and prevents its own shard leader from reviewing transactions through active view conversion.
[0063] In an embodiment of the present application, after the input shard member where the malicious leader is located receives the cross-shard view conversion proof, the view conversion is performed through the intra-shard Byzantine fault tolerance algorithm to replace the malicious leader, and the active view conversion is used to prevent the leader of its own shard from reviewing the transaction, including: the output shard leader sends the proof to the relevant input shard members, wherein the input shard member verifies the legitimacy, and if the verification passes, initiates the intra-shard view conversion to replace the leader, and completes the cross-shard view conversion proof transmission; the input shard member constructs a view conversion confirmation message and sends it to the new leader, wherein the new leader of the input shard collects the confirmation message to construct a new view message, and broadcasts it within the shard to enter the next view, completing the cross-shard view conversion; in the preparation stage of the two-phase commitment protocol, the input shard member performs the intra-shard view conversion to replace the leader who did not initiate the proposal, and in the commitment stage of the two-phase commitment protocol, the input shard member performs the intra-shard view conversion to replace the leader who did not send the unlock or spend transaction, and the output shard member performs the intra-shard view conversion to replace the leader who did not send the acceptance or rejection proof, completing the intra-shard active view conversion.
[0064] Specifically, cross-shard view conversion includes three steps: the shard leader sends the view conversion certificate to the corresponding shard member, the shard member verifies its legitimacy, and initiates the Byzantine fault tolerance algorithm view conversion within the shard. Specifically:
[0065] Step 8: Cross-shard view conversion proof transfer: In shard S c In, L c After constructing the view conversion proof csvc-CC using the collected 2f+1 legitimate signatures, L c Send the proof csvc-CC to shard S c′ At least f+1 members. As shard S c′ Members of the shard should first determine whether the received cross-shard view conversion certificate is legitimate by verifying the legitimacy of the signature. Since the signature verification requires the public key of other shard members or the group public key of other shards as input, each member should maintain a list of public keys of other shards locally. If the verification passes, it is considered that the shard S c′ The current leader L c′ Is malicious, that is, L c′ No input availability proof AC is provided to other relevant shards of transaction tx. c′ The honest member initiates a view conversion operation within the shard to replace the leader L c′ .
[0066] Step 9: Cross-shard view conversion: In shard S c′ Inside, the honest member constructs the view transition confirmation message m csvc-ack , including its own current state, signature and other information, and sends the view conversion confirmation message to the next leader, who is determined by a round-robin method. The new leader collects 2f+1 (including itself) legal view conversion confirmation messages and constructs a new view message m csvc-nview The new view message contains the current state of the shard, the proposal to be processed in the next round, etc. The new leader broadcasts the new view message in the current shard, and shard S c′ Go to the next view.
[0067] Step 10: Active view conversion within a shard: In the preparation phase of the two-phase commitment protocol, if an input shard member does not receive a proposal message from the leader about tx within Δ time after receiving the transaction tx, the member initiates a view conversion operation of the Byzantine fault tolerance algorithm within the shard. In the commitment phase of the two-phase commitment protocol, if an input shard member does not receive a proposal message from the leader about tx within Δ time after receiving the transaction tx, the member initiates a view conversion operation of the Byzantine fault tolerance algorithm within the shard. bft If no request is received from the shard leader to unlock or spend the corresponding input of transaction tx within +2Δ time, the intra-shard Byzantine fault tolerance algorithm view conversion operation is initiated. In the output shard, if the output shard member receives T after receiving transaction tx bft If no acceptance or rejection proof of transaction tx is received from the leader within +2Δ time, the intra-shard Byzantine fault tolerance algorithm view conversion is also initiated.
[0068] The following is combined with Figure 2 , Figure 3 , Figure 4 and Figure 5 The sharded blockchain secure cross-shard view conversion of the present application is described in detail with specific embodiments.
[0069] 1. Initialization phase
[0070] Step 1: System model confirmation: Assume that the network model is a synchronous network. Messages sent by honest nodes must reach each other after Δ time, that is, the time of one round is Δ. The adversary is responsible for message transmission. The adversary can delay and reorder the messages sent by honest nodes, but must follow the time limit of Δ. The adversary controls a limited computing power ρ. The computing power limit is to ensure that in each shard, the proportion of honest nodes is equal to or exceeds a preset security threshold Q, and the value of Q is determined by the on-chip consensus algorithm. If the practical Byzantine fault tolerance algorithm is used, the value of Q is 2 / 3. The value of ρ should be less than Q to ensure that the above security conditions are met during the shard member selection process, because the adversary can use its own advantages such as network latency to expand its share of members in this process.
[0071] Step 2: Shard members and shard leaders confirm. The system participating nodes are divided into m shards S1, S2…S m , each shard contains u members, of which the number of malicious members is f, and u≥3f+1. The identity of each shard member is issued by a unified certification authority. In order to prevent corruption attacks by adversaries, shard members are updated regularly. In each shard, shard members serve as shard leaders in a rotating manner.
[0072] Step 3: Confirmation of the consensus algorithm within the shard. The practical Byzantine fault-tolerant algorithm is used within the shard to process transactions and transaction input availability. Each shard member processes transactions within the shard through steps such as proposal, preparation, and commitment. The shard leader is responsible for proposing transactions that need to be processed in each round and broadcasts the proposal message to the members within the shard. Shard members vote on the proposal by verifying whether the proposal is legal locally.
[0073] 2. Generation of cross-shard view conversion proof
[0074] Step 4: Two-Phase Commitment - Preparation:
[0075] (1) The user uploads transaction tx to the f+1 shard members of its related shards S1, S2, and S3, where shards S1 and S2 are input shards and S3 is the output shard;
[0076] (2) The S1 and S2 shard leaders run the Practical Byzantine algorithm within the shard and propose transaction tx to the shard members;
[0077] (3) Shard members determine whether the transaction tx input is available. If available, they prepare and commit it within the practical Byzantine fault tolerance algorithm and broadcast the vote;
[0078] (4) In the preparation and commitment phase, if the shard member collects 2f+1 votes for the current proposal, it is considered to have entered the prepared and committed phase. The leader collects 2f+1 commitment messages and forms the input availability proof AC of the transaction tx;
[0079] (5) The leader sends the availability proof AC to other shards, such as the S1 shard leader sends AC to S2 and S3 shard leaders send AC to S1 and S3.
[0080] Step 5: Cross-slice view conversion - Proposal:
[0081] (1) Below is S c Represents the output shard, S c′ Represents the input fragment that has not sent AC. As the output fragment S c The leader, after receiving the transaction tx, bft +Δ time, if there is no input fragment S from tx c′ Leader L c′ After receiving the transaction availability proof, construct a cross-shard view conversion message: m csvc :=(″S c -S c′ -csvc",L c′ ,tx).
[0082] (2) Leader L c Send the message csvc Signature obtained <m csvc >, place it in the current shard S c Intranet Broadcast,as a Proposal for a Practical Byzantine Fault Tolerant Protocol.
[0083] Step 6: Enter the Attestation of Availability Request:
[0084] (1) As shard S c members, receive the leader L c Proposal <m csvc >After that, first verify the legitimacy of the leader’s signature;
[0085] (2) If the signature is illegal, ignore the message; if the signature is legal, send the message to shard S. c′ Leader L c′ Send request: <m req:=(ask-for-response,tx)>, request L c′ Returns the input availability proof AC for transaction tx;
[0086] (3) If after 2Δ time, there is still no c′ Leader L c′ After receiving the legal availability proof AC of transaction tx, in the current shard S c The preparation and commitment phases of the practical Byzantine fault-tolerant algorithm are constructed to vote <m prepare-vote > and <m commit-vote >, sent to the shard leader L c ; Otherwise, L is received within 2Δ time c′ AC, broadcast AC in the current slice.
[0087] Step 7: Byzantine Algorithm - Commitment:
[0088] (1) As shard S c Leader L c , in the preparation phase of the Practical Byzantine Fault Tolerance algorithm, 2+1 members’ legitimate votes are received < m prepare-vote >, use the aggregate signature algorithm to aggregate 2f+1 signatures into 1 total signature, in the current shard S c Internal broadcast;
[0089] (2) As shard S c Leader L c , in the commitment phase of the PBT algorithm, receiving 2+1 members’ legitimate votes < m commit-vote >, use the aggregate signature algorithm to aggregate 2+1 signatures into 1 total signature SIG csvc , construct the cross-slice view conversion proof csvc-CC: = ("S c -S c′ -csvc",L c′ ,tx,SIG csvc ).
[0090] 3. Cross-slice view conversion
[0091] Step 8: Proof of cross-shard view conversion transfer
[0092] (1) Shard S c Leader L c Send the cross-shard view conversion certificate csvc-CC related to transaction tx to shard S c′ At least f+1 members;
[0093] (2) Shard S c′ After receiving csvc-CC, members ofc The public key verification signature SIG csvc the legality of
[0094] (3) If the verification fails, the message is ignored; if the verification passes, the current shard S is considered c′ LeaderL c′ For malicious purposes, a view conversion operation using the Byzantine fault tolerance algorithm is issued.
[0095] Step 9: Transition across slices:
[0096] (1) Shard S c′ Members determine the current leader L c′ After becoming a malicious leader, construct a view transition confirmation message m csvc-ack :=(″S c -S c′ -csvc",state,v+1), where state indicates the current member state, and v indicates the current view number. The signature is obtained <m csvc-ack >
[0097] (2) Shard S c′ Member will view the conversion confirmation message <m csvc-ack >Sent to the next leader L of the current shard c ″;
[0098] (3) Shard S c′ The next leader L c ″After collecting 2f+1 valid view conversion confirmation messages <m csvc-ack >After that, construct a new view message m csvc-nview :=(″S c -S c′ -csvc",state′,p,v+1,SIG 2f+1 ), where state′ represents the committed state of the current shard, p represents the next pending proposal, and SIG 2f+1 Indicates the signatures of the legitimate view conversion confirmation messages of 2f+1 shard members. The new leader L c″ Broadcast new view message m within the shard csvc-nview .
[0099] (4) Shard Sc' member receives new view message m csvc-nview After that, verify SIG 2f+1 The validity of the signature is included in it. After verification, enter the new view v+1 and start processing the proposal p in normal operation according to the practical Byzantine algorithm.
[0100] Step 10: Active view conversion within the shard:
[0101] (1) As the input shard S of transaction tx c Members, after the transaction tx is uploaded Δ time, if they still have not received the leader L c Regarding the proposal of tx input, construct the active view conversion message m csvc-vc :=("proactive-vc","input-Δ",tx,state,v+1), where "input-Δ" means it is in the input shard of transaction txtx, and the transaction has not received AC after being uploaded Δ, and it is sent to the next leader of the current shard;
[0102] (2) As a member of the input shard Sc of the transaction txtx, if the leader L is still not received after the transaction tx is uploaded for 2Δ time c Regarding the proposal to unlock or spend tx, an active view conversion message m is constructed csvc-vc :=("proactive-vc","input-2Δ",tx,state,v+1), and send it to the next leader of the current shard;
[0103] (3) As an output shard member of transaction tx, after 2Δ time after transaction tx is uploaded, if it still does not receive the leader's commitment / rejection proposal about tx, or the cross-shard view conversion message m about tx csvc , then initiate an active view conversion message m csvc-vc :=("proactive-vc","output-2Δ",tx,state,v+1), and send it to the next leader of the current shard;
[0104] (4) As the input or output shard leader of transaction tx, upon receiving the active view transition message m csvc-vc After that, verify the legitimacy of the message; after the verification passes, construct a new view message m csvc-nview :=(″proactive-vc”,state′,p,v+1,SIG 2f+1 ) and broadcast it within the shard;
[0105] (5) Shard member receives new view message m csvc-nview After that, verify that it contains the signature SIG 2f+1 After verification, the new view is entered and the new proposal is processed normally according to the practical Byzantine fault tolerance algorithm.
[0106] The sharded blockchain secure cross-shard view conversion method proposed in the embodiment of the present application involves blockchain technology and Byzantine fault tolerance technology, and its advantages and functions are: 1) It can resist the intra-shard and cross-shard transaction review attacks of malicious leaders. When processing cross-shard transactions, malicious leaders may not process some transactions that are unfavorable to themselves, that is, review their transactions, resulting in the inability to process legitimate transactions uploaded by users in a timely manner. The present invention uses the output shard members to run the Byzantine fault tolerance algorithm to jointly generate a proof of malicious behavior of a certain input shard leader, and uses the proof to achieve intra-shard view conversion, which can replace the malicious leader. 2) It is applicable to different types of sharded blockchain systems. Most existing sharded blockchain systems use Byzantine fault tolerance type algorithms in each shard, and the cross-shard view conversion protocol designed by the present invention can be used in different sharded blockchains. 3) The activity of the sharded blockchain system is ensured. Transactions submitted by users to the sharded blockchain system will definitely be processed within a period of time.
[0107] Next, a sharded blockchain secure cross-shard view conversion device proposed according to an embodiment of the present application is described with reference to the accompanying drawings.
[0108] Figure 6 This is an example diagram of a sharded blockchain secure cross-shard view conversion device according to an embodiment of the present application.
[0109] like Figure 6 As shown, the sharded blockchain secure cross-shard view conversion device 10 is used for sharded blockchain leader replacement, including: an initialization module 100, a cross-shard view conversion proof generation module 200 and a cross-shard view conversion module 300.
[0110] Among them, the initialization module 100 is used to confirm the system model, shard members and leaders, and the intra-shard consensus algorithm respectively to complete the initialization process. The cross-shard view conversion proof generation module 200 is used to generate a cross-shard view conversion proof of malicious behavior of any input shard leader through the Byzantine fault tolerance algorithm. The cross-shard view conversion module 300 is used to perform view conversion through the intra-shard Byzantine fault tolerance algorithm after the input shard member where the malicious leader is located receives the cross-shard view conversion proof, replace the malicious leader, and prevent the leader of its own shard from reviewing transactions through active view conversion.
[0111] Optionally, in an embodiment of the present application, the initialization process module 100 is specifically used to include: confirming the shard blockchain network model and the adversary model, wherein the adversary computing power does not exceed a preset security threshold; confirming the shard members and the shard leaders, wherein the identities of the shard members are issued by the certification authority, and the shard members are updated at preset intervals, and serve as shard leaders in a rotating manner; confirming the consensus algorithm within the shard, wherein a practical Byzantine fault-tolerant algorithm is adopted within the shard, so that the shard leader broadcasts the proposal to the shard members, and the shard members vote after local verification.
[0112] Optionally, in an embodiment of the present application, the cross-shard view conversion proof generation module 200 is specifically used to, after the user uploads the transaction to the relevant shard member, the input shard member runs the Byzantine fault-tolerant algorithm to determine whether the transaction is available in the input of the current shard, and generates an availability proof to other relevant shards, and the output shard member checks whether the availability proofs of all shards are received, completing the two-stage commitment-preparation; for the relevant shards that have not sent the availability proof, the output shard leader constructs and signs the cross-shard view conversion message, broadcasts it within the shard, and for the leader who has not proposed the cross-shard conversion, the output shard member initiates the intra-shard view conversion to complete the cross-shard view conversion-proposal; the output shard member sends an availability proof request to the leader of the relevant shard that has not sent the availability proof, where if it is still not received, it is regarded as a malicious leader and votes in favor of the cross-shard view conversion, otherwise it performs two-stage commitment preparation to complete the input availability proof request; the output shard leader collects votes to construct a cross-shard view conversion commitment proof to complete the Byzantine algorithm-commitment.
[0113] Optionally, in an embodiment of the present application, the cross-shard view conversion module 300 is specifically used for: the output shard leader sends the certificate to the relevant input shard member, wherein the input shard member verifies the legitimacy, and if the verification is passed, initiates the intra-shard view conversion to replace the leader, and completes the cross-shard view conversion certificate transmission; the input shard member constructs a view conversion confirmation message and sends it to the new leader, wherein the new leader of the input shard collects the confirmation message to construct a new view message, and broadcasts it within the shard to enter the next view, and completes the cross-shard view conversion; in the preparation phase of the two-phase commitment protocol, the input shard member performs an intra-shard view conversion to replace the leader who did not initiate the proposal, and in the commitment phase of the two-phase commitment protocol, the input shard member performs an intra-shard view conversion to replace the leader who did not send the unlock or spend transaction, and the output shard member performs an intra-shard view conversion to replace the leader who did not send the acceptance or rejection certificate, and completes the active view conversion within the shard.
[0114] It should be noted that the aforementioned explanation of the embodiment of the sharded blockchain secure cross-shard view conversion method is also applicable to the sharded blockchain secure cross-shard view conversion device of this embodiment, and will not be repeated here.
[0115] The sharded blockchain secure cross-shard view conversion device proposed in the embodiment of the present application involves blockchain technology and Byzantine fault tolerance technology, and has the characteristics of preventing double-spending attacks, preventing malicious leader transaction review attacks, fast transaction confirmation, security and efficiency, etc.
[0116] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:
[0117] A memory 701 , a processor 702 , and a computer program stored in the memory 701 and executable on the processor 702 .
[0118] When the processor 702 executes the program, the sharded blockchain secure cross-shard view conversion method provided in the above embodiment is implemented.
[0119] Furthermore, the electronic device further comprises:
[0120] The communication interface 703 is used for communication between the memory 701 and the processor 702 .
[0121] The memory 701 is used to store computer programs that can be executed on the processor 702 .
[0122] The memory 701 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0123] If the memory 701, the processor 702 and the communication interface 703 are implemented independently, the communication interface 703, the memory 701 and the processor 702 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0124] Optionally, in a specific implementation, if the memory 701, the processor 702 and the communication interface 703 are integrated on a chip, the memory 701, the processor 702 and the communication interface 703 can communicate with each other through an internal interface.
[0125] The processor 702 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0126] This embodiment also provides a computer-readable storage medium on which a computer program is stored, characterized in that when the program is executed by a processor, the above-mentioned sharded blockchain secure cross-shard view conversion method is implemented.
[0127] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0128] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0129] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0130] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0131] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0132] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0133] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0134] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A secure cross-shard view conversion method for sharded blockchains. It is characterized in that The method is used for shard blockchain leader replacement, wherein the method comprises the following steps: Confirm the system model, shard members and leaders, and the consensus algorithm within the shard to complete the initialization process; Generate a cross-shard view conversion proof of malicious behavior of any input shard leader through the Byzantine fault tolerance algorithm, specifically including: after the user uploads the transaction to the relevant shard member, the input shard member runs the Byzantine fault tolerance algorithm to determine whether the transaction is available in the input of the current shard, and generates an availability proof to other relevant shards, and the output shard member checks whether the availability proof of all shards has been received, completing the two-stage commitment-preparation; for the relevant shards that have not sent the availability proof, the output shard leader constructs and signs the cross-shard view conversion message, broadcasts it in the shard, and for the leader who has not proposed the cross-shard conversion, the output shard member initiates the intra-shard view conversion, completing the cross-shard view conversion-proposal; the output shard member sends an availability proof request to the leader of the relevant shard that has not sent the availability proof, wherein if it is still not received, it is regarded as a malicious leader and votes to support the cross-shard view conversion, otherwise it performs a two-stage commitment preparation to complete the input availability proof request; the output shard leader collects votes to construct a cross-shard view conversion commitment proof, completing the Byzantine algorithm-commitment; and After the input shard member where the malicious leader is located receives the cross-shard view conversion proof, the view conversion is performed through the intra-shard Byzantine fault tolerance algorithm to replace the malicious leader, and the active view conversion is used to prevent the leader of its own shard from reviewing transactions, which specifically includes: the output shard leader sends the proof to the relevant input shard members, wherein the input shard member verifies the legitimacy, and if the verification is passed, initiates the intra-shard view conversion to replace the leader, and completes the transmission of the cross-shard view conversion proof; the input shard member constructs a view conversion confirmation message and sends it to the new leader, wherein the new leader of the input shard collects the confirmation message to construct a new view message, and broadcasts it in the shard to enter the next view, and completes the cross-shard view conversion; in the preparation stage of the two-phase commitment protocol, the input shard member performs the intra-shard view conversion to replace the leader who did not initiate the proposal, and in the commitment stage of the two-phase commitment protocol, the input shard member performs the intra-shard view conversion to replace the leader who did not send the unlock or spend transaction, and the output shard member performs the intra-shard view conversion to replace the leader who did not send the acceptance or rejection proof, and completes the intra-shard active view conversion.
2. The method according to claim 1, It is characterized in that The system model, shard members and leaders, and the consensus algorithm within the shard are confirmed to complete the initialization process, including: Confirm the sharded blockchain network model and adversary model, where the adversary's computing power does not exceed the preset security threshold; Confirm the shard members and shard leaders, where the identities of the shard members are issued by a certification authority, and the shard members are updated at preset intervals and serve as shard leaders in a rotating manner; Confirm the consensus algorithm within the shard, wherein the practical Byzantine fault-tolerance algorithm is adopted in the shard, so that the shard leader broadcasts the proposal to the shard members, and the shard members vote after local verification.
3. A sharded blockchain secure cross-shard view conversion device, It is characterized in that For shard blockchain leader replacement, wherein the device comprises: The initialization module is used to confirm the system model, shard members and leaders, and the consensus algorithm within the shard to complete the initialization process; A cross-shard view transition proof generation module, which is used to generate a cross-shard view transition proof of malicious behavior of any input shard leader through a Byzantine fault-tolerant algorithm; and A cross-shard view conversion module is used to perform view conversion through the intra-shard Byzantine fault tolerance algorithm to replace the malicious leader after the input shard member where the malicious leader is located receives the cross-shard view conversion proof, and prevent the leader of its own shard from reviewing transactions through active view conversion; The cross-shard view conversion proof generation module is specifically used for: after the user uploads the transaction to the relevant shard member, the input shard member runs the Byzantine fault tolerance algorithm to determine whether the transaction is available in the input of the current shard, and generates an availability proof to other relevant shards, and the output shard member checks whether the availability proof of all shards has been received, completing the two-stage commitment-preparation; for the relevant shards that have not sent the availability proof, the output shard leader constructs and signs the cross-shard view conversion message, broadcasts it in the shard, and for the leader who has not proposed the cross-shard conversion, the output shard member initiates the intra-shard view conversion, completing the cross-shard view conversion-proposal; the output shard member sends an availability proof request to the leader of the relevant shard that has not sent the availability proof, wherein if it is still not received, it is regarded as a malicious leader and votes to support the cross-shard view conversion, otherwise it performs two-stage commitment preparation to complete the input availability proof request; the output shard leader collects votes to construct a cross-shard view conversion commitment proof, and completes the Byzantine algorithm-commitment; The cross-shard view conversion module is specifically used for: the output shard leader sends the certificate to the relevant input shard members, wherein the input shard members verify the legitimacy, and if the verification is passed, initiate the intra-shard view conversion to replace the leader, and complete the cross-shard view conversion certificate transmission; the input shard member constructs a view conversion confirmation message and sends it to the new leader, wherein the new leader of the input shard collects the confirmation message to construct a new view message, and broadcasts it in the shard to enter the next view, and completes the cross-shard view conversion; in the preparation stage of the two-phase commitment protocol, the input shard member performs the intra-shard view conversion to replace the leader who did not initiate the proposal, and in the commitment stage of the two-phase commitment protocol, the input shard member performs the intra-shard view conversion to replace the leader who did not send the unlock or spend transaction, and the output shard member performs the intra-shard view conversion to replace the leader who did not send the acceptance or rejection certificate, and completes the active view conversion within the shard.
4. The device according to claim 3, It is characterized in that The initialization process module is specifically used to: confirm the shard blockchain network model and the adversary model, wherein the adversary's computing power does not exceed a preset security threshold; confirm the shard members and shard leaders, wherein the identities of the shard members are issued by a certification authority, and the shard members are updated at preset intervals and serve as shard leaders in a rotating manner; confirm the consensus algorithm within the shard, wherein a practical Byzantine fault-tolerant algorithm is used within the shard, so that the shard leader broadcasts the proposal to the shard members, and the shard members vote after local verification.
5. An electronic device, It is characterized in that include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for secure cross-shard view conversion of a sharded blockchain as described in any one of claims 1 to 2.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that The program is executed by a processor to implement the sharded blockchain secure cross-shard view conversion method as described in any one of claims 1-2.
Citation Information
Patent Citations
Fast transaction confirmation method and device based on block chain technology
CN109360100A
Alliance chain-oriented fragmentation method
CN110808838A
Byzantine fault-tolerant alliance chain consensus method and system for power consumption information protection and storage medium
CN111612455A
Method for information confirmation in distributed systems using hybrid byzantine agreement
US20200204351A1
