Electronic contract automatic generation method and system based on block chain

By defining contract templates and parameters on the blockchain, using smart contracts to generate electronic contracts, and locking contracts through hash time to achieve cross-chain operations, the problems of manual intervention and cross-platform connection in the existing technology are solved, and contract management is improved The efficiency and security of the company ensure legal compliance.

CN118967050APending Publication Date: 2024-11-15GUANGZHOU SUIJIAN CONSTR TECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411114623.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The existing electronic contract system requires manual intervention in the face of changes in the external environment, and the contract management systems of different regions and platforms cannot be seamlessly connected and integrated, and there are restrictions such as automatic adaptation and privacy protection.

Method used

Define and store contract templates on the blockchain, enter and encrypt contract parameters, generate electronic contracts that meet legal requirements through smart contracts, and achieve cross-chain operations through hash time locking smart contracts, conduct risk assessments and dynamic adjustment of contract terms.

Benefits of technology

It improves the efficiency and security of contract management, ensures legal compliance, and supports multi-chain operations, expanding the applicability of blockchain technology on a global scale.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967050A_ABST
    Figure CN118967050A_ABST
Patent Text Reader

Abstract

The invention discloses an electronic contract automatic generation method and system based on a block chain. The electronic contract automatic generation method based on the block chain comprises the following steps: defining and storing a contract template on the block chain; inputting parameters required by the contract, and encrypting and storing the parameters in the block chain; verifying the encrypted parameters, and executing the smart contract according to the parameters when the conditions are met; the intelligent contract generates an electronic contract meeting legal requirements according to a preset contract template and conditions; after the generated electronic contract is preliminarily examined, encrypting the electronic contract; according to the method, the generation, verification and approval processes of the contract can be effectively managed, the efficiency and safety of contract management are improved, meanwhile, the law compliance of contract execution is guaranteed, and the applicability of the block chain technology in the global range is expanded by supporting multi-chain operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic contract generation, and in particular to a method and system for automatically generating electronic contracts based on blockchain. Background Art

[0002] With the rapid development of information technology, electronic contracts, as a modern alternative to traditional paper contracts, have become a commonly used method in commercial transactions. Initially, electronic contracts mainly relied on digital signature technology to ensure the authenticity and integrity of contracts. In the field of electronic contracts, the introduction of blockchain technology has brought innovation to traditional contract management. Although it has achieved digital management of contracts to a certain extent, it still has limitations in automatically adapting to external changes, privacy protection, and cross-chain operations. Traditional electronic contract systems usually require manual intervention when facing changes in the external environment, and contract management systems in different regions and different platforms often cannot be seamlessly connected and integrated. Summary of the invention

[0003] In order to overcome the defects in the above-mentioned prior art, the present invention provides a method for automatically generating electronic contracts based on blockchain, including: defining and storing contract templates on the blockchain; inputting parameters required for the contract, and encrypting and storing the parameters on the blockchain; verifying the encrypted parameters, and when the conditions are met, executing the smart contract according to the parameters; the smart contract generates an electronic contract that meets legal requirements based on the preset contract template and conditions; the generated electronic contract is automatically sent to all parties for approval after preliminary review.

[0004] As a preferred solution of the blockchain-based automatic electronic contract generation method described in the present invention, the contract template includes the basic structure, terms and conditions of the contract, but does not include specific contract parameters or personalized information.

[0005] As a preferred solution of the blockchain-based automatic generation method of electronic contracts described in the present invention, it also includes: encrypting the electronic contract; performing a hash operation on the contract plaintext m to generate a hash value H(m), encrypting the electronic contract through a symmetric key k, and uploading the generated ciphertext c to the InterPlanetary File System; wherein the symmetric key k is:

[0006] k=(m*H(m))mod d

[0007] Where d is a random number;

[0008] The ciphertext c is:

[0009] c=E(k,S)

[0010] Where: E() is the AES-256 encryption function, S is a pseudo-random sequence;

