A blockchain smart contract deployment method

By quantifying node reputation and combining it with a weighted summation method of system reputation and direct reputation, the problem of unreasonable node reputation evaluation in blockchain systems is solved, enabling reliable deployment of smart contracts and stable management of the system, thereby improving the system's operational reliability and stability.

CN115879935BActive Publication Date: 2026-05-15HENAN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HENAN UNIVERSITY OF TECHNOLOGY
Filing Date
2021-09-28
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In existing technologies, the reputation evaluation mechanism of nodes in blockchain systems is unreasonable, leading to untimely contract execution and the publication of false execution results, which affects the stability and reliability of system operation.

Method used

By calculating the system reputation and direct reputation of nodes, a weighted summation method is used to quantify node reputation. Nodes with high reputation are selected for smart contract deployment, and dynamic evaluation and management are carried out by combining system reputation and direct reputation.

Benefits of technology

It enables dynamic maintenance and management of blockchain system nodes, improves the reliability of smart contracts and the stability of the system, and ensures the accuracy and reliability of contract execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115879935B_ABST
    Figure CN115879935B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of blockchains, and particularly relates to a blockchain smart contract deployment method. The method first acquires a transaction tendency node list with transaction tendency; then calculates system credit and direct credit of each node in the transaction tendency node list, and comprehensively utilizes the system credit and the direct credit to update the node credit of each node, wherein the system credit is the node credit calculated according to historical transaction records of the smart contract, and the direct credit is the node credit calculated according to interaction records with past nodes; finally, according to the updated node credit of each node, a node with higher node credit is selected to initiate a transaction, so as to realize smart contract deployment. The method not only can support dynamic deployment of the smart contract, but also can dynamically maintain and manage the blockchain system node, that is, the node credit can be inquired at fixed periods, and nodes with lower credit are removed to ensure stability of the system and reliability of the smart contract.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of blockchain technology, specifically relating to a method for deploying blockchain smart contracts. Background Technology

[0002] In public blockchains, nodes can join and leave at will, potentially leading to attacks and hindering effective monitoring of malicious nodes. While consortium blockchains require node verification before joining, nodes can fail, suffer from Byzantine errors, and their integrity cannot be guaranteed. Therefore, effective management and evaluation of nodes are crucial for the proper deployment and instantiation of smart contracts. Establishing a node reputation evaluation mechanism is essential. An inadequate mechanism can result in delayed contract execution, the publication of false results, and other issues that jeopardize system operation. Summary of the Invention

[0003] This invention provides a blockchain smart contract deployment method to address the problem of impaired system operation caused by unreasonable reputation evaluation mechanisms in existing technologies.

[0004] To solve the above-mentioned technical problems, the technical solutions included in this invention and their corresponding beneficial effects are as follows:

[0005] This invention provides a method for deploying blockchain smart contracts, comprising the following steps:

[0006] 1) Obtain a list of nodes with a trading tendency;

[0007] 2) Calculate the system reputation and direct reputation of each node in the transaction preference node list, and update the node reputation of each node using the following method:

[0008] Determine if a node's system reputation is greater than or equal to a set threshold: If a node's system reputation is greater than or equal to the set threshold, then the node's system reputation and direct reputation are weighted and summed, and the sum is used as the node's reputation; if a node's system reputation is less than the set threshold, then the node's direct reputation is used as the node's reputation.

[0009] Among them, system reputation is the node reputation calculated based on the historical transaction records of smart contracts; direct reputation is the node reputation calculated based on the interaction records with past nodes.

[0010] 3) Based on the updated node reputation of each node, select the node with higher node reputation to initiate a transaction and realize the deployment of smart contracts.

[0011] The beneficial effects of the above technical solution are as follows: This invention quantifies node reputation, calculates the system reputation and direct reputation of a node, and comprehensively evaluates the node reputation using both system reputation and node reputation. When the system reputation of a node is high, the node reputation is a weighted sum of the system reputation and direct reputation. When the system reputation of a node is low, the node reputation is directly the direct reputation. Nodes with higher node reputation are then selected as smart contract deployment nodes, realizing dynamic maintenance and management of blockchain system nodes, and effectively improving the reliability of smart contracts and the stability of the system.

[0012] Furthermore, in order to accurately extract and calculate the system reputation from historical transaction records, the formula for calculating the system reputation of a node is as follows:

[0013] SR j =b+εu

[0014] In the formula, SR j ε represents the system reputation of a node; ε is a constant, 0≤ε≤1, representing the degree of influence of trust uncertainty; b represents the trust level, and u represents the hesitation level. The formulas for calculating the trust level b and the hesitation level u are as follows:

[0015]

[0016] u = 1 - s

