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

Method and system for realizing consensus based on smart contract

A smart contract and consensus technology, applied in the field of blockchain, can solve problems such as difficulty in achieving different consensus

Inactive Publication Date: 2021-09-07
南京创江湖企业管理有限公司
View PDF0 Cites 1 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] Such as Figure 1-Figure 5 As shown, this embodiment provides a method for realizing consensus based on smart contracts, including the following steps:

[0066] S1. Write a smart contract, specify the signer of the smart contract, the content of the contract, the subject of the contract and the specific terms that must be reflected in the contract;

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

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

[0069] S4. Replace the consensus and release a new smart contract, execute it in a loop to achieve consensus.

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

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

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

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. The method comprises 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 a block chain, and consensus type data and a corresponding consensus algorithm are set, so that the consensus can be conveniently realized at the block nodes according to triggering conditions of the smart contract; the flexible replacement of the consensus can be realized at each node, the upgrading difficulty of the block is reduced, 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 field of block chain technology, 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 cryptography to protect data security. It has remarkable characteristics such as non-tampering and non-forgery, and is widely used in many fields such as digital economy, Internet governance, and big data development. The consensus mechanism is the core of blockchain technology, which enables entities that do not trust each other to establish a trust relationship even in a scenario where there is no central trust agency. Another core technology of blockchain technology is smart contracts. The working principle of smart contracts is essentially similar to if-then statements of other computer programs. Smart contracts interact with real-world assets in a computer language. The working principle is: whe...

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 Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products