CN111865907A - Single-point execution single-point verification block chain intelligent contract system, realization method and device - Google Patents

Single-point execution single-point verification block chain intelligent contract system, realization method and device Download PDF

Info

Publication number
CN111865907A
CN111865907A CN202010510369.2A CN202010510369A CN111865907A CN 111865907 A CN111865907 A CN 111865907A CN 202010510369 A CN202010510369 A CN 202010510369A CN 111865907 A CN111865907 A CN 111865907A
Authority
CN
China
Prior art keywords
transaction
contract
verification
node
point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010510369.2A
Other languages
Chinese (zh)
Inventor
程文彬
幸佳
刘萍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wealedger Network Technologies Co ltd
Original Assignee
Wealedger Network Technologies Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wealedger Network Technologies Co ltd filed Critical Wealedger Network Technologies Co ltd
Priority to CN202010510369.2A priority Critical patent/CN111865907A/en
Publication of CN111865907A publication Critical patent/CN111865907A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0815Network architectures or network communication protocols for network security for authentication of entities providing single-sign-on or federations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention belongs to the technical field of block chains, and particularly relates to a single-point execution single-point verification block chain intelligent contract system, a method and a device, wherein the system comprises: a calling node for creating a contract called transaction T1 and broadcasting to the whole network; contract owner node, which is used to receive and execute the transaction T1, create and sign the return transaction T2, and broadcast the common message M to the whole network; the calling node is used for receiving and verifying the matching between M and T1, signing a returned transaction T2 contained in M to generate a transaction T3 if the verification is passed, and broadcasting T3 to the whole network; the packaging node is used for receiving the T3 and verifying whether the signature of the calling node and the signature of the contract owner node exists, if so, input and output verification is carried out, the signature is written into the block, and the block is broadcasted; and the verification node is used for finishing the call consensus confirmation. The system contract execution result provided by the invention only needs to call the node for one-time verification, thereby greatly saving the computing resource of the block chain network.

Description