[0011] The administrator uses the public key to encrypt the symmetric key k and the index address returned by the InterPlanetary File System to generate a key ciphertext kc0, and uploads it to the blockchain network together with the hash value H(m); when a user applies to access an electronic contract, it is determined whether the user meets the set access requirements. If so, the user's public key is called in the blockchain network to generate a re-encryption key kc1 for the user locally. After receiving the re-encrypted ciphertext, the user can decrypt it and obtain the plaintext data of the electronic contract; if not, the application is rejected; the re-encryption key kc1 is sent to the smart contract, and after receiving the re-encryption key kc1, the smart contract calls the key ciphertext kc0 uploaded by the administrator on the blockchain for re-encryption, and then returns the generated re-encrypted ciphertext Rm to the user.

[0012] As a preferred solution of the blockchain-based electronic contract automatic generation method described in the present invention, the smart contract includes: identifying the blockchain network that needs cross-chain interoperability and the data and asset types that need to be exchanged; determining the interface and data structure of the smart contract; using the hash time lock smart contract to perform cross-chain atomic exchange; designing and deploying HTLC contracts on each blockchain and defining HTLC contract parameters; deploying and testing the HTLC contract on the test network to verify its functionality and security; configuring bridge nodes to enable them to monitor and record transaction status on different blockchains; performing data synchronization processing on the bridge nodes so that the bridge nodes can read and verify transaction information on the two blockchains in real time; and executing cross-chain transactions, including asset locking, asset unlocking, and transaction verification.

[0013] As a preferred solution of the blockchain-based automatic generation method of electronic contracts described in the present invention, it also includes: risk assessment of electronic contracts: collecting historical contract data, including contract type, delivery period, payment terms, breach of contract, and dispute type; using historical contract data to train the risk assessment model, and performing risk assessment on the generated contract text through the trained risk assessment model; real-time monitoring of the execution progress of new contracts, collecting real-time data streams, including supplier delivery time and quality inspection results; dynamically adjusting contract terms based on real-time monitoring data and risk assessment results to reflect changes in the current market and supply chain environment.

[0014] As a preferred solution of the blockchain-based automatic electronic contract generation system described in the present invention, wherein: a template construction module is configured to execute the definition and storage of contract templates on the blockchain; a parameter setting module is configured to execute the input of parameters required for the contract and encrypt and store the parameters on the blockchain; a smart contract execution module is configured to execute the verification of the encrypted parameters, and when the conditions are met, execute the smart contract according to the parameters; an electronic contract generation module is configured to execute the smart contract according to the preset contract template and conditions, and generate an electronic contract that meets legal requirements; and a review module is configured to execute the generated electronic contract and encrypt the electronic contract after preliminary review.

[0015] As a preferred solution of the blockchain-based automatic electronic contract generation system described in the present invention, the template construction module is specifically configured to execute the definition of a contract template, which includes the basic structure, terms and conditions of the contract, but does not include specific contract parameters or personalized information.

[0016] As a preferred solution of the blockchain-based electronic contract automatic generation system described in the present invention, it also includes an electronic contract encryption module, which is configured to execute: performing a hash operation on the contract plaintext m to generate a hash value H(m), encrypting the electronic contract through the symmetric key k, and uploading the generated ciphertext c to the interplanetary file system; wherein the symmetric key k is:

[0017] k=(m*H(m))mod d

[0018] Where d is a random number;

[0019] The ciphertext c is:

[0020] c=E(k,S)

[0021] Where: E() is the AES-256 encryption function, S is a pseudo-random sequence;

[0022] The administrator uses the public key to encrypt the symmetric key k and the index address returned by the InterPlanetary File System to generate a key ciphertext kc0, and uploads it to the blockchain network together with the hash value H(m); when a user applies to access an electronic contract, it is determined whether the user meets the set access requirements. If so, the user's public key is called in the blockchain network to generate a re-encryption key kc1 for the user locally. After receiving the re-encrypted ciphertext, the user can decrypt it and obtain the plaintext data of the electronic contract; if not, the application is rejected; the re-encryption key kc1 is sent to the smart contract, and after receiving the re-encryption key kc1, the smart contract calls the key ciphertext kc0 uploaded by the administrator on the blockchain for re-encryption, and then returns the generated re-encrypted ciphertext Rm to the user.

[0023] As a preferred solution of the blockchain-based electronic contract automatic generation system described in the present invention, the smart contract execution module is specifically configured to execute: identifying the blockchain network that needs cross-chain interoperability and the data and asset types that need to be exchanged; determining the interface and data structure of the smart contract; using hash time lock smart contracts to perform cross-chain atomic swaps; designing and deploying HTLC contracts on each blockchain and defining HTLC contract parameters; deploying and testing HTLC contracts on a test network to verify their functionality and security; configuring bridge nodes so that they can monitor and record transaction status on different blockchains; performing data synchronization processing on bridge nodes so that bridge nodes can read and verify transaction information on two blockchains in real time; and executing cross-chain transactions, including asset locking, asset unlocking, and transaction verification.

[0024] As a preferred solution of the blockchain-based automatic electronic contract generation system described in the present invention, it also includes an electronic contract risk assessment module, which is configured to perform: collecting historical contract data, including contract type, delivery period, payment terms, breach of contract, and dispute type; using historical contract data to train the risk assessment model, and performing risk assessment on the generated contract text through the trained risk assessment model; real-time monitoring of the execution progress of new contracts, and collecting real-time data streams, including suppliers' delivery time and quality inspection results; dynamically adjusting contract terms based on real-time monitoring data and risk assessment results to reflect changes in the current market and supply chain environment.

[0025] Beneficial effects of the invention: The invention can effectively manage the generation, verification and approval process of the contract, improve the efficiency and security of contract management, while ensuring the legal compliance of contract execution, and by supporting multi-chain operations, expand the applicability of blockchain technology on a global scale. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:

[0027] Figure 1 This is a flowchart of the method for automatically generating an electronic contract based on blockchain according to the first embodiment of the present invention;

[0028] Figure 2 This is a schematic diagram of the process of creating a cross-chain smart contract according to the first embodiment of the present invention;

[0029] Figure 3This is a flow chart of the electronic contract risk assessment process described in the first embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0031] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0032] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0033] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.

[0034] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0035] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0036] Example 1

[0037] Reference Figure 1 to Figure 3 , which is the first embodiment of the present invention, and provides a method for automatically generating an electronic contract based on blockchain, comprising:

[0038] S1: Define and store contract templates on the blockchain.

[0039] The contract template includes the basic structure, terms and conditions of the contract (the contract terms can automatically adjust the payment terms according to the changes in the relevant market price index), such as title, information of both parties, background, service description, service fee, service period, etc., but does not include specific contract parameters or personalized information, such as information of the participating parties, contract amount, validity period, etc. The storage of contract templates is managed through smart contracts to ensure the transparency and immutability of the templates.

[0040] S2: Enter the parameters required by the contract and encrypt and store the parameters on the blockchain.

[0041] The user enters the parameters required for the contract through the interface or API, such as information of the participating parties, contract amount, validity period, etc. These input parameters are stored on the blockchain in an encrypted manner to ensure the security and privacy of the data.

[0042] S3: Verify the encrypted parameters. When the conditions are met, execute the smart contract according to the parameters.

[0043] Smart contracts are verified based on preset conditions, which may include legal requirements (such as the legal validity of the contract), specific external conditions (such as market prices, timestamps, etc.), or the authorization status of the parties involved.

[0044] Once all conditions are verified, the smart contract will begin to execute the preset contract generation procedure, which includes obtaining the preset contract template and terms from the blockchain, and combining the decrypted parameters to generate the actual electronic contract content.

[0045] S4: Smart contracts generate electronic contracts that comply with legal requirements based on preset contract templates and conditions.

[0046] Smart contracts use verified contract parameters and preset contract templates to automatically generate electronic contracts on the blockchain, ensuring that the contract generation process is efficient and in compliance with legal regulations.

[0047] In order to allow contracts to be seamlessly executed between different blockchain platforms and solve the interoperability problem between blockchains, the present invention creates cross-chain smart contracts on different chains to ensure the consistent execution of contract terms on multiple blockchain networks and achieve secure transmission and exchange of data and assets. Figure 2 , the specific steps are as follows:

[0048] (1) Identify the blockchain networks that need cross-chain interoperability (e.g., Ethereum and Bitcoin) and the types of data and assets that need to be exchanged (e.g., tokens, NFTs, data records, etc.);

[0049] (2) Determine the interface and data structure of the smart contract;

[0050] (3) Use hash time-locked smart contracts for cross-chain atomic swaps;

[0051] (4) Design and deploy HTLC contracts on each blockchain and define HTLC contract parameters;

[0052] HTLC contracts are deployed on each participating blockchain to ensure the atomicity of cross-chain transactions. HTLC requires transactions to be completed within a specific time, otherwise they are automatically canceled.

[0053] Define contract parameters, such as lock time and hash value calculation method.

[0054] (5) Deploy and test the HTLC contract on the test network to verify its functionality and security;

[0055] (6) Configure the bridge node to monitor and record the transaction status on different blockchains;

[0056] (7) Perform data synchronization on the bridge node so that the bridge node can read and verify the transaction information on the two blockchains in real time;

[0057] (8) Execute cross-chain transactions, including asset locking, asset unlocking, and transaction verification.

[0058] a. Asset Locking

[0059] User A locks assets on chain A, generates a hash value (H), and informs user B of the hash value.

[0060] User B uses the same hash value (H) to lock the corresponding assets on chain B.

[0061] b. Asset unlocking

[0062] User A uses a predetermined hash value (H) on chain A to unlock the assets locked by user B on chain B.

[0063] User B uses the same hash value (H) on chain B to unlock the assets locked by user A on chain A.

[0064] c. Transaction Verification

[0065] The bridge node verifies the completion of the transaction and ensures that the assets of both parties have been successfully exchanged.

[0066] Update transaction status to respective blockchain networks to ensure data consistency.

[0067] (9) Regular safety audits

[0068] Regularly conduct security audits on smart contracts and bridge nodes to identify potential security vulnerabilities, and perform repairs and optimizations based on the audit results to improve the overall security of the system.

[0069] S5: After the generated electronic contract is initially reviewed, the electronic contract is encrypted.

[0070] The generated electronic contract will undergo a preliminary review to ensure that there are no significant errors or contradictions. The preliminary review may involve checking the completeness of the contract, the consistency of the terms, and the identity verification of the parties involved.

[0071] Furthermore, in order to improve the security of electronic contracts, electronic contracts need to be encrypted. The specific steps are as follows:

[0072] (1) Perform a hash operation on the contract plaintext m to generate a hash value H(m), encrypt the electronic contract with the symmetric key k, and upload the generated ciphertext c to the InterPlanetary File System. It should be noted that the InterPlanetary File System is a hypermedia protocol designed to operate in a peer-to-peer manner. It is a global, peer-to-peer distributed file storage protocol that achieves effective data storage and sharing through content addressing and a decentralized network architecture. Unlike the traditional HTTP protocol, the InterPlanetary File System does not search and access content through domain name addresses, but rather through the content's unique identifier (i.e., content address). This design makes data transmission in the InterPlanetary File System network more efficient because it avoids the bottleneck problem of centralized servers.

[0073] Among them, the symmetric key k is:

[0074] k=(m*H(m))mod d

[0075] Where d is a random number;

[0076] The ciphertext c is:

[0077] c=E(k,S)

[0078] Where: E() is the AES-256 encryption function, S is a pseudo-random sequence;

[0079] (2) The administrator uses the public key to encrypt the symmetric key k and the index address returned by the InterPlanetary File System to generate the key ciphertext kc0, and uploads it to the blockchain network together with the hash value H(m) to ensure that the data on the chain cannot be tampered with.

[0080] Generate a symmetric key k, which will be used to encrypt data or other sensitive information; the index address is the unique identifier of the file in the distributed system. Further, use the public key encryption algorithm to encrypt the symmetric key k and the index address returned by the InterPlanetary File System:

[0081] kc0=Encrypt(pk,k||index address)

[0082] In the formula, pk is the public key.

[0083] Furthermore, the InterPlanetary File System is used to store electronic contract ciphertexts, and the blockchain stores the electronic contract index values ​​returned by the InterPlanetary File System. A combination of on-chain and off-chain methods is used to ensure the safe and reliable storage of electronic contracts, alleviating the storage pressure on the blockchain.

[0084] Furthermore, the lifecycle management of electronic contracts is automatically executed through smart contracts, including operations such as automatic renewal, renewal or termination of contracts.

[0085] (3) When a user applies to access an electronic contract, it is determined whether the user meets the set access requirements. If so, the user's public key is called in the blockchain network to generate a re-encryption key kc1 for the user locally. After receiving the re-encrypted ciphertext, the user can decrypt it and obtain the plaintext data of the electronic contract. If not, the application is rejected.

[0086] Access requirements include:

[0087] a. Identity verification.

[0088] Users must have a valid digital certificate and confirm their identity through two-factor authentication (such as a password plus biometric verification).

[0089] The user's identity must match their role and permissions within the organization, such as administrator-level permissions or authorization to a specific department.

[0090] b. Equipment and environmental safety.

[0091] Users must use company-issued secure devices and operating systems, and these devices must undergo regular security checks and updates.

[0092] User devices must have up-to-date antivirus software installed, and the device's security configuration must comply with corporate security standards and policies.

[0093] c. Compliance requirements.

[0094] Users must agree in advance to comply with the company's internal data access policies and compliance requirements, including regulations on data protection, privacy protection, and intellectual property protection.

[0095] Users must confirm that their purpose of accessing contract data is legal and complies with the company's compliance requirements, such as contract management regulations or relevant industry regulations.

[0096] (4) The re-encryption key kc1 is sent to the smart contract. After receiving the re-encryption key kc1, the smart contract calls the key ciphertext kc0 uploaded by the administrator on the blockchain to perform a re-encryption operation, and then returns the generated re-encrypted ciphertext Rm to the user.

[0097] The smart contract uses a legitimate decryption algorithm and private key (corresponding to the public key pk used to encrypt kc0) to decrypt the key ciphertext kc0 and obtain the original symmetric key k and the index address of the Interstellar File System.

[0098] Use the obtained original symmetric key k to re-encrypt the re-encryption key kc1, that is, combine kc1 with k and encrypt them to generate the re-encrypted ciphertext Rm.

[0099] Rm=Rijndael(k,kc1)

[0100] S6: Conduct risk assessment on electronic contracts and dynamically adjust contract terms.

[0101] Reference Figure 3 , conduct risk assessment on electronic contracts:

[0102] (1) Collect historical contract data, including contract type, delivery period, payment terms, breach of contract, and dispute type; for example, collect 1,000 supply contracts, of which 200 have breached the contract. The reasons for the breach include delayed delivery, substandard quality, etc.

[0103] (2) Use historical contract data to train the risk assessment model, and use the trained risk assessment model to perform risk assessment on the generated contract text;

[0104] The risk assessment model is extreme random tree or LightGBM; it should be noted that when the extreme random tree determines the best split of each node, it randomly selects a partition point of the feature for splitting. For each tree, samples are randomly selected from the training set for training, which can increase the diversity of the model; LightGBM adopts a leaf-wise growth strategy, that is, each time the leaf with the largest split gain is selected from all current leaves for splitting. Compared with hierarchical growth, it can more effectively reduce losses. By providing a highly optimized gradient boosting framework, LightGBM can build more complex models to capture the complex relationship between different features, thereby more accurately assessing risks.

[0105] (3) Monitor the execution progress of new contracts in real time and collect real-time data streams, including supplier delivery times and quality inspection results.

[0106] Use stream processing technologies such as Apache Kafka or Spark Streaming for data collection and analysis.

[0107] (4) Dynamically adjust contract terms based on real-time monitoring data and risk assessment results to reflect changes in the current market and supply chain environment.

[0108] Example 2

[0109] This embodiment is different from the first embodiment in that it provides an automatic generation system of electronic contracts based on blockchain, including:

[0110] The template building module is configured to execute the definition and storage of contract templates on the blockchain; the contract template includes the basic structure, terms and conditions of the contract (the contract terms can automatically adjust the payment terms according to the changes in the relevant market price index), such as title, information of both parties, background, service description, service fee, service period, etc., but does not include specific contract parameters or personalized information, such as information of the participating parties, contract amount, validity period, etc. The storage of contract templates is managed through smart contracts to ensure the transparency and immutability of the templates.

[0111] The parameter setting module is configured to execute the parameters required for the input contract and encrypt and store the parameters on the blockchain; the user enters the parameters required for the contract, such as party information, contract amount, validity period, etc., through the interface or API.

[0112] The smart contract execution module is configured to execute and verify the encrypted parameters. When the conditions are met, the smart contract is executed according to the parameters; the smart contract is verified according to the preset conditions, which may include legal requirements (such as the legal effect of the contract), specific external conditions (such as market prices, timestamps, etc.) or the authorization status of the participants. The smart contract execution module is specifically configured to execute: identify the blockchain network that needs cross-chain interoperability and the data and asset types that need to be exchanged; determine the interface and data structure of the smart contract; use the hash time lock smart contract for cross-chain atomic exchange; design and deploy HTLC contracts on each blockchain and define HTLC contract parameters; deploy and test HTLC contracts on the test network to verify their functions and security; configure bridge nodes to enable them to monitor and record transaction status on different blockchains; synchronize data on bridge nodes so that bridge nodes can read and verify transaction information on two blockchains in real time; execute cross-chain transactions, including asset locking, asset unlocking and transaction verification.

[0113] An electronic contract generation module is configured to execute the smart contract and generate an electronic contract that meets legal requirements according to a preset contract template and conditions;

[0114] The review module is configured to perform a preliminary review of the generated electronic contract and then encrypt the electronic contract.

[0115] The electronic contract encryption module is configured to perform: performing a hash operation on the contract plaintext m to generate a hash value H(m), encrypting the electronic contract using a symmetric key k, and uploading the generated ciphertext c to the InterPlanetary File System;

[0116] Among them, the symmetric key k is:

[0117] k=(m*H(m))mod d

[0118] Where d is a random number;

[0119] The ciphertext c is:

[0120] c=E(k,S)

[0121] Where: E() is the AES-256 encryption function, S is a pseudo-random sequence;

[0122] The administrator uses the public key to encrypt the symmetric key k and the index address returned by the InterPlanetary File System to generate the key ciphertext kc0, and uploads it to the blockchain network together with the hash value H(m);

[0123] When a user applies to access an electronic contract, it is determined whether the user meets the set access requirements. If so, the user's public key is called in the blockchain network to generate a re-encryption key kc1 for the user locally. After receiving the re-encrypted ciphertext, the user can decrypt it and obtain the plaintext data of the electronic contract. If not, the application is rejected.

[0124] Access requirements include:

[0125] a. Identity verification.

[0126] Users must have a valid digital certificate and confirm their identity through two-factor authentication (such as a password plus biometric verification).

[0127] The user's identity must match their role and permissions within the organization, such as administrator-level permissions or authorization to a specific department.

[0128] b. Equipment and environmental safety.

[0129] Users must use company-issued secure devices and operating systems, and these devices must undergo regular security checks and updates.

[0130] User devices must have up-to-date antivirus software installed, and the device's security configuration must comply with corporate security standards and policies.

[0131] c. Compliance requirements.

[0132] Users must agree in advance to comply with the company's internal data access policies and compliance requirements, including regulations on data protection, privacy protection, and intellectual property protection.

[0133] Users must confirm that their purpose of accessing contract data is legal and complies with the company's compliance requirements, such as contract management regulations or relevant industry regulations.

[0134] The re-encryption key kc1 is sent to the smart contract. After receiving the re-encryption key kc1, the smart contract calls the key ciphertext kc0 uploaded by the administrator on the blockchain for re-encryption operation, and then returns the generated re-encrypted ciphertext Rm to the user.

[0135] The electronic contract risk assessment module is configured to perform the following: collect historical contract data, including contract type, delivery period, payment terms, breach of contract, and dispute type; use historical contract data to train the risk assessment model, and perform risk assessment on the generated contract text through the trained risk assessment model; monitor the execution progress of new contracts in real time, and collect real-time data streams, including supplier delivery time and quality inspection results; dynamically adjust contract terms based on real-time monitoring data and risk assessment results to reflect changes in the current market and supply chain environment.

[0136] It should be appreciated that embodiments of the present invention may be implemented or enforced by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The method may be implemented in a computer program using standard programming techniques - including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the methods and drawings described in the specific embodiments. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if desired, the program may be implemented in an assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed ASIC for this purpose.

[0137] Furthermore, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) that is executed collectively on one or more processors, by hardware, or a combination thereof. The computer program includes a plurality of instructions that may be executed by one or more processors.

[0138] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or part thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described herein includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques described in the present invention, the present invention also includes the computer itself. The computer program can be applied to input data to perform the functions described herein, thereby converting the input data to generate output data stored in a non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the converted data represents a physical and tangible object, including a specific visual depiction of the physical and tangible object produced on a display.

[0139] As used in this application, the terms "component", "module", "system", etc. are intended to refer to a computer-related entity, which can be hardware, firmware, a combination of hardware and software, software, or software in operation. For example, a component can be, but is not limited to: a process running on a processor, a processor, an object, an executable file, a thread in execution, a program, and / or a computer. As an example, an application running on a computing device and the computing device can both be components. One or more components can exist in a process and / or thread in execution, and a component can be located in a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures thereon. These components can communicate in a local and / or remote process manner, such as according to a signal having one or more data packets (e.g., data from a component that interacts with another component in a local system, a distributed system, and / or interacts with other systems in a signal manner through a network such as the Internet).

[0140] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for automatically generating electronic contracts based on blockchain, characterized in that: include: Define and store contract templates on the blockchain; Enter the parameters required for the contract and encrypt and store the parameters on the blockchain; Verify the encrypted parameters and, when conditions are met, execute the smart contract based on the parameters; Smart contracts generate electronic contracts that meet legal requirements based on preset contract templates and conditions; After the generated electronic contract is initially reviewed, it is encrypted.

2. The method for automatically generating an electronic contract based on blockchain as claimed in claim 1, characterized in that: The contract template includes the basic structure, terms and conditions of the contract, but does not include specific contract parameters or personalized information.

3. The method for automatically generating an electronic contract based on blockchain as claimed in claim 2, characterized in that: It also includes encryption of electronic contracts; Perform a hash operation on the contract plaintext m to generate a hash value H(m), encrypt the electronic contract with the symmetric key k, and upload the generated ciphertext c to the InterPlanetary File System; Among them, the symmetric key k is: k=(m*H(m))mod d Where d is a random number; The ciphertext c is: c=E(k,S) Where: E() is the AES-256 encryption function, S is a pseudo-random sequence; The administrator uses the public key to encrypt the symmetric key k and the index address returned by the InterPlanetary File System to generate the key ciphertext kc0, and uploads it to the blockchain network together with the hash value H(m); When a user applies to access an electronic contract, it is determined whether the user meets the set access requirements. If so, the user's public key is called in the blockchain network to generate a re-encryption key kc1 for the user locally. After receiving the re-encrypted ciphertext, the user can decrypt it and obtain the plaintext data of the electronic contract. If not, the application is rejected. The re-encryption key kc1 is sent to the smart contract. After receiving the re-encryption key kc1, the smart contract calls the key ciphertext kc0 uploaded by the administrator on the blockchain to perform a re-encryption operation, and then returns the generated re-encrypted ciphertext Rm to the user.

4. The method for automatically generating an electronic contract based on blockchain as claimed in claim 3, characterized in that: The smart contract includes: Identify the blockchain networks that need to interoperate across chains and the types of data and assets that need to be exchanged; Determine the interface and data structure of the smart contract; Cross-chain atomic swaps using hashed time-locked smart contracts; Design and deploy HTLC contracts on each blockchain and define HTLC contract parameters; Deploy and test the HTLC contract on the test network to verify its functionality and security; Configure the bridge node to monitor and record transaction status on different blockchains; Perform data synchronization on the bridge node, so that the bridge node can read and verify the transaction information on the two blockchains in real time; Execute cross-chain transactions, including asset locking, asset unlocking, and transaction verification.

