Methods, devices, and media for protecting against malicious attacks on blockchain-based privacy computing
By registering tasks and rules in blockchain smart contracts, participants submit deposits and generate commitment values. Combined with off-chain behavior records, this enables verifiable detection and automatic handling of malicious attacks, solving the problem of difficulty in verifying malicious attacks in privacy computing and improving the credibility and cost-effectiveness of attack protection.
Patent Information
- Application Number
- CN202611404792.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-11-17
AI Technical Summary
In existing privacy computing processes, malicious attacks are difficult to verify and handle automatically, and there is a lack of closed-loop protection mechanisms, resulting in inaccurate attack detection results and low costs for participants to commit malicious acts.
By registering task identifiers, privacy computing protocols, attack judgment rules, and margin rules in blockchain smart contracts, participants submit margin and generate commitment values. Combined with off-chain computing behavior record summaries and verifiable credentials, an attack evidence package is formed. The smart contract automatically verifies and deducts the margin for violations.
It enables verifiable detection and automated handling of malicious attacks without disclosing the original data, improving the credibility of attack protection and the cost of malicious behavior for participants, and reducing reliance on centralized arbitration.
Smart Images

Figure CN123122955A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of blockchain, privacy computing, and network security technology, and in particular to a method, device, and medium for protecting against malicious attacks on privacy computing based on blockchain. Background Technology
[0002] Privacy-preserving computation is a technique that enables joint statistics, joint modeling, joint reasoning, or joint decision-making without the original data leaving its domain or being disclosed to other parties in plaintext. Existing privacy-preserving computation methods mainly include multi-party secure computation, federated learning, trusted execution environments, homomorphic encryption, and zero-knowledge proofs. These technologies can reduce the risk of privacy breaches during data collaboration, but their secure operation depends not only on the cryptographic algorithms or computation protocols themselves, but also on whether each participant executes the corresponding operations according to the agreed-upon protocols, code, and computational procedures.
[0003] In real-world cross-institutional privacy computation, participants typically have independent interests, making it difficult to consistently meet the assumptions of a semi-honest model. Participants may engage in malicious activities such as submitting false inputs, tampering with intermediate computation values, deviating from the planned computation process, refusing to send necessary messages, replaying historical messages, submitting abnormal model updates, poisoning the model, forging execution environment credentials, or colluding. These malicious actions can lead to incorrect computation results, failure of the joint model, or interruption of the computation task, and may even harm the data security and business interests of other participants.
[0004] To address the aforementioned issues, existing technologies typically employ methods such as anomaly detection, log auditing, digital signatures, or trusted third-party arbitration to identify and handle malicious behavior. However, privacy-preserving computation processes are primarily executed offline, and attack detection results, participant input, executed code, execution environment, and behavioral records for each computation round are often scattered, lacking a reliable evidentiary mechanism to link this information to specific tasks, participants, and computation rounds. Therefore, when participants deny related behaviors or object to detection results, existing technologies struggle to prove that attack evidence has not been forged or tampered with, and also find it difficult to reliably and verifiably verify whether participants performed computations according to the agreed-upon protocol. Relying on centralized platforms or third-party institutions for judgment introduces an additional reliance on trust in those platforms or institutions, and may lead to inconsistent processing standards and lengthy processing cycles.
[0005] To improve the traceability of the computation process, some existing technologies store privacy-preserving computation task information, participant identities, computation result summaries, or operation log summaries on the blockchain. However, on-chain storage of summaries typically only proves that the relevant information existed at a specific time; it is difficult to directly prove what kind of violation a participant committed, nor can it enable smart contracts to automatically complete attack determination based on clear and verifiable attack evidence. If only the final result or a small number of summaries are recorded, there is a lack of complete correspondence between off-chain attack behavior and on-chain records. If computation logs, model parameters, message content, or other attack evidence are directly uploaded to the blockchain, it may leak original data, sensitive intermediate results, or participants' business information, while also increasing on-chain storage and computational overhead. Therefore, existing on-chain evidence storage mechanisms struggle to balance the sufficiency, verifiability, and privacy of attack evidence.
[0006] Furthermore, existing privacy-preserving computing security mechanisms typically focus on detecting attacks or halting tasks after an attack occurs, lacking a closed-loop mechanism that connects attack detection, evidence preservation, liability determination, and violation handling. Some solutions primarily employ post-incident accountability, reputation downgrades, or manual penalties, failing to establish quantifiable economic constraints on participants before the task begins, and failing to automatically execute corresponding actions based on verifiable attack evidence, thus keeping the cost of launching attacks low for malicious participants. For erroneous reports or disputed attack evidence, existing technologies often lack corresponding evidence verification and counter-evidence mechanisms, easily affecting the accuracy and impartiality of attack determination results.
[0007] Therefore, existing technologies struggle to reliably verify the protocol execution behavior of participants in privacy computing without disclosing raw data, plaintext model parameters, and sensitive intermediate results, and to effectively integrate attack detection, evidence preservation, liability determination, and automated handling. Establishing a closed-loop protection mechanism that spans privacy computing task registration, participant information commitment, computation round behavior recording, attack evidence verification, and economic constraint handling to improve the credibility and verifiability of attack evidence, reduce reliance on centralized arbitration, and increase the cost of malicious behavior for participants is a pressing technical problem in this field. Summary of the Invention
[0008] To address the shortcomings of existing technologies, embodiments of the present invention provide a method, device, and medium for protecting against malicious attacks on privacy computing based on blockchain.
[0009] In a first aspect, embodiments of the present invention provide a method for protecting against malicious attacks on privacy-preserving computing based on blockchain, the method comprising: Create a privacy computing task and register the task identifier, privacy computing protocol, attack detection rules, and margin rules into a blockchain smart contract; Participants register with the smart contract and submit a deposit, which is then locked by the smart contract. Participants generate a commitment value based on the task identifier, participant identifier, privacy computation input digest, execution code digest, and execution environment digest, and submit the commitment value to the smart contract; Participants perform privacy-preserving computations off-chain and generate behavioral record summaries and verifiable behavioral credentials to prove that they performed computations in accordance with the privacy-preserving computation protocol, according to the computation rounds. The verifier detects whether a participant violates the attack determination rules based on the behavior record summary and verifiable behavior credentials, and generates an attack evidence package when a violation of the attack determination rules is detected, and submits the attack evidence package to the smart contract. The smart contract verifies the attack evidence package based on the commitment value, behavior record summary and verifiable behavior credentials, and deducts the margin of the participant confirmed to have violated the attack judgment rules when the attack evidence package passes the verification. After the privacy computation task is completed, the smart contract releases the undeducted margin.
[0010] In a second aspect, embodiments of the present invention provide an electronic device, comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs that can be executed by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the above-described blockchain-based privacy computing malicious attack protection method.
[0011] Thirdly, embodiments of the present invention provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the aforementioned blockchain-based privacy computing malicious attack protection method.
[0012] Fourthly, embodiments of the present invention provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements the aforementioned blockchain-based privacy computing malicious attack protection method.
[0013] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention pre-registers task identifiers, privacy computation protocols, attack judgment rules, and margin rules into a blockchain smart contract, and locks participants' margins before the task begins, subjecting participants to pre-determined and automatically enforceable economic constraints. Simultaneously, a commitment value is generated based on the task identifier, participant identifier, privacy computation input digest, execution code digest, and execution environment digest. This commitment value is then combined with behavior record digests and verifiable behavior credentials generated according to computation rounds during off-chain privacy computation, linking the participant's task identity, inputs, and execution conditions to the actual computation behavior. This allows the verifier to detect violations and form an attack evidence package. The smart contract then verifies the attack evidence package based on the commitment value, behavior record digest, and verifiable behavior credentials. Upon successful verification, the margin of the violating participant is automatically deducted, and any undeducted margin is released upon task completion. This achieves verifiable detection, behavior tracing, and automatic handling of malicious attacks without requiring the original privacy computation inputs and the complete computation process to be recorded on the blockchain, increasing the cost of malicious behavior for participants and the credibility of attack protection, while also protecting privacy and the financial rights of legitimate participants. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 A flowchart illustrating a blockchain-based privacy computing malicious attack protection method provided in an embodiment of the present invention; Figure 2 This is a flowchart of the smart contract task status and margin status provided in an embodiment of the present invention; Figure 3 A flowchart of deposit forfeiture and credit update provided for embodiments of the present invention; Figure 4 This is a schematic diagram of the attack evidence packet structure provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] It should be noted that, unless otherwise specified, the features in the following embodiments and implementation methods can be combined with each other.
[0018] In this embodiment, the blockchain can be a consortium blockchain, a permissioned blockchain, or other distributed ledger that supports smart contracts. Privacy-preserving computation can be federated learning, multi-party secure computation, trusted execution environment computation, homomorphic cryptographic computation, or a combination of the above. Hash operations can use SHA-256, SM3, or other collision-resistant hash algorithms; digital signatures can use signature algorithms based on elliptic curve cryptography, SM2, or other public-key cryptosystems. The following description uses a consortium blockchain and federated learning tasks as examples, but the invention is not limited to this specific implementation.
[0019] The entities participating in this method include at least a task initiator, two or more participants, a validator, and a smart contract deployed in the blockchain network. The task initiator configures the task; participants register, submit security deposits, form commitments, and perform off-chain privacy computations; the validator detects participant behavior and generates attack evidence packages; the smart contract stores task and participant states, verifies evidence, and deducts or releases security deposits. Aggregators, blockchain nodes, or task initiators can all act as validators after identity verification.
[0020] like Figure 1 As shown, this embodiment of the invention provides a method for protecting against malicious attacks on privacy-preserving computing based on blockchain. The method includes: Step S1: Create a privacy computing task and register the task identifier, privacy computing protocol, attack determination rules, and security deposit rules into the blockchain smart contract.
[0021] Specifically, the task initiator generates a task random number and, based on the initiator's public key, task creation time, task random number, and privacy computing service identifier, generates a unique task identifier (sid). The task identifier, privacy computing protocol, attack detection rules, and security deposit rules are then registered in a smart contract. After verifying that the task identifier is not already in use and that the rule parameters are in the correct format, the smart contract generates the corresponding task record and sets the task status to "pending registration."
[0022] For example, attack determination rules can be registered in the form of a combination of rule number and rule parameters. For example, rule R1 indicates that the evidence item submitted by a participant is inconsistent with its commitment value; rule R2 indicates that the same participant signs contradictory message digests in the same round; rule R3 indicates that a participant fails to submit the message or credential required by the protocol within the specified time limit; and rule R4 indicates that the verification of verifiable behavioral credentials fails.
[0023] In step S2, the participant registers with the smart contract and submits a deposit, which is then locked by the smart contract.
[0024] Furthermore, such as Figure 2 As shown, the i-th participant uses their private key to sign the registration request, which includes the sid, participant's public key, role, and registration time. After the smart contract verifies the signature, it uses the hash value of the participant's public key as the participant identifier. And read the task value parameter Participant role weight Data sensitivity level Agreement risk level Participant's historical reputation score and the number of violations by participants The expression for calculating the margin submitted by participants to the smart contract is as follows: In the formula, This represents the margin submitted by the i-th participant to the smart contract. For the minimum margin, Let be the task value parameter corresponding to the t-th privacy computation task. Let i be the role weight of the i-th participant. Let t be the data sensitivity level corresponding to the t-th privacy computing task. Let t be the protocol risk level corresponding to the t-th privacy computing task. Let i be the historical reputation value of the i-th participant. Let represent the number of historical violations by the i-th participant, and α, β, γ, δ, ε, and ζ are preset weight parameters.
[0025] Furthermore, the higher the task value, data sensitivity, agreement risk, and historical number of violations, the higher the calculated margin; the higher the historical credit score, the higher the margin. The lower the additional margin required for the item.
[0026] As a concrete calculation example, let... =100, =4, =1.2, =0.8, =0.7, =0.9, =1, and α=40, β=20, γ=30, δ=30, ε=80, ζ=15, then the weighted result is 252, therefore =252 minimum margin units. After a participant transfers 252 units to the margin contract, the smart contract records their margin balance as 252 and sets the participant's margin status to locked. If the amount received is less than... If the condition is not met, the participant will remain in a locked state and will be prohibited from proceeding to subsequent calculation steps.
[0027] It should be noted that this invention pre-registers the task identifier, privacy computing protocol, attack judgment rules, and deposit rules into the blockchain smart contract, locks the participant's deposit before the task begins, automatically deducts the deposit after the attack evidence is verified, and releases the undeducted portion after the task is completed. This forms an on-chain closed loop covering task access, execution supervision, violation handling, and task termination, enabling participants to bear definite economic constraints before committing malicious acts, increasing the cost of wrongdoing, and reducing reliance on manual accountability and manual asset disposal.
[0028] In step S3, the participant generates a commitment value based on the task identifier, participant identifier, privacy computation input digest, execution code digest, and execution environment digest, and submits the commitment value to the smart contract.
[0029] Specifically, each participant first normalizes and encodes the data, model, algorithm, or parameters to be used in privacy-preserving computation. Normalization can specify field order, field length, numerical precision, character encoding, and version number to avoid different digests for the same content due to encoding differences. Participants then hash the normalized privacy-preserving computation input with a salt value stored only locally to obtain a data digest or a data commitment digest. Hash the model, algorithm, or parameter configuration to obtain a digest of the privacy computation input. Hash the executable program, dependent libraries, and configuration manifest to obtain the executable code digest. Hash the runtime environment, container image, or trusted execution environment certificate to obtain the execution environment digest. .
[0030] Furthermore, the participant generates the following expression for the commitment value based on the task identifier, participant identifier, privacy computation input digest, execution code digest, and execution environment digest: In the formula, the symbol "||" indicates concatenation according to a predetermined field order, and sid is the task identifier. Let i be the identifier of the i-th participant. For the role of the i-th participant, For the data summary or data commitment summary of the i-th participant, Enter a digest for privacy computing. To execute the code digest, Summary for Trusted Execution Environment is a random number generated for the i-th participant.
[0031] in, It can be a 256-bit random number generated by a cryptographically secure random number generator, used to prevent the same input from forming correlated commitment values in different tasks.
[0032] In step S4, participants perform privacy-preserving computation off-chain and generate a summary of behavior records and verifiable behavioral credentials to prove that they performed computation in accordance with the privacy-preserving computation protocol, according to the computation round.
[0033] Once all participants' deposits are locked and their commitments are registered, the smart contract sets the task status to "in computation." Participants then perform computations off-chain according to the registered privacy computation protocol. In the r-th computation round, each recorded action includes the task identifier sid and the participant identifier. The system includes round number (r), behavior type, sequence number, and behavior content summary to prevent records from being replaced for different tasks, participants, or rounds.
[0034] Participants can each generate a message digest h. send Receive message digest h recv Challenge Response Summary h challenge Execution Log Summary h log and local proof summary h proof Each leaf node can be accessed by pressing l. x =Hash(sid||pid i ||r||type x ||seq x ||h x ) generated, where type x Used to indicate the record type, seq x This is used to indicate the order of records of this type in this round. Subsequently, participants select at least two items from the five types of summaries mentioned above to construct a Merkle tree. In this embodiment, all five items are selected; when the number of leaf nodes is odd, the last leaf node can be copied or the next level of nodes can be formed according to a preset padding rule. Finally, the root record of the behavior of the i-th participant in round r is obtained. .
[0035] Participant's task identifier sid, participant identifier r and Sign the record and submit the behavior record root and signature to the smart contract within the preset submission deadline after the end of this round. The complete behavior record continues to be stored off-chain; for any piece of evidence to be verified, the participant or verifier only needs to provide the evidence and the Merkle path consisting of the summary of adjacent nodes at the same level and the left and right position information to prove that the evidence belongs to the registered behavior record root.
[0036] Verifiable behavioral credentials Used to prove that participants performed computations in accordance with the privacy computing protocol. This can be zero-knowledge proofs, remote proofs in trusted execution environments, threshold signatures, message authentication code verification results, aggregate signatures, or verifiable computational proofs. For example, in federated learning tasks, It can provide a zero-knowledge proof that the norm of a vector lies within a predetermined interval, without disclosing the model update vector; in trusted execution environment tasks. It can be a remote proof containing a digest of the executable code and a digest of the execution environment. The verifiable behavioral credential itself or its digest is recorded along with the corresponding round.
[0037] Step S5: The verifier detects whether the participant violates the attack judgment rules based on the behavior record summary and verifiable behavior credentials, and generates an attack evidence package when a violation of the attack judgment rules is detected, and submits the attack evidence package to the smart contract.
[0038] The verifier reads the task rules, participant commitment values, and action record roots from the blockchain, and receives the evidence items to be verified and verifiable action credentials that can be obtained according to task permissions from the off-chain execution platform. The verifier performs commitment consistency checks, round and order checks, message integrity checks, timeout checks, and credential checks item by item.
[0039] For example, if the verifier receives valid signatures for two mutually exclusive output digests from the same pid_i for the same sid and the same round, the verifier determines that there is a suspected double submission based on rule R2; if the necessary message is still missing and a valid proof of non-attribution cannot be provided by the deadline, the verifier determines that there is a suspected refusal to execute based on rule R3.
[0040] like Figure 4 As shown, upon detecting suspected violations, the verifying party generates an attack evidence package E. The attack evidence package includes at least the task identifier sid and the reported participant identifier pid. i Attack type (type), calculation round (r), evidence item to be verified (e), Merkle path corresponding to the evidence item to be verified (path), verifiable behavioral credential (π) i Verifier's signature σ v And a timestamp t. For ease of verification, the attack evidence package may also include a summary h of the evidence item to be verified. e The rules include the rule number, credential verification parameter identifier, and evidence version number. The verifying party verifies the attack evidence packet excluding σ. v After normalizing and encoding the fields other than E, sign it, and then submit E to the smart contract.
[0041] It should be noted that this invention constructs at least two of the sent message digest, received message digest, challenge response digest, execution log digest, and local proof digest from the computation rounds into a Merkle tree, and sets the evidence items to be verified and their Merkle paths in the attack evidence package, enabling smart contracts to verify that the evidence items do indeed belong to the corresponding computation rounds without retrieving the complete behavior records; combined with multiple verifications of signature, timestamp, commitment consistency, Merkle path, verifiable behavior credentials, and attack judgment rules, it is beneficial to identify forged, tampered, replayed, or inconsistent evidence with the task commitment, thereby improving the integrity and credibility of the attack evidence package.
[0042] In step S6, the smart contract verifies the attack evidence package based on the commitment value, behavior record summary, and verifiable behavior credentials. When the attack evidence package passes the verification, the contract deducts the margin of the participant confirmed to have violated the attack judgment rules in accordance with the margin rules.
[0043] The smart contract verifies the attack evidence package according to the following formula: In the formula, E represents the attack evidence package. This represents the signature of the verifier, and t represents the timestamp. This indicates the commitment value of the reported participant. This represents a summary of the evidence item, and path represents the Merkle path corresponding to the evidence item. This represents the root of the behavior record submitted by participant i in round r. This indicates a verifiable credential or reverse proof; `type` indicates the attack type; `rule` indicates the attack determination rule corresponding to the attack type; `VerSig` indicates signature verification, used to verify the signature based on the registered verifier's public key. The verification process confirms that the verifier has the authority to verify this task; VerTime indicates time verification, used to confirm that the timestamp t is within the evidence submission deadline of the corresponding round; VerCommit indicates commitment consistency verification, used to confirm the summary of the evidence item to be verified. The commitment value of the reported participant It exhibits consistency, for example, through commitment to open values or zero-knowledge consistency proofs; VerPath represents Merkle path verification, used to compute node summaries layer by layer along the Merkle path and confirm that the final result is equal to the root of the behavior record submitted by the i-th participant in round r. VerProof represents credential verification, used to call the corresponding verification function according to the credential type. VerRule indicates attack determination rule verification, used to confirm that the factual conditions corresponding to the type meet the attack determination rules registered when the task was created.
[0044] When all checks pass, the attack evidence package is deemed valid. Specifically, the smart contract can execute checks in the order of VerSig, VerTime, VerPath, VerCommit, VerProof, and VerRule, or execute checks that do not have dependencies on each other in parallel. Verify(E) only returns true when all checks return true, and the attack evidence package passes the initial verification. If any check returns false, the contract records the failure and its code, rejects the attack evidence package, and does not deduct the margin of the reported participant.
[0045] Furthermore, such as Figure 5 As shown, the process of deducting the deposit of a participant confirmed to have violated the attack determination rules, according to the deposit rules, includes: In the formula, This represents the amount of the penalty imposed on the i-th participant. This represents the current locked margin balance of the i-th participant. The penalty percentage corresponds to the type of attack. Let be the estimated task loss value corresponding to the t-th privacy computation task. Let μ be the number of historical violations by the i-th participant, and μ and ν be the preset weights.
[0046] As a concrete example, let's say =300, =0.3, =100, =1, μ=0.4, ν=10, then =min(300, 90+40+10) = 140 minimum margin units. Smart contracts from 140 units will be deducted, and the remaining locked balance will be updated to 160 units. For on-chain assets priced in integers, the processing method of rounding up, rounding down, or truncating to the smallest unit of pricing can be pre-defined in the task rules.
[0047] The deducted margin can be transferred to the affected participant's account, task compensation account, validator account, or destruction address according to the allocation rules registered when the task was created. This allocation operation can be completed in the same on-chain transaction as the confiscation status update; if any asset transfer fails, the entire transaction is rolled back to avoid a situation where the status is confirmed but the margin balance is not updated synchronously.
[0048] It should be noted that this invention determines the security deposit based on the task value, participant role, data sensitivity level, protocol risk level, historical reputation, and number of historical violations, and determines the penalty amount in combination with the attack type, task loss, and historical violation situation. This ensures that the economic constraint strength matches the task risk and potential loss, while making repeat offenders bear higher subsequent participation costs, thereby enhancing the adaptability and continuous constraint capability of the protection mechanism for different tasks and different participants.
[0049] Step S7: After the privacy computation task is completed, the smart contract releases the undeducted margin.
[0050] Specifically, after the privacy computation is completed, the task initiator or execution platform submits a result summary and a task completion request. The smart contract verifies that all preset rounds have ended, the result summary has been registered, the evidence submission deadline has passed, and there are no disputed attack evidence packages. Then, it sets the task status to "completed" and releases the remaining security deposits of each participant. For the violating participant in the example above, the released amount is the remaining 160 units after deduction; for participants not confirmed to have violated the rules, all remaining locked security deposits are released.
[0051] Example 1: Protection against model update attacks in federated learning scenarios This embodiment includes one aggregator and four data holders P1 to P4. Each data holder trains the same model locally and submits model updates in 20 training rounds. Upon task creation, the submission deadline for each round of updates, the dimension of the update vector, the upper limit of the allowed norm, the zero-knowledge proof verification parameters, the anomaly detection rules, and the margin rules are registered to the smart contract. Each data holder completes registration, margin locking, and generates a commitment value bound to the local data summary, the initial model summary, the training code summary, and the execution environment summary according to step S103.
[0052] In the r-th training round, the data holder Pi forms the model update vector. It makes an update commitment to the vector and the random number in this round, and generates a zero-knowledge proof to prove that the updated vector has the correct dimension and that its norm does not exceed a preset upper limit. Pi will send a message digest, a reception confirmation digest returned by the aggregator, a challenge response digest for this round, a training log digest, and... The summary is constructed as a Merkle tree, and the behavior records are rooted. Submit to the smart contract. The aggregator only accepts model updates that have passed the local credential pre-check.
[0053] Suppose that the model update sent by P3 to the aggregator in round 8 is inconsistent with its registered update commitment. The verifier obtains the evidence item to be verified from the message sent in this round, P3's signature, the corresponding Merkle path, and a zero-knowledge proof that can prove the commitment inconsistency, generating an attack evidence package E with the attack type "commitment inconsistency". The smart contract sequentially confirms the validity of the verifier's signature, that the evidence is within the submission deadline, and that the evidence item belongs to... The zero-knowledge proof is valid and the condition of rule R1 is met, thus Verify(E) returns to true and enters the dispute period.
[0054] If P3 fails to submit counter-evidence that overturns the aforementioned consensus conclusion within the dispute period, the smart contract calculates and deducts P3's margin according to step S107. The aggregator discards P3's model update in round 8 based on the on-chain confirmation result, aggregating only the valid updates from P1, P2, and P4, or re-executes round 8 from the trusted checkpoint saved in round 7. Throughout the evidence verification process, the model update vector... It is not written into the blockchain in plaintext.
[0055] Example 2: Dual Submission Protection in Multi-Party Secure Computation Scenarios In a multi-party secure computation task, participants exchange computational fragments in a secret sharing manner. For the same round and the same receiver, each sent fragment contains an SID, sender identifier, receiver identifier, round number, sequence number, fragment digest, and sender signature. Participants construct a Merkle tree from the sent message digest, received message digest, and local proof digest, and submit the corresponding action record root.
[0056] If the same participant signs two different shard digests for the same round and sequence number, the two recipients can provide their respective received signature messages to the verifier. The verifier uses the two contradictory signature messages as evidence to be verified, attaching their respective Merkle paths, threshold confirmation credentials, and timestamps to form a double-submit attack evidence package. After the smart contract confirms that both signatures originate from the reported participant, both evidence items belong to the corresponding round's behavior record root, and their shard digests are different, it confirms the violation according to the double-submit rule and executes dispute resolution and deduction of the security deposit.
[0057] In summary, this invention provides a blockchain-based method for protecting against malicious attacks on privacy computing. By pre-registering task identifiers, privacy computing protocols, attack judgment rules, and security deposit rules into a blockchain smart contract, and locking participants' security deposits before the task begins, participants are subject to pre-determined and automatically enforceable economic constraints. Simultaneously, a commitment value is generated based on the task identifier, participant identifier, privacy computing input digest, execution code digest, and execution environment digest. Combined with behavior record digests and verifiable behavior credentials generated according to the computation rounds during off-chain privacy computing, the participant's task identity, input, and execution conditions are associated with the actual computation behavior. This allows the verifier to detect violations and form an attack evidence package. The smart contract then verifies the attack evidence package based on the commitment value, behavior record digest, and verifiable behavior credentials. Upon successful verification, the security deposit of the violating participant is automatically deducted, and any undeducted security deposit is released upon task completion. This achieves verifiable detection, behavior tracing, and automatic handling of malicious attacks without requiring the original privacy computing inputs and the complete computation process to be recorded on the blockchain, increasing the cost of malicious behavior for participants and the credibility of attack protection, while also protecting privacy and the financial rights of legitimate participants.
[0058] Accordingly, this application also provides an electronic device, including: one or more processors; a memory for storing one or more programs; and when the one or more programs are executed by the one or more processors, causing the one or more processors to implement the blockchain-based privacy computing malicious attack protection method described above. Figure 5 The diagram shown illustrates a hardware structure of any data processing-capable device for implementing the blockchain-based privacy computing malicious attack protection method provided in this embodiment of the invention. (Except for...) Figure 5 In addition to the processor, memory, and network interface shown, any data processing device in the embodiment may also include other hardware depending on the actual function of the data processing device, which will not be described in detail here.
[0059] Accordingly, this application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the aforementioned blockchain-based privacy computing malicious attack protection method. The computer-readable storage medium can be an internal storage unit of any data processing device as described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units of any data processing device and external storage devices. The computer-readable storage medium is used to store the computer program and other programs and data required by the data processing device, and can also be used to temporarily store data that has been output or will be output.
[0060] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only.
[0061] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A method for protecting against malicious attacks on privacy-preserving computing based on blockchain, characterized in that, The method includes: Create a privacy computing task and register the task identifier, privacy computing protocol, attack detection rules, and margin rules into a blockchain smart contract; Participants register with the smart contract and submit a deposit, which is then locked by the smart contract. Participants generate a commitment value based on the task identifier, participant identifier, privacy computation input digest, execution code digest, and execution environment digest, and submit the commitment value to the smart contract; Participants perform privacy-preserving computations off-chain and generate behavioral record summaries and verifiable behavioral credentials to prove that they performed computations in accordance with the privacy-preserving computation protocol, according to the computation rounds. The verifier detects whether a participant violates the attack determination rules based on the behavior record summary and verifiable behavior credentials, and generates an attack evidence package when a violation of the attack determination rules is detected, and submits the attack evidence package to the smart contract. The smart contract verifies the attack evidence package based on the commitment value, behavior record summary and verifiable behavior credentials, and deducts the margin of the participant confirmed to have violated the attack judgment rules when the attack evidence package passes the verification. After the privacy computation task is completed, the smart contract releases the undeducted margin.
2. The method for protecting against malicious attacks on blockchain-based privacy computing according to claim 1, characterized in that, The process of participants submitting margin to the smart contract includes: ; In the formula, This represents the margin submitted by the i-th participant to the smart contract. For the minimum margin, Let be the task value parameter corresponding to the t-th privacy computation task. Let i be the role weight of the i-th participant. Let t be the data sensitivity level corresponding to the t-th privacy computing task. Let t be the protocol risk level corresponding to the t-th privacy computing task. Let i be the historical reputation value of the i-th participant. Let represent the number of historical violations by the i-th participant, and α, β, γ, δ, ε, and ζ are preset weight parameters.
3. The method for protecting against malicious attacks on blockchain-based privacy computing according to claim 1, characterized in that, The process by which participants generate a commitment value based on the task identifier, participant identifier, privacy computation input digest, execution code digest, and execution environment digest includes: ; In the formula, sid is the task identifier. Let i be the identifier of the i-th participant. For the role of the i-th participant, For the data summary or data commitment summary of the i-th participant, Enter a digest for privacy computing. To execute the code digest, Summary for Trusted Execution Environment is a random number generated for the i-th participant.
4. The method for protecting against malicious attacks on blockchain-based privacy computing according to claim 1, characterized in that, The behavior record summary is generated by constructing a Merkle tree from at least two of the following in each computation round: sent message summary, received message summary, challenge response summary, execution log summary, and local proof summary; The attack evidence package includes evidence items to be verified and a Merkle path used to prove that the evidence items to be verified belong to the corresponding behavior record digest.
5. The method for protecting against malicious attacks on blockchain-based privacy computing according to claim 4, characterized in that, The attack evidence package includes a task identifier, the identifier of the reported participant, the attack type, the calculation round, the evidence item to be verified, the Merkle path, the verifiable behavior credential, the verifier's signature, and the timestamp. The smart contract verifies the verifier's signature, timestamp, consistency between the evidence item to be verified and the promised value, the Merkle path, and the verifiable behavior credential. After the verification is passed, it enters the dispute period to receive the counter-evidence submitted by the reported participant.
6. The method for protecting against malicious attacks on blockchain-based privacy computing according to claim 1, characterized in that, The smart contract verifies the attack evidence package according to the following formula: ; In the formula, E represents the attack evidence package. This represents the signature of the verifier, and t represents the timestamp. This indicates the commitment value of the reported participant. This represents a summary of the evidence item, and path represents the Merkle path corresponding to the evidence item. This represents the root of the behavior record submitted by participant i in round r. This indicates a verifiable credential or reverse proof; type indicates the attack type; rule indicates the attack determination rule corresponding to the attack type; VerSig indicates signature verification; VerTime indicates time verification; VerCommit indicates commitment consistency verification; VerPath indicates Merkle path verification; VerProof indicates credential verification; VerRule indicates attack determination rule verification. When all verifications pass, the attack evidence packet is deemed to have passed verification.
7. The method for protecting against malicious attacks on blockchain-based privacy computing according to claim 1, characterized in that, The process of deducting the margin of participants confirmed to have violated the attack detection rules, according to the margin rules, includes: ; In the formula, This represents the amount of the penalty imposed on the i-th participant. This represents the current locked margin balance of the i-th participant. The penalty percentage corresponds to the type of attack. Let be the estimated task loss value corresponding to the t-th privacy computation task. Let μ be the number of historical violations by the i-th participant, and μ and ν be the preset weights.
8. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs that can be executed by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to perform the blockchain-based privacy computing malicious attack protection method as described in any one of claims 1-7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the blockchain-based privacy computing malicious attack protection method as described in any one of claims 1-7.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the blockchain-based privacy computing malicious attack protection method as described in any one of claims 1-7.
