CN113327109A - Intelligent contract construction method for block chain - Google Patents

Intelligent contract construction method for block chain Download PDF

Info

Publication number
CN113327109A
CN113327109A CN202110659764.1A CN202110659764A CN113327109A CN 113327109 A CN113327109 A CN 113327109A CN 202110659764 A CN202110659764 A CN 202110659764A CN 113327109 A CN113327109 A CN 113327109A
Authority
CN
China
Prior art keywords
contract
intelligent contract
code
file
intelligent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110659764.1A
Other languages
Chinese (zh)
Inventor
童世华
武春岭
付蔚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing College of Electronic Engineering
Original Assignee
Chongqing College of Electronic Engineering
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chongqing College of Electronic Engineering filed Critical Chongqing College of Electronic Engineering
Priority to CN202110659764.1A priority Critical patent/CN113327109A/en
Publication of CN113327109A publication Critical patent/CN113327109A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3821Electronic credentials
    • G06Q20/38215Use of certificates or encrypted proofs of transaction rights
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/405Establishing or using transaction specific rules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/18Legal services; Handling legal documents

Abstract

The invention discloses a block chain intelligent contract construction method, which comprises the following steps: step one, compiling contracts; step two, checking and verifying; step three, converting and compiling; step four, contract encryption; step five, contract arrangement; step six, verifying and confirming; step seven, executing the contract; the invention checks the intelligent contract code by combining a plurality of methods such as self-checking, tool checking, checking by others and software simulation testing, effectively avoids the occurrence of code errors, avoids the situation that vulnerabilities are utilized by lawless persons, improves the security of intelligent contract transactions, and is beneficial to reducing disputes and contradictions generated in the contract execution process and reducing the risk of default by sending a mutual verification file and a confirmation file to both sides before the intelligent contract is executed.

Description