Single-point execution single-point verification block chain intelligent contract system, realization method and device
Technical Field
The invention belongs to the technical field of block chains, and particularly relates to a system, a method and a device for single-point execution single-point verification block chain intelligent contracts.
Background
Smart contracts, a concept proposed in 1995 by nicak. sabbo (Nick Szabo), are a computer protocol intended to propagate, validate or execute contracts in an informative manner, allowing trusted transactions to be conducted without third parties, which transactions are traceable and irreversible. The vending machine is an intelligent contract application scene for selling goods by utilizing the closed characteristic of physical equipment. However, smart contracts have not been applied to the actual industry due to the lack of a trusted execution environment on the internet. Since the birth of the bit coin, people recognize that a bottom technical block chain of the bit coin can naturally provide a credible execution environment for the intelligent contract, and the block chain not only has the advantages of decentralization, untrustworthy data, openness and transparency and the like, but also enables the intelligent contract to generate new vitality.
The intelligent contracts are all contract synchronous execution contracts in the whole network, namely contract transactions are broadcasted to the whole network, after a packing node in the network receives the broadcasted transactions, the contracts are executed, results and the transactions are written into blocks at the same time, finally the blocks are broadcasted to the whole network and verified by other nodes, and the specific execution result can be determined by the network consensus. There are several significant problems with this type of network-wide synchronous execution of authentication contracts: firstly, the computing resources are wasted: the whole network packing nodes execute contracts, only one result in the obtained results is selected, and in principle, all the nodes of the whole network verify the contracts in the blocks; contract execution results must be packed in synchronization with the transaction, and transaction packing is blocked when the contract execution results are waited; the contract content and result must be public, and there is no secret, because the contract must be verified by all nodes throughout the network.
The single-point asynchronous contract provided by the prior art is only executed at the issuing node of the contract and is verified at the nodes of the whole network, and the transaction packaging is not blocked. The contract implementation method divides contract transaction into calling transaction and result transaction, the calling transaction is established and then broadcasted to the network, the packing node receives the calling transaction and can be immediately packed as common transaction without waiting for the result, meanwhile, the contract execution node executes contract establishment and return transaction if discovering that own contract needs to be executed, and returns the contract containing the result to the network for broadcasting. And the packing node receives the broadcast, performs verification to return the transaction to pass, then packs the transaction, and broadcasts the packed block to the network. And other nodes receive the block containing the return transaction, the return transaction is verified and executed, the block is confirmed after the return transaction is passed, and finally the network forms consensus.
Although the single-point asynchronous contract execution avoids transaction packing congestion and reduces the consumption of computing resources to a certain extent, the contract is verified by nodes of the whole network, and the verification process consumes the computing resources, which needs to be improved.
Disclosure of Invention
The embodiment of the invention aims to provide a single-point execution single-point verification block chain intelligent contract system, which aims to solve the problems that although single-point asynchronous execution contracts avoid transaction packing congestion and reduce the consumption of computing resources to a certain extent, the contracts need to be verified by nodes in the whole network, the computing resources are consumed in the verification process, and the improvement is needed.
The embodiment of the invention is realized in such a way that a single-point execution single-point verification block chain intelligent contract system comprises: the contract management method comprises the following steps of calling nodes, contract owner nodes, packaging nodes and verification nodes;
the calling node is used for creating a contract called transaction T1 and broadcasting the contract called transaction T1 to the whole network;
the contract owner node is used for receiving and executing the transaction T1, creating a return transaction T2 according to an execution result, signing, and broadcasting the signed return transaction T2 serving as a common message M to the whole network;
the calling node is used for receiving the common message M, verifying the matching with the transaction T1, signing the returned transaction T2 contained in the common message M to generate a transaction T3 if the verification is passed, and broadcasting the transaction T3 to the whole network;
the packaging node is used for receiving the transaction T3, verifying whether the transaction has the signatures of the calling node and the contract owner node, if so, performing input and output verification and writing the verification into a block, and broadcasting the block to the whole network;
and the verification node is used for receiving the block and performing consensus verification, and if the verification is passed, the contract is represented to complete calling consensus confirmation.
Another object of the embodiments of the present invention is to provide a method for implementing a single-point execution single-point verification block chain intelligent contract, which is applied to a call node, and the method for implementing a single-point execution single-point verification block chain intelligent contract includes the following steps:
creating a contract invoked transaction T1 and broadcasting to the whole network;
receiving a common message M returned after the contract owner node executes the transaction T1, and verifying the matching of the common message M and the transaction T1;
and if the verification is passed, signing the returned transaction T2 contained in the common message M to generate a transaction T3, and broadcasting the transaction T3 to the whole network.
Another object of an embodiment of the present invention is to provide a method for implementing a single-point verification block chain intelligent contract, which is applied to a contract owner node, and the method for implementing a single-point verification block chain intelligent contract includes the following steps:
receiving and executing a calling transaction T1 issued by a calling node, creating a return transaction T2 according to an execution result and signing;
and broadcasting the signed return transaction T2 to the whole network as a common message M.
Another object of an embodiment of the present invention is to provide an apparatus for implementing a single-point execution single-point verification blockchain intelligent contract, which is applied to a call node, and the apparatus for implementing a single-point execution single-point verification blockchain intelligent contract includes:
The contract calling module is used for creating a contract called transaction T1 and broadcasting the contract called transaction T1 to the whole network;
the receiving verification module is used for receiving a common message M returned after the contract owner node executes the transaction T1 and verifying the matching of the common message M and the transaction T1;
and the signature broadcasting module is used for signing the returned transaction T2 contained in the common message M to generate a transaction T3 if the verification is passed, and broadcasting the transaction T3 to the whole network.
Another object of an embodiment of the present invention is to provide an intelligent contract implementing apparatus for single-point execution single-point verification blockchain, which is applied to a contract owner node, and the intelligent contract implementing apparatus for single-point execution single-point verification blockchain includes:
the receiving execution module is used for receiving and executing the calling transaction T1 issued by the calling node, creating a return transaction T2 according to an execution result and signing;
and the broadcasting module is used for broadcasting the signed return transaction T2 to the whole network as a common message M.
In the single-point execution single-point verification block chain intelligent contract system provided by the embodiment of the invention, in the contract calling process, the contract execution result only needs the contract calling node to carry out one-time verification, the signature is attached and the broadcast is carried out to the whole network, and other nodes in the network do not need to carry out the contract verification execution, so that the computing resource of the block chain network is greatly saved; moreover, the contract running mechanism of the system provided by the invention needs the calling node to sign, confirm and broadcast the contract execution result, and then the result can take effect, the calling node is given a certain repentance right, the calling node can not take effect if not signing, and the contract execution result can not be confirmed, thereby being highly matched with the practical commercial contract signing scene and improving the applicability of the system.
Drawings
Fig. 1 is a schematic structural diagram of a single-point execution single-point verification blockchain intelligent contract system according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a single-point execution single-point verification blockchain intelligent contract system executing a contract call according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a single-point execution single-point verification blockchain intelligent contract system executing contract creation according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a single-point execution single-point verification block chain intelligent contract implementation method applied to a contract invoking node according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a single-point execution single-point verification block chain intelligent contract implementation method applied to a contract owner node according to an embodiment of the present invention;
fig. 6 is a block diagram illustrating a structure of a single-point execution single-point verification block chain intelligent contract implementation apparatus applied to a contract invocation node according to an embodiment of the present invention;
fig. 7 is a block diagram illustrating a structure of a single-point verification block chain intelligent contract implementation apparatus applied to a contract owner node according to an embodiment of the present invention;
FIG. 8 is a block diagram showing an internal configuration of a computer device according to one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms unless otherwise specified. These terms are only used to distinguish one element from another. For example, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script, without departing from the scope of the present application.
As shown in fig. 1, in one embodiment, a single point execution single point verification blockchain intelligent contract system is provided, which includes: the contract management method comprises the following steps of calling nodes, contract owner nodes, packaging nodes and verification nodes;
the calling node is used for creating a contract called transaction T1 and broadcasting the contract called transaction T1 to the whole network;
the contract owner node is used for receiving and executing the transaction T1, creating a return transaction T2 according to an execution result, signing, and broadcasting the signed return transaction T2 serving as a common message M to the whole network;
the calling node is used for receiving the common message M, verifying the matching with the transaction T1, signing the returned transaction T2 contained in the common message M to generate a transaction T3 if the verification is passed, and broadcasting the transaction T3 to the whole network;
The packaging node is used for receiving the transaction T3, verifying whether the transaction has the signatures of the calling node and the contract owner node, if so, performing input and output verification and writing the verification into a block, and broadcasting the block to the whole network;
and the verification node is used for receiving the block and performing consensus verification, and if the verification is passed, the contract is represented to complete calling consensus confirmation.
In the embodiment of the present invention, it should be understood that the invoking node, the contract owner node, the packaging node, and the verifying node are named after the role of each node in an intelligent contract invoking process, and the role of the node is not limited to what is described in the present invention, and in other processes, such as a contract creating process and another contract invoking process, each node in the present invention may serve as other types of nodes to perform corresponding functions. In addition, in an intelligent contract invocation flow, the invocation node and the contract owner node are generally single, and the packaging node and the verification node are generally not unique. The invention has no difference from the contract calling flow provided by the prior art in the number of nodes.
In the embodiment of the invention, the transaction T1 invoked by the contract is created by the invoking node, and it can be understood that T1 corresponds to a certain target contract, and T1 points to a certain target contract. Therefore, optionally, the calling node may further include a process of receiving broadcast information of the target contract creation before creating the call transaction T1, but the broadcast of the creation process does not mean that the call of the contract necessarily occurs, and the method of the embodiment of the present invention is limited only to the contract calling process, and this is not particularly limited to the broadcast of the creation process and the reception of the embodiment of the present invention.
In the embodiment of the present invention, the contract owner node is a node holding the target contract, and the node may be a contract invoking node or a node other than the contract invoking node, that is, in the embodiment of the present invention, the contract owner node and the contract invoking node may be the same node or different nodes. It should be understood that the target contract on the contract owner node may originate from a locally created contract, or may be obtained by other means, such as obtaining a historical contract for the address by means of address migration; in addition, the contract owner node may be specified by other means. In the embodiment of the invention, after receiving the call transaction T1, if the contract owner node judges that the target contract pointed by the transaction is about the contract held by the node, the transaction T1 is executed, the transaction T2 is created according to the execution result, and the signature is performed by using a private key, the signed transaction T2 is used as a common message M to perform whole network broadcasting, and the non-call node can not perform operation after receiving the common message M.
In the embodiment of the invention, after the calling node receives the common message M, if M is the return transaction of the calling transaction T1 sent by the node, contract verification execution is triggered, and after the verification is passed, the private key of the node is used for signing the transaction T2 to generate the transaction T3, and the transaction T3 is broadcasted to the whole network.
In the embodiment of the invention, a plurality of packing nodes are provided, after receiving the transaction T3, the packing nodes only need to verify whether the T3 has the signatures of the calling node and the contract owner node, if yes, input and output verification is carried out, and the verification is carried out by packing the T3, writing the block and broadcasting the block. In an embodiment of the present invention, the packing node may also be configured to receive and pack transaction T1, write the chunk to, and broadcast it. It should be understood that this process is not a critical element in the implementation of the present invention, and the sequence of packaging T1 and T3 and whether they are packaged in combination or not may be determined according to specific situations, and no matter what implementation form will have a substantial influence on the present invention, which is not limited in this respect.
In the embodiment of the present invention, the verification node is configured to receive the block and perform consensus verification, where an algorithm of the consensus verification is an existing mature technology. In the process of consensus verification, only double-signature verification is additionally carried out on T3 on the basis of ordinary transactions, and contract execution verification is not needed.
In an embodiment of the present invention, fig. 2 shows a timing diagram of a contract invocation performed by the single-point execution single-point verification blockchain intelligent contract system provided in the present invention. It should be understood that each node has a verification and/or verification process, and when the verification and/or verification fails, the transaction is discarded, which is a conventional operation in a block chain, and the details of the embodiment of the present invention are not repeated.
In the single-point execution single-point verification block chain intelligent contract system provided by the embodiment of the invention, in the contract calling process, the contract execution result only needs the contract calling node to carry out one-time verification, the signature is attached and the broadcast is carried out to the whole network, and other nodes in the network do not need to carry out the contract verification execution, so that the computing resource of the block chain network is greatly saved; moreover, the contract running mechanism of the system provided by the invention needs the calling node to sign, confirm and broadcast the contract execution result, and then the result can take effect, the calling node is given a certain repentance right, the calling node can not take effect if not signing, and the contract execution result can not be confirmed, thereby being highly matched with the practical commercial contract signing scene and improving the applicability of the system.
In one embodiment, the contract owner node is further configured to:
Generating an intelligent contract, creating a transaction T4 issued by the intelligent contract and broadcasting the transaction T4 to the whole network;
calling a local virtual machine to execute the transaction T4 and generate a transaction T5, and broadcasting the transaction T5 to the whole network;
the intelligent contract is a target contract of the transaction T1 and carries a single-point execution single-point verification identifier.
In the embodiment of the present invention, the intelligent contract held by the contract owner node may be created by the node or may originate from other manners. In the embodiment of the present invention, the single-point execution single-point verification identifier may be disposed on the smart contract address, and exists as a specific field, and of course, other forms may also be adopted, which is not specifically limited in the present invention. It should be understood that, since the created smart contract carries the single-point execution single-point verification identifier, and all transactions (including the transactions T1-T5 in the embodiment of the present invention) associated with the smart contract include the single-point execution single-point verification identifier, each step of the embodiment of the present invention may include an identification process for the identifier, and when an identification process exists, the identifier really assumes that the step is performed.
In addition, it should be understood that, in the embodiment of the present invention, the contracts created by the contract owner nodes in the contract creation process are named as T4 and T5, and it means that T1 to T3 are generated before T4 and T5, and the naming in the embodiment of the present invention is only used for distinguishing different transactions, and is not related to the generation precedence, membership, importance degree, and the like.
In one embodiment, the generating of the intelligent contract specifically includes the following steps:
acquiring a contract code;
and selecting a contract address, and generating an address of the intelligent contract carrying the single-point execution single-point verification identifier according to the token of the selected address and the contract code according to the homologous address generation rule.
In the embodiment of the present invention, the contract code may be written by a developer, but may also be obtained by other means, such as web crawling, and the like, which is not specifically limited by the present invention. After obtaining the contract code, selecting a contract source address at the node, and generating an address of the intelligent contract carrying the single-point execution single-point verification identifier by using the token of the source address and the contract code according to a homologous address generation rule, wherein the homologous address generation rule is the prior art, and details are not repeated herein.
In one embodiment, the packing node is further configured to:
receiving the transaction T4 and writing the transaction into a block n, and broadcasting the block n to the whole network; and/or
Receiving the transaction T5 and executing a contract initialization verification program, writing the initialized state and the returned transaction into a block m if the verification is passed, and broadcasting the block m to the whole network;
wherein m > = n.
In the embodiment of the present invention, it should be understood that since the blockchain network is a periodic calculation block, T4 and T5 may be written into the same block, where m = n, otherwise m > n is usually said. After receiving the T4 and/or T5, the packaging node may confirm whether the T4 and/or T5 carries a single-point execution single-point verification identifier, and if not, execute the operation according to the existing contract type.
The single-point execution single-point verification block chain intelligent contract system provided by the embodiment of the invention guides the operation of each node by setting the single-point execution single-point verification identifier, has a simple and convenient mode, is easy to realize, does not need to improve or innovate hardware for the existing system, and has low cost.
In one embodiment, the verification node is further configured to:
receiving the block m and/or n and verifying the transaction in the block, and completing the establishment of consensus confirmation on behalf of the contract if the verification is passed.
In the embodiment of the present invention, the verification node is configured to perform consensus verification on the generated block of the packing node, which is an application of the prior art, and this is not specifically limited in the embodiment of the present invention. Fig. 3 is a timing chart of the single-point execution single-point verification blockchain intelligent contract system for contract creation provided by the present invention, which contains the flows of the above-mentioned embodiments of the present invention, and also belongs to a specific embodiment provided by the present invention.
As shown in fig. 4, in an embodiment, an embodiment of the present invention further provides a single-point execution single-point verification blockchain intelligent contract implementation method, which is applied to a calling node, where the single-point execution single-point verification blockchain intelligent contract implementation method includes the following steps:
step S402, creating a transaction T1 called by a contract and broadcasting the transaction T1 to the whole network;
step S404, receiving a common message M returned by the contract owner node after executing the transaction T1, and verifying the matching between the common message M and the transaction T1;
and step S406, if the verification is passed, signing the returned transaction T2 contained in the common message M to generate a transaction T3, and broadcasting the transaction T3 to the whole network.
In the embodiment of the invention, the transaction T1 invoked by the contract is created by the invoking node, and it can be understood that T1 corresponds to a certain target contract, and T1 points to a certain target contract. Therefore, optionally, the calling node may further include a process of receiving broadcast information of the target contract creation before creating the call transaction T1, but the broadcast of the creation process does not mean that the call of the contract necessarily occurs, and the method of the embodiment of the present invention is limited only to the contract calling process, and this is not particularly limited to the broadcast of the creation process and the reception of the embodiment of the present invention.
In the embodiment of the invention, different from the prior art, the result can take effect only after the calling node signs and confirms and broadcasts the execution result of the contract, and the caller is given remorse power to a certain extent; moreover, the contract execution result only needs to call the node for one-time verification, attach the signature and broadcast, and other nodes in the network do not need to perform the contract verification execution, so that the computing resources of the block chain network are greatly saved.
As shown in fig. 5, in an embodiment, an embodiment of the present invention further provides a single-point execution single-point verification blockchain intelligent contract implementation method, which is applied to a contract owner node, where the single-point execution single-point verification blockchain intelligent contract implementation method includes the following steps:
step S502, receiving and executing the calling transaction T1 issued by the calling node, creating a return transaction T2 according to the execution result and signing;
step S504, the signed return transaction T2 is broadcast to the whole network as a common message M.
In the embodiment of the invention, after receiving the call transaction T1, if the contract owner node judges that the target contract pointed by the transaction is about the contract held by the node, the transaction T1 is executed, the transaction T2 is created according to the execution result, and the signature is performed by using a private key, the signed transaction T2 is used as a common message to perform whole network broadcasting, and the non-call node can not perform operation after receiving the common message M. Before the above steps, the node where the contract is located may also execute the creation process of the intelligent contract according to any one of the foregoing embodiments of the present invention.
The single-point execution single-point verification block chain intelligent contract implementation method provided by the embodiment of the invention has the advantages that for the node where the contract is located, after the call transaction of the call node is received, the block chain message broadcast channel is utilized to realize the transmission of the contract result intermediate information M (the contract execution result transaction only containing the unilateral signature of the contract execution node), so that the resource waste caused by the execution of the message by a non-call node can be effectively reduced, the resource consumption of node calculation is reduced, and the energy is saved.
In one embodiment, the present invention further provides a single-point execution single-point verification blockchain intelligent contract implementation apparatus, which is applied to a call node, and the single-point execution single-point verification blockchain intelligent contract implementation apparatus includes:
a contract calling module 601, configured to create a contract called transaction T1 and broadcast the transaction to the whole network;
a receiving verification module 602, configured to receive a common message M returned after the contract owner node executes the transaction T1, and verify matching between the common message M and the transaction T1;
and a signature broadcasting module 603, configured to sign the returned transaction T2 included in the normal message M to generate a transaction T3 if the verification is passed, and broadcast the transaction T3 to the whole network.
In the embodiment of the invention, the transaction T1 invoked by the contract is created by the invoking node, and it can be understood that T1 corresponds to a certain target contract, and T1 points to a certain target contract. Therefore, optionally, the calling node may further include a process of receiving broadcast information of the target contract creation before creating the call transaction T1, but the broadcast of the creation process does not mean that the call of the contract necessarily occurs, and the method of the embodiment of the present invention is limited only to the contract calling process, and this is not particularly limited to the broadcast of the creation process and the reception of the embodiment of the present invention.
In the embodiment of the invention, different from the prior art, the result can take effect only after the calling node signs and confirms and broadcasts the execution result of the contract, and the caller is given remorse power to a certain extent; moreover, the contract execution result only needs to call the node for one-time verification, attach the signature and broadcast, and other nodes in the network do not need to perform the contract verification execution, so that the computing resources of the block chain network are greatly saved.
In one embodiment, the present invention further provides a single-point execution single-point verification blockchain intelligent contract implementing apparatus, which is applied to a contract owner node, and the single-point execution single-point verification blockchain intelligent contract implementing apparatus includes:
A receiving execution module 701, configured to receive and execute the call transaction T1 issued by the call node, create a return transaction T2 according to the execution result, and sign the return transaction T2;
a broadcasting module 702, configured to broadcast the signed return transaction T2 to the whole network as a common message M.
In the embodiment of the invention, after receiving the call transaction T1, if the contract owner node judges that the target contract pointed by the transaction is about the contract held by the node, the transaction T1 is executed, the transaction T2 is created according to the execution result, and the signature is performed by using a private key, the signed transaction T2 is used as a common message to perform whole network broadcasting, and the non-call node can not perform operation after receiving the common message M. Before the above steps, the node where the contract is located may also execute the creation process of the intelligent contract according to any one of the foregoing embodiments of the present invention.
The single-point execution single-point verification block chain intelligent contract implementation device provided by the embodiment of the invention utilizes the block chain message broadcast channel to realize the transmission of the contract result intermediate information M (only the contract execution result transaction containing the unilateral signature of the contract execution node) after receiving the call transaction of the call node for the node where the contract is located, thereby effectively reducing the resource waste caused by the execution of the message by a non-call node and improving the calculation efficiency of the block chain grid.
FIG. 8 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may specifically be any node in fig. 1. As shown in fig. 8, the computer apparatus includes a processor, a memory, a network interface, an input device, and a display screen connected through a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system, and may further store a computer program, and when the computer program is executed by the processor, the computer program may enable the processor to implement the method for implementing the single-point execution single-point verification block chain intelligent contract provided by the embodiment of the present invention. The internal memory may also store a computer program, and when the computer program is executed by the processor, the computer program may enable the processor to execute the method for implementing the single-point execution single-point verification blockchain intelligent contract provided by the embodiment of the present invention. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the single-point execution single-point verification blockchain intelligent contract implementation apparatus provided in the present application may be implemented in the form of a computer program that is executable on a computer device as shown in fig. 8. The memory of the computer device can store various program modules which form the xx device, such as a contract calling module, a receiving verification module and a signature broadcasting module shown in FIG. 6; or the reception execution module and the broadcasting module shown in fig. 7. The computer program formed by the program modules enables the processor to execute the steps of the single-point execution single-point verification block chain intelligent contract implementation method of the embodiments of the application described in the specification.
For example, the computer device shown in fig. 8 may perform step S402 through the contract invocation module in the single-point execution single-point verification blockchain intelligent contract implementation apparatus shown in fig. 6; the computer device may perform step S404 by receiving the authentication module; the computer device may perform step S406 through the signature broadcasting module.
For another example, the computer device shown in fig. 8 may execute step S502 through the receiving execution module in the single-point execution single-point verification blockchain intelligent contract implementation apparatus shown in fig. 7; the computer device may perform step S504 through the broadcasting module.
In one embodiment, a computer device is proposed, the computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
step S402, creating a transaction T1 called by a contract and broadcasting the transaction T1 to the whole network;
step S404, receiving a common message M returned by the contract owner node after executing the transaction T1, and verifying the matching between the common message M and the transaction T1;
and step S406, if the verification is passed, signing the returned transaction T2 contained in the common message M to generate a transaction T3, and broadcasting the transaction T3 to the whole network.
Or:
step S502, receiving and executing the calling transaction T1 issued by the calling node, creating a return transaction T2 according to the execution result and signing;
step S504, the signed return transaction T2 is broadcast to the whole network as a common message M.
In one embodiment, a computer readable storage medium is provided, having a computer program stored thereon, which, when executed by a processor, causes the processor to perform the steps of:
step S402, creating a transaction T1 called by a contract and broadcasting the transaction T1 to the whole network;
step S404, receiving a common message M returned by the contract owner node after executing the transaction T1, and verifying the matching between the common message M and the transaction T1;
and step S406, if the verification is passed, signing the returned transaction T2 contained in the common message M to generate a transaction T3, and broadcasting the transaction T3 to the whole network.
Or:
step S502, receiving and executing the calling transaction T1 issued by the calling node, creating a return transaction T2 according to the execution result and signing;
step S504, the signed return transaction T2 is broadcast to the whole network as a common message M.
It should be understood that, although the steps in the flowcharts of the embodiments of the present invention are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in various embodiments may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. A single point execution single point verification blockchain intelligent contract system, the single point execution single point verification blockchain intelligent contract system comprising: the contract management method comprises the following steps of calling nodes, contract owner nodes, packaging nodes and verification nodes;
The calling node is used for creating a contract called transaction T1 and broadcasting the contract called transaction T1 to the whole network;
the contract owner node is used for receiving and executing the transaction T1, creating a return transaction T2 according to an execution result, signing, and broadcasting the signed return transaction T2 serving as a common message M to the whole network;
the calling node is used for receiving the common message M, verifying the matching with the transaction T1, signing the returned transaction T2 contained in the common message M to generate a transaction T3 if the verification is passed, and broadcasting the transaction T3 to the whole network;
the packaging node is used for receiving the transaction T3, verifying whether the transaction has the signatures of the calling node and the contract owner node, if so, performing input and output verification and writing the verification into a block, and broadcasting the block to the whole network;
and the verification node is used for receiving the block and performing consensus verification, and if the verification is passed, the contract is represented to complete calling consensus confirmation.
2. The single point execution single point verification blockchain intelligent contract system of claim 1, wherein the packaging node is further configured to receive the transaction T1 and write a block, broadcast a block containing the transaction T1 to the entire network.
3. The single point execution single point verification blockchain intelligent contract system of claim 1, wherein the contract owner node is further configured to:
generating an intelligent contract, creating a transaction T4 issued by the intelligent contract and broadcasting the transaction T4 to the whole network;
calling a local virtual machine to execute the transaction T4 and generate a transaction T5, and broadcasting the transaction T5 to the whole network;
the intelligent contract is a target contract of the transaction T1 and carries a single-point execution single-point verification identifier.
4. The single point execution single point verification blockchain intelligent contract system of claim 3, wherein the generating an intelligent contract specifically comprises the steps of:
acquiring a contract code;
and selecting a contract address, and generating an address of the intelligent contract carrying the single-point execution single-point verification identifier according to the token of the selected address and the contract code according to the homologous address generation rule.
5. The single point execution single point verification blockchain intelligent contract system of claim 3, wherein the packaging node is further configured to:
receiving the transaction T4 and writing the transaction into a block n, and broadcasting the block n to the whole network; and/or
Receiving the transaction T5 and executing a contract initialization verification program, writing the initialized state and the returned transaction into a block m if the verification is passed, and broadcasting the block m to the whole network;
Wherein m > is n.
6. The single point execution single point verification blockchain intelligent contract system of claim 3, wherein the verification node is further configured to:
receiving the block m and/or n and verifying the transaction in the block, and completing the establishment of consensus confirmation on behalf of the contract if the verification is passed.
7. A single-point execution single-point verification block chain intelligent contract implementation method is applied to a calling node, and is characterized by comprising the following steps:
creating a contract invoked transaction T1 and broadcasting to the whole network;
receiving a common message M returned after the contract owner node executes the transaction T1, and verifying the matching of the common message M and the transaction T1;
and if the verification is passed, signing the returned transaction T2 contained in the common message M to generate a transaction T3, and broadcasting the transaction T3 to the whole network.
8. A single-point execution single-point verification block chain intelligent contract implementation method is applied to a contract owner node, and is characterized by comprising the following steps:
receiving and executing a calling transaction T1 issued by a calling node, creating a return transaction T2 according to an execution result and signing;
And broadcasting the signed return transaction T2 to the whole network as a common message M.
9. A single-point execution single-point verification block chain intelligent contract implementation device is applied to a calling node, and is characterized in that the single-point execution single-point verification block chain intelligent contract implementation device comprises:
the contract calling module is used for creating a contract called transaction T1 and broadcasting the contract called transaction T1 to the whole network;
the receiving verification module is used for receiving a common message M returned after the contract owner node executes the transaction T1 and verifying the matching of the common message M and the transaction T1;
and the signature broadcasting module is used for signing the returned transaction T2 contained in the common message M to generate a transaction T3 if the verification is passed, and broadcasting the transaction T3 to the whole network.
10. A single-point execution single-point verification block chain intelligent contract implementation device is applied to a contract owner node, and is characterized in that the single-point execution single-point verification block chain intelligent contract implementation device comprises:
the receiving execution module is used for receiving and executing the calling transaction T1 issued by the calling node, creating a return transaction T2 according to an execution result and signing;
and the broadcasting module is used for broadcasting the signed return transaction T2 to the whole network as a common message M.
CN202010510369.2A 2020-06-08 2020-06-08 Single-point execution single-point verification block chain intelligent contract system, realization method and device Pending CN111865907A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010510369.2A CN111865907A (en) 2020-06-08 2020-06-08 Single-point execution single-point verification block chain intelligent contract system, realization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010510369.2A CN111865907A (en) 2020-06-08 2020-06-08 Single-point execution single-point verification block chain intelligent contract system, realization method and device

