Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Highly-available contract executing method and system

An execution method and contract technology, which is applied in the field of blockchain smart contracts and virtual machine implementations, can solve problems such as limited stack storage and inconvenient data random access, and achieve the effect of low execution cost

Active Publication Date: 2018-03-27
HANGZHOU RIVTOWER TECH CO LTD
View PDF3 Cites 31 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

For example, the SWAP (data exchange) and DUP (data copy) operations used for data exchange can only be operated on the stack, and the stack storage is limited, which is inconvenient for random access to data.

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
  • Highly-available contract executing method and system
  • Highly-available contract executing method and system
  • Highly-available contract executing method and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0029] figure 2 For the ABI to support local variables or parameters that exceed the maximum stack depth (for example, a maximum of 16 is allowed when written in Solidity language), the implementation scheme of adding push offset and swapx or push offset and dupx bytecode sequence includes the following steps:

[0030] (1) Contract writers can write corresponding smart contract codes with more than 16 local variables or parameters according to the contract information, and are no longer restricted by the ABI information of the number of local variables or parameters when writing contracts.

[0031] (2) The contract language parser, after analyzing the syntax and semantics of the above-mentioned ABI-extended smart contract code, generates a corresponding abstract syntax tree. Among them, when more than 16 local variables and parameters are parsed or combined in expressions and arrays, these extended information will be generated into the corresponding abstract syntax tree acco...

Embodiment 2

[0037] Such as image 3 shown, including the following steps:

[0038] (1) Contract writers can write corresponding smart contract codes based on contract information. ABI supports member variable structures that exceed the maximum number of stack depth elements, which can be passed as local variables of functions (including internal or external functions) or as parameters.

[0039] (2) The contract language parser, after analyzing the syntax and semantics of the above-mentioned ABI-extended smart contract code, generates a corresponding abstract syntax tree. Among them, when the member variable structure that exceeds the maximum number of stack depth elements is parsed as a local variable of a function (including internal or external functions) or passed as a parameter, the decoding (decoder) process including the structure itself and its member variables, The structure itself and the member variable information of the member variables exceeding the maximum number of stack d...

Embodiment 3

[0045] Such as Figure 4 shown, including the following steps:

[0046] (1) Contract writers can write high-availability smart contract codes based on contract information, that is, local variables, function parameters and structures that exceed the maximum stack depth are supported in terms of ABI.

[0047] (2) The contract language parser generates the corresponding abstract syntax tree after analyzing the syntax and semantics of the above-mentioned ABI-extended smart contract code. The parser can parse the above-mentioned extended ABI information and can handle errors, and the syntax tree data structure includes the above-mentioned extended ABI information.

[0048] (3) For the part that does not exceed the depth of the stack, convert the abstract syntax tree data structure into a corresponding binary bytecode sequence, which can be interpreted and executed by the contract virtual machine. For local variables that exceed the stack depth, the stack depth is pushed to the s...

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

The invention discloses a highly-available contract executing method, which includes steps of (1), compiling an intelligent contract code according to contract information, wherein the intelligent contract code comprises more than maximum stack depth number of local variables, parameters or structure bodies; (2), performing grammar semantic parsing on the intelligent contract code, and generatinga corresponding abstract grammar tree; (3), converting the abstract grammar tree data structure to be a binary byte assembly code sequence and an related order; (4), explaining and executing the byteassembly code sequence by a contract virtual machine. Specific to the problems that the stack is easy to overflow and a stack element cannot be visited at random, the original intelligent contract design adopts an avoiding plan of small stack depth and exchangeable different storage spaces ordinarily; through the plan of realizing the order visit at random by the contract encoder and the virtual machine, the stack overflow is prevented and the random visit of the stack element can be realized. More complex available intelligent contract can be operated on the system; the cost for contract writing, compilation, and execution is lower.

Description

technical field [0001] The invention relates to the fields of block chain smart contract and virtual machine realization, and is a smart contract execution method based on block chain technology. The problem of easy stack overflow and inability to randomly access stack elements in the original smart contract design has been improved. Background technique [0002] The concept of "smart contract" was originally proposed by Nick Szabo, a cryptographer who is engaged in digital contracts and digital currencies. It is essentially a computer protocol, similar to the program's branch selection statements (if-else statements). When the pre-compiled logic process conditions are triggered, the smart contract program automatically executes the corresponding contract terms. [0003] The smart contract code written in a high-level language can be executed by a virtual machine in the blockchain, and the operating environment of the Ethereum smart contract is the Ethereum Virtual Machine ...

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
IPC IPC(8): G06F8/20G06F8/30G06F8/41
CPCG06F8/24G06F8/37G06F8/42G06F8/443
Inventor 谢晗剑胡焰林宁志伟
Owner HANGZHOU RIVTOWER TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products