Intelligent contract construction method for block chain
Technical Field
The invention relates to the technical field of block chains, in particular to a block chain intelligent contract construction method.
Background
The intelligent contract is a computer protocol aiming at propagating, verifying or executing contracts in an information-based manner, the intelligent contract allows credible transactions without a third party, the transactions can be tracked and can not be reversed, and the block chain intelligent contract building method in the market has more advantages nowadays, but still has certain disadvantages, and the specific problems are as follows:
(1) the existing intelligent block chain closure is relatively complicated in the process of compiling codes, errors and bugs can occur if the checks are not detailed, the bugs can be utilized by lawbreakers, and the safety of contract transaction is reduced;
(2) the existing block chain intelligent contract advocates that the disclosure is transparent and irreversible, the execution can be realized as long as the conditions are met, the irreversible sword is a double-edged sword, disputes and contradictions are easy to generate, and certain risks are brought to the irreversible sword, so that unnecessary troubles are caused;
(3) the existing intelligent contracts of the block chains are public and transparent in the deploying and calling processes, so that the problem of unnecessary privacy disclosure is easily caused, and even the problem of information safety can occur, so that losses are caused to both parties of a transaction.
Disclosure of Invention
The invention aims to provide a block chain intelligent contract construction method to solve the problems of code errors, dispute easily generated and privacy exposure in the background technology.
In order to achieve the purpose, the invention provides the following technical scheme: a block chain intelligent contract construction method comprises the following steps: step one, compiling contracts; step two, checking and verifying; step three, converting and compiling; step four, contract encryption; step five, contract arrangement; step six, verifying and confirming; step seven, executing the contract;
firstly, writing codes of the intelligent contracts by using a high-level programming language according to functions and requirements;
in the second step, after the contract code in the first step is written, self-examination is carried out by using an examination tool and an examination method, after the self-examination is finished, joint line-by-line examination is carried out with professional examiners, and finally simulation is carried out by using simulation software, and bugs in the code are found and modified to form an intelligent contract code file taking sol as suffix;
in the third step, the intelligent contract code file which is examined and modified in the second step is compiled into an executable binary contract file through a compiler according to a specific grammar rule;
in the fourth step, the executable binary contract file obtained in the third step is encrypted by using a mathematical encryption algorithm, and a trusted security management system is established;
in the fifth step, the encrypted intelligent contract codes in the fourth step are uploaded and deployed on the block chain of the Ethernet workshop by using the Ethernet workshop client, and then the contract codes are stored on the block chain of the Ethernet workshop, namely the intelligent contracts are sent to all the network-connected devices;
in the sixth step, when the user in the network calls the intelligent contract already deployed in the fifth step, the security management system examines and verifies the public key and the access certificate of the user, verifies whether the access certificate is correct, and starts the virtual machine to execute the next operation after the verification is finished;
in the seventh step, after the virtual machine in the sixth step is started, a mutual authentication file and a contract confirmation file are sent to both trading parties, then both trading parties respectively confirm by using respective private keys, and after the node receives the trade confirmation, the EVM in the seventh step executes a corresponding contract code, thereby achieving a contract.
Preferably, in the first step, the high-level programming language is Solidity.
Preferably, in the second step, the Code inspection Tool is one or more of Code strike, rhode, Code, Phabricator, Code, getbakeout, crumble, crack and Code Review Tool, and the inspection method is inspection table and table top inspection.
Preferably, in the third step, the compiler is a solc compiler, and the intelligent contract code is an EVM bytecode after being compiled.
Preferably, in the fifth step, the user needs to sign the contract to be deployed by using the private key during the deployment process, and the user obtains the address of the contract and invokes an interface required by the contract after the deployment is completed.
Preferably, in the sixth step, a JavaScript API interface provided by the web3.js library is used for calling the contract when calling.
Preferably, in the seventh step, the mutual authentication file mainly includes the intelligent contract execution condition, the intelligent contract execution step and the digital asset.
Compared with the prior art, the invention has the beneficial effects that:
1. the intelligent contract code is checked by combining a plurality of methods such as self-checking, tool checking, checking by others and software simulation testing, so that the occurrence of code errors is effectively avoided, the situation that a vulnerability is utilized by lawbreakers is avoided, and the safety of intelligent contract transactions is improved;
2. the mutual verification file and the confirmation file are sent to the two parties before the intelligent contract is executed, so that disputes and contradictions generated in the contract execution process are reduced, and the risk of default is reduced;
3. according to the invention, through the establishment of the digital encryption algorithm and the security management system, the data privacy protection is facilitated, and the privacy disclosure is avoided.
Drawings
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the present invention: a block chain intelligent contract construction method comprises the following steps: step one, compiling contracts; step two, checking and verifying; step three, converting and compiling; step four, contract encryption; step five, contract arrangement; step six, verifying and confirming; step seven, executing the contract;
firstly, compiling codes of the intelligent contract by using a high-level programming language according to functions and requirements, wherein the high-level programming language is identity;
in the second step, after the contract Code in the first step is written, a self-examination is carried out by using an examination Tool and an examination method, after the self-examination is finished, the self-examination is carried out by combining with professional reviewers line by line, finally simulation is carried out by using simulation software, the Code examination Tool is one or more of Codestriker, Rhodeco, Codebrag, Phabricator, Codifferous, Getbarkerep, Crucible and Code Review Tool, the examination method is an examination table and table examination, and a bug in the Code is found out and modified to form an intelligent contract Code file with sol as a suffix;
in the third step, the intelligent contract code file which is checked and modified in the second step is compiled into an executable binary contract file through a compiler according to a specific grammar rule, the compiler is a solc compiler, and the intelligent contract code is compiled into an EVM byte code;
in the fourth step, the executable binary contract file obtained in the third step is encrypted by using a mathematical encryption algorithm, and a trusted security management system is established;
in the fifth step, the encrypted intelligent contract codes in the fourth step are uploaded and deployed to the block chain of the Ethernet workshop by using the Ethernet workshop client, then the contract codes are stored in the block chain of the Ethernet workshop, namely, the intelligent contracts are sent to all devices connected with the network, and in the deploying process, a user needs to sign the contracts to be deployed by using a personal private key, and meanwhile, the user obtains the addresses of the contracts and invokes interfaces needed by the contracts after the deploying is completed;
in the sixth step, when the user in the network calls the intelligent contract already deployed in the fifth step, and a JavaScript API provided by a web3.js library is adopted to call the contract, the security management system can check and verify the public key and the access certificate of the caller, verify whether the access certificate is correct, and start the virtual machine to execute the next operation after the verification is completed;
in the seventh step, after the virtual machine in the sixth step is started, a mutual authentication file and a contract confirmation file are sent to both transaction parties, the mutual authentication file mainly comprises an intelligent contract execution condition, an intelligent contract execution step and digital assets, then both transaction parties respectively confirm by using respective private keys, and after the node receives the transaction confirmation, the EVM in the node executes a corresponding contract code, so as to reach a contract.
Based on the above, the method has the advantages that the codes are jointly detected through self-examination, tool examination, combined examination, simulation verification and the like, the accuracy of the codes is ensured, the situation that the loophole is utilized by lawless persons after the intelligent contract is deployed is avoided, the safety of the intelligent contract is favorably improved, meanwhile, mutual authentication files and confirmation files are sent to the two parties before the contract is executed, the generation of contradictions and disputes after the intelligent contract is executed is favorably reduced, the privacy of data is ensured, and the situation that the privacy is leaked is avoided.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.

