Method and system for realizing consensus based on smart contract

A smart contract and consensus technology, applied in the blockchain field, can solve problems such as difficult to achieve different consensus, achieve the effect of reducing execution costs, reducing waste, and improving intelligence

Pending Publication Date: 2022-08-09
南京创江湖企业管理有限公司
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

At present, the common consensus mechanism is pre-set and stored in the public chain. During the operation of the blockchain, the purpose is to realize the consensus mechanism. However, it is difficult to achieve different consensus in each private chain of the blockchain. consensus

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 system for realizing consensus based on smart contract
  • Method and system for realizing consensus based on smart contract
  • Method and system for realizing consensus based on smart contract

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0065] like Figure 1-Figure 5 As shown, this embodiment provides a method for realizing consensus based on a smart contract, including the following steps:

[0066] S1. Write a smart contract to clarify the signatory, contract content, contract subject and specific terms that must be reflected in the contract;

[0067] S2. Set the corresponding consensus algorithm in the node program and execute it;

[0068] S3. Define the block header information interface of the smart contract on the chain and perform transaction packaging to generate blocks;

[0069] S4, replace the consensus and issue a new smart contract, execute it in a circular manner, and realize the consensus.

[0070] In this embodiment, in S2, the method for setting a consensus algorithm and executing it includes the following steps:

[0071] S2.1. Set the shared type data in the smart contract;

[0072] S2.2. Set the consensus algorithm corresponding to the consensus type data in the node program;

[0073] S2...

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 relates to the technical field of block chains, in particular to a method and a system for realizing consensus based on a smart contract. Comprising the steps of compiling a smart contract, setting and executing a corresponding consensus algorithm in a node program, defining a block header information interface chained on the smart contract, carrying out transaction packaging to generate a block, replacing a consensus, issuing a new smart contract and the like. According to the method designed by the invention, the smart contract is independently compiled at each node of the block chain, and the consensus type data and the corresponding consensus algorithm are set, so that the consensus can be conveniently realized at the block nodes according to the triggering conditions of the smart contract, and the flexible replacement of the consensus can be realized at each node, thereby reducing the upgrading difficulty of the block and improving the upgrading efficiency of the block. Waste of computing resources is reduced, and possible inadaptability after consensus replacement is reduced; the system can safely and stably realize the consensus at the node, also provides a channel for replacing the consensus algorithm, can improve the operation speed, improves the intelligence of the contract, and reduces the execution cost.

Description

technical field [0001] The present invention relates to the technical field of blockchain, in particular to a method and system for realizing consensus based on smart contracts. Background technique [0002] Blockchain technology is a distributed storage technology that uses cryptographic methods to protect data security. It has remarkable characteristics such as non-tampering and non-forgery. It is widely used in digital economy, Internet governance, and big data development. Consensus mechanism is the core of blockchain technology, which enables entities that do not trust each other to establish a trust relationship even in the scenario where there is no central trust organization. Another core technology of blockchain technology is smart contracts. The working principle of smart contracts is essentially similar to the if-then statements of other computer programs. Smart contracts interact with real-world assets in a computer language. The working principle is: when a pre...

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 Applications(China)
IPC IPC(8): G06F16/27G06F21/60G06Q40/04
CPCG06F16/27G06F21/602G06Q40/04Y02P90/30
Inventor 张旭晖刘楼李伟顾筱彤
Owner 南京创江湖企业管理有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products