Publications (1)

Publication Number Publication Date
CN111865907A true CN111865907A (en) 2020-10-30

Family

ID=72987194

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010510369.2A Pending CN111865907A (en) 2020-06-08 2020-06-08 Single-point execution single-point verification block chain intelligent contract system, realization method and device

Country Status (1)

Country Link
CN (1) CN111865907A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
US20170345011A1 (en) * 2016-05-26 2017-11-30 Hitfin, Inc. System and method executed on a blockchain network
CN109064334A (en) * 2018-08-27 2018-12-21 深圳前海益链网络科技有限公司 A kind of intelligence contract bookkeeping methods, computer installation and readable storage medium storing program for executing
CN109118364A (en) * 2018-08-27 2019-01-01 深圳前海益链网络科技有限公司 Method, apparatus, computer equipment and the storage medium of asynchronous execution intelligence contract
US20190087793A1 (en) * 2017-08-31 2019-03-21 Brown University Adding concurrency to smart contracts
CN110519277A (en) * 2019-08-29 2019-11-29 上海威尔立杰网络科技发展有限公司 A method of contract is executed based on single-point and realizes the other systems of control
CN111090581A (en) * 2019-11-22 2020-05-01 腾讯科技(深圳)有限公司 Intelligent contract testing method and device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170345011A1 (en) * 2016-05-26 2017-11-30 Hitfin, Inc. System and method executed on a blockchain network
CN106603698A (en) * 2016-12-28 2017-04-26 北京果仁宝科技有限公司 Block chain consensus method based on DPOS and nodes
US20190087793A1 (en) * 2017-08-31 2019-03-21 Brown University Adding concurrency to smart contracts
CN109064334A (en) * 2018-08-27 2018-12-21 深圳前海益链网络科技有限公司 A kind of intelligence contract bookkeeping methods, computer installation and readable storage medium storing program for executing
CN109118364A (en) * 2018-08-27 2019-01-01 深圳前海益链网络科技有限公司 Method, apparatus, computer equipment and the storage medium of asynchronous execution intelligence contract
CN110519277A (en) * 2019-08-29 2019-11-29 上海威尔立杰网络科技发展有限公司 A method of contract is executed based on single-point and realizes the other systems of control
CN111090581A (en) * 2019-11-22 2020-05-01 腾讯科技(深圳)有限公司 Intelligent contract testing method and device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈宇翔等: "区块链的税收智能合约设计", 《通信技术》 *