Claims (7)

1. A block chain intelligent contract construction method comprises the following steps: step one, compiling contracts; step two, checking and verifying; step three, converting and compiling; step four, contract encryption; step five, contract arrangement; step six, verifying and confirming; step seven, executing the contract; the method is characterized in that:
firstly, writing codes of the intelligent contracts by using a high-level programming language according to functions and requirements;
in the second step, after the contract code in the first step is written, self-examination is carried out by using an examination tool and an examination method, after the self-examination is finished, joint line-by-line examination is carried out with professional examiners, and finally simulation is carried out by using simulation software, and bugs in the code are found and modified to form an intelligent contract code file taking sol as suffix;
in the third step, the intelligent contract code file which is examined and modified in the second step is compiled into an executable binary contract file through a compiler according to a specific grammar rule;
in the fourth step, the executable binary contract file obtained in the third step is encrypted by using a mathematical encryption algorithm, and a trusted security management system is established;
in the fifth step, the encrypted intelligent contract codes in the fourth step are uploaded and deployed on the block chain of the Ethernet workshop by using the Ethernet workshop client, and then the contract codes are stored on the block chain of the Ethernet workshop, namely the intelligent contracts are sent to all the network-connected devices;
in the sixth step, when the user in the network calls the intelligent contract already deployed in the fifth step, the security management system examines and verifies the public key and the access certificate of the user, verifies whether the access certificate is correct, and starts the virtual machine to execute the next operation after the verification is finished;
in the seventh step, after the virtual machine in the sixth step is started, a mutual authentication file and a contract confirmation file are sent to both trading parties, then both trading parties respectively confirm by using respective private keys, and after the node receives the trade confirmation, the EVM in the seventh step executes a corresponding contract code, thereby achieving a contract.
2. The method for building a blockchain intelligent contract according to claim 1, wherein the method comprises the following steps: in the first step, the high-level programming language is identity.
3. The method for building a blockchain intelligent contract according to claim 1, wherein the method comprises the following steps: in the second step, the Code inspection Tool is one or more of Code pointer, rhode Code, Code brag, Phabricator, Codifferous, Getbarkerep, Crucible and Code Review Tool, and the inspection method is inspection table and table top inspection.
4. The method for building a blockchain intelligent contract according to claim 1, wherein the method comprises the following steps: in the third step, the compiler is a solc compiler, and the intelligent contract code is an EVM bytecode after being compiled.
5. The method for building a blockchain intelligent contract according to claim 1, wherein the method comprises the following steps: in the fifth step, the user needs to sign the contract to be deployed by using the personal private key in the deployment process, and the user obtains the address of the contract and invokes the interface required by the contract after the deployment is completed.
6. The method for building a blockchain intelligent contract according to claim 1, wherein the method comprises the following steps: in the sixth step, a JavaScript API provided by the web3.js library is adopted to call the contract during calling.
7. The method for building a blockchain intelligent contract according to claim 1, wherein the method comprises the following steps: in the seventh step, the mutual authentication file mainly comprises an intelligent contract execution condition, an intelligent contract execution step and a digital asset.
CN202110659764.1A 2021-06-15 2021-06-15 Intelligent contract construction method for block chain Pending CN113327109A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110659764.1A CN113327109A (en) 2021-06-15 2021-06-15 Intelligent contract construction method for block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110659764.1A CN113327109A (en) 2021-06-15 2021-06-15 Intelligent contract construction method for block chain

