Method and system for anchoring trustable external database by blockchain intelligent contract

A smart contract and database technology, applied in the blockchain field, can solve problems such as large-scale applications that are difficult to carry massive amounts of data, limit the depth of data processing, etc.

Active Publication Date: 2019-09-10
杭州时戳信息科技有限公司
View PDF3 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the nature of the blockchain as a decentralized database determines that it is difficult to store a large amount of data for a single application like a traditional database, thus limiting the difficulty of carrying large-scale applications with massive data
[0005] The smart contract at this stage supports the operation of the smart contract by continuously storing data in the KV storage space of the smart contract. The upper limit of the KV storage space of the smart contract limits the depth of data that the smart contract can process

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 anchoring trustable external database by blockchain intelligent contract
  • Method and system for anchoring trustable external database by blockchain intelligent contract
  • Method and system for anchoring trustable external database by blockchain intelligent contract

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0025] Example 1 (insert data)

[0026] Such as figure 1 and figure 2 As shown, a method for anchoring a trusted external database with a blockchain smart contract includes the following steps:

[0027] S1: Initialize and compile the smart contract, put the smart contract on the chain, and strip the data of the smart contract from the storage space of the smart contract, store it in any type of off-chain database, obtain the off-chain external database, and initialize the off-chain external database;

[0028] S2: Initialize the smart contract data verification module on the chain. When the smart contract initialization is completed, add a 64-byte hash to represent the Merkle tree of the external database under the chain mapped by the smart contract in the persistent storage layer of the smart contract root hash;

[0029] S3: When data is inserted into the smart contract, after inserting the data to be inserted into the external database under the chain, calculate the Merk...

Embodiment 2

[0030] Example 2 (delete data)

[0031] Such as figure 1 and figure 2 As shown, a method for anchoring a trusted external database with a blockchain smart contract includes the following steps:

[0032] S1: Initialize and compile the smart contract, put the smart contract on the chain, and strip the data of the smart contract from the storage space of the smart contract, store it in any type of off-chain database, obtain the off-chain external database, and initialize the off-chain external database;

[0033] S2: Initialize the smart contract data verification module on the chain. When the smart contract initialization is completed, add a 64-byte hash to represent the Merkle tree of the external database under the chain mapped by the smart contract in the persistent storage layer of the smart contract root hash;

[0034] S3: When there is data that needs to be deleted from the smart contract, after deleting the data to be deleted in the external database under the chain, ...

Embodiment 3

[0035] Embodiment 3 (calling data)

[0036] Such as figure 1 and image 3 As shown, a method for anchoring a trusted external database with a blockchain smart contract includes the following steps:

[0037] S1: Initialize and compile the smart contract, put the smart contract on the chain, and strip the data of the smart contract from the storage space of the smart contract, store it in any type of off-chain database, obtain the off-chain external database, and initialize the off-chain external database;

[0038] S2: Initialize the smart contract data verification module on the chain. When the smart contract initialization is completed, add a 64-byte hash to represent the Merkle tree of the external database under the chain mapped by the smart contract in the persistent storage layer of the smart contract root hash;

[0039] S3: When a smart contract needs to use data that already exists in an external database under the chain, the original data of the data and the sibling...

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 method and system for anchoring a trustable external database by a blockchain intelligent contract, and the method comprises the steps: peeling the data of the intelligent contract from the storage space of the intelligent contract, and storing the data in a database under any type of chain; adding a fixed-length hash to a continuous storage layer of the smart contract torepresent Merkel tree root hash of the under-chain external database mapped by the smart contract; if the data need to be inserted into the smart contract or the data need to be deleted from the smart contract or the data needs to be called; according to the invention, the Merkel tree, which is a data structure, is utilized to compress the infinite data set into the Hash with a certain length tooptimize the virtual space of the continuous storage of the intelligent contract; in the process of adding, deleting, modifying and checking external data, the verification overhead of the smart contract is always kept within a reasonable range by utilizing the characteristics of the balance tree, and block chain node CPU resources within the reasonable range are fully utilized to replace storageresources under a trusted chain which is nearly free of an upper limit.

Description

technical field [0001] The invention belongs to the technical field of blockchain, and in particular relates to a method and system for anchoring a trusted external database with a blockchain smart contract. Background technique [0002] Blockchain technology is a decentralized distributed database technology with various characteristics such as decentralization, openness and transparency, non-tampering, and trustworthiness, and is suitable for many application scenarios that have high requirements for data reliability. [0003] A smart contract is a script executed on the upper layer of the blockchain, which has the characteristics of Turing completeness and high plasticity. Users can implement complex business logic in the form of smart contracts, and by handing over the smart contracts to the underlying hosting model of the blockchain, the business model that requires multi-party trust can be completed without trust. [0004] The precondition for smart contracts to achie...

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/23G06F16/27G06Q40/04
CPCG06Q40/04G06F16/23G06F16/27
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