Blockchain-based smart contract deployment method and related equipment
By introducing the contract publisher as a third party to review and publish smart contracts, the security and functional problems of smart contracts in the blockchain network are solved, the security and standardization of smart contracts are realized, and the credibility of on-chain data is ensured.
Patent Information
- Application Number
- CN202110763688.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-06
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2041-07-06
AI Technical Summary
In a completely decentralized blockchain public chain project, when the business party writes and publishes it on the chain, there are risks of smart contract security vulnerabilities and malicious contract uploads, resulting in frequent security accidents and cannot effectively ensure the security and functionality of the smart contract.
The contract publisher is introduced as the third party of the business. The contract publisher has the permission to publish smart contracts. After the business party creates a smart contract, it reviews and publishes it through the contract publisher to ensure the security and functionality of the smart contract. The contract publishing permissions and creation permissions are separated, and the contract publishing portal is concentrated to the contract publisher.
Through the review and supervision of the contract issuer, the security and standardization of smart contracts in the blockchain network are improved, the security and credibility of on-chain data are ensured, and the security vulnerabilities of smart contracts and the risks of malicious contracts are avoided.
Smart Images

Figure CN115577382B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of blockchain technology, and more specifically, to a blockchain-based smart contract deployment method, node device, contract publishing device, business device, electronic device, and computer-readable medium. Background Art
[0002] With the development of internet technology, users are increasingly concerned about network security and trustworthiness. Blockchain technology, with its decentralization, full traceability, traceability, openness, transparency, and collective maintenance, has greatly enhanced the level of trust among users.
[0003] Blockchain is a new application model for computer technologies such as distributed data storage, peer-to-peer (P2P) transmission, consensus mechanisms, and encryption algorithms. As a programmable blockchain, its main feature is that it allows users to write sophisticated and intelligent protocols, also known as smart contracts.
[0004] Smart contracts are contractual programs that automatically execute based on specific conditions. They are a key way for users to interact with blockchains and implement business logic. For example, institutions can use smart contracts on the blockchain to store and share information. They can also trigger smart contracts based on received requests, acquired information, or pre-stored information. When certain conditions are met, they trigger the smart contract to execute the corresponding steps to implement the business processing function corresponding to the request. Smart contracts allow for trusted transactions without a third party, and these transactions are traceable and irreversible. Compared to traditional contracts, smart contracts can automatically execute the original agreement, reducing transaction costs.
[0005] However, in fully decentralized public blockchain projects, business entities independently develop and publish smart contracts on-chain. This means they act as both the contract creator and publisher. This approach places complete control over contract publication and oversight in the hands of the business entity. This creates a high risk of security vulnerabilities in smart contracts deployed on the blockchain network due to flaws in the smart contract development process, or the publisher could upload malicious contracts. Because smart contracts on the blockchain are visible to all users, anyone can exploit these vulnerabilities, leading to frequent security incidents and unavoidable losses.
[0006] Therefore, a new blockchain-based smart contract deployment method, node device, terminal device, electronic device and computer-readable medium are needed. Summary of the Invention
[0007] The embodiments of the present disclosure provide a blockchain-based smart contract deployment method, device, electronic device, and computer-readable medium, thereby solving, at least to a certain extent, the security issues of smart contracts deployed in blockchain networks in related technologies.
[0008] The disclosed embodiments provide a blockchain-based smart contract deployment method, which is applied to node devices in a blockchain network. The blockchain network is in communication with a contract issuing device of a contract issuing party, and the contract issuing party is in communication with a business device of a business party. The method comprises: obtaining a blockchain transaction for deploying a smart contract sent by the contract issuing device, the blockchain transaction for deploying a smart contract carrying the account address of the contract issuing party, wherein the blockchain transaction for deploying a smart contract is generated by the contract issuing device based on a request to publish a smart contract received from a business device; confirming that the contract issuing party has the authority to publish the smart contract based on the account address of the contract issuing party carried in the blockchain transaction for deploying the smart contract; reaching a consensus on the blockchain transaction for deploying the smart contract; and deploying the corresponding smart contract in the blockchain network after the consensus on the blockchain transaction for deploying the smart contract is passed.
[0009] The disclosed embodiment proposes a blockchain-based smart contract deployment method, which is applied to a contract issuing device of a contract issuing party, and the contract issuing device is respectively connected to the business device of the business party and the blockchain network. The method includes: receiving a smart contract issuance request sent by the business device, the smart contract issuance request carrying the smart contract, the smart contract's signature information, and the business party's digital certificate; confirming that the business party has the authority to create the smart contract based on the business party's digital certificate; confirming the security and functionality of the smart contract based on the smart contract and the smart contract's signature information; constructing a blockchain transaction for deploying the smart contract, the blockchain transaction for deploying the smart contract carrying the account address of the contract issuing party; sending the blockchain transaction for deploying the smart contract to the blockchain network, so that the node devices in the blockchain network can confirm that the contract issuing party has the authority to publish the smart contract based on the contract issuing party's account address, and deploying the smart contract to the blockchain network after the blockchain transaction consensus on deploying the smart contract is passed.
[0010] The disclosed embodiments provide a blockchain-based smart contract deployment method, which is applied to a business device of a business party, wherein the business device is communicatively connected to a contract issuing device of a contract issuing party, and the contract issuing device is communicatively connected to a blockchain network. The method includes: creating a smart contract; generating signature information for the smart contract; constructing a smart contract publishing request, wherein the smart contract publishing request carries the smart contract, the smart contract signature information, and the business party's digital certificate; submitting the smart contract publishing request to the contract issuing device, so that the contract issuing device verifies that the business party has permission to create the smart contract based on the business party's digital certificate, verifies the smart contract based on the smart contract and the smart contract signature information, and constructs and sends a blockchain transaction for deploying the smart contract to the blockchain network, thereby deploying the smart contract to the blockchain network.
[0011] The disclosed embodiment proposes a node device, which is set in a blockchain network. The blockchain network is connected to the contract issuing device of the contract issuing party, and the contract issuing device is connected to the business equipment of the business party. The node device includes: a smart contract deployment transaction acquisition unit, which is used to acquire the blockchain transaction for deploying the smart contract sent by the contract issuing device, the blockchain transaction for deploying the smart contract carrying the account address of the contract issuing party, wherein the blockchain transaction for deploying the smart contract is generated by the contract issuing device based on the smart contract release request received from the business device; a smart contract release authority confirmation unit, which is used to confirm that the contract issuing party has the smart contract release authority based on the account address of the contract issuing party carried in the blockchain transaction for deploying the smart contract; a smart contract deployment transaction consensus unit, which is used to reach a consensus on the blockchain transaction for deploying the smart contract; and a smart contract deployment unit, which is used to deploy the corresponding smart contract in the blockchain network after the consensus on the blockchain transaction for deploying the smart contract is passed.
[0012] The disclosed embodiment proposes a contract issuing device, wherein the contract issuing device of the contract issuing party is respectively connected to the business device of the business party and the blockchain network. The contract issuing device includes: a smart contract issuing request receiving unit, which is used to receive the smart contract issuing request sent by the business device, the smart contract issuing request carrying the smart contract, the smart contract signature information and the digital certificate of the business party; a smart contract creation permission confirmation unit, which is used to confirm that the business party has the permission to create the smart contract based on the digital certificate of the business party; a smart contract security function review unit, which is used to confirm the security and functionality of the smart contract based on the smart contract and the smart contract signature information; a smart contract deployment transaction construction unit, which is used to construct a blockchain transaction for deploying the smart contract, the blockchain transaction for deploying the smart contract carrying the account address of the contract issuing party; a smart contract deployment transaction sending unit, which is used to send the blockchain transaction for deploying the smart contract to the blockchain network, so that the node devices in the blockchain network can confirm that the contract issuing party has the permission to publish the smart contract based on the account address of the contract issuing party, and after the blockchain transaction consensus on deploying the smart contract is passed, the smart contract is deployed to the blockchain network.
[0013] The disclosed embodiment proposes a business device, wherein the business device of a business party is communicatively connected to the contract issuing device of a contract issuing party, and the contract issuing device is communicatively connected to a blockchain network. The business device includes: a smart contract creation unit for creating a smart contract; a contract signature generation unit for generating signature information for the smart contract; a contract publishing request construction unit for constructing a smart contract publishing request, wherein the smart contract publishing request carries the smart contract, the smart contract signature information, and the digital certificate of the business party; and a contract publishing request submission unit for submitting the smart contract publishing request to the contract issuing device, so that the contract issuing device verifies that the business party has the authority to create the smart contract based on the digital certificate of the business party, verifies the smart contract based on the smart contract and the signature information of the smart contract, and constructs and sends a blockchain transaction for deploying the smart contract to the blockchain network, thereby deploying the smart contract to the blockchain network.
[0014] An embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a storage device for storing at least one program. When the at least one program is executed by the at least one processor, the at least one processor implements the blockchain-based smart contract deployment method as described in the above embodiment.
[0015] The embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the blockchain-based smart contract deployment method as described in the above embodiments.
[0016] According to one aspect of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the blockchain-based smart contract deployment method provided in the various optional implementations described above.
[0017] In the technical solutions provided in some embodiments of the present disclosure, by introducing a contract issuer as a business third party, the contract issuer is given the authority to issue a smart contract, thereby separating the smart contract issuance authority from the smart contract creation authority. That is, the business party has the authority to create a smart contract. After creating a smart contract, the business party can send a smart contract issuance request to the contract issuer to request the contract issuer with the smart contract issuance authority to deploy the smart contract created by the business party to the blockchain network, converging the smart contract issuance entrance to the contract issuer instead of distributing it to various business parties. This strengthens the security and functionality of the smart contracts on the chain, and can better ensure the standardization of the smart contracts on the chain and the security of the data on the chain.
[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0020] Figure 1 This is a schematic diagram of the architecture of a blockchain-based smart contract deployment system provided by an embodiment of the present disclosure.
[0021] Figure 2 This is a schematic diagram of a blockchain network provided by an embodiment of the present disclosure.
[0022] Figure 3 It is a structural diagram of a block provided by an embodiment of the present disclosure.
[0023] Figure 4 This is a schematic diagram of a new block generation process provided by an embodiment of the present disclosure.
[0024] Figure 5 The figure schematically shows a flowchart of a blockchain-based smart contract deployment method according to an embodiment of the present disclosure.
[0025] Figure 6 The figure schematically shows a flow chart of a blockchain-based smart contract deployment method according to an embodiment of the present disclosure.
[0026] Figure 7 The figure schematically shows a flowchart of a blockchain-based smart contract deployment method according to another embodiment of the present disclosure.
[0027] Figure 8 The figure schematically shows a flowchart of a blockchain-based smart contract deployment method according to another embodiment of the present disclosure.
[0028] Figure 9 A block diagram of a node device according to an embodiment of the present disclosure is schematically shown.
[0029] Figure 10 The block diagram of a contract issuing device according to an embodiment of the present disclosure is schematically shown.
[0030] Figure 11 The block diagram schematically shows a service device according to an embodiment of the present disclosure.
[0031] Figure 12 A schematic structural diagram of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.
[0033] In addition, the described features, structures or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, well-known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present disclosure.
[0034] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. In other words, these functional entities may be implemented in software, in at least one hardware module or integrated circuit, or in different networks and / or processor devices and / or microcontroller devices.
[0035] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0036] The blockchain involved in the embodiments of the present disclosure is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each data block contains information about a batch of transactions (called network transactions or blockchain transactions), which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. The blockchain can be composed of multiple serial transaction records (also known as blocks) that are connected and protected by cryptography. The distributed ledger connected by the blockchain allows multiple parties to effectively record transactions and can permanently verify these transactions (non-tamperable). The blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.
[0037] like Figure 1 As shown, the blockchain-based smart contract deployment system provided by the embodiment of the present disclosure may include a blockchain network 100 and multiple electronic devices. Figure 1 In the example, three electronic devices are included, namely the first device 201, the second device 202, and the third device 203. The first device 201, the second device 202, and the third device 203 can be used to obtain transaction data (including transaction requests or transaction data generated after executing transaction requests) from the blockchain network, or upload transaction data to the blockchain network.
[0038] like Figure 2 As shown, Figure 1 The blockchain network 100 in the embodiment may include multiple node devices 101, and the multiple node devices 101 may refer to various clients in the blockchain network 100. The blockchain network 100 refers to a system for sharing data between node devices 101 and node devices 101. Each node device 101 may receive transaction data when performing normal operations and maintain shared data within the blockchain network 100 based on the received transaction data.
[0039] In order to ensure information intercommunication within the blockchain network 100, an information connection can exist between each node device 101 in the blockchain network 100, and information can be transmitted between the node devices 101 through the above information connection.
[0040] For example, when any node device 101 in the blockchain network 100 receives transaction data, other node devices 101 in the blockchain network 100 obtain the transaction data according to the consensus algorithm and store the transaction data as data in the shared data, so that the data stored on all node devices 101 in the blockchain network 100 are consistent.
[0041] Among them, the node device 101, the first device 201, the second device 202 and the third device 203 in the blockchain network 100 can be any electronic device, including but not limited to mobile phones, tablet computers, laptops, PDAs, smart speakers, mobile Internet devices (mobile internet devices, MIDs), POS (Point Of Sales) machines, wearable devices (such as smart watches, smart bracelets, etc.); it can also be an independent server, or a server cluster composed of several servers, or a cloud computing center.
[0042] Each node device 101 in the blockchain network 100 has a corresponding node device identifier, and each node device 101 in the blockchain network 100 can store the node device identifiers of other node devices 101 in the blockchain network 100, so that the generated blocks can be broadcast to other node devices 101 in the blockchain network 100 based on the node device identifiers of other node devices 101.
[0043] Each node device 101 may maintain a node device identification list as shown in Table 1 below, storing the node device name and node device identification in the node device identification list. A node device identification may be an IP (Internet Protocol) address or any other information that can be used to identify the node device. Table 1 uses the IP address as an example. N is a positive integer greater than or equal to 1.
[0044] Table 1
[0045] Node Name Node ID Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258
[0046] Each node device 101 in the blockchain network 100 stores an identical blockchain. The blockchain consists of multiple blocks, each of which contains a cryptographic hash of the previous block (which can be represented by a hash value calculated using a Merkle tree algorithm), a corresponding timestamp, and transaction data. This design makes the block content difficult to tamper with.
[0047] See also Figure 3 , the blockchain consists of multiple blocks, Figure 3Three blocks are used as an example for illustration, but the present disclosure is not limited thereto. The genesis block includes a block header and a block body. The block header stores the input information data feature value, version number, timestamp, and difficulty value, and the block body stores the transaction data. The next block of the genesis block uses the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores the input information feature value of the current block, the block header feature value, version number, timestamp, and difficulty value of the parent block, and so on. This ensures that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the transaction data in the block.
[0048] When generating each block in the blockchain, see Figure 4 When the node device of the blockchain receives the transaction data, it verifies the transaction data. After the verification is completed, the transaction data is stored in the memory pool and the hash tree used to record the transaction data is updated. After that, the update timestamp is updated to the time when the transaction data is received, and different random numbers are tried to calculate the eigenvalue multiple times so that the calculated eigenvalue can satisfy the following formula:
[0049] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET (1)
[0050] Among them, SHA256 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of the transaction data; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, which can be determined based on nbits.
[0051] In this way, when a random number that satisfies the above formula is calculated, the information can be stored accordingly, and the block header and block body can be generated to obtain the current block. Subsequently, the node device where the blockchain is located sends the newly generated block to the other node devices in the blockchain network 100 according to the node device identifiers of the other node devices in the blockchain network 100. The other node devices verify the newly generated block and, after completing the verification, add the newly generated block to the blockchain stored in them.
[0052] Figure 5 The figure schematically shows a flowchart of a blockchain-based smart contract deployment method according to an embodiment of the present disclosure. Figure 5The method provided in the embodiment can be applied to node devices in the blockchain network (such as Figure 2 Node device 101 in the blockchain network can be communicated with the contract issuing device of the contract issuing party, and the contract issuing device can be communicated with the business device of the business party.
[0053] The contract issuer in the disclosed embodiments refers to the on-chain contract publisher, which has the authority to review smart contracts to be uploaded to the blockchain network and publish approved smart contracts to the blockchain network. Therefore, the contract issuer can be said to have an on-chain supervisory and publishing role, that is, the contract issuer is authorized to publish smart contracts in the blockchain network. The contract issuer can be designated by the business party that created the smart contract. By designating the contract issuer as the auditing agency of the smart contract, the smart contract is uploaded to the blockchain, ensuring the credibility of the smart contract.
[0054] In the embodiment of the present disclosure, the contract issuer can log in and register with the authentication center to obtain the contract issuer's digital certificate from the authentication center. The contract issuer's digital certificate may include the contract issuer's public key and the digital signature signed by the authentication center on the contract issuer's public key and the contract issuer's identity information, which is used by the blockchain network to confirm the contract issuer's on-chain supervisory and issuing role.
[0055] The electronic device used by the contract issuer to issue smart contracts is called a contract issuing device.
[0056] The business party in the disclosed embodiment refers to a business participant on the chain. It can create smart contracts, that is, it has the permission to create smart contracts, and can also have the permission to witness blockchain consensus and contract transactions, but does not have the permission to publish smart contracts. The smart contracts created by the business party can only be reviewed by the designated contract publisher entrusted by the business party to review the content of the smart contract and publish it on the chain. Therefore, the business party can be said to have the role of an ordinary business party.
[0057] In the embodiment of the present disclosure, the business party can log in and register with the authentication center to obtain the business party's digital certificate from the authentication center. The business party's digital certificate may include the business party's public key and the digital signature signed by the authentication center on the business party's public key and the business party's identity information, which is used for the blockchain network to confirm the business party's ordinary business party role.
[0058] Specifically, this disclosed embodiment introduces two types of on-chain roles: on-chain supervisory and issuing roles, and general business party roles, corresponding to on-chain business participants and on-chain contract issuers, respectively. The methods provided by this disclosed embodiment can centralize contract on-chain entry points while facilitating the introduction of audit and oversight mechanisms to ensure the security of on-chain contracts and data.
[0059] The on-chain supervisory and publishing roles and general business party roles in this disclosure are used only to distinguish between those with smart contract publishing permissions and have no bearing on on-chain data governance and consensus. In other words, restricting smart contract publishing permissions does not affect the blockchain's decentralization or the credibility of on-chain data.
[0060] The electronic device used by the business party to create smart contracts is called a business device.
[0061] In the following examples, Figure 1 In the example, the first device 201 is a business device corresponding to the business party, and the second device 202 is a contract issuance device corresponding to the contract issuing party. However, the present disclosure is not limited to this. In the embodiments of the present disclosure, the business device corresponding to the business party and the contract issuance device corresponding to the contract issuing party do not need to be node devices in the blockchain network. They only need to be able to communicate with any node device and forward transactions to the blockchain.
[0062] Among them, according to the different degrees of centralization of the blockchain network, it is differentiated into: the blockchain that is open to the public and has no user authorization mechanism is called a public chain; the blockchain that allows authorized node devices to join the blockchain network and can view information according to permissions, which is often used for blockchains between institutions, is called an alliance chain or industry chain; all node devices in the blockchain network are controlled by one institution, which is called a private chain.
[0063] The blockchain network in the embodiments of the present disclosure may be a public chain, a consortium chain, or a private chain with multiple roles (for example, including the above-mentioned on-chain regulatory and publishing roles and ordinary business party roles). In the following examples, the consortium chain is taken as an example to illustrate the third-party entrusted on-chain solution based on the consortium chain provided in the embodiments of the present disclosure, that is, there are on-chain regulatory and publishing roles and ordinary business party roles in the consortium chain, but the present disclosure is not limited to this.
[0064] When the blockchain network of the disclosed embodiments utilizes a consortium chain, the consensus nodes can be pre-selected nodes designated internally. The generation of each block is determined by all pre-selected nodes. This access mechanism improves transaction performance and avoids issues caused by uneven participation.
[0065] like Figure 5 As shown, the method provided by the embodiment of the present disclosure may include the following steps.
[0066] In step S510, the blockchain transaction for deploying the smart contract sent by the contract issuing device is obtained. The blockchain transaction for deploying the smart contract carries the account address of the contract issuer, wherein the blockchain transaction for deploying the smart contract is generated by the contract issuing device based on the smart contract publishing request received from the business device.
[0067] The term "transaction" in the disclosed embodiments is equivalent to the computer term "transaction." A transaction encompasses operations that must be submitted to a blockchain network for execution, and does not refer solely to transactions in a business context. For example, a blockchain transaction that deploys a smart contract installs a specified smart contract on a node in the blockchain network and prepares it for invocation. The blockchain transaction that invokes a smart contract, mentioned below, adds a transaction record to the blockchain by invoking the smart contract.
[0068] In an exemplary embodiment, obtaining a blockchain transaction for deploying a smart contract sent by a contract issuing device may include: obtaining a blockchain transaction request for deploying a smart contract initiated by the contract issuing device, the blockchain transaction request for deploying a smart contract carrying the blockchain transaction for deploying a smart contract, signature information of the blockchain transaction for deploying a smart contract, and the digital certificate of the contract issuer; verifying the signature information of the blockchain transaction for deploying a smart contract and the digital certificate of the contract issuer; after the signature information of the blockchain transaction for deploying a smart contract and the digital certificate of the contract issuer are successfully verified, extracting the blockchain transaction for deploying a smart contract from the blockchain transaction request for deploying a smart contract.
[0069] In the embodiment of the present disclosure, the contract issuer can use a hash function to obtain a summary of the blockchain transaction for deploying the smart contract, and then use the private key of the contract issuer corresponding to the public key of the contract issuer in the digital certificate of the contract issuer to encrypt the summary of the blockchain transaction for deploying the smart contract, obtain the signature information of the blockchain transaction for deploying the smart contract, and then attach the blockchain transaction for deploying the smart contract, the signature information of the blockchain transaction for deploying the smart contract, and the digital certificate of the contract issuer to the blockchain transaction request for deploying the smart contract, and broadcast it to the blockchain network, so that the node devices in the blockchain network can extract the digital certificate of the contract issuer, the blockchain transaction for deploying the smart contract, and the signature information of the blockchain transaction for deploying the smart contract from the blockchain transaction request for deploying the smart contract.
[0070] Based on the extracted digital certificate of the contract issuer, the node device can obtain the public key and identity information of the contract issuer. Based on the identity information of the contract issuer, the blockchain network will verify the identity information of the contract issuer to confirm whether it has the authority to issue smart contracts.
[0071] The node device can also use the contract issuer's public key to decrypt the signature information of the smart contract deployment blockchain transaction carried in the smart contract deployment blockchain transaction request to obtain a digest of the smart contract deployment blockchain transaction. The blockchain transaction carried in the smart contract deployment blockchain transaction request is digested using the same hash function to obtain a digest of the smart contract deployment blockchain transaction. The decrypted digest of the smart contract deployment blockchain transaction is then verified for consistency with the digest of the smart contract deployment blockchain transaction obtained by the digest processing. If the data source is correct and the data has not been tampered with during transmission, the digest of the smart contract deployment blockchain transaction obtained after public key decryption should be consistent with the digest of the smart contract deployment blockchain transaction before encryption. Therefore, if the two digests of the smart contract deployment blockchain transaction are consistent, the signature verification of the smart contract deployment blockchain transaction request has passed. If they are inconsistent, the signature verification of the smart contract deployment blockchain transaction request has failed. By performing signature verification on the smart contract deployment blockchain transaction request sent by the contract issuer, the authenticity of the data source can be verified.
[0072] In the disclosed embodiment, after the contract issuer receives the request to issue a smart contract from the business party, it reviews the smart contract contained in the request. After the review is passed, a blockchain transaction for deploying the smart contract is constructed to put the smart contract on the chain. Since both the party on the chain (i.e., the contract issuer) and the content on the chain (i.e., the smart contract) are signed by the transaction and are traceable on the chain, the contract issuer can ensure the correctness of the on-chain data without additional proof. Since the contract issuer does not modify the data in the smart contract, the business party can also verify the data of the on-chain smart contract after it is put on the chain.
[0073] In step S520, based on the account address of the contract issuer carried in the blockchain transaction for deploying the smart contract, it is confirmed that the contract issuer has the authority to issue the smart contract.
[0074] Among them, smart contracts are computer protocols designed to disseminate, verify or execute contracts in an information-based manner. They can execute the terms of a contract through code deployed on a shared ledger that is executed when certain conditions are met. According to actual business needs, the code is used to complete automated transactions, such as querying the logistics status of the buyer's purchase and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.
[0075] Smart contracts on the blockchain are contracts that can be triggered and executed by transactions on the blockchain. Smart contracts can be defined in code.
[0076] Taking Ethereum as an example, users can create and invoke complex logic within the Ethereum network. As a programmable blockchain, Ethereum's core is the Ethereum Virtual Machine (EVM), which runs on every Ethereum node. The EVM is a Turing-complete virtual machine that enables the implementation of complex logic. When users publish and invoke smart contracts within Ethereum, they execute them on the EVM. In reality, the EVM directly runs virtual machine code (bytecode), so smart contracts deployed on the blockchain can be written in bytecode.
[0077] Any smart contract in the embodiments of the present disclosure can be deployed on the blockchain network in the following manner, but the present disclosure is not limited thereto. After the contract issuer sends a blockchain transaction containing the deployment of the smart contract to the blockchain network, each node device can execute the blockchain transaction for deploying the smart contract in the EVM. Among them, the From field in the blockchain transaction for deploying the smart contract is used to record the account address that initiated the blockchain transaction for deploying the smart contract, that is, the account address of the contract issuer. The contract code stored in the field value of the Data field in the blockchain transaction for deploying the smart contract can be bytecode, and the field value of the To field of the blockchain transaction for deploying the smart contract can be a null (empty) account. The node device can confirm that the contract issuer has the authority to publish the smart contract by recording the account address of the contract issuer in the From field of the blockchain transaction for deploying the smart contract. If it is confirmed that it does not have the authority to publish the smart contract, the operation will be terminated and the smart contract will not be deployed to the blockchain network.
[0078] In step S530, consensus is reached on the blockchain transaction for deploying the smart contract.
[0079] Consensus is a process in a blockchain network used to reach agreement on transactions in a block among multiple node devices involved. The agreed-upon blocks will be appended to the end of the blockchain. Mechanisms for achieving consensus may include Proof of Work (PoW), Proof of Stake (PoS), Delegated Proof–of-Stake (DPoS), Proof of Elapsed Time (PoET), etc.
[0080] In step S540, after the blockchain transaction consensus for deploying the smart contract is passed, the corresponding smart contract is deployed in the blockchain network.
[0081] When the contract issuer wants to deploy a smart contract on a blockchain network, the contract code of the smart contract can be sent to any node device in the blockchain network. The node device can then conduct consensus authentication on the smart contract to be deployed with other node devices in the blockchain network. After the consensus authentication is passed, a new block containing the contract code of the smart contract can be generated. The new block will be connected to the blockchain for the node device to call and run.
[0082] When the node devices reach an agreement through the consensus mechanism, the smart contract is successfully created and the subsequent business parties can call this smart contract.
[0083] After each smart contract is created, a corresponding contract account appears on the blockchain with a specific address. The contract code is stored in the account storage of that contract account. The smart contract's behavior is controlled by the contract code, while the smart contract's account storage stores the contract's state. In other words, a smart contract creates a virtual account on the blockchain that contains the contract code and account storage. A smart contract can declare various members, including state variables, functions, function modifiers, and events. State variables are values permanently stored in the smart contract's account storage field and are used to maintain the smart contract's state.
[0084] In an exemplary embodiment, the method may further include: generating identification information (ID) of the smart contract; and returning the identification information of the smart contract to the contract issuing device.
[0085] In the disclosed embodiment, the contract issuer may return the ID of the smart contract on the chain to the business party, notifying the business party that the smart contract has been successfully deployed to the blockchain network.
[0086] In an exemplary embodiment, when deploying a smart contract on a blockchain network, the administrator address of the smart contract can be set to the account address of the contract issuer. After deploying the corresponding smart contract on the blockchain network, the method can further include: receiving a contract transfer transaction initiated by a contract issuing device, the contract transfer transaction carrying the identification information of the smart contract and the account address of the business party; reaching consensus on the contract transfer transaction; and after consensus on the contract transfer transaction is reached, modifying the administrator address of the smart contract deployed on the blockchain network from the account address of the contract issuer to the account address of the business party according to the contract transfer transaction.
[0087] In the embodiment of the present disclosure, when the business party creates a smart contract, it can specify the administrator address of the smart contract as the account address of the business party in the smart contract, that is, specify that the management authority of the smart contract belongs to the business party. If the business party does not specify the administrator address of the smart contract as the account address of the business party in the smart contract, the node device will set the administrator address of the newly-on-chain smart contract to the account address of the contract publisher by default, that is, the management authority of the smart contract belongs to the contract publisher by default. At this time, the contract publisher can construct a contract transfer transaction to transfer the administrator address of the smart contract to the business party. That is, the business party entrusts the designated contract publisher to review the content of the smart contract it created. After the review is passed, the contract publisher will publish it on the chain, and after the chain is successfully uploaded, the management authority of the smart contract will be transferred back to the business party.
[0088] In the disclosed embodiment, the management authority of the smart contract may include, but is not limited to, the authority to modify / change the status (freeze / unfreeze) / transfer the smart contract.
[0089] After completing the above steps, the business party has effectively gained management rights to the smart contract on the chain and can construct relevant transactions to interact with the smart contract to perform business operations as needed. The following examples use blockchain transactions to construct and modify smart contracts and blockchain transactions to call smart contracts as examples, but this disclosure is not limited to this.
[0090] In an exemplary embodiment, a blockchain network can be communicatively connected to a business device. The method may further include: receiving a blockchain transaction request for modifying a smart contract sent by a business device, the blockchain transaction request for modifying the smart contract may carry the blockchain transaction for modifying the smart contract, the digital certificate of the business party, and signature information of the blockchain transaction for modifying the smart contract, the blockchain transaction for modifying the smart contract including identification information of the smart contract and a modification operation for the smart contract; confirming that the business party has smart contract management authority based on the administrator address of the smart contract deployed in the blockchain network being the account address of the business party and the digital certificate of the business party; verifying the blockchain transaction for modifying the smart contract based on the blockchain transaction for modifying the smart contract and the signature information of the blockchain transaction for modifying the smart contract; after the blockchain transaction for modifying the smart contract is successfully verified, reaching a consensus on the blockchain transaction for modifying the smart contract; after the consensus on the blockchain transaction for modifying the smart contract is reached, generating a first block based on the blockchain transaction for modifying the smart contract; adding the first block to the blockchain of the blockchain network, and executing the blockchain transaction for modifying the smart contract in the first block to modify the smart contract according to the modification operation.
[0091] Modifications to a smart contract can upgrade the smart contract and store the modification records for easy tracing later.
[0092] In an exemplary embodiment, a blockchain network is communicatively connected to a business device. The method further includes: obtaining a blockchain transaction request initiated by the business device to invoke a smart contract, the blockchain transaction request to invoke the smart contract carrying the blockchain transaction to invoke the smart contract, the digital certificate of the business party, and signature information of the blockchain transaction to invoke the smart contract, the blockchain transaction to invoke the smart contract including identification information of the smart contract and parameters passed to the smart contract; verifying the signature information of the blockchain transaction to invoke the smart contract and the digital certificate of the business party; upon successful verification of the signature information of the blockchain transaction to invoke the smart contract and the digital certificate of the business party, reaching a consensus on the blockchain transaction to invoke the smart contract; upon reaching a consensus on the blockchain transaction to invoke the smart contract, generating a second block based on the blockchain transaction to invoke the smart contract; adding the second block to the blockchain of the blockchain network, and invoking the smart contract according to the parameters to execute the blockchain transaction to invoke the smart contract in the second block.
[0093] The blockchain-based smart contract deployment method provided by the embodiments of the present disclosure introduces a contract issuer as a business third party, so that the contract issuer has the smart contract issuance authority, thereby separating the smart contract issuance authority from the smart contract creation authority. That is, the business party has the smart contract creation authority. After creating the smart contract, the business party can send a smart contract issuance request to the contract issuer to request the contract issuer with the smart contract issuance authority to deploy the smart contract created by the business party to the blockchain network, converging the smart contract issuance entrance to the contract issuer instead of distributing it to various business parties. This strengthens the security and functionality of the smart contracts on the chain, and can better ensure the standardization of the smart contracts on the chain and the security of the data on the chain.
[0094] Figure 6 The figure schematically shows a flow chart of a blockchain-based smart contract deployment method according to an embodiment of the present disclosure.
[0095] like Figure 6 As shown, the method provided by the embodiment of the present disclosure may include the following steps.
[0096] In step S1, after creating the smart contract, the business party 610 can send a request to the contract publishing center (i.e., the contract publisher) 620 to create the contract, that is, submit the smart contract created by the business party 610 to the contract publishing center 620. For example, the business party 610 can send a request to publish the smart contract to the contract publishing center 620, and the request to publish the smart contract carries the smart contract.
[0097] In step S2, after the contract issuance center 620 obtains the smart contract submitted by the business party 610, it can review the smart contract to check its security and functionality, for example, including unit test coverage, ERC (Ethereum Request for Comment) 20 / ERC721 standard checks, etc.
[0098] After the security and functionality of the smart contract are reviewed and approved, the contract issuance center 620 may request the blockchain network 630 to put the contract on the chain. For example, the contract issuance center 620 may send a blockchain transaction to the blockchain network 630 to deploy the smart contract.
[0099] After the node devices in the blockchain network 630 monitor the blockchain transaction for deploying the smart contract input by the contract issuance center 620, they can reach a consensus on the blockchain transaction for deploying the smart contract. After the consensus is passed, the smart contract created by the business party is deployed in the blockchain network, which is called the business contract 631.
[0100] In step S3, if the smart contract is successfully deployed and the administrator address of the smart contract is set by the node device to the account address of the contract issuer, the contract issuer 620 can execute the contract execution step to the blockchain network 630, that is, send a contract transfer transaction to the blockchain network 630 to modify the administrator address of the smart contract to the account address of the business party 610, and transfer the management authority of the smart contract to the business party 610 so that the business party 610 can manage the smart contract.
[0101] It should be noted that Figure 6 Step S3 in the embodiment is optional. If the business party 610 specifies the administrator address as the business party's account address when creating the smart contract, step S3 does not need to be performed.
[0102] In step S4, after successful deployment, blockchain network 630 can return the smart contract ID, referred to as the contract ID, to contract issuance center 620. Contract issuance center 620 can return the smart contract ID to business party 610 to notify business party 610 that the smart contract has been successfully deployed on blockchain network 630.
[0103] In step S5, the business party 610 can perform business management on the smart contract deployed in the blockchain network 630, such as initiating a blockchain transaction to modify the smart contract or calling a blockchain transaction of the smart contract, etc.
[0104] The blockchain-based smart contract deployment method provided by the disclosed embodiments introduces a contract publishing center as a third-party business entity to assist business parties in contract review and actual on-chain execution. While maintaining the characteristics of blockchain, it streamlines the contract publishing entry point and strengthens the security and functionality of on-chain contract rules, thereby better ensuring the standardization of on-chain contracts and the security of on-chain data.
[0105] Figure 7 The figure schematically shows a flowchart of a blockchain-based smart contract deployment method according to another embodiment of the present disclosure. Figure 7 The method provided in the embodiment can be applied to the contract issuing device of the contract issuing party, and the contract issuing device can be respectively connected to the business device of the business party and the blockchain network communication.
[0106] like Figure 7 As shown, the method provided by the embodiment of the present disclosure may include the following steps.
[0107] In step S710, a smart contract publishing request sent by a business device is received, where the smart contract publishing request carries the smart contract, the signature information of the smart contract, and the digital certificate of the business party.
[0108] In the disclosed embodiment, the business party first creates a smart contract and submits it to the contract issuance center (i.e., the contract issuer). To ensure that the data in the smart contract is not tampered with by the contract issuance center or a third party, the business party can sign the smart contract requested to be uploaded to the chain and obtain the signature information of the smart contract. The contract issuance center receives the smart contract from the business party and verifies the signature information of the business party's smart contract, verifies whether the business party has the authority to create the smart contract, and audits the security and functionality of the smart contract to ensure the security of the smart contract.
[0109] In step S720, based on the business party's digital certificate, it is confirmed that the business party has the authority to create a smart contract.
[0110] In step S730, the security and functionality of the smart contract are confirmed based on the smart contract and the signature information of the smart contract.
[0111] In step S740, a blockchain transaction for deploying the smart contract is constructed, and the blockchain transaction for deploying the smart contract carries the account address of the contract issuer.
[0112] In step S750, a blockchain transaction for deploying the smart contract is sent to the blockchain network so that the node devices in the blockchain network can confirm that the contract issuer has the authority to publish the smart contract based on the account address of the contract issuer. After the blockchain transaction consensus for deploying the smart contract is passed, the smart contract is deployed to the blockchain network.
[0113] In an exemplary embodiment, the method may further include: if the administrator address of the smart contract is not specified in the request to publish the smart contract, constructing a contract transfer transaction, the contract transfer transaction carrying the identification information of the smart contract and the account address of the business party; sending the contract transfer transaction to the blockchain network, so that the node device changes the administrator address of the smart contract deployed in the blockchain network from the account address of the contract issuer to the account address of the business party according to the contract transfer transaction.
[0114] In an exemplary embodiment, the method may further include: receiving identification information of the smart contract returned by the node device; and sending the identification information of the smart contract to the business device.
[0115] Figure 7 For other contents in the embodiment, reference can be made to the description in the above embodiment.
[0116] Figure 8 The figure schematically shows a flowchart of a blockchain-based smart contract deployment method according to another embodiment of the present disclosure. Figure 8 The method provided in the embodiment can be applied to the business equipment of the business party, the business equipment can be communicated with the contract issuing equipment of the contract issuing party, and the contract issuing equipment can be communicated with the blockchain network.
[0117] like Figure 8 As shown, the method provided by the embodiment of the present disclosure may include the following steps.
[0118] In step S810, a smart contract is created.
[0119] In step S820, the signature information of the smart contract is generated.
[0120] In step S830, a smart contract publishing request is constructed, and the smart contract publishing request carries the smart contract, the signature information of the smart contract, and the digital certificate of the business party.
[0121] In step S840, the smart contract publishing request is submitted to the contract publishing device so that the contract publishing device verifies that the business party has the authority to create the smart contract based on the business party's digital certificate, verifies the smart contract based on the smart contract and the signature information of the smart contract, and constructs and sends a blockchain transaction for deploying the smart contract to the blockchain network to deploy the smart contract to the blockchain network.
[0122] Figure 8 For other contents in the embodiment, reference can be made to the description in the above embodiment.
[0123] The following describes embodiments of devices related to the present disclosure that can be used to implement the blockchain-based smart contract deployment method described above. For details not disclosed in the embodiments of the devices related to the present disclosure, please refer to the embodiments of the blockchain-based smart contract deployment method described above.
[0124] Figure 9 A block diagram of a node device according to an embodiment of the present disclosure is schematically shown. Figure 9 The node device in the embodiment can be set in the blockchain network, the blockchain network can be communicated with the contract issuing device of the contract issuing party, and the contract issuing device can be communicated with the business device of the business party.
[0125] Reference Figure 9 As shown, according to an embodiment of the present disclosure, a node device 900 may include: a deployment smart contract transaction acquisition unit 910, a smart contract publishing authority confirmation unit 920, a deployment smart contract transaction consensus unit 930, and a smart contract deployment unit 940.
[0126] In the embodiment of the present disclosure, the smart contract deployment transaction acquisition unit 910 can be used to obtain the blockchain transaction for deploying the smart contract sent by the contract issuing device. The blockchain transaction for deploying the smart contract can carry the account address of the contract issuer, wherein the blockchain transaction for deploying the smart contract can be generated by the contract issuing device based on the smart contract issuance request received from the business device. The smart contract issuance authority confirmation unit 920 can be used to confirm that the contract issuer has the smart contract issuance authority based on the account address of the contract issuer carried in the blockchain transaction for deploying the smart contract. The smart contract deployment transaction consensus unit 930 can be used to reach a consensus on the blockchain transaction for deploying the smart contract. The smart contract deployment unit 940 can be used to deploy the corresponding smart contract in the blockchain network after the blockchain transaction consensus on deploying the smart contract is passed.
[0127] In an exemplary embodiment, when deploying a smart contract in a blockchain network, the administrator address of the smart contract can be set to the account address of the contract issuer. The node device 900 may further include: a contract transfer transaction receiving unit, which may be used to receive a contract transfer transaction initiated by the contract issuing device after the corresponding smart contract is deployed in the blockchain network, the contract transfer transaction carrying the identification information of the smart contract and the account address of the business party; a contract transfer transaction consensus unit, which may be used to reach a consensus on the contract transfer transaction; and a contract management authority transfer unit, which may be used to modify the administrator address of the smart contract deployed in the blockchain network from the account address of the contract issuer to the account address of the business party according to the contract transfer transaction after the contract transfer transaction consensus is passed.
[0128] In an exemplary embodiment, the blockchain network can be connected to the business device for communication. The node device 900 may further include: a contract modification transaction receiving unit, which may be used to receive a blockchain transaction request for modifying a smart contract sent by a business device. The blockchain transaction request for modifying a smart contract may carry the blockchain transaction for modifying the smart contract, the digital certificate of the business party, and the signature information of the blockchain transaction for modifying the smart contract. The blockchain transaction for modifying the smart contract may include the identification information of the smart contract and the modification operation for the smart contract; a contract management authority confirmation unit, which may be used to confirm that the business party has the smart contract management authority based on the administrator address of the smart contract deployed in the blockchain network being the account address of the business party and the digital certificate of the business party; a contract modification transaction verification unit. The element can be used to verify the blockchain transaction for modifying the smart contract based on the blockchain transaction for modifying the smart contract and the signature information of the blockchain transaction for modifying the smart contract; the contract modification transaction consensus unit can be used to reach a consensus on the blockchain transaction for modifying the smart contract after the blockchain transaction for modifying the smart contract is successfully verified; the first block generation unit can be used to generate a first block based on the blockchain transaction for modifying the smart contract after the consensus on the blockchain transaction for modifying the smart contract is passed; the contract modification transaction execution unit can be used to add the first block to the blockchain of the blockchain network and execute the blockchain transaction for modifying the smart contract in the first block to modify the smart contract according to the modification operation.
[0129] In an exemplary embodiment, a blockchain network can be communicatively connected to a business device. The node device 900 may further include: a contract transaction request acquisition unit configured to acquire a blockchain transaction request for invoking a smart contract initiated by a business device, the blockchain transaction request for invoking a smart contract may carry the blockchain transaction for invoking the smart contract, the digital certificate of the business party, and signature information of the blockchain transaction for invoking the smart contract. The blockchain transaction for invoking the smart contract may include identification information of the smart contract and parameters passed to the smart contract; a transaction signature verification unit configured to verify the signature information of the blockchain transaction for invoking the smart contract and the digital certificate of the business party; a contract transaction consensus unit configured to reach a consensus on the blockchain transaction for invoking the smart contract after the signature information of the blockchain transaction for invoking the smart contract and the digital certificate of the business party are successfully verified; a second block generation unit configured to generate a second block based on the blockchain transaction for invoking the smart contract after consensus on the blockchain transaction for invoking the smart contract is reached; and a contract transaction execution unit configured to add the second block to the blockchain of the blockchain network and execute the blockchain transaction for invoking the smart contract in the second block by invoking the smart contract according to the parameters.
[0130] In an exemplary embodiment, the deployment smart contract transaction acquisition unit 910 may include: a deployment contract transaction request acquisition unit, which can be used to obtain a blockchain transaction request for deploying a smart contract initiated by a contract issuing device, and the blockchain transaction request for deploying a smart contract can carry the blockchain transaction for deploying a smart contract, the signature information of the blockchain transaction for deploying a smart contract, and the digital certificate of the contract issuer; a deployment contract transaction signature verification unit, which can be used to verify the signature information of the blockchain transaction for deploying a smart contract and the digital certificate of the contract issuer; a deployment contract transaction extraction unit, which can be used to extract the blockchain transaction for deploying a smart contract from the blockchain transaction request for deploying a smart contract after successfully verifying the signature information of the blockchain transaction for deploying a smart contract and the digital certificate of the contract issuer.
[0131] In an exemplary embodiment, the node device 900 may further include: a contract identification generation unit, which can be used to generate identification information of the smart contract; and a contract identification information return unit, which can be used to return the identification information of the smart contract to the contract issuing device.
[0132] Figure 10 The block diagram of a contract issuing device according to an embodiment of the present disclosure is schematically shown. Figure 10 The contract issuing device of the contract issuing party in the embodiment can be connected to the business device of the business party and the blockchain network communication respectively.
[0133] Reference Figure 10 As shown, the contract issuing device 1000 according to one embodiment of the present disclosure may include: a smart contract issuing request receiving unit 1010, a smart contract creation permission confirmation unit 1020, a smart contract security function review unit 1030, a smart contract transaction construction unit 1040, and a smart contract transaction sending unit 1050.
[0134] In the disclosed embodiment, the smart contract publishing request receiving unit 1010 can be used to receive a smart contract publishing request sent by a business device. The smart contract publishing request can include the smart contract, the smart contract's signature information, and the business party's digital certificate. The smart contract creation permission confirmation unit 1020 can be used to confirm that the business party has permission to create a smart contract based on the business party's digital certificate. The smart contract security function review unit 1030 can be used to confirm the security and functionality of the smart contract based on the smart contract and its signature information. The smart contract deployment transaction construction unit 1040 can be used to construct a blockchain transaction for deploying the smart contract. The blockchain transaction for deploying the smart contract includes the account address of the contract issuer. The smart contract deployment transaction sending unit 1050 can be used to send the blockchain transaction for deploying the smart contract to the blockchain network, so that node devices in the blockchain network can confirm that the contract issuer has permission to publish the smart contract based on the contract issuer's account address. After the blockchain transaction consensus for deploying the smart contract is passed, the smart contract is deployed to the blockchain network.
[0135] In an exemplary embodiment, the contract issuing device 1000 may further include: a contract transfer transaction construction unit, which can be used to construct a contract transfer transaction if the administrator address of the smart contract is not specified in the smart contract issuance request, and the contract transfer transaction carries the identification information of the smart contract and the account address of the business party; a contract transfer transaction sending unit, which can be used to send the contract transfer transaction to the blockchain network, so that the node device can modify the administrator address of the smart contract deployed in the blockchain network from the account address of the contract issuer to the account address of the business party according to the contract transfer transaction.
[0136] In an exemplary embodiment, the contract issuing device 1000 may further include: a contract identification information receiving unit, which can be used to receive the identification information of the smart contract returned by the node device; and a contract identification information forwarding unit, which can be used to send the identification information of the smart contract to the business device.
[0137] Figure 11 The block diagram schematically shows a service device according to an embodiment of the present disclosure. Figure 11 The business device of the business party in the embodiment can be communicatively connected to the contract issuing device of the contract issuing party, and the contract issuing device can be communicatively connected to the blockchain network.
[0138] Reference Figure 11 As shown, the business device 1100 according to an embodiment of the present disclosure may include: a smart contract creation unit 1110, a contract signature generation unit 1120, a contract release request construction unit 1130 and a contract release request submission unit 1140.
[0139] In the embodiment of the present disclosure, the smart contract creation unit 1110 can be used to create a smart contract. The contract signature generation unit 1120 can be used to generate the signature information of the smart contract. The contract publishing request construction unit 1130 can be used to construct a smart contract publishing request, which can carry the smart contract, the signature information of the smart contract, and the digital certificate of the business party. The contract publishing request submission unit 1140 can be used to submit the smart contract publishing request to the contract publishing device, so that the contract publishing device verifies that the business party has the authority to create the smart contract based on the digital certificate of the business party, verifies the smart contract based on the smart contract and the signature information of the smart contract, constructs and sends a blockchain transaction for deploying the smart contract to the blockchain network, so as to deploy the smart contract to the blockchain network.
[0140] Figure 12 Schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present disclosure is shown. Figure 12 The electronic device 1200 shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0141] like Figure 12 As shown, electronic device 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage portion 1208 into a random access memory (RAM) 1203. Various programs and data required for system operation are also stored in RAM 1203. CPU 1201, ROM 1202, and RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to bus 1204.
[0142] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, and the like; an output section 1207 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 1208 including a hard disk; and a communication section 1209 including a network interface card such as a LAN card or a modem. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. Removable media 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1210 as needed, so that computer programs read therefrom can be installed in the storage section 1208 as needed.
[0143] In particular, according to an embodiment of the present disclosure, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1209, and / or installed from a removable medium 1211. When the computer program is executed by the central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.
[0144] It should be noted that the computer-readable medium described in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having at least one conductor, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.
[0145] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains at least one executable instruction for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0146] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, and the units described may also be provided in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.
[0147] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiment. For example, the electronic device may implement the following Figure 5 or Figure 6 or Figure 7 or Figure 8 The steps shown.
[0148] It should be noted that although several modules or units or subunits of the device for action execution are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units or subunits described above can be concretized in one module or unit or subunit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units or subunits to be concretized.
[0149] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Claims
1. A blockchain-based smart contract deployment method, characterized in that: The method is applied to a node device in a blockchain network, wherein the blockchain network is communicatively connected to a contract issuing device of a contract issuing party, and the contract issuing device is communicatively connected to a business device of a business party; wherein the method includes: Obtaining a blockchain transaction for deploying a smart contract sent by the contract issuing device, the blockchain transaction for deploying the smart contract carrying the account address of the contract issuer, wherein the blockchain transaction for deploying the smart contract is generated by the contract issuing device based on a smart contract publishing request received from the business device, the smart contract publishing request carrying the smart contract, signature information of the smart contract, and the digital certificate of the business party, the contract issuing device being configured to confirm, based on the digital certificate of the business party, that the business party has permission to create a smart contract; and confirming, based on the smart contract and the signature information of the smart contract, the security and functionality of the smart contract; Confirming that the contract issuer has the authority to issue the smart contract based on the account address of the contract issuer carried in the blockchain transaction for deploying the smart contract; Reaching consensus on the blockchain transaction for deploying the smart contract; After the blockchain transaction consensus for deploying the smart contract is passed, the corresponding smart contract is deployed in the blockchain network.
2. The method according to claim 1, wherein When deploying the smart contract in the blockchain network, setting the administrator address of the smart contract to the account address of the contract issuer; After deploying the corresponding smart contract in the blockchain network, the method further includes: Receiving a contract transfer transaction initiated by the contract issuing device, the contract transfer transaction carrying the identification information of the smart contract and the account address of the business party; Reaching consensus on the contract transfer transaction; After the contract transfer transaction consensus is passed, the administrator address of the smart contract deployed in the blockchain network is modified from the account address of the contract issuer to the account address of the business party according to the contract transfer transaction.
3. The method according to claim 2, wherein The blockchain network is communicatively connected to the business device; wherein the method further comprises: Receive a blockchain transaction request for modifying a smart contract sent by the business device, where the blockchain transaction request for modifying the smart contract carries the blockchain transaction for modifying the smart contract, the digital certificate of the business party, and signature information of the blockchain transaction for modifying the smart contract, where the blockchain transaction for modifying the smart contract includes identification information of the smart contract and a modification operation for the smart contract; Confirming that the business party has smart contract management authority based on the administrator address of the smart contract deployed in the blockchain network being the account address of the business party and the digital certificate of the business party; Verifying the blockchain transaction for modifying the smart contract based on the blockchain transaction for modifying the smart contract and the signature information of the blockchain transaction for modifying the smart contract; After the blockchain transaction for modifying the smart contract is successfully verified, consensus is reached on the blockchain transaction for modifying the smart contract; After the blockchain transaction consensus for modifying the smart contract is passed, generating a first block according to the blockchain transaction for modifying the smart contract; Adding the first block to the blockchain of the blockchain network and executing the blockchain transaction for modifying the smart contract in the first block to modify the smart contract according to the modification operation.
4. The method according to claim 1, wherein The blockchain network is communicatively connected to the business device; wherein the method further comprises: Obtaining a blockchain transaction request for invoking a smart contract initiated by the business device, the blockchain transaction request for invoking the smart contract carrying the blockchain transaction for invoking the smart contract, the digital certificate of the business party, and signature information of the blockchain transaction for invoking the smart contract, the blockchain transaction for invoking the smart contract including identification information of the smart contract and parameters passed to the smart contract; Verify the signature information of the blockchain transaction that calls the smart contract and the digital certificate of the business party; After the signature information of the blockchain transaction that calls the smart contract and the digital certificate of the business party are successfully verified, consensus is reached on the blockchain transaction that calls the smart contract; After the blockchain transaction consensus for calling the smart contract is passed, a second block is generated according to the blockchain transaction for calling the smart contract; The second block is added to the blockchain of the blockchain network, and the smart contract is called according to the parameters to execute the blockchain transaction of the called smart contract in the second block.
5. The method according to claim 1, wherein Obtaining the blockchain transaction for deploying the smart contract sent by the contract issuing device, including: Obtaining a blockchain transaction request for deploying a smart contract initiated by the contract issuing device, where the blockchain transaction request for deploying a smart contract carries the blockchain transaction for deploying the smart contract, signature information of the blockchain transaction for deploying the smart contract, and a digital certificate of the contract issuer; Verify the signature information of the blockchain transaction that deployed the smart contract and the digital certificate of the contract issuer; After the signature information of the blockchain transaction for deploying the smart contract and the digital certificate of the contract issuer are successfully verified, the blockchain transaction for deploying the smart contract is extracted from the blockchain transaction request for deploying the smart contract.
6. The method according to claim 1, wherein Also includes: Generate identification information of the smart contract; Return the identification information of the smart contract to the contract issuing device.
7. A blockchain-based smart contract deployment method, characterized in that: The method is applied to a contract issuing device of a contract issuing party, wherein the contract issuing device is respectively connected to a business device of a business party and a blockchain network for communication; wherein the method includes: Receive a smart contract publishing request sent by the business device, where the smart contract publishing request carries the smart contract, signature information of the smart contract, and the digital certificate of the business party; Confirming that the business party has the authority to create a smart contract based on the business party’s digital certificate; Confirming the security and functionality of the smart contract based on the smart contract and the signature information of the smart contract; Constructing a blockchain transaction for deploying a smart contract according to the smart contract publishing request received from the business device, wherein the blockchain transaction for deploying the smart contract carries the account address of the contract publisher; The blockchain transaction for deploying the smart contract is sent to the blockchain network so that the node devices in the blockchain network can confirm that the contract issuer has the authority to publish the smart contract based on the account address of the contract issuer. After the blockchain transaction consensus for deploying the smart contract is passed, the smart contract is deployed to the blockchain network.
8. The method according to claim 7, wherein Also includes: If the administrator address of the smart contract is not specified in the smart contract publishing request, a contract transfer transaction is constructed, which carries the identification information of the smart contract and the account address of the business party; The contract transfer transaction is sent to the blockchain network so that the node device changes the administrator address of the smart contract deployed in the blockchain network from the account address of the contract issuer to the account address of the business party according to the contract transfer transaction.
9. The method according to claim 7, wherein: Also includes: Receiving identification information of the smart contract returned by the node device; The identification information of the smart contract is sent to the business device.
10. A blockchain-based smart contract deployment method, characterized in that: The method is applied to a business device of a business party, wherein the business device is communicatively connected to a contract issuing device of a contract issuing party, and the contract issuing device is communicatively connected to a blockchain network; wherein the method includes: Create smart contracts; Generate signature information of the smart contract; Constructing a smart contract publishing request, the smart contract publishing request carries the smart contract, the signature information of the smart contract, and the digital certificate of the business party; The smart contract publishing request is submitted to the contract publishing device so that the contract publishing device verifies that the business party has the authority to create a smart contract based on the digital certificate of the business party, and verifies the smart contract based on the smart contract and the signature information of the smart contract, constructs and sends a blockchain transaction for deploying the smart contract to the blockchain network. The blockchain transaction for deploying the smart contract carries the account address of the contract issuer. The blockchain network is used to confirm that the contract issuer has the authority to publish the smart contract based on the account address, and deploys the smart contract to the blockchain network after the blockchain transaction consensus is passed.
11. A node device, characterized in that: The node device is set in the blockchain network, the blockchain network is communicatively connected to the contract issuing device of the contract issuing party, and the contract issuing device is communicatively connected to the business device of the business party; wherein the node device includes: a smart contract deployment transaction acquisition unit, configured to acquire a blockchain transaction for deploying a smart contract sent by the contract issuing device, the blockchain transaction for deploying the smart contract carrying the account address of the contract issuer, wherein the blockchain transaction for deploying the smart contract is generated by the contract issuing device based on a smart contract issuance request received from the business device, the smart contract issuance request carrying the smart contract, the signature information of the smart contract, and the digital certificate of the business party, the contract issuing device being configured to confirm, based on the digital certificate of the business party, that the business party has permission to create a smart contract; and to confirm, based on the smart contract and the signature information of the smart contract, the security and functionality of the smart contract; A smart contract publishing authority confirmation unit, configured to confirm that the contract issuer has the smart contract publishing authority based on the account address of the contract issuer carried in the blockchain transaction for deploying the smart contract; A smart contract transaction consensus unit is deployed to reach a consensus on the blockchain transaction of the deployed smart contract; A smart contract deployment unit is used to deploy the corresponding smart contract in the blockchain network after the blockchain transaction consensus for deploying the smart contract is passed.
12. A contract issuing device, characterized in that: The contract issuing device of the contract issuing party is respectively connected to the business device of the business party and the blockchain network; wherein the contract issuing device includes: a smart contract publishing request receiving unit, configured to receive a smart contract publishing request sent by the business device, wherein the smart contract publishing request carries the smart contract, signature information of the smart contract, and the digital certificate of the business party; A smart contract creation permission confirmation unit, configured to confirm, based on the business party's digital certificate, that the business party has permission to create a smart contract; A smart contract security function review unit, configured to verify the security and functionality of the smart contract based on the smart contract and the signature information of the smart contract; A smart contract deployment transaction construction unit, configured to construct a blockchain transaction for deploying a smart contract based on the smart contract release request received from the business device, wherein the blockchain transaction for deploying the smart contract carries the account address of the contract issuer; The smart contract deployment transaction sending unit is used to send the blockchain transaction for deploying the smart contract to the blockchain network, so that the node devices in the blockchain network can confirm that the contract issuer has the authority to publish the smart contract based on the account address of the contract issuer. After the blockchain transaction consensus for deploying the smart contract is passed, the smart contract is deployed to the blockchain network.
13. A business device, characterized in that: The business equipment of the business party is communicatively connected to the contract issuing equipment of the contract issuing party, and the contract issuing equipment is communicatively connected to the blockchain network; wherein the business equipment includes: Smart contract creation unit, used to create smart contracts; A contract signature generation unit, configured to generate signature information of the smart contract; A contract publishing request construction unit, configured to construct a smart contract publishing request, wherein the smart contract publishing request carries the smart contract, the signature information of the smart contract, and the digital certificate of the business party; A contract publishing request submission unit is used to submit the smart contract publishing request to the contract publishing device, so that the contract publishing device verifies that the business party has the authority to create a smart contract based on the digital certificate of the business party, and verifies the smart contract based on the smart contract and the signature information of the smart contract, constructs and sends a blockchain transaction for deploying the smart contract to the blockchain network. The blockchain transaction for deploying the smart contract carries the account address of the contract issuer. The blockchain network is used to confirm that the contract issuer has the authority to publish the smart contract based on the account address, and deploys the smart contract to the blockchain network after the blockchain transaction consensus is passed.
14. An electronic device, characterized in that: include: at least one processor; a storage device for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 6, the method according to any one of claims 7 to 9, or the method according to claim 10.
15. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6, the method according to any one of claims 7 to 9, or the method according to claim 10 is implemented.
Citation Information
Patent Citations
Transaction authentication method and system based on blockchain smart contract
CN110060056A
Blockchain transaction method and device
CN110298755A