5. The method for automatically generating an electronic contract based on blockchain as claimed in claim 4, characterized in that: It also includes risk assessment of electronic contracts: Collect historical contract data, including contract type, delivery period, payment terms, breach of contract, and dispute type; Use historical contract data to train the risk assessment model, and use the trained risk assessment model to conduct risk assessment on the generated contract text; Monitor the progress of new contracts in real time and collect real-time data streams, including supplier delivery times and quality inspection results; Based on real-time monitoring data and risk assessment results, contract terms are dynamically adjusted to reflect changes in the current market and supply chain environment.

6. A blockchain-based electronic contract automatic generation system, characterized in that: include: A template building module, configured to execute definition and storage of contract templates on the blockchain; A parameter setting module, configured to execute the parameters required for the input contract and encrypt and store the parameters on the blockchain; A smart contract execution module is configured to execute and verify the encrypted parameters, and when conditions are met, execute the smart contract according to the parameters; An electronic contract generation module is configured to execute the smart contract and generate an electronic contract that meets legal requirements according to a preset contract template and conditions; The review module is configured to perform a preliminary review of the generated electronic contract and then encrypt the electronic contract.

7. The blockchain-based electronic contract automatic generation system as claimed in claim 6, characterized in that: The template building module is specifically configured to execute definition of a contract template, which includes the basic structure, terms and conditions of a contract but does not include specific contract parameters or personalized information.

8. The blockchain-based electronic contract automatic generation system as claimed in claim 7, characterized in that: It also includes an electronic contract encryption module, which is configured to execute: Perform a hash operation on the contract plaintext m to generate a hash value H(m), encrypt the electronic contract with the symmetric key k, and upload the generated ciphertext c to the InterPlanetary File System; Among them, the symmetric key k is: k=(m*H(m))mod d Where d is a random number; The ciphertext c is: c=E(k,S) Where: E() is the AES-256 encryption function, S is a pseudo-random sequence; The administrator uses the public key to encrypt the symmetric key k and the index address returned by the InterPlanetary File System to generate the key ciphertext kc0, and uploads it to the blockchain network together with the hash value H(m); When a user applies to access an electronic contract, it is determined whether the user meets the set access requirements. If so, the user's public key is called in the blockchain network to generate a re-encryption key kc1 for the user locally. After receiving the re-encrypted ciphertext, the user can decrypt it and obtain the plaintext data of the electronic contract. If not, the application is rejected. The re-encryption key kc1 is sent to the smart contract. After receiving the re-encryption key kc1, the smart contract calls the key ciphertext kc0 uploaded by the administrator on the blockchain to perform a re-encryption operation, and then returns the generated re-encrypted ciphertext Rm to the user.

9. The blockchain-based electronic contract automatic generation system as claimed in claim 8, characterized in that: The smart contract execution module is specifically configured to execute: Identify the blockchain networks that need to interoperate across chains and the types of data and assets that need to be exchanged; Determine the interface and data structure of the smart contract; Cross-chain atomic swaps using hashed time-locked smart contracts; Design and deploy HTLC contracts on each blockchain and define HTLC contract parameters; Deploy and test the HTLC contract on the test network to verify its functionality and security; Configure the bridge node to monitor and record transaction status on different blockchains; Perform data synchronization on the bridge node, so that the bridge node can read and verify the transaction information on the two blockchains in real time; Execute cross-chain transactions, including asset locking, asset unlocking, and transaction verification.

10. The blockchain-based electronic contract automatic generation system as claimed in claim 9, characterized in that: The electronic contract risk assessment module is further included, and the electronic contract risk assessment module is configured to execute: Collect historical contract data, including contract type, delivery period, payment terms, breach of contract, and dispute type; Use historical contract data to train the risk assessment model, and use the trained risk assessment model to conduct risk assessment on the generated contract text; Monitor the progress of new contracts in real time and collect real-time data streams, including supplier delivery times and quality inspection results; Based on real-time monitoring data and risk assessment results, contract terms are dynamically adjusted to reflect changes in the current market and supply chain environment.

Citation Information

Cited By

  • Legal service management system based on block chain

    CN119577033A

  • Contract management method and system based on block chain

    CN120257333A

  • Contract management method and system based on blockchain

    CN120257333B

  • Bitcoin intelligent contract construction and control block generation method based on multi-path script

    CN121235693A

  • Bitcoin smart contract construction and control block generation method based on multi-path script

    CN121235693B