Safe and reliable cryptocurrency transaction fraud detection model design method under hybrid block chain
By adopting a hybrid blockchain architecture and an adaptive privacy budget differential privacy method in the federated learning framework supported by blockchain, the problems of blockchain storage consumption and privacy protection are solved, and the security and reliability of the cryptocurrency transaction fraud detection process is achieved.
Patent Information
- Application Number
- CN202411760448.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-03
AI Technical Summary
Under the federated learning framework supported by blockchain, how to reduce the storage consumption of blockchain without sacrificing decentralization, ensure the security and reliability of the cryptocurrency transaction fraud detection process, and build a model with privacy protection functions.
Adopting a hybrid blockchain architecture, through the combination of public blockchain and consortium blockchain, a light-weight hybrid blockchain cryptocurrency transaction fraud detection model is built. The specific steps include public blockchain participants training local models and sending hash values to consortium blockchain, consortium blockchain validates and summarizes local models, and patching the model training fingerprint after reaching a consensus. At the same time, differential privacy methods for adaptive privacy budgets and sensitivity calculations are designed to defend against information inference attacks.
It realizes that without sacrificing decentralization, reduces blockchain storage consumption, improves the security and reliability of transaction detection processes, and effectively defends against information reasoning attacks, and protects the privacy of transaction participants.
Smart Images

Figure CN119741021A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a safe and reliable cryptocurrency transaction fraud detection model design method under a hybrid blockchain, and belongs to the technical field of blockchain. Background Art
[0002] With the development of blockchain technology, cryptocurrency has received more and more attention. At the same time, cryptocurrency transaction fraud activities have become more rampant and complex, such as phishing scams, Ponzi schemes, etc. In order to effectively detect forged cryptocurrency transactions, regulators must collect transaction records between users. However, in order to defend against deanonymization attacks, the existing privacy-preserving payment mechanism also prevents regulators from collecting transaction records for transaction fraud detection. However, users will save their original transaction records locally, which allows us to collaboratively train cryptocurrency transaction fraud detection models by using Federated Learning (FL).
[0003] The traditional federated learning framework aggregates local models in a centralized manner, which leads to single point failure. Due to the decentralized, tamper-proof, and traceable characteristics of blockchain, some studies have integrated federated learning with blockchain to address the above shortcomings. In this framework, each user trains a local model based on his or her own data and sends the local model to the blockchain. After aggregating the received models, the blockchain broadcasts the global model to the user and rewards them. At the same time, the blockchain stores the global model and the local model in each block, providing an opportunity to track and punish attackers. However, there are two challenges in building a fraud detection model for cryptocurrency transactions with privacy protection.
[0004] First, blockchains can be divided into public blockchains and consortium blockchains. Some studies have proposed FL that supports public blockchains. However, methods based on public blockchains are open and transparent. They will provide vulnerabilities for attackers to obscure the supervision of smart contracts or launch information reasoning attacks. Saving local models in public databases will also take up a lot of storage space. In order to protect privacy and reduce the time consumption of reaching consensus, some studies have proposed a blockchain-based consortium FL framework. However, methods based on consortium blockchains are partially decentralized, which can authorize privileged nodes to maliciously change the content of the blockchain, potentially damaging the interests of other nodes. Therefore, in the blockchain-supported FL framework, it is a challenge to reduce storage consumption and ensure security and reliability without sacrificing decentralization.
[0005] Secondly, although FL can build a fraud detection model while keeping data locally, the uploaded local model still has privacy leakage vulnerabilities. Some studies use differential privacy (DP) to defend against the above attacks. DP-based methods usually require a good trade-off between fraud detection model performance and privacy budget. Good privacy protection performance will seriously affect the detection performance. Existing adaptive differential privacy algorithms can add different degrees of noise according to the value range of local model parameters. However, it ignores the heterogeneous risks of different attacks and the impact of gradient similarity on the privacy budget, sacrificing detection performance while protecting privacy. Therefore, it is necessary to consider the similarity and heterogeneous risks of different inference attacks and design a more fine-grained DP method. Summary of the invention
[0006] The purpose of the present invention is to reduce the storage consumption of blockchain and ensure the security and reliability of the transaction detection process under the federated learning framework that supports blockchain without sacrificing decentralization, thereby building a safe and reliable cryptocurrency transaction fraud detection model with privacy protection function.
[0007] In order to achieve the above object, the technical solution of the present invention is to disclose a method for designing a secure and reliable cryptocurrency transaction fraud detection model under a hybrid blockchain, which is characterized by comprising the following steps:
[0008] Step 1: Build a lightweight hybrid blockchain cryptocurrency transaction fraud detection model based on federated learning, including the following steps:
[0009] Step 101, the public blockchain participant trains its local model based on the global model and local data;
[0010] Step 102: Some ordinary users of the public blockchain are selected as committee members. The public blockchain participants calculate the hash value of the local model and send it to the current committee and the alliance blockchain.
[0011] Step 103: The alliance blockchain participants verify and summarize the local model and calculate the participant c i Credibility score Credibility Rating Participants with high,values are more trustworthy, and the global model is obtained by,aggregating verified local models;
[0012] Step 104: When the alliance blockchain participants reach a consensus, the model training fingerprint is patched in the alliance blockchain;
[0013] Step 105: The alliance blockchain participant selects a bookkeeping node of the public blockchain from the committee members and sends the global model to the node;
[0014] Step 106: After the committee members reach a consensus, the accounting node patches the hash value of the local model and the global model into the public blockchain;
[0015] Step 107: The public blockchain participant obtains the global model from the public chain and starts the next round of local model training;
[0016] Step 2: Based on the user credibility score, a consensus mechanism based on a lightweight hybrid blockchain is proposed, which includes the following steps:
[0017] Step 201: For the kth round of federated learning, the participants of the previous round of public blockchain automatically become the consensus committee C = {c 1 ,c 2 ,…,c n}, where n represents the number of committee members;
[0018] Step 202: The participants in this round train their local models based on the global model and local data;
[0019] Step 203: The participants in this round calculate the hash value of the local model and send the local model and its hash value to the alliance chain;
[0020] Step 204: The consortium chain calculates the credibility score of each participant
[0021]
[0022] Among them, TOA (c j ) for participant c j The local model time offset accumulation;
[0023] Step 205: After the alliance chain reaches a consensus, the accounting node generates a hash value β and a VRF proof π using a verifiable random function based on the hash value and the private key. The accounting node of the public blockchain is selected based on the credibility score of the committee members. Participants with better scores have a higher probability of becoming accounting nodes.
[0024] Step 206: The consortium chain sends the hash value β, VRF proof π, and the selection of the accounting node to the committee members;
[0025] Step 207, once the selection of the accounting node is verified by the committee members, the accounting node patches the block into the public blockchain;
[0026] Step 3: Based on gradient similarity and attack heterogeneity, a differential privacy method with adaptive privacy budget and sensitivity calculation is designed.
[0027] Preferably, in step 1, a hybrid blockchain is composed of a public blockchain and a consortium blockchain; in the hybrid blockchain, the public blockchain is composed of some ordinary nodes, and the consortium blockchain is composed of some authoritative institutions.
[0028] Preferably, for a lightweight hybrid blockchain, a lightweight public blockchain that only retains the hash value of the local model is designed under the hybrid blockchain framework based on federated learning. The difference between the block structure of the public blockchain and the alliance blockchain is that the public blockchain only stores the hash value of the local model, while the alliance blockchain stores not only the hash value of the local model, but also the model parameters of the local model, where:
[0029] Public blockchains store some public or anonymized data, run some smart contracts without privacy concerns, and provide some basic reliable services to supervise consortium blockchains;
[0030] Consortium blockchains store private data and run some complex or security-based smart contracts.
[0031] Preferably, in step 1, the public blockchain includes miners and accounting nodes: the accounting node receives and saves the hash value of the local model and the global model sent by the alliance chain; the miner is responsible for training the model based on the received global model and local data and uploading the local model and its hash value to the alliance chain;
[0032] The alliance blockchain includes ordinary clients and accounting nodes: ordinary clients receive local models and their hash values, verify uploaded local model parameters, and calculate credit points; accounting nodes: ledger applications that record credit values, reward values, and detection fees, and are responsible for issuing rewards and collecting fraud detection fees, and storing local model parameters.
[0033] Preferably, in step 205, the selection of the accounting node depends on the credibility score of the committee members, so each participant c i Credibility score Calculate the selection probability P s (c i ):
[0034]
[0035] For each participant c i , corresponding to [0,2 L ) is a subinterval SI i ,have:
[0036]
[0037] Where L represents the number of bits of the hash value β. If β falls within the subinterval SI i , then the corresponding participant ci Will be selected as the accounting node of the public blockchain.
[0038] Preferably, in step 3, a differential privacy method with adaptive privacy budget is used to defend against DLG and MIA attacks, wherein:
[0039] For the DLG attack, the privacy budget of user i in the tth round of local training is adaptively changed according to the model gradient as follows:
[0040]
[0041] Where, ε represents the predefined privacy budget, represents the privacy budget of user i against DLG attack in the tth round of communication, represents the model gradient of user i in round t, |||| 2 The symbol represents the Euclidean norm;
[0042] The privacy budget for MIA attacks can be adaptively changed as follows:
[0043]
[0044] In the formula, var() is the variance operation, represents the privacy budget of user i against MIA attack in the tth round of communication, Represents a tuple based on x m Predictions of fraud detection models;
[0045] Adaptively change the privacy budget of the i-th participant in round t to defend against DLG and MIA attacks as follows:
[0046]
[0047] in, represents the privacy budget of user i in the tth round of communication.
[0048] Preferably, in step 3, based on the adaptive privacy budget allocation and sensitivity calculation method, a cryptocurrency transaction fraud detection model under the federated learning framework based on the hybrid blockchain is constructed, including the following steps:
[0049] The alliance blockchain initializes the global transaction fraud detection model;
[0050] Participants collaboratively train the global fraud detection model by using adaptive privacy budget allocation and adaptive sensitivity calculation, which specifically includes the following steps: each participant obtains the local model gradient according to the global transaction fraud detection model; each participant calculates the noise scale of the bias and weight gradients; after obtaining the noise scale, each participant calculates a new gradient with adaptive noise, and each participant updates the local model using the gradient descent method according to the new gradient; after each participant sends its local model to the consortium blockchain, the global model is updated and patched using the federated learning framework based on the hybrid blockchain; the hybrid blockchain synchronizes the global model to other participants; when the maximum number of global rounds is reached, the training process stops and outputs the final cryptocurrency transaction fraud detection model.
[0051] Preferably, in step 3, the noise scale of the weight gradient between the i-th input and the j-th output of the k-th layer is defined as Then we have:
[0052]
[0053] is the noise scale of the weight gradient between the i-th input and j-th output of the k-th layer for the R-gap attack:
[0054]
[0055] Where ε is the privacy budget, is the loss function, represents the bias of the jth output of the kth layer, |||| 1 represents the Manhattan norm;
[0056] is the noise scale of the Laplace mechanism of the kth layer in the tth round:
[0057]
[0058] In the formula, is the sensitivity of the tth round to the kth layer represents the gradient of the kth layer in the tth round, represents the privacy budget of user i in the tth round of communication.
[0059] Preferably, in step 3, each participant calculates a new gradient with adaptive noise using the following formula:
[0060] The new weight gradient between the i-th input and j-th output of the k-th layer is calculated as:
[0061]
[0062] Wherein, Lap() represents the Laplace mechanism.
[0063] The new gradient of the bias of the kth layer at the tth round is calculated as:
[0064] Compared with the prior art solutions, the technical solution disclosed in the present invention has the following effects:
[0065] The hybrid blockchain model can improve throughput and reduce memory usage. It can also defend against information inference attacks through adaptive privacy allocation and sensitivity calculation, ensuring that the privacy of transaction participants is not leaked while reducing the performance loss of fraud detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 A schematic diagram showing a flow chart of a design of a secure and reliable cryptocurrency transaction fraud detection model under a hybrid blockchain disclosed in an embodiment of the present invention;
[0067] Figure 2 Shown is a system framework of a federated learning model based on a hybrid blockchain in one embodiment of the present invention;
[0068] Figure 3 Shown is the block structure of a public blockchain in a hybrid blockchain in one embodiment of the present invention;
[0069] Figure 4 Shown is the block structure of the alliance blockchain in the hybrid blockchain in one embodiment of the present invention;
[0070] Figure 5 Shown is a schematic diagram of a public blockchain consensus mechanism within a hybrid blockchain in one embodiment of the present invention. DETAILED DESCRIPTION
[0071] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the appended claims of the application equally.
[0072] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0073] like Figure 1 As shown, the present invention provides a design of a secure and reliable cryptocurrency transaction fraud detection model under a hybrid blockchain, and the steps are as follows:
[0074] Step 1: Build a lightweight hybrid blockchain cryptocurrency transaction fraud detection model based on federated learning.
[0075] Step 2: Based on the user credibility score, a consensus mechanism based on a lightweight hybrid blockchain is proposed.
[0076] Step 3: Based on gradient similarity and attack heterogeneity, a differential privacy method with adaptive privacy budget and sensitivity calculation is designed.
[0077] like Figure 2 As shown in the figure, the cube on the left represents each block in the public blockchain, and the cube on the right represents each block in the consortium blockchain. A hybrid blockchain consists of a public blockchain and a consortium blockchain. In a hybrid blockchain, the public blockchain consists of some ordinary nodes, such as cryptocurrency users; the consortium blockchain consists of some authoritative institutions, such as the country's banking regulatory committee, cryptocurrency trading platforms, and banks.
[0078] In the embodiment of the present invention, step 1 constructs a federated learning fraud detection framework integrating the public chain and the alliance chain, and further includes the following steps:
[0079] Step 101: Public blockchain participants train their local models based on the global model and local data.
[0080] Step 102: Some ordinary users of the public blockchain will be selected as committee members. The public blockchain participants calculate the hash value of the local model and send it to the current committee and the alliance blockchain.
[0081] Step 103: The participants of the alliance blockchain verify and summarize the local model and calculate the corresponding credibility score. Participants with high credibility scores are more trustworthy. To represent participant c i The global model is obtained by aggregating the local models that have passed the validation.
[0082] Step 104. When the consortium blockchain participants reach a consensus, they will patch the model training fingerprint, such as the local model and credibility score, in the consortium blockchain.
[0083] Step 105: The alliance blockchain participant selects the accounting node of the public blockchain from the committee members and sends the global model to it.
[0084] Step 106: After the committee members reach a consensus, the accounting node patches the hash value of the local model and the global model into the public blockchain.
[0085] Step 107: Public blockchain participants obtain the global model from the public chain and start the next round of local model training.
[0086] Furthermore, in order to reduce the storage space consumption of ordinary users, the present invention designs a lightweight public blockchain that only retains the local model hash value under the hybrid blockchain framework based on federated learning. Specifically, the public blockchain stores some public or desensitized data and runs some smart contracts without privacy concerns, such as calculating model hashes. It mainly provides some basic reliable services to supervise the alliance blockchain. The alliance chain stores private data and runs some complex or security-based smart contracts, such as local models, model verification, reputation calculation, etc. In this way, the privacy of data and smart contracts can be maintained when building a fraud detection model, while reducing the congestion of the public chain and facilitating model training under the FL framework.
[0087] Figure 3 The block structure of the public blockchain is shown. In the blocks in the public blockchain, each block contains the hash of the previous block, forming a chain. The global model is shared through the public blockchain. The local model hashes (LMH) guarantee the correctness of the local model stored in the consortium chain. In this way, the public blockchain does not store the local model for each round of updates, saving the space consumption of the participants. The score distribution represents the credibility score of the public blockchain participants. The consortium chain uses VRF to select the accounting node according to the score distribution. VRF is a function that can be used to verify the validity of the output. Through the VRF proof, the public key of the accounting node in the consortium chain, and the score distribution, any participant can obtain the same VRF output to verify the selection of the accounting node. In addition, each block in the public blockchain also contains a timestamp, the number of training rounds, and a CoinBase (the CoinBase transaction is the first transaction in a new block, which rewards miners with newly generated cryptocurrency).
[0088] like Figure 4 As shown, each block in the alliance blockchain not only stores the model hash value of the received local model, but also stores the model parameters of the local model (LM), namely LM1-LM8.
[0089] In addition, the public chain contains miners and accounting nodes. The consortium chain contains ordinary clients and accounting nodes. In the public blockchain, the accounting node receives and saves the hash value of the local model and the global model sent by the consortium chain; the miner is responsible for training the model based on the received global model and local data and uploading the local model and its hash value to the consortium chain. In the consortium blockchain, the ordinary client receives the local model and its hash value, verifies the uploaded local model parameters, and calculates the reputation score; the accounting node: a ledger application that records the reputation value, reward value, and detection fee, and is responsible for the issuance of rewards and the collection of fraud detection fees, and stores the local model parameters.
[0090] The consensus mechanism plays a key role in maintaining the integrity and security of the blockchain system. The present invention uses the Replicated And Fault-Tolerant (RAFT) consensus algorithm in the consortium blockchain. For the public chain, the present invention proposes a consensus mechanism based on user credit scores.
[0091] like Figure 5 As shown, the public blockchain consensus mechanism based on the alliance chain in step 2 includes the following steps:
[0092] Step 201: For the kth round of FL, the participants of the previous round of public blockchain automatically become the consensus committee C = {c 1 ,c 2 ,…,c n}, where n represents the number of committee members.
[0093] Step 202: Participants in this round train their local models based on the global model and local data.
[0094] Step 203: The participants in this round calculate the hash value of the local model and send the local model and its hash value to the alliance chain.
[0095] Step 204: The consortium chain calculates the credibility score of each participant
[0096] Credibility Score The calculation formula is as follows:
[0097]
[0098] Among them, TOA (c j ) is participant c j The local model time offset accumulation (TOA) of the model. The higher the TOA value, the greater the possibility of malicious intent of the participant.
[0099] Step 205: After the alliance chain reaches a consensus, the accounting node generates a hash value β and a VRF proof π based on the hash value and the private key using VRF. Here, the accounting node of the public blockchain is selected based on the credibility score of the committee members. Participants with better scores have a higher probability of becoming accounting nodes. Therefore, the present invention selects the accounting nodes based on the credibility score of each participant c i Credibility score Define a selection probability P s (c i ).
[0100]
[0101] In the formula, ci Representing different actors; Representative participant c i For each participant c i , corresponding to [0,2 L ) is a subinterval SI i ,have
[0102]
[0103] Where L represents the number of bits of the hash value β. If β falls within the subinterval SI i , then the corresponding participant c i Will be selected as the accounting node of the public blockchain.
[0104] Step 206: The consortium chain sends the hash value β, VRF proof π, and the selection of the accounting node to the committee members.
[0105] Step 207: Once the selection of the accounting node is verified by the committee members, the accounting node will patch the block into the public blockchain.
[0106] Since there are many participating nodes in the hybrid blockchain cryptocurrency transaction fraud detection model based on federated learning, aggregating local models using multi-party secure computing methods will cause relatively large communication consumption, while using homomorphic encryption will introduce huge communication overhead. Therefore, the present invention proposes a model aggregation method with adaptive differential privacy to improve the accuracy of the model while ensuring privacy security.
[0107] DP-based methods usually require a good trade-off between fraud detection model performance and privacy budget. Good privacy protection performance will seriously affect the detection performance. Therefore, in order to reduce the performance loss of fraud detection, it is necessary to reasonably set the privacy budget in DP.
[0108] The present invention firstly presents an adaptive privacy budget allocation method to defend against Data Leakage Gradient (DLG) and Membership Inference Attack (MIA). On this basis, the present invention proposes an adaptive sensitivity calculation method to defend against Reconstruction Gap (R-gap). Based on the adaptive privacy budget allocation and sensitivity calculation method, the present invention constructs a cryptocurrency transaction fraud detection model under the FL framework based on hybrid blockchain.
[0109] Furthermore, in step 3, based on gradient similarity and attack heterogeneity, a differential privacy method for adaptive privacy budget and sensitivity calculation is designed, which includes the following steps:
[0110] The DLG attack reconstructs the input by minimizing the deviation between the model gradient g and the generated model gradient g′. Since the data available to the attacker is g rather than local data, the present invention can assume that the local training is a Laplace mechanism. The DP algorithm of the tth round of local training can be expressed by the DP mechanism as follows:
[0111]
[0112] is a random number generation algorithm, x is the original data set, x′ is the data set adjacent to x, and o is The random number generated, g is the model gradient, g′ is the model gradient generated by DLG, |||| 2 The symbol represents the Euclidean norm, σ is the noise scale of the Laplace mechanism, and ε t is the privacy budget for round t.
[0113] As the model converges, the deviation between the gradients of different inputs will become smaller, and the deviation between g and g′ will decrease. At the same time, the privacy budget of FL is gradually reduced, thereby strengthening privacy protection. Therefore, for the DLG attack, the present invention adaptively changes the privacy budget of user i in the tth round according to the model gradient as follows:
[0114]
[0115] Where ε represents the predefined privacy budget, represents the privacy budget of user i against DLG attack in the tth round of communication, represents the model gradient of user i in round t.
[0116] In fact, the training inputs are classified with high confidence, while the non-training inputs are classified with low confidence. The MIA attack can infer the in / out labels based on the confidence of the model output. The FL framework aggregates the local models of the participants and improves the generalization performance of the model. Therefore, more non-training inputs will be classified with higher confidence, which will lead to lower MIA attack performance. Therefore, the privacy budget of the MIA attack can be adaptively changed as follows:
[0117]
[0118] In the formula, var() is the variance operation; represents the privacy budget of user i against MIA attack in the tth round of communication, Calculated as
[0119]
[0120] In the formula, Represents a tuple based on x m The predictions of the fraud detection model, Represents a tuple x m The label of .
[0121] Therefore, the present invention adaptively changes the privacy budget of the i-th participant in the t-th round to defend against DLG and MIA attacks as follows:
[0122]
[0123] in, represents the privacy budget of user i in the tth round of communication.
[0124] The sensitivity of the tth round to the kth layer It can be calculated as
[0125]
[0126] The noise scale of the Laplace mechanism is calculated as
[0127]
[0128] is the noise scale of the kth layer.
[0129] R-gap attack is to infer the input based on the gradient of weights and biases. To defend against R-gap attack, the present invention can only add DP to weights or biases. The forward propagation process of the neural network can be expressed as
[0130] y=ω*x+b (11)
[0131] When we add noise Δn to the weights, we have
[0132] Δy=Δn*x (12)
[0133] When we add noise Δn to the bias, we have
[0134]
[0135] If x∈[0,1], then Therefore, when the input is normalized, adding noise to the bias of the neural network will lead to a relatively large prediction error. Furthermore, according to the attack process of the R-gap attack, we have
[0136]
[0137] In the formula, is the loss function, represents the i-th input of the k-th layer, represents the weight between the i-th input and j-th output of the k-th layer, represents the bias of the jth output of the kth layer. The sensitivity of the kth layer is the bias gradient The noise scale of the weight gradient between the i-th input and j-th output of the k-th layer can be defined as
[0138]
[0139] In the formula, |||| 1 Represents the Manhattan norm.
[0140] According to the adaptive privacy budget allocation and adaptive sensitivity calculation, the noise scale of the weight gradient between the i-th input and the j-th output of the k-th layer is calculated as
[0141]
[0142] The new weight gradient between the i-th input and j-th output of the k-th layer can be calculated as
[0143]
[0144] Wherein, Lap() represents the Laplace mechanism.
[0145] Then the new gradient of the bias of the kth layer in the tth round can be calculated as
[0146]
[0147] Therefore, the implementation process of designing a secure and reliable cryptocurrency transaction fraud detection model under hybrid blockchain is as follows:
[0148] The consortium blockchain first initializes the global transaction fraud detection model. Then the participants collaboratively train the global fraud detection model by using adaptive privacy budget allocation and adaptive sensitivity calculation.
[0149] Specifically, each participant obtains the local model gradient according to the global transaction fraud detection model. Then each participant calculates the noise scale of the bias and weight gradients according to the predefined privacy budget ε, equations (10) and (16). After obtaining the noise scale, each participant obtains a new gradient with adaptive noise according to equations (17) and (18). Each participant updates the local model using the gradient descent method according to the new gradient. After each participant sends its local model to the consortium blockchain, the global model is updated and patched using the federated learning framework based on the hybrid blockchain. Finally, the hybrid blockchain synchronizes the global model to other participants.
[0150] When the maximum number of global rounds is reached, the training process stops and outputs the final cryptocurrency transaction fraud detection model.
[0151] As described above, the hybrid blockchain cryptocurrency transaction fraud detection model based on secure and reliable federated learning provided by the present invention can improve throughput and reduce memory usage. Through adaptive privacy allocation and sensitivity calculation, the present invention can well defend against information reasoning attacks while reducing the performance loss of fraud detection.
[0152] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A method for designing a secure and reliable cryptocurrency transaction fraud detection model under a hybrid blockchain, characterized in that: The following steps are involved: Step 1: Build a lightweight hybrid blockchain cryptocurrency transaction fraud detection model based on federated learning, including the following steps: Step 101, the public blockchain participant trains its local model based on the global model and local data; Step 102: Some ordinary users of the public blockchain are selected as committee members. The public blockchain participants calculate the hash value of the local model and send it to the current committee and the alliance blockchain. Step 103: The alliance blockchain participants verify and summarize the local model and calculate the participant c i Credibility score Credibility Rating Participants with high,values are more trustworthy, and the global model is obtained by,aggregating verified local models; Step 104: When the alliance blockchain participants reach a consensus, the model training fingerprint is patched in the alliance blockchain; Step 105: The alliance blockchain participant selects a bookkeeping node of the public blockchain from the committee members and sends the global model to the node; Step 106: After the committee members reach a consensus, the accounting node patches the hash value of the local model and the global model into the public blockchain; Step 107: The public blockchain participant obtains the global model from the public chain and starts the next round of local model training; Step 2: Based on the user credibility score, a consensus mechanism based on a lightweight hybrid blockchain is proposed, which includes the following steps: Step 201: For the kth round of federated learning, the participants of the previous round of public blockchain automatically become the consensus committee C = {c1, c2, ..., c n }, where n represents the number of committee members; Step 202: The participants in this round train their local models based on the global model and local data; Step 203: The participants in this round calculate the hash value of the local model and send the local model and its hash value to the alliance chain; Step 204: The consortium chain calculates the credibility score of each participant Among them, TOA (c j ) is participant c j The local model time offset accumulation; Step 205: After the alliance chain reaches a consensus, the accounting node generates a hash value β and a VRF proof π using a verifiable random function based on the hash value and the private key. The accounting node of the public blockchain is selected based on the credibility score of the committee members. Participants with better scores have a higher probability of becoming accounting nodes. Step 206: The consortium chain sends the hash value β, VRF proof π, and the selection of the accounting node to the committee members; Step 207, once the selection of the accounting node is verified by the committee members, the accounting node patches the block into the public blockchain; Step 3: Based on gradient similarity and attack heterogeneity, a differential privacy method with adaptive privacy budget and sensitivity calculation is designed.
2. A method for designing a secure and reliable cryptocurrency transaction fraud detection model under a hybrid blockchain as claimed in claim 1, characterized in that: In step 1, a hybrid blockchain is composed of a public blockchain and a consortium blockchain; in the hybrid blockchain, the public blockchain is composed of some ordinary nodes, and the consortium blockchain is composed of some authoritative institutions.
3. A method for designing a secure and reliable cryptocurrency transaction fraud detection model under a hybrid blockchain as described in claim 2, characterized in that: For lightweight hybrid blockchains, a lightweight public blockchain that only retains the hash value of the local model is designed under the hybrid blockchain framework based on federated learning. The difference between the public blockchain and the consortium blockchain block structure is that the public blockchain only stores the hash value of the local model, while the consortium blockchain stores not only the hash value of the local model, but also the model parameters of the local model, where: Public blockchains store some public or anonymized data, run some smart contracts without privacy concerns, and provide some basic reliable services to supervise consortium blockchains; Consortium blockchains store private data and run some complex or security-based smart contracts.
4. A method for designing a secure and reliable cryptocurrency transaction fraud detection model under a hybrid blockchain as claimed in claim 3, characterized in that: In step 1, the public blockchain contains miners and accounting nodes: the accounting nodes receive and save the hash values of the local model and the global model sent by the alliance chain; the miners are responsible for training the model based on the received global model and local data and uploading the local model and its hash value to the alliance chain; The alliance blockchain includes ordinary clients and accounting nodes: ordinary clients receive local models and their hash values, verify uploaded local model parameters, and calculate credit points; accounting nodes: ledger applications that record credit values, reward values, and detection fees, and are responsible for issuing rewards and collecting fraud detection fees, and storing local model parameters.
5. A method for designing a secure and reliable cryptocurrency transaction fraud detection model under a hybrid blockchain as claimed in claim 1, characterized in that: In step 205, the selection of the accounting node depends on the credibility score of the committee members. i Credibility score Calculate the selection probability P s (c i ): For each participant c i , corresponding to [0,2 L ) is a subinterval SI i ,have: Where L represents the number of bits of the hash value β. If β falls within the subinterval SI i , then the corresponding participant c i Will be selected as the accounting node of the public blockchain.
6. A method for designing a secure and reliable cryptocurrency transaction fraud detection model under a hybrid blockchain as claimed in claim 1, characterized in that: In step 3, the differential privacy method with adaptive privacy budget is used to defend against DLG and MIA attacks, where: For the DLG attack, the privacy budget of user i in the tth round of local training is adaptively changed according to the model gradient as follows: Where, ε represents the predefined privacy budget, represents the privacy budget of user i against DLG attack in the tth round of communication, represents the model gradient of user i in round t, and the symbol ∥∥2 represents the Euclidean norm; The privacy budget for MIA attacks can be adaptively changed as follows: In the formula, var() is the variance operation, represents the privacy budget of user i against MIA attack in the tth round of communication, Represents a tuple based on x m Predictions of fraud detection models; Adaptively change the privacy budget of the i-th participant in round t to defend against DLG and MIA attacks as follows: in, represents the privacy budget of user i in the tth round of communication.
7. A method for designing a secure and reliable cryptocurrency transaction fraud detection model under a hybrid blockchain as claimed in claim 1, characterized in that: In step 3, based on the adaptive privacy budget allocation and sensitivity calculation method, a cryptocurrency transaction fraud detection model under the federated learning framework based on hybrid blockchain is constructed, including the following steps: The alliance blockchain initializes the global transaction fraud detection model; Participants collaboratively train the global fraud detection model by using adaptive privacy budget allocation and adaptive sensitivity calculation, which specifically includes the following steps: each participant obtains the local model gradient according to the global transaction fraud detection model; each participant calculates the noise scale of the bias and weight gradients; after obtaining the noise scale, each participant calculates a new gradient with adaptive noise, and each participant updates the local model using the gradient descent method according to the new gradient; after each participant sends its local model to the consortium blockchain, the global model is updated and patched using the federated learning framework based on the hybrid blockchain; the hybrid blockchain synchronizes the global model to other participants; when the maximum number of global rounds is reached, the training process stops and outputs the final cryptocurrency transaction fraud detection model.
8. A method for designing a secure and reliable cryptocurrency transaction fraud detection model under a hybrid blockchain as claimed in claim 7, characterized in that: In step 3, the noise scale of the weight gradient between the i-th input and j-th output of the k-th layer is defined as Then we have: is the noise scale of the weight gradient between the i-th input and j-th output of the k-th layer for the R-gap attack: Where ε is the privacy budget, is the loss function, represents the bias of the j-th output of the k-th layer, and ∥∥1 represents the Manhattan norm; is the noise scale of the Laplace mechanism of the kth layer in the tth round: In the formula, is the sensitivity of the tth round to the kth layer represents the gradient of the kth layer in the tth round, represents the privacy budget of user i in the tth round of communication.
9. A method for designing a secure and reliable cryptocurrency transaction fraud detection model under a hybrid blockchain as claimed in claim 8, characterized in that: In step 3, each participant calculates a new gradient with adaptive noise using the following formula: The new weight gradient between the i-th input and j-th output of the k-th layer is calculated as: Wherein, Lap() represents the Laplace mechanism. The new gradient of the bias of the kth layer at the tth round is calculated as:
Citation Information
Patent Citations
Privacy protection method and system based on federated learning, and storage medium
CN112199702A
Industry Internet of Things data lightweight trusted sharing technology based on block chain
CN112395640A
Medical data sharing privacy protection method based on block chain by utilizing federated learning
CN113536382A
Federal learning-based block chain data management method and system, and storage medium
CN114580009A
Defense method for inference attack in federated learning
CN117371037A