Similar Documents

Publication Publication Date Title
US11048825B2 (en) Managing a smart contract on a blockchain
CN111681003B (en) Resource cross-chain transfer method and device, computer equipment and storage medium
CN107895111B (en) Internet of things equipment supply chain trust system management method, computer program and computer
CN107240017B (en) Block chain transaction management system and method
CN108804706B (en) Block chain data processing method, device, equipment and storage medium
CN111324446A (en) Multi-access edge computing node and method for deploying distributed accounting application
CN103078744B (en) Public key-based bidirectional radio frequency identification authorization method
CN111753335A (en) Editing method and device for block content
CN110599177A (en) Transaction verification method and related equipment
CN106326751B (en) One kind can channel system and its implementation
CN111949602A (en) Outsourcing data safety migration method and system supporting integrity verification
CN111090581B (en) Intelligent contract testing method, intelligent contract testing device, computer equipment and storage medium
CN110149323B (en) Processing device with ten-million-level TPS (platform secure protocol) contract processing capacity
CN111416709B (en) Voting method, device, equipment and storage medium based on block chain system
Tsimos et al. Gossiping for communication-efficient broadcast
Zhao et al. Fuzzy identity-based dynamic auditing of big data on cloud storage
CN116668313A (en) Scalable blockchain network model based on slicing
CN113312630B (en) Method and device for realizing trusted scheduling
CN109873828A (en) Method for managing resource, device, equipment and storage medium
CN111865907A (en) Single-point execution single-point verification block chain intelligent contract system, realization method and device
CN116166402B (en) Data security processing method, system, security chip and electronic equipment
CN112184226A (en) Block chain dynamic fragmentation method and system
CN116132058A (en) Block chain consensus method, apparatus, device and computer readable storage medium
CN113051618B (en) Intelligent contract privacy data processing system and method for block chain
Deng et al. PSSC: Practical and secure sidechains construction for heterogeneous blockchains orienting IoT

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20201030

RJ01 Rejection of invention patent application after publication