Unlock instant, AI-driven research and patent intelligence for your innovation.

Method and device for executing smart contracts in blockchain

A smart contract and blockchain technology, applied in the blockchain field, can solve problems that affect the correctness of the world state, and achieve the effect of improving performance and efficiency

Active Publication Date: 2021-02-05
ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

In addition, the contract A called in the transaction may call the contract B. If the execution of the contract B fails, the contract A needs to roll back the modification of the world state when the contract B is executed, otherwise the correctness of the world state will be affected.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for executing smart contracts in blockchain
  • Method and device for executing smart contracts in blockchain
  • Method and device for executing smart contracts in blockchain

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0054] Embodiments of this specification will be described below with reference to the accompanying drawings.

[0055] figure 1 is a schematic diagram of the process of executing smart contracts in the blockchain 100. Such as figure 1 As shown in , the blockchain 100 includes a plurality of interconnected nodes, including node 1 and node 2, for example. Assume that the user Alice corresponding to node 2 wants to call the smart contract already deployed in the blockchain 100 (such as figure 1 In the contract PostingData), node 2 can initiate a transaction (Tx) to any node in the blockchain 100 to make a contract call.

[0056] Specifically, in the transaction content, the from field can be the account address of the caller Alice, and the to field is the contract address 0x6f... of the above PostingData contract, indicating the smart contract called by the exchange. In the Data field, it contains the method or function name (set) and the incoming parameters ("green public we...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

Embodiments of this specification provide a method and apparatus for executing a smart contract in a blockchain, the method comprising: after starting to execute a first smart contract called in a transaction, allocating in the storage space corresponding to the transaction the first subspace corresponding to the first smart contract; before modifying the first variable according to the first smart contract, read the current state value of the first variable as the first value of the first variable; Store the first value of the first variable into the first subspace; modify the state value of the first variable according to the first smart contract; after the execution of the first smart contract is completed, read and delete the first subspace to obtain the first value of the first variable; in the case of failure to execute the first smart contract, restore the state value of the first variable to the first value value.

Description

technical field [0001] The embodiment of this description relates to the technical field of blockchain, and more specifically, to a method and device for executing smart contracts in blockchain. Background technique [0002] Blockchain technology is built on a peer-to-peer (P2P) network, uses a chained data structure to verify and store data, uses a distributed node consensus algorithm to generate and update data, and uses cryptography to ensure the security of data transmission and access. A new distributed infrastructure and computing paradigm that uses smart contracts composed of automated script code to program and manipulate data. In the blockchain, the consensus data in the blockchain is generated by sending a transaction and causing the transaction to be executed by the nodes. The transaction may include a call to a smart contract, so that when the transaction is executed, the execution of the smart contract will result in changes to the world state. The world state ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F16/27G06Q40/04G06F16/2455
CPCG06Q40/04G06F16/24552G06F16/27
Inventor 谢桂鲁
Owner ALIPAY (HANGZHOU) INFORMATION TECH CO LTD