[0017] In the formula, s represents network connection quality; HR n This indicates the number of transactions that the node honestly records in the smart contract's historical transaction history; FR m This indicates the number of false records this node has in the smart contract's historical transaction history.

[0018] Furthermore, in order to account for the impact of network conditions and ensure the accuracy of honesty record statistics, HR... n This represents the number of honest records that a node has corrected in the smart contract's historical transaction records, and the number of corrected honest records is:

[0019] HR n =HR′ n +PL*(HR′ n +FR′ m )

[0020] In the formula, HR′ n and FR′ m These represent the number of honest and false records made by a node in the original transaction record of the smart contract, respectively; PL represents the impact of network conditions on node transactions.

[0021] Furthermore, in order to take into account the impact of network conditions to ensure the accuracy of the fraudulent record count, FRm This indicates the number of corrected false records in the smart contract's historical transaction records for that node, and the corrected number of false records is:

[0022] FR m =FR′ m -PL*(HR′ n +FR′ m )

[0023] In the formula, HR′ n and FR′ m These represent the number of honest and false records made by a node in the original transaction record of the smart contract, respectively; PL represents the impact of network conditions on node transactions.

[0024] Furthermore, the formula for calculating the impact of network conditions on node transactions (PL) is as follows:

[0025]

[0026] In the formula, w(i) is the weight value of the historical transaction status; n is the number of historical transaction records.

[0027] Furthermore, the formula for calculating direct credit is as follows:

[0028]

[0029] In the formula, DR j Represents the node run_peer j Direct credit; and These represent the nodes run_peer. j Honesty and false credit scores are used to represent the timeliness of interactions between nodes; and They represent the node set run_peer respectively i The middle node req_peer corresponds to the node run_peer j Honesty and false trustworthiness, node set run_peer i Let N represent the set of all nodes that have interacted with node req_peer in the past, where i = 1, 2, ..., N, and N represents the set of nodes run_peer. i The total number of nodes, and the node set run_peer i middle node run_peer j Honesty and credibility and false credibility The calculation formulas are as follows:

[0030]

[0031]

[0032] In the formula, and These represent the nodes run_peer. j The number of honest records and the number of false records in the interaction with node req_peer; and They represent the node set run_peer respectively i The number of honest records and the number of false records in the interaction with node req_peer.

[0033] Furthermore, the node run_peer j The formula for calculating honesty and creditworthiness score is:

[0034]

[0035] In the formula, T c Indicates the current time; Represents the node run_peer j The time of the t-th interaction in the honest record of interactions with node req_peer; F(x) represents a weight function that adjusts frequency and timeliness; n H This refers to nodes req_peer and run_peer. j The total number of interactions is recorded in the honest log of interactions.

[0036] Furthermore, the node run_peer j The formula for calculating a false credit score is:

[0037]

[0038] Among them, T c Indicates the current time; Represents the node run_peer j The time of the t-th interaction in the spoofed record of interaction with node req_peer; F(x) represents a weighting function that adjusts frequency and timeliness; n F This refers to nodes req_peer and run_peer. j The total number of interactions in the fake interaction log.

[0039] Furthermore, the weighting function F(x) is:

[0040]

[0041] In the formula, M represents the hyperparameter. Attached Figure Description

[0042] Figure 1 This is a flowchart of the system reputation calculation process of the present invention;

[0043] Figure 2 This is a flowchart of the direct reputation calculation process of the present invention;

[0044] Figure 3 This is a flowchart of the blockchain smart contract deployment method. Detailed Implementation

[0045] This invention quantifies node reputation, combining system reputation and direct reputation to determine a node's reputation value. This allows for the selection of nodes with high reputations as smart contract deployment nodes, enabling the management and deployment of blockchain nodes within smart contracts and effectively improving the reliability of smart contracts and the stability of the system. System reputation and direct reputation will be introduced below.

[0046] System reputation is calculated based on the historical transaction records of smart contracts, which are used to determine node reputation. (Node run_peer) j The system reputation calculation process is as follows: Figure 1 As shown:

[0047] (1) Statistical node smart contract historical transaction records, transaction records are divided into honest records (HR, honest run) and false records (FR, false run), respectively through parameter HR′ n and FR′ m This represents the number of honest and false records made by a node in the original smart contract transaction record. Since network conditions affect execution records, the network packet loss rate (PL) is calculated through network transmission data analysis. This loss is represented by the parameter PL, which describes the impact of network conditions on node transactions. Furthermore, the impact of PL on node transactions is used to represent the number of original transaction records, HR′. n and FR′ m The correction is made, and the correction formula is as follows:

[0048] HR n =HR′ n +PL*(HR′ n +FR′ m )

[0049] FR m =FR′ m -PL*(HR′ n +FR′ m )

[0050] In the formula, HR n and FR mThese represent the corrected number of honest records and the number of false records, respectively; the estimation formula for the impact of network conditions on node transactions (PL) is as follows:

[0051]

[0052] In the formula, w(i) is the weight value of the historical transaction state. When the historical transaction state record is Transaction=(t(1),t(2),…,t(n))=(1,0,…,1), the weight value is... i is the sequence number of t(i) in the Transaction, and n is the number of historical transactions recorded in the Transaction.

[0053] It should be noted that the purpose of this correction is to reduce the negative impact of transaction failures caused by network issues on node reputation. Therefore, the purpose of this correction is not to actually change the transaction records, but to take into account the network impact when calculating the input of the constructed trust model, so as to comprehensively consider network factors when calculating trust and hesitation, and make the final calculated system reputation more accurate.

[0054] (2) A trust model is constructed using a subjective logic framework w = {b, d, u}, where b represents the degree of trust (belief), d represents the degree of distrust (disbelief), and u represents the degree of uncertainty (uncertainty). The modified number of honest records (HR) is then used to construct the model. n And the number of false records FR m The three parameters are calculated using the following formula:

[0055]

[0056]

[0057] u = 1 - s

[0058] In the formula, s represents the network connection quality.

[0059] (3) Calculate the node run_peer based on the trust level b and the hesitation level u. j The system reputation (SR) is calculated using the following formula:

[0060] SR j =b+εu

[0061] Here, ε is a constant, 0≤ε≤1, representing the degree of influence of trust uncertainty.

[0062] Direct reputation is calculated by examining a node's interactions with past nodes, and then calculating the reputation of each node based on those interactions. The node's `run_peer` is used for this purpose.j The calculation process of direct reputation is as follows Figure 2 As shown:

[0063] (1) Obtain the set of nodes that have interacted with the current node req_peer in the past as run_peer. i i = 1, 2, ..., N, where N represents the set of nodes run_peer i The total number of nodes, transaction records are divided into honest records (HR, honest run) and false records (FR, false run), and the set of compute nodes is run_peer. i The middle node req_peer corresponds to the node run_peer j The credibility level (CL) represents the honesty credibility level. and false credibility The calculation formula used is as follows:

[0064]

[0065]

[0066] In the formula, Represents the node run_peer j The number of honest records in the interaction with node req_peer; Represents the node set run_peer i The number of honest records in the interaction with node req_peer; Represents the node run_peer j The number of spoofed records in interactions with node req_peer; They represent the node set run_peer respectively i The number of spurious records in interactions with node req_peer.

[0067] (2) A node is neither always trustworthy nor always untrustworthy, run_peer j Reputation changes over time. Common sense suggests that more recent events have a greater impact on the accuracy and credibility of reputation calculations. Similar to credibility, credit value (CV) is also divided into honesty and trustworthiness. and fake credit scores The calculation formula used is as follows:

[0068]

[0069]

[0070] In the formula, F(x) is a weighting function that adjusts frequency and timeliness. A classic form can be expressed as follows: M is a hyperparameter; T c Indicates the current time. node run_peer j The honest record of the interaction with node req_peer contains the time of the t-th interaction; n H This refers to nodes req_peer and run_peer. j The total number of interactions is recorded honestly in the interaction log; Represents the node run_peer j The time of the t-th interaction in the spurious record of the interaction with node req_peer; n F This refers to nodes req_peer and run_peer. j The total number of interactions in the fake interaction log.

[0071] (3) Based on the results obtained from steps (1) and (2), calculate the node run_peer according to the following formula. j Direct reputation (DR):

[0072]

[0073] Among them, DR j Represents the node run_peer j Direct credibility.

[0074] Based on the system reputation and direct reputation described above, a blockchain smart contract deployment method of the present invention can be implemented, the overall process of which is as follows: Figure 3 As stated above.

[0075] Step 1: Obtain a list of nodes with trading tendencies, and determine if the list of nodes with trading tendencies is empty.

[0076] If the list of transaction preference nodes is empty, proceed to step four.

[0077] If the list of transaction preference nodes is not empty, proceed to step two.

[0078] Step 2: Calculate the system reputation (SR) of the first node in the node list using the method described above. j and direct credit DR j And the system reputation (SR) of the first node. j Perform a judgment to determine whether it is greater than or equal to a set threshold Th. num :

[0079] If SR j ≥Th numThis indicates that the first node has a good reputation in the system, which in turn affects the system's reputation SR. j and direct credit DR j The node reputation of the first node is calculated using a weighted method, i.e., R. j =w1*SR j +w2*DR j w1 and w2 are the weights corresponding to system trust and local trust, respectively, where w1∈[0,1], w2∈[0,1], and w1+w2=1. After updating the node reputation of the first node, proceed to step three. The weights corresponding to system trust and local trust here need to be set according to the actual operation of the system, taking into account factors such as trust preference, i.e., whether to emphasize system reputation or direct reputation. The one that is emphasized has a larger weight.

[0080] If SR j <Th num This indicates that the first node may be a newly launched node or that the node has been significantly affected by network issues. In this case, system reputation is no longer used; instead, direct reputation is used as the node reputation of the first node, i.e., R. j =SR j After updating the node reputation of the first node, proceed to step three. Here, the threshold Th... num It needs to be configured based on the number of system nodes.

[0081] Step 3: Add the first node with the updated node reputation to the node reputation list to update the node reputation list, and remove the first node from the transaction tendency node list. Repeat Step 2 until the transaction tendency node list is empty, and then proceed to Step 4.

[0082] Step four: Sort the node reputation of each node in the node reputation list, select the node with the highest node reputation to initiate a transaction, and realize the deployment of smart contracts.

[0083] In summary, this invention addresses the issues of node failure and Byzantine faults in public and consortium blockchains, respectively, and the unreliability of existing nodes in smart contract execution. It proposes a blockchain smart contract deployment method, the key feature of which is a smart contract deployment node reputation evaluation mechanism. This mechanism quantifies node reputation values, calculating both system reputation and direct reputation of nodes. By combining these two methods, node reputation is dynamically evaluated, selecting nodes with high reputations for smart contract deployment. This method not only supports dynamic deployment of smart contracts but also enables dynamic maintenance and management of blockchain system nodes. Specifically, it allows for periodic queries of node reputation, removing nodes with low reputations to ensure system stability and smart contract reliability.

Claims

1. A method for deploying blockchain smart contracts, characterized in that, include: 1) Calculate the system reputation and direct reputation of each node in the obtained list of nodes with transactional tendencies, and update the node reputation of each node using the following method: If a node’s system reputation is greater than or equal to a set threshold, then the node’s system reputation and direct reputation are weighted and summed, and the sum is used as the node’s reputation. Otherwise, the node's direct reputation is used as its node reputation; System Reputation It is a constant. This indicates the degree of impact of trust uncertainty; For trust level, , For network connection quality, , These represent the number of honest and false records made by a node in the smart contract's historical transaction records, respectively. Direct credit rating: For nodes Direct credit; and They are nodes Honest credit score and false credit score; and Each is a set of nodes Middle node For nodes Honesty and credibility versus false credibility To and The set of all nodes that have had past interactions, i = 1, 2, ..., N, where N is a set of nodes that have had interactions with each other. The total number of nodes in the middle, , , and They are respectively and The number of honest and false records during the interaction. and They are respectively and The number of honest and false records during interactions; 2) Based on the updated node reputation of each node, select the node with higher node reputation to initiate a transaction and realize the deployment of smart contracts.

2. The blockchain smart contract deployment method according to claim 1, characterized in that, The threshold value is set based on the number of system nodes.

3. The blockchain smart contract deployment method according to claim 2, characterized in that, This represents the number of honest records that a node has corrected in the smart contract's historical transaction records, and the number of corrected honest records is: In the formula, and These represent the number of honest records and the number of false records made by a node in the original transaction record of the smart contract, respectively. This indicates the impact of network conditions on node transactions.

4. The blockchain smart contract deployment method according to claim 2, characterized in that, This indicates the number of corrected false records in the smart contract's historical transaction records for that node, and the corrected number of false records is: In the formula, and These represent the number of honest records and the number of false records made by a node in the original transaction record of the smart contract, respectively. This indicates the impact of network conditions on node transactions.

5. The blockchain smart contract deployment method according to claim 3 or 4, characterized in that, The impact of network conditions on node transactions The calculation formula is: In the formula, It is the weight value of historical transaction status; It represents the number of historical transaction records.

6. The blockchain smart contract deployment method according to claim 1, characterized in that, node The formula for calculating honesty and creditworthiness score is: In the formula, Indicates the current time; Represents a node With nodes The time of the t-th interaction in the honest record of the interaction; This represents a weighting function that adjusts frequency and timeliness. Represents a node With nodes The total number of interactions is recorded in the honest log of interactions.

7. The blockchain smart contract deployment method according to claim 1, characterized in that, node The formula for calculating a false credit score is: in, Indicates the current time; Represents a node With nodes The time of the t-th interaction in the spurious record of the interaction; This represents a weighting function that adjusts frequency and timeliness. Represents a node With nodes The total number of interactions in the fake interaction log.

8. The blockchain smart contract deployment method according to claim 6 or 7, characterized in that, Weighting function for: In the formula, M represents the hyperparameter.