Publications (1)

Publication Number Publication Date
CN113327109A true CN113327109A (en) 2021-08-31

Family

ID=77420723

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110659764.1A Pending CN113327109A (en) 2021-06-15 2021-06-15 Intelligent contract construction method for block chain

Country Status (1)

Country Link
CN (1) CN113327109A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598549A (en) * 2016-12-08 2017-04-26 天津米游科技有限公司 Intelligent agreement system based on block chain and implementation method
CN107844704A (en) * 2017-11-01 2018-03-27 济南浪潮高新科技投资发展有限公司 One kind is based on block chain believable intelligent contract reinforcement means
CN109766722A (en) * 2019-01-22 2019-05-17 苏州同济区块链研究院有限公司 The method and its system of intelligent contract are constructed in a kind of block chain
WO2020108138A1 (en) * 2018-11-30 2020-06-04 阿里巴巴集团控股有限公司 Method for implementing privacy protection in blockchain
WO2020119391A1 (en) * 2018-12-12 2020-06-18 阿里巴巴集团控股有限公司 Blockchain smart contract-based data processing method and system
CN112379727A (en) * 2020-11-05 2021-02-19 重庆电子工程职业学院 Examination score inquiry and display device and method based on block chain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598549A (en) * 2016-12-08 2017-04-26 天津米游科技有限公司 Intelligent agreement system based on block chain and implementation method
CN107844704A (en) * 2017-11-01 2018-03-27 济南浪潮高新科技投资发展有限公司 One kind is based on block chain believable intelligent contract reinforcement means
WO2020108138A1 (en) * 2018-11-30 2020-06-04 阿里巴巴集团控股有限公司 Method for implementing privacy protection in blockchain
WO2020119391A1 (en) * 2018-12-12 2020-06-18 阿里巴巴集团控股有限公司 Blockchain smart contract-based data processing method and system
CN109766722A (en) * 2019-01-22 2019-05-17 苏州同济区块链研究院有限公司 The method and its system of intelligent contract are constructed in a kind of block chain
CN112379727A (en) * 2020-11-05 2021-02-19 重庆电子工程职业学院 Examination score inquiry and display device and method based on block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈淼绚;吕佳;: "加快对区块链技术的研究和应用,构建信用社会" *

Similar Documents

Publication Publication Date Title
CN108399329B (en) Method for improving security of trusted application program
EP3564884A1 (en) Method and system for verifying policy compliance of transactions in a blockchain executing smart contracts
CN102760219B (en) A kind of Android platform software protection system, method and apparatus
JP2021502746A (en) A system to protect the verification key from modification and to verify the validity of the legitimacy proof
CN112801663B (en) Blockchain certification method, device, system, equipment and medium
CN113489584B (en) Method and device for processing random numbers in block chain and electronic equipment
CN104283860A (en) ELF file identification method and device based on code signature
WO2023029447A1 (en) Model protection method, device, apparatus, system and storage medium
CN109992987B (en) Script file protection method and device based on Nginx and terminal equipment
WO2022078366A1 (en) Application protection method and apparatus, device and medium
WO2019178763A1 (en) Certificate importing method and terminal
Wang et al. Security enhancement technologies for smart contracts in the blockchain: A survey
CN114448605A (en) Encrypted ciphertext verification method, system, equipment and computer readable storage medium
CN111045722A (en) Intelligent contract packaging method, device, system, computer equipment and storage medium
CN106888094B (en) A kind of endorsement method and server
CN105873030A (en) Method for performing countersigning on an application of terminal
CN109902500B (en) Method and system for realizing service call data security through link library
CN113327109A (en) Intelligent contract construction method for block chain
CN108052842B (en) Signature data storage and verification method and device
CN115048630A (en) Integrity verification method and device of application program, storage medium and electronic equipment
CN115396206A (en) Message encryption method, message decryption method, device and program product
CN114629658A (en) Application signature method, device, equipment and storage medium
CN113360575A (en) Method, device, equipment and storage medium for supervising transaction data in alliance chain
CN109886043B (en) Method and apparatus for generating organizational credentials for blockchain participants
Lloyd et al. Security analysis of a biometric authentication system using UMLsec and JML

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination