A secure and neutral digital currency smart contract implementation method
By adopting key sharding technology and inadvertent transmission algorithms in digital currency smart contracts, combined with multi-party participation verification mechanisms, the problems of digital currency asset management and contract neutrality in the existing technology have been solved, achieving higher security and fairness.
Patent Information
- Application Number
- CN202411884115.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-12-20
AI Technical Summary
The existing digital currency smart contract technology is either too neutral and lacks asset management functions, or it relies too much on user keys to undermine the neutrality and security of contracts, making it difficult to ensure the security of digital currency assets and the neutrality of contract operation at the same time.
The private key of the smart contract is securely divided and distributed, combining inadvertent transmission algorithms and multi-party participation verification mechanisms to ensure the security of key sharding and the fairness of contract execution.
The security of private keys is improved through key sharding technology, avoid single subject control, ensure the neutrality and fairness of contract operation, and at the same time enhance the security and immutability of the entire process.
Smart Images

Figure CN119338462B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of digital RMB, and specifically, relates to a method for implementing a secure and neutral digital currency smart contract. Background Art
[0002] At present, digital currency smart contract technology has been widely used. There are two typical implementation schemes: keyless neutral contract and keyed contract.
[0003] A keyless neutral contract is to deploy the compiled smart contract code directly to the blockchain and create a blockchain account for it. The difference between this account and an ordinary user account is that it does not have any key information. Therefore, the operation of the smart contract on the blockchain is completely neutral and is not controlled by any single entity. This can well ensure the fairness and immutability of the contract.
[0004] However, keyless neutral contracts also have some flaws. The most important one is that once digital currency assets are transferred to the contract, but the corresponding asset management functions are not defined in the contract, these assets will be permanently locked in the contract account and cannot be recovered. In this case, the neutrality of smart contracts becomes a flaw.
[0005] To solve this problem, some solutions adopt the design of key contracts. In this solution, the smart contract account is a sub-account derived from a user account. The user can manage the parent account through his own key, and thus indirectly manage the associated smart contract sub-account. In this way, the user can flexibly adjust the digital currency assets in the contract according to his own needs.
[0006] However, key contracts also have their own flaws. Although users can manage contract assets through keys, if the contract involves the circulation of digital currencies involving multiple parties, users can use their own keys to arbitrarily interfere with the operating rules of the contract, destroying the neutrality and security of the contract. This is obviously not in line with the fairness and immutability of smart contracts.
[0007] In summary, the existing digital currency smart contract technology is either too neutral and lacks the necessary asset management function, or is too dependent on user keys and destroys the neutrality of the contract. Therefore, how to design a technology that can ensure the security of digital currency assets and the neutrality of contract operation has become a key technical problem that needs to be solved urgently. Summary of the invention
[0008] In view of this, the present invention provides a method for implementing a secure and neutral digital currency smart contract, which can solve the technical problems that are difficult to solve in the prior art, that is, ensuring the security of digital currency assets and the neutrality of contract operation.
[0009] The present invention is achieved in that:
[0010] The present invention provides a method for implementing a secure neutral digital currency smart contract, comprising the following steps:
[0011] S10. Obtain a smart contract creation instruction, where the smart contract creation instruction includes the transaction initiator's wallet address, the transaction recipient's wallet address, protocol rules, and the agreed transaction amount;
[0012] S20, constructing a message for the smart contract creation instruction, wherein the message includes a protocol summary, public key information of both parties to the agreement, protocol rules, and the effective time of the agreement, and signing and verifying the message through the private key of the relevant party;
[0013] S30, generating a unique business identification number based on the message, and constructing a smart contract private key through an encryption module using the unique business identification number in combination with the message content;
[0014] S40, sharding the smart contract private key using the Shamir secret sharing algorithm, optimizing the key sharding based on the key sharding optimization equation group, generating a smart contract key sharding sequence, and constructing a key distribution matrix of the smart contract key sharding sequence, wherein each element in the key distribution matrix corresponds to a key shard;
[0015] S50, grouping the key distribution matrix, randomly dividing the key sharding sequence into a plurality of key sharding subsets according to the number of recipients, and performing key distribution on each of the key sharding subsets based on an oblivious transfer algorithm, wherein the oblivious transfer algorithm includes public-private key pair generation, key selection, data encryption and decryption, and key sharding plaintext extraction;
[0016] S60: Based on the smart contract creation instruction and the smart contract key shard sequence, a smart contract digital currency account is constructed, and a fund transfer operation is performed to transfer the agreement funds into the smart contract digital currency account;
[0017] S70. When the smart contract execution condition is triggered, a contract execution instruction is sent to the business participant, and the business participant verifies the contract execution process and sends the key shard to the digital currency core system;
[0018] S80, reconstructing the received key shards using a Lagrange interpolation algorithm to obtain a reconstructed smart contract private key, and unlocking the digital currency in the smart contract digital currency account based on the reconstructed smart contract private key;
[0019] S90, execute the smart contract digital currency fund transfer, and destroy the smart contract private key, the key sharding sequence and the related key distribution matrix.
[0020] The digital currency mentioned is digital RMB.
[0021] The key sharding optimization equation group includes a key sharding entropy calculation equation, a key sharding correlation evaluation equation, a key sharding complexity calculation equation, and a key sharding security measurement equation;
[0022] The key shard entropy calculation equation is used to calculate the information entropy of each key shard, the input includes the binary sequence of the key shard and the length of the key shard, and the output is the information entropy value of the key shard;
[0023] The key shard correlation evaluation equation is used to evaluate the correlation between different key shards, the input includes a binary sequence of any two key shards, and the output is the correlation coefficient between the key shards;
[0024] The key sharding complexity calculation equation is used to calculate the structural complexity of the key sharding, the input includes the binary sequence of the key sharding and the sharding length, and the output is the complexity score of the key sharding;
[0025] The key sharding security metric equation is used to evaluate the overall security of the key sharding, the input includes the information entropy value, correlation coefficient and complexity score of the key sharding, and the output is the comprehensive security score of the key sharding.
[0026] By introducing this key sharding optimization equation group, the quality of key sharding can be evaluated and optimized from multiple dimensions to improve the security and reliability of key sharding. Each shard needs to meet certain information entropy requirements, ensure low correlation between shards, and have sufficient complexity. Finally, the overall security of the key sharding solution is ensured through comprehensive scoring.
[0027] Furthermore, the key sharding optimization equations in S40 involve a calculation process, which is specifically expressed as follows:
[0028] The key sharding entropy calculation equation is specifically expressed as follows:
[0029] ;
[0030] In the formula, is the information entropy value of the key shard; The first key shard The probability of a binary number occurring; is the length of the key shard; is the entropy adjustment coefficient, and its value range is ; is the entropy compensation term, which is used to correct the error of entropy calculation;
[0031] The key sharding correlation evaluation equation is specifically expressed as follows:
[0032] ;
[0033] In the formula, Shard for two keys and The correlation coefficient of The first two key shards are Bit binary value; are the means of the two key shards respectively; is the correlation adjustment coefficient, and its value range is ; is the correlation correction term;
[0034] The key sharding complexity calculation equation is specifically expressed as follows:
[0035] ;
[0036] In the formula, Score the complexity of key sharding; is the fragment length; is the maximum allowed length; is the number of 01 conversions in the slice; is the maximum number of conversions allowed; is the uniformity of the sharding; is the maximum allowable uniformity; is the weight coefficient and satisfies ; is the complexity adjustment coefficient; is the complexity correction term;
[0037] The key sharding security metric equation is specifically expressed as follows:
[0038] ;
[0039] In the formula, Score the security of the key shard; is the maximum allowable entropy value; is the maximum allowed correlation coefficient; is the maximum allowed complexity; is the weight coefficient and satisfies ; is the safety adjustment factor; This is a security revision item;
[0040] Furthermore, the key distribution matrix operation in S50 is specifically expressed as follows:
[0041] The key distribution matrix is specifically expressed as follows:
[0042] ;
[0043] In the formula, Indicates In the group key shards; is the number of groups; The number of shards for each key group;
[0044] Furthermore, the Lagrangian interpolation reconstruction algorithm in S80 is specifically expressed as follows:
[0045] The Lagrangian basis function is specifically expressed as follows:
[0046] ;
[0047] In the formula, is the number of key shards; The index value of the key shard;
[0048] The key reconstruction equation is specifically expressed as follows:
[0049] ;
[0050] In the formula, is the reconstructed key; For the The value of each key shard; is a large prime modulus; is the reconstruction adjustment coefficient; is the reconstruction error correction term;
[0051] The main innovations and principles of the above equations are explained as follows:
[0052] 1. The key sharding entropy calculation equation adopts information entropy theory, evaluates the randomness of key sharding by calculating the probability distribution of binary sequences, adds entropy compensation terms to correct calculation errors, and improves the accuracy of the evaluation;
[0053] 2. The correlation evaluation equation is based on the Pearson correlation coefficient. By calculating the linear correlation between two key shards, a correlation correction term is introduced to handle nonlinear correlation situations, making the evaluation more comprehensive.
[0054] 3. The complexity calculation equation comprehensively considers the three dimensions of length, degree of variation and uniformity, balances the importance of each factor through the weight coefficient, and adds complexity correction terms to deal with special cases;
[0055] 4. The security metric equation unifies entropy, correlation and complexity into the security score, makes each indicator comparable through normalization, and introduces security correction items to improve the robustness of the assessment;
[0056] 5. The key distribution matrix adopts a two-dimensional structure, which is convenient for managing and distributing key shards and supports flexible grouping strategies;
[0057] 6. The Lagrangian reconstruction algorithm adds modular operations and error correction to traditional interpolation, improving the accuracy and security of reconstruction.
[0058] Compared with the prior art, the method for implementing a secure and neutral digital currency smart contract provided by the present invention has the following beneficial effects:
[0059] First, this solution uses key sharding technology to securely divide the private key of the smart contract and distribute it to multiple parties. This not only greatly improves the security of the private key, but also avoids the control of the contract assets by a single entity. At the same time, in order to ensure the high quality of key sharding, this solution also introduces a key sharding optimization mechanism to evaluate and optimize the sharding scheme from multiple dimensions such as entropy, correlation and complexity, further improving the security of the scheme.
[0060] Secondly, this scheme uses the oblivious transfer algorithm to achieve the secure distribution of key shards. Through the clever public-private key encryption mechanism, the participating parties cannot obtain the key shard information of other parties, thus ensuring the privacy and non-tamperability of the key shards.
[0061] Thirdly, during the contract execution process, this solution requires multiple participants to jointly verify the legitimacy of the contract execution, including execution conditions, execution process, and execution authority. Only with the confirmation of all participants can the complete private key be reconstructed and the transfer of digital currency in the contract be completed. This multi-party participation and mutual supervision mechanism effectively guarantees the neutrality and fairness of the contract operation.
[0062] Finally, after the contract execution is completed, this solution will promptly destroy all key materials, including private keys, key shards, and key distribution matrices, etc. This further enhances the security of the entire process and avoids the leakage and abuse of key information.
[0063] In summary, the secure and neutral digital currency smart contract implementation method proposed in the present invention not only ensures the security of digital currency assets, but also effectively guarantees the neutrality and fairness of the contract operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 A flow chart of the method provided by the present invention. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0066] like Figure 1 As shown, it is a flow chart of a method for implementing a secure neutral digital currency smart contract provided by the present invention. The specific implementation methods of the steps of the present invention are described in detail below:
[0067] The specific implementation method of step S10 is as follows. First, receive the smart contract creation instruction sent by the user wallet management system. This instruction contains key information such as the wallet address of the transaction initiator, the wallet address of the transaction recipient, the protocol rules, and the agreement transaction amount. Next, it is necessary to verify the validity of this information. Specifically, it is necessary to first verify the validity of the wallet address of the transaction initiator to ensure that the address is a legal and valid digital currency wallet address. Then verify the validity of the wallet address of the transaction recipient to ensure that the recipient address is also legal and valid. Next, it is necessary to perform syntax parsing and rule validity verification on the protocol rules to ensure that the rule description is correct and legal. Finally, it is also necessary to verify the legality of the agreement transaction amount to ensure that the amount does not exceed the payment ability of both parties. After these verification steps, the key information that has passed the verification can be associated and bound, and the verification result of the smart contract creation instruction can be generated. The main purpose of this step is to ensure the legality and validity of the key information contained in the smart contract creation instruction.
[0068] The specific implementation method of step S20 is as follows. First, it is necessary to construct a smart contract creation message and generate a protocol summary information. The protocol summary information mainly includes a hash value or digital signature of the message content. Next, it is necessary to extract the respective public key information from the wallet addresses of the transaction initiator and the recipient. Then, compile the protocol rules into a smart contract executable code. At the same time, obtain the current timestamp of the system and set it as the effective time of the protocol. Next, package the protocol summary information, public key information, smart contract executable code and the effective time of the protocol into a smart contract message. Finally, the smart contract message is digitally signed by the private key of the relevant party, and a signature verification result is generated. The main purpose of this step is to construct a message containing key contents such as the protocol summary, public key information, smart contract code and effective time, and to verify the digital signature, laying the foundation for subsequent steps.
[0069] The specific implementation method of step S30 is as follows. First, a unique business identification number is generated based on the smart contract message constructed in the previous step. This identification number will be bound to the transaction initiator's wallet address, the transaction recipient's wallet address and the smart contract executable code in the message. Next, the original private key of the smart contract is generated by the encryption module using these binding information. In order to ensure the security of the private key, it is necessary to perform an encryption strength test on it to verify whether it meets the security requirements. Finally, the private key that passes the test is marked as a pending sharding state to prepare for the next step. The main purpose of this step is to generate a unique smart contract private key based on the message content and verify its security.
[0070] The specific implementation method of step S40 is as follows. First, the smart contract private key generated in the previous step is segmented according to the preset bit length to generate an initial key shard sequence. Next, these key shards need to be evaluated and optimized. Specifically, the information entropy value of each key shard, the correlation coefficient between any two key shards, and the complexity score of each key shard need to be calculated. The information entropy value reflects the randomness of the key shards, the correlation coefficient reflects the degree of correlation between the shards, and the complexity score reflects the structural complexity of the shards. When calculating these indicators, corresponding correction items are introduced to improve the accuracy and robustness of the evaluation. Then, the security score of each key shard is calculated by combining these indicators. Finally, the initial shard sequence is optimized according to the security score to generate the final smart contract key shard sequence. Next, a key distribution matrix is constructed and the optimized key shard sequence is filled in. The main purpose of this step is to evaluate and optimize the generated key shards in multiple dimensions to ensure the overall security of the key sharding scheme.
[0071] The specific implementation method of step S50 is as follows. First, according to the number of receivers, the key distribution matrix generated in the previous step is divided into multiple sub-matrices, each sub-matrix corresponding to one receiver. Next, a set of public-private key pair sequences is generated for each sub-matrix, and its length is the same as the number of key shards in the sub-matrix. Then, the public key sequence corresponding to each sub-matrix is sent to the corresponding receiver system. The receiver system will select the index of the key shard and encrypt it with the public key, generate an encrypted random number, and then send it back. Next, use the private key sequence to decrypt these encrypted random numbers to obtain a decryption result sequence. Finally, use the decryption result sequence as a symmetric encryption key to encrypt the key shards in the sub-matrix, and send the encrypted key shards to the receiver system to complete the distribution of the key shards. The main purpose of this step is to use the oblivious transfer algorithm to securely distribute the key shards to each receiver.
[0072] The specific implementation method of step S60 is as follows. First, based on the smart contract creation instruction obtained above, a smart contract digital currency account is constructed. And a unique identifier is assigned to the account. Next, a binding relationship is established between the smart contract key shard sequence and the digital currency account. Then, it is necessary to verify whether the balance of the transaction initiator's wallet account meets the requirements of the agreed transaction amount. If it does, a fund transfer instruction is generated to transfer the agreed amount from the initiator's wallet to the smart contract digital currency account. At the same time, the relevant information of the fund transfer operation is recorded, such as the transfer time, amount, transfer-out account and transfer-in account. Finally, the status of the smart contract digital currency account is updated. The main purpose of this step is to construct a digital currency account specifically for executing smart contracts, and transfer the agreement funds to this account to prepare for subsequent contract execution.
[0073] The specific implementation method of step S70 is as follows. First, the execution trigger conditions of the smart contract need to be continuously monitored. Once the trigger conditions are met, a contract execution notification needs to be generated and sent to each business participant, including the payment wallet system, the collection wallet system, and the backend system of the operating institutions of both parties. After receiving the notification, these participants need to return the contract execution confirmation information. Then, the legality of the contract execution process needs to be verified, including the verification of execution conditions, execution process, and execution authority. Finally, the key fragments sent by the business participants are received, and the integrity and validity of these key fragments are verified. The main purpose of this step is to trigger the execution of the smart contract and ensure the legality of the execution process, so as to prepare for the subsequent key reconstruction.
[0074] The specific implementation method of step S80 is as follows. First, receive the key shards sent by the business participants and verify the integrity of these shards. Then, calculate the index value of each key shard, and construct the Lagrangian basis function based on these index values. Next, use the Lagrangian basis function to calculate the interpolation coefficient, and perform a modular operation on it and the key shard to obtain the initial reconstructed key. In order to improve the accuracy of reconstruction, it is necessary to calculate the reconstruction error, and perform error correction based on the reconstruction adjustment coefficient to generate the final reconstructed key. Finally, verify the validity of the reconstructed key, and use the key to unlock the digital currency in the smart contract digital currency account. The main purpose of this step is to use the received key shards to reconstruct the private key of the smart contract through the Lagrangian interpolation algorithm, thereby unlocking the funds in the smart contract digital currency account.
[0075] The specific implementation method of step S90 is as follows. First, based on the smart contract private key reconstructed in the previous step, a fund transfer authorization code is generated. Then, the validity of this authorization code needs to be verified. Next, a fund transfer instruction for the smart contract digital currency is generated, and the fund transfer operation is executed to transfer the digital currency in the account to the wallet of the transaction recipient. Finally, the smart contract private key, key sharding sequence and related key distribution matrix are cleared, the status of the smart contract is updated to completed, and a notification of execution completion is generated. The main purpose of this step is to use the reconstructed private key to complete the final transfer of digital currency in the smart contract, clean up the related key materials, and end the execution process of the entire smart contract.
[0076] Specifically, the principle of the present invention is to skillfully combine key sharding technology, oblivious transfer algorithm and multi-party verification mechanism to construct a secure and neutral digital currency smart contract implementation solution. Specifically:
[0077] First of all, the key sharding technology is used to improve the security of smart contract private keys. Dividing the private key into multiple key shards and distributing them to different participants can effectively prevent a single entity from controlling and tampering with the private key. At the same time, in order to ensure the quality of each key shard, this solution also introduces a set of optimization mechanisms to evaluate and adjust the sharding scheme from multiple dimensions such as information entropy, correlation and complexity to ensure that each shard meets security requirements. This distributed key management model lays the foundation for subsequent neutrality guarantees.
[0078] Secondly, the oblivious transfer algorithm is used to achieve secure distribution of key shards. Through the public-private key encryption mechanism, participants can successfully send shards to other parties without revealing their own key shard information. This not only protects the privacy of key shards, but also ensures that the shard transmission process cannot be tampered with. In this way, even if some participants try to tamper with or steal key shards, it will not affect the final reconstruction of the private key.
[0079] Thirdly, requiring multiple parties to participate in verifying the legality of contract execution is to ensure the neutrality and fairness of the entire process. When the contract triggering conditions are met, this solution will notify all relevant participants, including the payer, the payee, and the operating agencies of both parties. These participants need to jointly verify each link of the contract execution to ensure that the execution conditions, execution process, and execution authority are all legal and valid, so as to finally complete the reconstruction of the key and the transfer of digital currency. This mechanism of multi-party participation and mutual checks and balances effectively avoids the control and intervention of a single entity.
[0080] Finally, after the contract execution is completed, this solution will completely destroy all key materials, including private keys, key shards, and key distribution matrices, etc. This will not only further enhance the security of the entire process, but also ensure that the contract execution record cannot be tampered with.
[0081] In order to better understand and implement the present invention, multiple embodiments of the present invention are provided below.
[0082] Embodiment 1 provides a method and system that can ensure the neutrality of smart contracts and solve the cryptographic security of smart contracts. The system includes a digital central bank currency core management system, a smart contract management system, a user wallet management system, and an operation management agency backend system.
[0083] In step 1, the user wallet management system sends a smart contract creation instruction to the operating organization's backend management system through the smart contract management system. The instruction includes the transaction initiator's wallet address, the transaction recipient's wallet address, the protocol rules, and the agreed transaction amount.
[0084] In the second step, the operating institution’s management backend system first determines the validity of the contract creation information, and after verification, the information signature is sent to the central bank’s digital currency core system.
[0085] Step 3: The central bank's digital currency core system builds a smart contract based on the initiator's wallet, the recipient's wallet, the protocol rules, the collection operator, and the payment operator information, and builds a smart contract digital currency account based on the smart contract. This account is an independent account that is only responsible for single business processing and does not belong to any individual or organization, so its key does not belong to any organization or individual. Smart contract key sharing must be carried out through the SSS (Shamir's Secret Sharing) protocol. The specific operation process is as follows:
[0086] The initiator's wallet, the payee's wallet, the payer's operating structure and the payee's operating organization system create a smart contract creation request message, which contains the agreement summary, the public keys of both parties to the agreement, the agreement rules and the effective time of the agreement. After signing the message with their respective private keys, it is sent to the central bank's digital currency core system.
[0087] After receiving the application message, the central bank's digital currency core system verifies the validity of the message. After the validity verification is passed, a unique business ID number is generated, and the smart contract private key is constructed through a trusted encryption module in combination with the message content and business ID number. The private key is then calculated through the Shamir secret sharing algorithm for key sharding. The specific calculation process is as follows:
[0088] Construct the polynomial:
[0089] ;
[0090] In the polynomial, a1…an are all random numbers and are controlled by a discrete signature algorithm system. It is the key of the smart contract account.
[0091] The overall modulus p (p is a large prime number) is to confine a linear polynomial result that can be reversed by exhaustive method to a controllable domain, thereby achieving an irreversible cycle of the result and achieving the purpose of hiding the original formula.
[0092] The present invention needs to select the polynomial complexity according to the actual business participants. The purpose is to discretize the private key of the smart contract sub-account into n parts, so that the complete signature can be completed when any m (m<=n) key fragments appear.
[0093] Step 4: The central bank’s digital currency core system, the payment and collection operating system, and the payment and collection wallets complete one-to-one key distribution through the 1-out-of-n oblivious transfer algorithm. The central bank provides n key shards, and the payment and collection operating institutions, payment operating institutions (even if the payment and collection operating institutions are the same during the process, they need to obtain different key shards according to their business roles), payment wallets, and payment wallets obtain a key shard of the smart contract business key through the oblivious transfer algorithm.
[0094] The method of using the 1-out-of-n oblivious transmission algorithm in the present invention is as follows:
[0095] The core system of the central bank's digital currency has n key shards (S1, S2, S3,…, Sn) calculated by the Shamir secret sharing algorithm. To ensure the discreteness of the distribution, the shards are randomly divided into c groups according to the number of recipients c, and are marked as G1, G2, G3…Gc respectively.
[0096] The payment operation structure, the collection operation structure, the payment wallet, and the payment wallet as the recipient obtain the key respectively. The central bank's digital currency and information system randomly takes a group G from the key shard group according to the application order, calculates the number of key shards of G, and assumes it is n. Then, n public-private key pairs (pk1, sk1), (pk2, sk2), (pk3, sk3)... (pkn, skn) are created, and the public key array {pk1, pk2, pk3... pkn} in this group of public-private key pairs is sent to the recipient.
[0097] After receiving the public-private key pair, the receiver's backend system selects an index i as the key shard tag to be obtained. It generates a random number r, encrypts the random number r with the public key corresponding to the selected index i, and sends the encrypted result R to the central bank's digital currency core system.
[0098] After receiving R, the central bank digital currency core system attempts to decrypt R using each item in {sk1, sk2, sk3…skn}:
[0099] R1=Decsk1(R);
[0100] R2=Decsk2(R);
[0101] R3=Decsk3(R);
[0102] …;
[0103] Rn=Decskn(R);
[0104] The result is used as the symmetric encryption key to encrypt each item of the key shard array passed this time. Assuming that the selected group is G, the encryption process is as follows:
[0105] M1=EncR1(G1);
[0106] M2=EncR2(G2);
[0107] M3=EncR3(G3);
[0108] …;
[0109] Mn=EncRn(Gn);
[0110] Send the array {M1,M2,M3…Mn} to the recipient system;
[0111] The receiver system selects the element Mi in the message array according to the index i selected in step 3, and decrypts it using r generated in step 3 to obtain the key-sharded plaintext S.
[0112] Each recipient interacts with the central bank's digital currency core system in the same way and obtains their own key shard plaintext.
[0113] During this process, it ensures that the central bank's digital currency core system does not know which key fragment is selected by each recipient, and also prevents each recipient from obtaining irrelevant keys.
[0114] Step 5: After the host computer system receives the message that the smart contract sub-account has been successfully created, it initiates the payment user wallet fund transfer operation, and the payment wallet transfers the agreement funds to the smart contract account.
[0115] Step 6: When the triggering conditions of the smart contract are met, the smart contract is executed, and the contract execution instructions are sent to the payment wallet system, the receiving wallet system, the payment operation institution backend system, the receiving wallet backend system and other business participant systems. After the business participant verifies the legitimacy of the contract pre-execution process, it sends the key fragment to the central bank's digital currency core system.
[0116] In step 7, after the central bank's digital currency core system collects the key shards, it calculates the original smart contract key through Lagrange interpolation based on the polynomial created in step 3 and the key shard collection rules. The process is as follows:
[0117] Li(x)= ;
[0118] Assuming there are t key shards, the calculation formula for key u is as follows:
[0119] ;
[0120] The final calculation can obtain the original key u. The central bank's digital currency core system uses the key u to unlock the digital currency in the smart contract account and transfer it to the recipient's wallet. After the execution is completed, the contract and the polynomials and key information related to this contract are destroyed, and the transaction is completed.
[0121] Example 2 provides a detailed implementation process. The specific implementation of each step in this Example 2 is described in detail as follows: The specific implementation of step S10 is as follows:
[0122] First, receive the smart contract creation instruction sent by the user's wallet management system. The smart contract creation instruction contains the wallet address of the transaction initiator. , Transaction recipient wallet address , Protocol Rules and the agreed transaction amount .
[0123] Next, we need to verify the validity of this information. Specifically, we first verify the wallet address of the transaction initiator. The validity of the address can be ensured by checking the address format, checksum, etc. Is a legal digital currency wallet address. Then, verify the transaction recipient's wallet address The effectiveness of the
[0124] After that, the protocol rules need to be Perform syntax parsing and rule validity verification. You can use the relevant domain specific language (DSL) parser to Perform grammatical analysis to check whether it conforms to the predefined grammatical specifications. Verify the specific rules in the document to ensure that its description is legal and valid.
[0125] Finally, the agreement transaction amount needs to be verified The legality of Whether it is within the balance range of the transaction initiator's wallet account and whether it complies with the regulatory requirements of the region.
[0126] After the above verification steps, the key information that has passed the verification can be , , and Perform association binding and generate verification results for smart contract creation instructions.
[0127] The specific implementation of step S20 is as follows:
[0128] First, build a smart contract to create a message , and generate protocol summary information . Protocol Summary Information It can be the content of the message The hash value obtained by hashing, or The signature value obtained by digital signature.
[0129] Next, from the transaction initiator's wallet address Extract the public key information , from the transaction recipient wallet address Extract the public key information .
[0130] Then, the protocol rules Compile into smart contract executable code . At the same time, get the current system timestamp , and set it as the time when the agreement takes effect.
[0131] Next, , , , and Packaged as smart contract message .
[0132] Finally, through the private key of the relevant party and right Perform digital signature and generate signature verification result .
[0133] The specific implementation of step S30 is as follows:
[0134] First, based on the smart contract message built in the previous step , generate a unique business identification number The specific method is to use The content is passed through a hash function Calculated .
[0135] Next, and , and Bind and establish an association relationship.
[0136] Then, through the encryption module , Generate the original private key of the smart contract using information such as . This can be calculated using the following formula:
[0137] ;
[0138] in, Indicates the use of a key The encryption process, Represents a string concatenation operation.
[0139] To ensure The security of the encryption strength needs to be tested. The entropy value , and the preset safety threshold Make comparisons to ensure .
[0140] Finally, the tested Mark as pending sharding state, ready for the next step.
[0141] The specific implementation of step S40 is as follows:
[0142] First, the smart contract private key generated in the previous step According to the preset bit length Segment to generate the initial key fragment sequence ,in .
[0143] Next, these key shards need to be evaluated and optimized. Specifically, each key shard needs to be calculated Information entropy value , any two key shards and The correlation coefficient between , and each key shard The complexity score of .
[0144] Information entropy value of key shards It can be calculated by the following formula:
[0145] ;
[0146] in, for Middle The probability of a binary number appearing is is the entropy adjustment coefficient, is the entropy compensation term.
[0147] Correlation coefficient between key shards It can be calculated by the following formula:
[0148] ;
[0149] in, and They are and The mean value of is the correlation adjustment coefficient, is the correlation correction term.
[0150] Complexity score for key sharding It can be calculated by the following formula:
[0151] ;
[0152] in, for Length, is the maximum allowed length, for 01 conversion times, is the maximum number of conversions allowed, for The uniformity of is the maximum allowable uniformity, , and is the weight coefficient, is the complexity adjustment coefficient, is the complexity correction term.
[0153] Then, the comprehensive information entropy value , correlation coefficient and complexity score , calculate each key shard Safety score :
[0154] ;
[0155] in, is the maximum allowable entropy value, is the maximum allowable correlation coefficient, is the maximum allowed complexity, , and is the weight coefficient, is the safety adjustment factor, This is a security fix.
[0156] Finally, according to the safety score Initial fragment sequence Optimize and generate the final smart contract key sharding sequence Next, construct a The key distribution matrix ,Will Fill it in, is the number of groups.
[0157] The specific implementation of step S50 is as follows:
[0158] First, according to the number of receivers , the key distribution matrix generated in the previous step Divide into Sub-matrices ,in Each submatrix Corresponds to a receiver.
[0159] Next, for each submatrix Generate a sequence of public and private key pairs , its length Same as the number of key shards in this submatrix.
[0160] Then, each sub-matrix The corresponding public key sequence Sent to the corresponding recipient system.
[0161] The receiver system will randomly select the index of the key shard , and use the corresponding public key Encrypt it and generate an encrypted random number , and then send it back.
[0162] Next, use the private key sequence Decrypt these encrypted random numbers to get the decryption result sequence .
[0163] Finally, the decrypted sequence is used as the symmetric encryption key to encrypt the submatrix The key shards in the cipher are encrypted and sent to the corresponding receiver system to complete the secure distribution of the key shards.
[0164] The specific implementation of step S60 is as follows:
[0165] First, based on the smart contract creation instructions obtained earlier, build a smart contract digital currency account .for Assign a unique identifier .
[0166] Next, the smart contract key is sharded into a sequence and Establish a binding relationship and record it in the account status information.
[0167] Then, you need to verify the transaction initiator's wallet account Balance Whether the agreed transaction amount is met The requirement is .
[0168] If satisfied, a fund transfer instruction is generated. from Transfer In At the same time, record the relevant information of the fund transfer operation, including the transfer time , Transfer amount , transfer out of account , transfer to account wait.
[0169] Finally, Update Status, record the information of transfer completion.
[0170] The specific implementation of step S70 is as follows:
[0171] First, continuously monitor the execution trigger conditions of smart contracts Once satisfied , you need to generate a contract execution notification , and send it to various business participants, including the payment wallet system, the collection wallet system, and the backend systems of the operating agencies of both parties.
[0172] Received After that, these participants need to return the contract execution confirmation information .
[0173] Then, the legality of the contract execution process needs to be verified. Specifically, the execution conditions can be checked. Whether it is met, whether the execution process meets expectations, whether the execution authority is legal, etc.
[0174] Finally, receive the key fragment sent by the business participant , and verify the integrity and validity of these key shards. You can check whether a shard is missing and whether the security indicators of each shard meet the requirements.
[0175] The specific implementation of step S80 is as follows:
[0176] First, receive the key fragment sent by the business participant , and verify the integrity of these shards.
[0177] Then, calculate each key shard The index value of , and construct the Lagrangian basis functions based on these index values:
[0178] ;
[0179] Next, the interpolation coefficients are calculated using the Lagrange basis function. , and shard it with the key Perform modular operation to obtain the initial reconstruction key :
[0180] ;
[0181] in, is a large prime modulus.
[0182] In order to improve the accuracy of reconstruction, it is necessary to calculate the reconstruction error , and based on the reconstruction adjustment coefficient Perform error correction to generate the final reconstructed key :
[0183] ;
[0184] Finally, verify the reconstructed key The validity of the smart contract digital currency account is verified by using the key Unlock the digital currency in the account.
[0185] The specific implementation of step S90 is as follows:
[0186] First, reconstruct the smart contract private key based on the previous step , generate a funds transfer authorization code . It can be calculated by the following formula:
[0187] ;
[0188] in, Represents a function that generates an authorization code.
[0189] Then, you need to verify this authorization code The validity of the data can be checked using the following formula:
[0190] ;
[0191] Next, generate the funds transfer instruction of the smart contract digital currency , and perform fund transfer operations, In Digital currency is transferred to the wallet of the transaction recipient .
[0192] Finally, clear away , and the associated key distribution matrix , update the status of the smart contract to completed , and generate a notification of execution completion .
[0193] In order to further better understand and implement the present invention, the following provides Example 3 of a specific application scenario of the present invention: Enterprise A intends to conduct a supply chain financing business with supplier B, which involves the transfer of digital currency assets. To ensure the security and neutrality of the entire business process, Enterprise A decides to adopt the security and neutrality digital currency smart contract implementation method proposed in the present invention. The following is a specific implementation scenario:
[0194] First, the legal department of Company A and relevant personnel of Supplier B jointly drafted the agreement rules of the smart contract. The contract rules mainly include: 1) Within 3 working days after Company A pays a certain amount of accounts payable to Supplier B, Supplier B needs to pay an equal amount of security deposit to Company A; 2) Company A can apply for the refund of the security deposit 3 months after the security deposit is received based on the actual business situation; 3) If Supplier B fails to pay the security deposit after the deadline, the contract will be automatically executed and the security deposit will be transferred to the account designated by Company A; 4) After the contract is executed, all key materials will be destroyed. After confirmation by both parties, the contract rules are encoded into executable code for the smart contract. .
[0195] Next, the digital asset management department of Enterprise A generates smart contract creation instructions according to the contract rules, including: the wallet address of the transaction initiator (Enterprise A's digital currency wallet), transaction recipient's wallet address (Smart Contract Account), Protocol Rules and the agreed transaction amount (Margin amount). After the necessary information verification, the instruction enters the smart contract construction process.
[0196] In the smart contract construction process, the protocol summary information is first generated The specific method is to create a contract message The content is calculated using the SHA-256 hash algorithm to obtain the summary information Next, extract the public key information from the digital currency wallets of enterprise A and supplier B respectively. and Then, , , , and contract effective time Packaged as smart contract message , and calculate the signature value through the digital signature algorithm of enterprise A and supplier B , as the digital signature of the message.
[0197] Based on smart contract message , generates a unique business identification number In order to ensure the security of the private key, it is key-sharded. First, the original private key The key is segmented into 256 bits and 256 key fragments are generated. .
[0198] Next, these key shards are evaluated and optimized. First, the information entropy value of each shard is calculated. . Assume that the 100th shard The binary sequence is "10011001", then its probability of occurrence is , , we can get . Similarly, the entropy values of other shards are calculated.
[0199] Then, calculate the correlation coefficient between any two key shards . Assume that the 100th shard and the 200th shard The binary sequences are "10011001" and "01100110" respectively. After calculation, we can get , , .
[0200] Next, calculate the complexity score for each key shard . Assume that the 100th shard Length bit,01 conversion times Second, uniformity , we can get .
[0201] Finally, the security score of each key shard is calculated by combining the entropy, correlation and complexity indicators. . Assume that the 100th shard of , , , we can get According to the security score, the initial key sharding sequence is optimized to generate the final smart contract key sharding sequence. .
[0202] Next, construct the key distribution matrix Since this scenario involves two parties, enterprise A and supplier B, the key shard sequence is randomly divided into two subsets, each containing 128 key shards. The constructed key distribution matrix As shown in Table 1 below:
[0203] Table 1 Key distribution matrix
[0204]
[0205] Next, the oblivious transfer algorithm is used to securely distribute the key shards. The specific steps are as follows:
[0206] 1. Enterprise A and supplier B each generate a set of public and private key pairs. and .
[0207] 2. Enterprise A sends its public key sequence Sent to supplier B, supplier B also sends its public key sequence Sent to Company A.
[0208] 3. Supplier B randomly selects 128 indexes , and use the corresponding public key Encrypt these indexes to get , sent to enterprise A.
[0209] 4. Enterprise A uses its own private key sequence Decrypt the received encrypted data and get .
[0210] 5. Enterprise A uses the decryption result as the symmetric key to decrypt the matrix The 128 key shards in are encrypted and sent to supplier B.
[0211] 6. Supplier B uses its own private key sequence Decrypt the received encrypted data and obtain your own 128 key shards.
[0212] Through this oblivious transfer algorithm, enterprise A and supplier B successfully completed the secure distribution of key shards, and neither party could obtain the other's key shard information.
[0213] Next, build a smart contract digital currency account , assign a unique identifier to it , and divide the key into a sequence Establish a binding relationship with the account. Then, Enterprise A verifies the balance of its own digital currency wallet USDC, meets the agreed transaction amount USDC requirements. So a fund transfer instruction is generated. Transfer from company A’s wallet to the smart contract account The relevant information of this fund transfer operation is shown in Table 2 below:
[0214] Table 2 Related information table
[0215]
[0216] Finally, the smart contract account The status is updated to "pending".
[0217] In the contract execution phase, first monitor the triggering conditions of the contract , that is, whether supplier B has paid the deposit to enterprise A within 3 working days. Once this condition is met, a contract execution notice is generated. , and sent to the payer company A, the payee supplier B and the operating organizations of both parties.
[0218] After receiving the notification, each party needs to verify the legality of the contract execution. First, check the execution conditions Is it satisfied? It has been confirmed that Supplier B has paid a deposit of 50,000 USDC to Enterprise A at 2023-06-04 15:30:00. Then, check the execution flow Whether it meets expectations, the contract execution process is normal after verification, Finally, verify the execution permissions , confirm that both company A and supplier B have the right to execute the contract, .
[0219] After verification, Enterprise A and Supplier B send their own key shards to the digital currency core system. The system receives the complete key shard sequence. After that, the Lagrange interpolation algorithm is used to reconstruct it and obtain the final smart contract private key. .
[0220] Next, use the reconstructed private key Generate Funds Transfer Authorization Code , and verify its validity. Finally, execute the fund transfer instruction , the smart contract account Transfer 50,000 USDC to the digital currency wallet designated by Company A.
[0221] After the contract is executed, all key materials include , and the key distribution matrix The smart contract status is updated to "Completed" , and generate a contract execution completion notification Sent to all parties involved.
[0222] Through the above implementation process, it can be seen that the security neutral digital currency smart contract implementation method proposed by the present invention makes full use of the core technologies such as key sharding optimization, inadvertent transmission and multi-party verification, effectively protects the security of digital currency assets, and also ensures the neutrality and fairness of the entire contract execution process. Compared with the existing keyless neutral contract and key contract schemes, this scheme has been significantly improved in terms of technical innovation and practicality.
[0223] It should be noted that the detailed explanations of the variables involved in the description of the present invention are shown in Table 3.
[0224] Table 3 Variable explanation table
[0225]
[0226] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for implementing a secure and neutral digital currency smart contract, characterized in that: The following steps are involved: S10. Obtain a smart contract creation instruction, where the smart contract creation instruction includes the transaction initiator's wallet address, the transaction recipient's wallet address, the protocol rules, and the agreed transaction amount; S20, constructing a message for the smart contract creation instruction, wherein the message includes a protocol summary, public key information of both parties to the agreement, protocol rules, and the effective time of the agreement, and signing and verifying the message through the private key of the relevant party; S30, generating a unique business identification number based on the message, and constructing a smart contract private key through an encryption module using the unique business identification number in combination with the message content; S40, sharding the smart contract private key using the Shamir secret sharing algorithm, optimizing the key sharding based on the key sharding optimization equation group, generating a smart contract key sharding sequence, and constructing a key distribution matrix of the smart contract key sharding sequence, wherein each element in the key distribution matrix corresponds to a key shard; S50, grouping the key distribution matrix, randomly dividing the key sharding sequence into a plurality of key sharding subsets according to the number of recipients, and performing key distribution on each of the key sharding subsets based on an oblivious transfer algorithm, wherein the oblivious transfer algorithm includes public-private key pair generation, key selection, data encryption and decryption, and key sharding plaintext extraction; S60: Based on the smart contract creation instruction and the smart contract key shard sequence, a smart contract digital currency account is constructed, and a fund transfer operation is performed to transfer the agreement funds into the smart contract digital currency account; S70. When the smart contract execution condition is triggered, a contract execution instruction is sent to the business participant, and the business participant verifies the contract execution process and sends the key shard to the digital currency core system; S80, reconstructing the received key shards using a Lagrange interpolation algorithm to obtain a reconstructed smart contract private key, and unlocking the digital currency in the smart contract digital currency account based on the reconstructed smart contract private key; S90, executing the smart contract digital currency fund transfer, and destroying the smart contract private key, the key sharding sequence and the related key distribution matrix; The key sharding optimization equation group includes a key sharding entropy calculation equation, a key sharding correlation evaluation equation, a key sharding complexity calculation equation, and a key sharding security measurement equation; The key shard entropy calculation equation is used to calculate the information entropy of each key shard, the input includes the binary sequence of the key shard and the length of the key shard, and the output is the information entropy value of the key shard; The key shard correlation evaluation equation is used to evaluate the correlation between different key shards, the input includes a binary sequence of any two key shards, and the output is the correlation coefficient between the key shards; The key sharding complexity calculation equation is used to calculate the structural complexity of the key sharding, the input includes the binary sequence of the key sharding and the sharding length, and the output is the complexity score of the key sharding; The key sharding security metric equation is used to evaluate the overall security of the key sharding, the input includes the information entropy value, correlation coefficient and complexity score of the key sharding, and the output is the comprehensive security score of the key sharding; The key sharding entropy calculation equation is specifically expressed as follows: ; In the formula, is the information entropy value of the key shard; The first key shard The probability of a binary number appearing; is the length of the key shard; is the entropy adjustment coefficient, and its value range is ; is the entropy compensation term, which is used to correct the error of entropy calculation; The key sharding correlation evaluation equation is specifically expressed as follows: ; In the formula, Shard for two keys and The correlation coefficient of The first two key shards are Bit binary value; are the means of the two key shards respectively; is the correlation adjustment coefficient, and its value range is ; is the correlation correction term; The key sharding complexity calculation equation is specifically expressed as follows: ; In the formula, Score the complexity of key sharding; is the fragment length; is the maximum allowed length; is the number of 01 conversions in the slice; is the maximum number of conversions allowed; is the uniformity of the sharding; is the maximum allowable uniformity; is the weight coefficient and satisfies ; is the complexity adjustment coefficient; is the complexity correction term; The key sharding security metric equation is specifically expressed as follows: ; In the formula, Score the security of the key shard; is the maximum allowable entropy value; is the maximum allowed correlation coefficient; is the maximum allowed complexity; is the weight coefficient and satisfies ; is the safety adjustment factor; This is a security fix.
2. The method according to claim 1, characterized in that The step S10 specifically includes: Step 101: Receive a smart contract creation instruction sent by the user wallet management system; Step 102: extract the transaction initiator's wallet address in the smart contract creation instruction, and verify the validity of the transaction initiator's wallet address; Step 103: extract the transaction recipient wallet address in the smart contract creation instruction, and verify the validity of the transaction recipient wallet address; Step 104: extract the protocol rules in the smart contract creation instruction, perform syntax parsing and rule validity verification on the protocol rules; Step 105: extract the agreed transaction amount in the smart contract creation instruction, and verify the legitimacy of the agreed transaction amount; Step 106: Associate and bind the verified transaction initiator's wallet address, transaction recipient's wallet address, protocol rules, and protocol transaction amount; Step 107: Generate smart contract creation instruction verification results.
3. The method according to claim 1, characterized in that The step S20 specifically includes: Step 201: Construct a smart contract creation message and generate protocol summary information; Step 202: extract the public key information in the wallet address of the transaction initiator and the public key information in the wallet address of the transaction recipient; Step 203: compile the protocol rules into smart contract executable code; Step 204: Obtain the current system timestamp, and set the current system timestamp as the protocol effective time; Step 205: Pack the protocol summary information, the public key information, the smart contract executable code and the protocol effective time into a smart contract message; Step 206: digitally sign the smart contract message using the private key of the relevant party; Step 207: Generate smart contract message signature verification result.
4. The method according to claim 1, characterized in that: The step S30 specifically includes: Step 301: Generate a unique business identification number based on the smart contract message; Step 302: Bind the unique business identification number to the transaction initiator's wallet address in the smart contract message; Step 303: Bind the unique service identification number to the transaction recipient wallet address in the smart contract message; Step 304: Bind the unique service identification number to the smart contract executable code in the smart contract message; Step 305: Generate an original private key of the smart contract based on the unique business identification number and the smart contract message through an encryption module; Step 306: Perform encryption strength test on the original private key of the smart contract; Step 307: Mark the original private key of the smart contract as being in a state to be sharded.
5. The method according to claim 1, characterized in that The step S40 specifically includes: Step 401: segment the smart contract private key according to a preset bit length to generate an initial key fragment sequence; Step 402: Calculate the information entropy value of each key fragment in the initial key fragment sequence, where the information entropy value is calculated based on the bit occurrence probability in the key fragment and the entropy compensation term; Step 403: Calculate the correlation coefficient between any two key fragments in the initial key fragment sequence, where the correlation coefficient is calculated based on the binary sequence mean of the key fragments and the correlation correction term; Step 404: Calculate the complexity score of each key fragment in the initial key fragment sequence, wherein the complexity score is calculated based on the key fragment length ratio, the bit transition number ratio, the uniformity ratio, and the complexity correction term; Step 405: Calculate the security score of each key shard in the initial key shard sequence, wherein the security score is calculated based on the information entropy value ratio, the correlation coefficient ratio, the complexity score ratio, and the security correction item; Step 406: Optimize the initial key sharding sequence according to the security score to generate a smart contract key sharding sequence; Step 407: construct a key distribution matrix, and fill the smart contract key fragment sequence into the key distribution matrix.
6. The method according to claim 1, characterized in that The step S50 specifically includes: Step 501: Divide the key distribution matrix into a plurality of sub-matrices according to the number of receivers, each of the sub-matrices corresponding to one receiver; Step 502: Generate a public-private key pair sequence for each sub-matrix, where the length of the public-private key pair sequence is the same as the number of key shards in the sub-matrix; Step 503: Send the public key sequence corresponding to each of the sub-matrices to the corresponding receiver system; Step 504: Receive the encrypted random number returned by the receiver system, where the receiver system selects a key shard index and generates encryption using a corresponding public key; Step 505: Decrypt the encrypted random number using the private key sequence to obtain a decryption result sequence; Step 506: Use the decryption result sequence as a symmetric encryption key to encrypt the key slices in the sub-matrix; Step 507: Send the encrypted key shards to the receiver system to complete the key shard distribution.
7. The method according to claim 1, characterized in that The step S60 specifically includes: Step 601: construct a smart contract digital currency account based on the smart contract creation instruction; Step 602: assign a unique account identifier to the smart contract digital currency account; Step 603: Establish a binding relationship between the smart contract key shard sequence and the smart contract digital currency account; Step 604: Verify whether the balance of the transaction initiator's wallet account meets the agreed transaction amount requirement; Step 605: Generate a fund transfer instruction to transfer the agreement funds from the transaction initiator's wallet to the smart contract digital currency account; Step 606: Record the fund transfer operation log, including the transfer time, transfer amount, transfer-out account, and transfer-in account; Step 607: Update the smart contract digital currency account status.
8. The method according to claim 1, characterized in that The step S70 specifically includes: Step 701: Monitor the trigger conditions for smart contract execution; Step 702: When the trigger condition is met, a smart contract execution notification is generated; Step 703: Sending a contract execution instruction to the business participants, including the payment wallet system, the receiving wallet system, the payment operation institution backend system, and the receiving operation institution backend system; Step 704: Receive the contract execution confirmation information returned by the business participant; Step 705: Verify the legality of the contract execution process, including execution condition verification, execution process verification, and execution authority verification; Step 706: Receive the key fragment sent by the business participant; Step 707: Verify the integrity and validity of the received key fragments.
9. The method according to claim 1, characterized in that: The step S80 specifically includes: Step 801: Receive key fragments sent by a business participant and verify the integrity of the key fragments; Step 802: Calculate the index value of the key shard and construct a Lagrangian basis function; Step 803, calculating interpolation coefficients using the Lagrangian basis function; Step 804: Perform a modular operation on the interpolation coefficient and the key shard to obtain an initial reconstruction key; Step 805: Calculate the key reconstruction error and perform error correction based on the reconstruction adjustment coefficient; Step 806: Generate a final reconstruction key, and verify the validity of the final reconstruction key; Step 807: Use the final reconstruction key to unlock the digital currency in the smart contract digital currency account.
10. The method according to claim 1, characterized in that The step S90 specifically includes: Step 901: Generate a fund transfer authorization code based on the reconstructed smart contract private key; Step 902: Verify the validity of the fund transfer authorization code; Step 903: Generate a smart contract digital currency fund transfer instruction; Step 904: Execute a fund transfer operation to transfer the funds in the smart contract digital currency account to the transaction recipient's wallet; Step 905: Clear the smart contract private key, the key sharding sequence, and the related key distribution matrix; Step 906: Update the smart contract status to completed status; Step 907: Generate a smart contract execution completion notification.
Citation Information
Patent Citations
Transaction method and device based on threshold signature
CN112288431A
Method and device for cooperatively generating fragments by two parties
CN114244497A
Key escrow method based on block chain and key sharing
CN117459230A