CN111611311A - Method and system for forming decentralized distributed database, electronic device and computer-readable storage medium - Google Patents

Method and system for forming decentralized distributed database, electronic device and computer-readable storage medium Download PDF

Info

Publication number
CN111611311A
CN111611311A CN202010396756.8A CN202010396756A CN111611311A CN 111611311 A CN111611311 A CN 111611311A CN 202010396756 A CN202010396756 A CN 202010396756A CN 111611311 A CN111611311 A CN 111611311A
Authority
CN
China
Prior art keywords
block
data
signature
chain
mining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010396756.8A
Other languages
Chinese (zh)
Other versions
CN111611311B (en
Inventor
徐皓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xu Hao
Original Assignee
Wuhu Mingxuan Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhu Mingxuan Technology Co ltd filed Critical Wuhu Mingxuan Technology Co ltd
Priority to CN202010396756.8A priority Critical patent/CN111611311B/en
Publication of CN111611311A publication Critical patent/CN111611311A/en
Priority to PCT/CN2021/090112 priority patent/WO2021227867A1/en
Application granted granted Critical
Publication of CN111611311B publication Critical patent/CN111611311B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Strategic Management (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Computer Hardware Design (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method, a system, electronic equipment and a computer readable storage medium for forming a decentralized distributed database. The blocks in the mine right chain contain the address of miners, and each miner sequentially generates a certain number of blocks in the data chain according to the sequence of the blocks in the mine right chain. Blocks in the data chain contain a miner signature to prove that the block was generated by the miner who obtained the block right.

Description

Method and system for forming decentralized distributed database, electronic device and computer-readable storage medium
Technical Field
The invention relates to the technical field of decentralized distributed databases, in particular to a method and a system for forming a decentralized distributed database, electronic equipment and a computer-readable storage medium.
Background
A distributed database is a database system commonly maintained by a plurality of devices (e.g., computers, servers) connected via a network. Distributed databases can be divided into two categories, centralized and decentralized. The centralized distributed database system comprises a main server and a plurality of slave servers, and the database is subject to the record of the main server. The decentralized distributed database system comprises a plurality of nodes, a main server is not arranged, all the nodes are equal in position, and the consistency of the database is maintained by means of a consensus algorithm.
The existing decentralized distributed database technology has the problems of slow data processing speed and long delay time. Decentralized distributed databases maintain the same database by allowing agreement between nodes without knowledge of the data stored in the databases of other accounting nodes, storing the same data, through a consensus algorithm. A common consensus algorithm is workload Proof (POW), where all nodes compete to generate new blocks that must qualify for addition to the database by providing proof that the workload is determined based on the current blockchain state. To be effective, the POW algorithm must be sufficiently difficult to prove with a workload that takes some time to complete to differentiate between new blocks to accommodate the delay in the propagation of a block through the network. For example, in bitcoin networks, the workload difficulty is set such that a new block is generated every 10 minutes or so, each block is 1MB in size, and thus the data processing speed is about 7 transactions per second, which is slow.
The decentralized distributed database can be used for processing scenes such as transactions and data storage certificates, and in the scenes, data cannot be used immediately after being stored in the decentralized distributed database, so that the delay time of data processing does not influence the efficiency of the system. However, in applications related to processes, such as workflow, supply chain management, etc., the long data processing delay time may result in a decrease in system efficiency. For example, if 100 pieces of data need to be processed and the delay time is 5 seconds, if there is no correlation between these pieces of data and the data can be processed simultaneously, it only needs 5 seconds to process all 100 pieces of data. However, if the 100 data items are process data items having a relationship between the front and the back, the process data items can be processed only in sequence, and 500 seconds are required for processing all the 100 data items. The delay time is therefore critical in determining the efficiency of the system. The existing decentralized distributed database uses the POW algorithm, and the problem of high delay exists.
Disclosure of Invention
The invention provides a decentralized distributed database method, aiming at solving the technical problem.
The invention also provides a method for forming the decentralized distributed database, which specifically comprises the following steps:
receiving a mining right block, verifying whether the mining right block is legal or not, and if so, adding the legal mining right block into a database;
receiving a data block, verifying whether the data block is legal or not, and if so, adding the legal data block into a database;
the data blocks contain references to another data block, the data blocks form a chain data structure through reference relations, the data structure is called a data chain, the mining right blocks contain references to another mining right block, and the mining right blocks form a chain data structure through reference relations, the mining right block is called a mining right chain;
the mining right block comprises a miner address, the data block comprises a signature block, the signature block comprises application data and a digital signature made by the miner address in the mining right block on the main chain of the mining right chain on the packaged application data, and the digital signature is called a block signature.
Further, according to the sequence of the mining right blocks in the main chain of the mining right chain, block signatures are made according to the mining right addresses in the mining right blocks, each mining right address generates a preset number of signature blocks, the generated signature blocks are sequentially added into the database and broadcast to other computing devices, and the signature blocks refer to data blocks containing digital signatures.
Further, the data block further comprises a POW block;
and within a preset time after receiving the previous data block, if a new data block is not received, packaging the received application data to generate a POW block, adding the newly generated POW block into the database, and broadcasting to other computing equipment.
Further, the right of way block contains a reference to a data block, the data block referenced by the right of way block is called an optimal data block, and the legal right of way block needs to satisfy the following conditions:
1) the optimal data block height H of the mine right block is not less than the optimal data block height H of the parent mine right block, namely H is more than or equal to H;
2) the father mine right block is the last mine right block on the main chain of the current mine right chain;
3) the miner address of the mine right block is not in the last N-1 mine right blocks of the mine right chain main chain, wherein N is the size of the mine right chain window.
Further, the legal signature block should satisfy the following condition:
1) the parent data block of the signature block is the last data block of the current data chain main chain;
2) the signature block has legal block signatures made by miner addresses more than half of the amount of active miners.
Further, the miner address is the miner address in the miner right block of the miner right chain window of the signature block parent block.
Further, the method for determining the mining weight chain window of the signature block specifically includes:
if the mining weight chain windows of M data blocks before the signature block are the same; the mining right chain window of the signature block is a mining right chain window formed by sliding the mining right chain window of the parent block of the signature block backwards by n mining right blocks; otherwise, the mining weight chain window of the signature block is the same as that of the parent block of the signature block, wherein n is the sliding step length of the mining weight chain window of the signature block, and M is the maximum value of the number of signature blocks which can correspond to each mining weight chain window.
The method for determining the mining weight chain window of the POW block comprises the following steps:
the mining right chain window of the POW block is a mining right chain window formed by sliding the mining right chain window of a POW block parent block backwards by m mining right blocks, wherein m is the sliding step length of the mining right chain window of the POW block.
Further, the legal right block also needs to satisfy the following conditions:
the workload of the mine weight block proves to satisfy a difficulty value determined according to a function of the waiting length, wherein the waiting length is the difference between the height of the mine weight block and the height of a mine weight chain window of the optimal data block of the mine weight block.
Further, the application data includes transaction data, the right of mining block includes a set of output points, the output points are references to transaction output, and verifying the validity of the right of mining block further includes:
verifying that all output points in the mining right block refer to unused transaction outputs, wherein the target address of the unused transaction outputs is the address of a miner in the mining right block, and the sum of the values of all the unused transaction outputs is not less than a preset value.
Further, the legal block signature needs to satisfy the following conditions:
3) all output points referenced in the mine right block corresponding to the mineworker address making the block signature are unused transaction outputs.
Further, the legal signature area also needs to satisfy the following conditions:
4) the size of the signature block does not exceed the maximum signature block capacity of the periodic adjustment, and the periodic adjustment method is to determine the maximum signature block capacity of the next period according to the average block generation time of the signature blocks in the period.
Further, the application data includes database transaction data, and the corresponding database transaction is executed according to the database transaction data in the data chain main chain data block, or the corresponding database transaction is executed according to the database transaction data in the legal data block.
The invention also provides a decentralized distributed database system, which consists of computing devices which are communicated with each other through a network, wherein the computer devices are provided with the database formed based on the decentralized distributed database forming method.
Further, the signature block is generated by N computing devices together, and the generated signature block comprises block signatures made by more than N/2 mining addresses; the miner address is the miner address in the mining right chain window of the signature block parent block.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the method for forming the decentralized distributed database.
The present invention also provides a computer-readable storage medium storing a program that implements the above-described decentralized distributed database formation method.
Decentralized distributed databases maintain database consistency between nodes, each of which needs to execute the same consensus algorithm. As a decentralized distributed database, the most common consensus algorithm in a block chain is workload proof, i.e., a new block needs to provide a workload proof that completes a difficulty determined according to the state of the block chain, and only a block that provides the workload proof is a legal block. When a plurality of nodes submit legal blocks containing different data at the same time, the nodes select the chain with the longest or the largest accumulated workload from the candidate chains as an effective chain. In order to avoid a large amount of forking of the block chain, the difficulty setting needs to make the node take a certain time to generate the required workload proof, which results in that the speed of processing data by the block chain is limited, the delay time is long, and the requirements of many applications, especially those requiring real-time data processing, cannot be met. Although blockchain techniques may be used to store other types of data in addition to the processing of transactions. Blockchain techniques are also used for attestation, for example, by exploiting the inability of blockchain data to be tampered with. However, the current blockchain technique is not suitable for processing flow data, because there is a dependency relationship between the former and later links of the flow, and the high delay of the blockchain technique may cause a reduction in system efficiency.
The present invention proposes to separate the acquisition of the right to produce a block from the behavior of the actual produced block, and to obtain the right to produce a block in the future by the nodes in a competitive manner. Therefore, the number of data blocks corresponding to each workload certificate can be set arbitrarily by the system, as long as the performance of the computing equipment is strong enough, the time interval and delay time of block output can be short arbitrarily, and the data processing can be high enough to meet the requirements of real-time application and flow processing.
In the present invention, the database includes two chained data structures. One of which is called the mining weight chain and the other is called the data chain. The block in the mining right chain records the address of the miner obtaining the accounting right and does not contain application data. Blocks in the mine weight chain are generated in a competitive manner, and a relatively long time is required for generating one mine weight chain block. For example, a hash collision method is used to generate a weighted chain block satisfying a certain difficulty value. The data blocks are generated by corresponding miners in sequence according to the sequence of the blocks in the mining right chain, and each miner can generate a batch of data blocks with preset quantity. In this way, the need for any block production rate can be met without sacrificing security. For example, in a transaction process, if security comparable to bitcoin is required, the workload-justified difficulty value may be set such that a block of mine rights is generated every 10 minutes on average. If the trading speed of 4200 transactions per second is required to be achieved under the condition that one right block is generated every 10 minutes, the number of data blocks which can be generated by each miner can be set to 600, so that 600 blocks can be generated every 10 minutes when the system is in stable operation, and the data processing speed is 600 times of that of the bitcoin network, namely 4200 transactions per second; the average delay time is 0.5 seconds, which is 600 times smaller than the bitcoin network. Miners prove that a block was created by a miner who has the right to create the block in a manner that provides a digital signature for the block.
Since a miner monopolizes the right to create blocks at any time, if the miner's equipment fails at that time, new data blocks cannot be created for a long time. To solve this problem, the present invention proposes two methods. One way is to allow two data blocks, called signature block and POW block, to be created in sequence from the miners who obtain the block weights according to the order of the miners in the mine weight chain in the manner described above. The POW blocks are data blocks generated by a traditional workload proving mode, and any node can generate the POW blocks without being limited by the mining sequence in the mine right chain, but a block can be generated in a longer time. Normally, because the speed of generating the signature block is much faster than the speed of generating the POW block, the POW block generated by the node has no chance to become a block on the main chain at all, and therefore the node does not waste resources to generate the POW block. However, if the node does not receive a new data block for a certain time, it indicates that the node with the right to generate the block may have a failure, and at this time, the node may initiate generation of the POW block. This approach ensures that the system does not freeze due to node failure, but performance is degraded.
Another method is to have the signature block generated by a group of predetermined numbers of miners instead of one, of which the signature is valid for the majority. The present invention uses a sliding weight chain window method to determine which set of miners can participate in generating signature blocks. As long as the number of failed nodes is less than half of the predetermined number, the system can stably generate new signature blocks without affecting performance. When the number of failed nodes exceeds half the predetermined number, the nodes in the system generate POW blocks, and system performance is affected but does not freeze. However, this effect is transient, since the POW block pattern drives the window of the mine weight chain to slide, resulting in the failed node losing the block weight and the other nodes taking the block weight.
The data that can be stored in the data block is not limited to transaction data, and may be any type of data. In particular, the data in the data block may be database transaction data, and after the data block becomes a data link main chain block, the node executes a database transaction corresponding to the database transaction data in the data block. Thus forming a universal decentralized distributed database. Due to the low latency nature of the present invention, such a universal decentralized distributed database may be used for workflow, supply chain management, and like applications.
The method proposed by the present invention is a decentralized method, because any node can finally obtain the right to generate data blocks by competing the generation of the right-to-mine blocks. The security and processing speed of the database in the invention are decoupled. The invention can reach high processing speed without sacrificing safety, or improve safety without reducing processing speed, and even reach high safety and high processing speed at the same time.
Drawings
FIG. 1 is a global schematic of a distributed database embodiment of the present invention;
FIG. 2 is a schematic diagram of a computing device according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a mine weight chain according to an embodiment of the present invention, wherein (a) is a chain data structure of the mine weight chain, and (b) is a branched data structure of the mine weight chain;
FIG. 4 is a diagram of a data chain according to an embodiment of the present invention, wherein (a) is a chain data structure of the data chain, and (b) is a branched data structure of the data chain;
FIG. 5 is a diagram illustrating relationships between the mining rights chain and the reference data chain according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating a mine weight chain window according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a hardness value according to an embodiment of the present invention.
Detailed Description
Many embodiments are possible based on the principles of the invention. The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely a few embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments or principles of the present invention without making creative efforts, shall fall within the protection scope of the present invention.
Some embodiments of the invention are methods of forming a distributed database on a set of computing devices in communication with each other over a network. As shown in fig. 1, a plurality of computing devices, each including a processor and a memory having a database stored therein, communicate with each other via a network. For any valid data in the distributed database, all the computing devices will eventually store the same valid information by executing the method of the present invention.
As shown in fig. 2, the computing device includes a database, a storage unit for storing the database, and a processing unit, and is configured with a communication module capable of receiving the right block, the data block, and the application data from other computing devices. The application data is data related to an application scenario, such as transaction data of a block chain, database transaction data, evidence storage data, company business data, personnel archive data, and data stored and processed by any conventional database, which belong to the application data of the present invention.
The computing device may be a single computer or server; or a group of computers or servers, each of which performs only part of the method of the present invention and assumes part of its functionality, and together performs the entire method of the present invention and assumes the entire functionality. On the other hand, by virtualization technology, one physical computer or server can be represented as a plurality of computers or servers in a network, in which case one physical computer or server should be regarded as a plurality of computing devices in the present invention, not just one computing device.
Each computing device is provided with a pair of a public key and a private key, and an address can be generated according to the public key, wherein the generated address is called a miner address. Typically the miner address is the public key itself, or a hash of the public key. In cryptography, a public key and a private key are a pair of numbers that have a mathematical relationship, but the private key cannot be calculated from the public key. The private key is not disclosed externally, and is kept only by the owner of the private key for signing data. Generally, a digest is generated for data to be signed, and then the digest is encrypted by a private key, and the encrypted result is a digital signature. Verifying the digital signature includes decrypting the digital signature with a public key, and if the decryption is successful, indicating that the encryption uses a private key associated with the public key. And then generating an address according to the public key, and if the address is the same as the address of the digital signature provider, considering the digital signature as authentic. In the present invention, the address is referred to as a miner address, and the digital signature made in this way is referred to as a digital signature made by the miner address.
The data in the database comprises two kinds of chained data structures consisting of two kinds of blocks. These two types of blocks are the right of mining block and the data block, respectively.
Each of the right-of-mine blocks contains a reference to another right-of-mine block, and the referenced right-of-mine block is called a parent block or a parent right-of-mine block of the right-of-mine block; the weighted block is called a child block of the parent block. In this embodiment, the weighted block references the parent block by including the hash value of the previous weighted block in the block data. All the weighted blocks in the database form a chain data structure as shown in fig. 3(a) by their parent block hash values, which is called weighted chain.
Each data block contains a reference to another data block, the referenced data block being referred to as the parent block or parent data block of the data block; the data block is referred to as a child block of the parent block. In this embodiment, the data chunk references the parent chunk by including the hash value of the previous data chunk in the chunk data. All data blocks in the database form a chained data structure, called a data chain, as shown in fig. 4(a) by their parent block hash values.
Each of the rights blocks includes the following data, see table 1:
TABLE 1 data included in the mine Right Block
Name (R) Content providing method and apparatus
Parent-mine-right block hash value Hash value of previous mine right block
Miner address An address generated from a public key
Optimal data block hash value Hash value of a data block
Proof of workload A random number for influencing the weighting blockGeneration of the desired value
Miners are a concept derived from blockchain technology, in which miners refer to computing devices that participate in competing to generate blocks. Computing devices are also referred to herein as miners or nodes. The miners are configured with a pair of public and private keys. Miners are identified by a miner address, and other miners confirm their qualifications, identities, or rights by verifying a digital signature corresponding to the miner address. Miners and physical equipment are not necessarily in a one-to-one correspondence. In block-chaining techniques, a group of physical devices may be organized to form a pool, and cooperatively generate blocks, the mining proceeds are attributed to a miner address, and the proceeds are further distributed within the pool. The mine pit may be considered a miner. In the present invention, there may be other physical device configuration modes, such as configuring two computers or servers, wherein one of the computers or servers is dedicated to generate the right of mining block, and the address of the miners in the generated right of mining block is a certain address; and a second exclusively generated data block, the generated signature block of which is block signed with the miner address. These two computers or servers constitute a miner. A computing device, a miner, or a node is synonymous and may be defined as a device configured with a pair of public and private keys, identified by a miner address, having data storage, processing, and network communication capabilities.
The optimal data block is one data block in the data chain. The miners can choose freely within a certain range. Miners typically select the last data block in the data chain backbone as the optimal data block. The miners can also select the optimal data block of the parent right-of-mine block or any data block after the optimal data block as the optimal data block of the child right-of-mine block.
In some embodiments, multiple right blocks with the same parent hash value are allowed to exist in the database, thereby forming a data structure with branches as shown in fig. 3(b), in which case the branch with the longest or most accumulated workload is a valid chain, called a main right chain or a main right chain, and the other branches are invalid data, called side right chains or side right chains; when one side mining weight chain becomes the branch with the longest or the largest accumulated workload due to the addition of the mining weight block, the miners reorganize the data in the database, so that the side mining weight chain becomes a new main mining weight chain, and the original main mining weight chain becomes the side mining weight chain. For uniform nomenclature, we refer to a mineral weight as the main or main chain even though in the embodiment where no sidechain is allowed, there is only one mineral weight in the database.
In some embodiments, multiple data chunks having the same parent data chunk hash value are allowed to exist in the database, thereby forming a data structure with branches as shown in fig. 4(b), in which case the longest branch is a valid chain, called a main data chain or data chain main chain, and the other branches are invalid data, called side data chains or data chain side chains. The side data chain has two types, one is that the bifurcation point is behind (including) the optimal data block of the mine weight chain tailing weight block, and the other is that the bifurcation point is in front of the optimal data block of the mine weight chain tailing weight block. When a first type of side data chain becomes the longest branch or the branch with the largest accumulated workload due to the addition of the data blocks, the miners reorganize the data in the database, so that the side data chain becomes a new main data chain, and the original main data chain becomes the side data chain. For uniform nomenclature, we also refer to this mining authority chain as the main data chain or data chain backbone, even though in embodiments where no side chains are allowed, there is only one data chain in the database.
The data block includes two types: POW block and signature block. All data chunks contain the block hash value of the packed application data and the parent data chunk. In addition, the POW block also contains the workload certificate and the signature block also contains the block signature.
In some embodiments, the chunk hash value is a hash of data in the chunk, including the chunk signature. Therefore, the signature blocks in the database of all miners have the same application data and the same block signature. The block signature is a digital signature made by the miner's address on other data in the block, including application data packaged into the block, and may also include data in other blocks, such as timestamps, version numbers, and the like.
In other embodiments, the chunk hash value is a hash of data in other chunks that do not include the chunk signature. The application data in the signature block in the database of all miners is the same, but they may have different block signatures. The block signature can be a digital signature made by the miner address on the block hash value, or can be a digital signature made by the miner address on other data in the block. The effect of both signatures is essentially the same. Since the decentralized distributed database aims to ensure that the application data recorded by each node is the same, no matter which way the block hash value is calculated and the block signature is made, the application range of the invention is not affected. But obviously the latter approach is more flexible.
In some embodiments, the POW block and the signature block are distinguished by including a special identification in the block. In other embodiments, the block includes a check value, and whether the POW block of one data block is the signature block is distinguished according to the positive and negative of the check value, if the check value is a positive number, the data block is the POW block, and the check value is the workload certification; if the check value is negative, the data block is a signature block, and the check value is a mine weight chain window count value. The mine weight chain window count value is used to record the height of the current mine weight chain window (i.e., of the belonging data block) and how many signature blocks have been generated that correspond to the current mine weight chain window.
After receiving the mining right block, the computing equipment verifies the validity of the mining right block, and if the mining right block is legal, the mining right block is added into the database; and after receiving the data block, the computing equipment verifies the validity of the data block, and if the data block is legal, the computing equipment adds the data block into the database.
Configurations of some embodiments of the invention include some or all of the following parameters, the values of which are either fixed or generated according to certain rules:
n: the amount of active miner; m: a maximum number of signature blocks that a set of active miners can correspond to; d: a basic difficulty target for determining whether the mine right block completes the workload certification; is a constant or a value periodically adjusted according to a certain rule; d: a difficulty target for determining whether the POW block completes the workload certification; is a constant or a value periodically adjusted according to a certain rule, or a value multiplied by d.
Active miners are miners with the right to make block signatures. That is, if the block signature was not made by an active miner, the block signature is not legitimate. The active miner amount is the number of miners authorized to make block signatures. In some embodiments, the mine weight chain window is used to determine active miners, and the member amount of the active miners is the mine weight chain window width. By adjusting the parameters, a distributed database system can safely achieve high processing speed and low latency. For example, in bitcoin systems, the difficulty of regularly adjusting the workload warrants that the system generates a block approximately every 10 minutes, each block no larger than 1MB in size (about 4000 transactions), so that the bitcoin system processes transactions approximately 7 transactions per second, which on average requires 5 minutes to be packed into a block. With the method of the present invention, to achieve the same security as bitcoin, the basic difficulty target d can be set to make the system generate one right block every 10 minutes, but on the other hand, M is set to 600, so that each miner who obtains right to generate the transaction block can generate 600 data blocks. And then the maximum capacity of the block is set to be matched with the transaction quantity which can be processed by the computing device per second, so that a mineworker can generate 600 data blocks within 10 minutes, and the transaction can be packed into one data block by waiting for 0.5 second on average. Since unassociated transactions can be processed in parallel by multiple processors or computers, the speed at which miners process transactions is limited only by the speed of network propagation, which is 1MB/s, and can process about 4000 transactions per second. Therefore, the processing speed and the delay are far better than those of the bitcoin system.
The legal right block needs to satisfy the following conditions:
1) the optimal data block of the mining right block is a data block in the main data chain, and the height H of the data block is not less than the optimal data block height H of the parent mining right block;
2) the parent mine weight block hash value is the hash value of the last mine weight block of the main mine weight chain. In the database that allows side chains, blocks that do not meet this condition but meet all other legitimacy conditions can be added as blocks of side chains into the database;
3) the miners' addresses of the mining right blocks are not in the last N-1 mining right blocks of the main mining right chain;
4) the mine right block has a proof of the workload meeting the requirements.
FIG. 5 shows an embodiment of optimal data blocks, wherein the optimal data blocks in the weighted blocks 1-8 are data blocks 1, 2, 2, 4, 8, 10, 12, 15, respectively. The weighting blocks and their optimal data blocks are weakly consistent in a front-to-back relationship, i.e., if the weighting block a is a block in the weighting chain before the weighting block B, the optimal data block of the weighting block a is before or the same as the optimal data block of the weighting block B in the data chain. Therefore, the miners cannot only store and verify the right block but not the data block, and the longer the right chain, the longer the data chain needs to be stored.
In some embodiments of the present invention, the method of verifying that the right of way block has satisfactory workload proofs is to verify that the hash value of the right of way block is less than the base difficulty target d. In other embodiments of the present invention, verifying that the right of mine block has the proof of satisfactory workload comprises: determining the height h of a mine weight chain window of the optimal data block P according to the optimal data block P of the mine weight block, if the difference between the height of the mine weight block and the height h is c, wherein c is called waiting length, verifying that the hash value of the mine weight block and the value of a predetermined function f (c, d) meet the workload proving condition, and the function f (c, d) is a function with the waiting length as an independent variable.
Generally, a workload justification condition is a numerically less than relational. The opposite may be true, as well, for numerical greater relationships. Therefore, the hash value of the weighted block and the value of a predetermined function f (c, d) satisfy the workload qualification, if the hash value of the weighted block is smaller (or larger) than f (c, d).
If the greatest of the mining right blockIn other embodiments of the present invention, f (C, d) is a function of f (C, d) if the wait length C ≦ C, and f (C, d) × g d if not otherwise(c-C). C and g are constants.
c represents the number of miners currently waiting to become active, and the value is not expected to be too low, so that no active miners are available when the system fluctuates; this value is also undesirable, resulting in a reduction in the total system service capacity as miners wait a long time before becoming active and therefore shut down the computing equipment during the wait period. The effect of this function is to maintain the number of miners waiting to become active within a desired range by adjusting the difficulty of meeting the workload justification condition.
Miners, in order to reduce the difficulty of generating the weighted block, tend to refer to the last block of the data chain in the generated weighted block and store the longest possible data chain in the database, so this block is "optimal" and is called the optimal block. One condition for determining the validity of a signature block is the number of block signatures. Signature blocks need to contain more than half of the active miner's amount of legal block signatures made from the miner's address to be legal. If the active miner amount is 1, the legal signature block only needs to contain one legal block signature. One method of determining active miners is to use a mine weight chain window. The weighted chain window of the data block is a height interval with the size of N in the weighted chain, the upper limit of the interval is called the height of the weighted chain window, and the lower limit is called the bottom of the weighted chain window. The block contains N consecutive mining right blocks in the mining right chain, and only the block signature made by the miner address in the mining right block in the sub data block is considered as the legal block signature of the signature block. The miners identified by these miner addresses are active miners, and these miner addresses are active miner addresses. N is the width of the mine weight chain window and is the amount of active miners.
As shown in fig. 7, the optimal data block of the weighted mining block 12 is POW block 3, and the active miner window of the POW block 3 is [1,3]]The height of the weight block 12 is 3, the height of the weight block 12 is 12, so C12-3 9 if C6, g 1/2, the difficulty target for the weight block 12 is d × (1/2)(9-6)D/8. That is, the hash value of the weighted block 12 must be less than d/8 to be determined to be legitimate. Therefore, when the length of the mining weight chain "leads" the data chain by more than a certain amount, the mining weight block takes longer to generate, so that the mining weight chain and the data chain are kept relatively balanced.
In other embodiments of the present invention, the base difficulty target d is a periodically adjusted value, and the adjusting method is: the block rate of a target weight block is set, i.e. how long a weight block is generated. And adjusting the basic difficulty target d value of the next adjustment period according to the actual block rate of the weighting block in the last adjustment period, so that the expected block rate of the weighting block in the next period is closer to the set block rate of the target weighting block. The base difficulty target d is therefore a value related to the height of the weighting block.
If the result of the validity verification of each mining right block is yes, the mining right block is judged to be legal, and the legal data block needs to meet the following conditions:
1) the parent data block hash value of the data block is the hash value of the last data block of the main data chain. In the database that allows side chains, blocks that do not meet this condition but meet all other legitimacy conditions can be added as blocks of side chains into the database;
2) if the data block is a POW block, verifying that the data block has a workload certification meeting the requirement; if the data block is a signature block, verifying that the signature block has block signatures made by active miner addresses of more than N/2 (not containing N/2) parent data blocks;
in some embodiments of the invention, the work load proof for verifying that the POW block meets the requirements is to verify that the hash value of the data block is less than the difficulty target D. In some embodiments of the present invention, the method for determining the difficulty target D value is as follows:
finding the first signature block before the POW block, determining the height h of the mine weight chain window of the signature block, wherein the difficulty target D value is a multiple of r of the basic difficulty target D of the mine weight chain at the height h, namely: d × r. In another embodiment, the bottom b of the mine weight chain window of the signature block is determined, and the difficulty target D value is a multiple r of the basic difficulty target D of the mine weight chain at the bottom b, namely: d × r.
As shown in fig. 7, the last signature block before POW block 4 is signature block 2, and the mining weight chain window of signature block 2 is [0, 2], whose height is 2. If the underlying difficulty target at this elevation mine weight chain is D, the multiple r is 1/4, then for POW block 4 the difficulty target is D/4. The hash value of POW block 4 may be valid if it is less than d/4.
The weighted window of the data block is a height interval of size N [ H-N +1, H ], where H is referred to as the height of the weighted window. The weight chain window corresponds to a set of weight blocks in the weight chain within its height interval. In some embodiments of the invention, the interval is determined as follows: if the weighted chain window S of the parent block of the data block is [ H-N +1, H ], then
1) If the data block is a POW block, the weighted chain window of the data block is [ H-N +1+ m, H + m ]; m is the sliding step length of the mining weight chain window of the POW block; namely, the mining right chain window of the data block is the mining right chain window of the parent block of the data block and slides m blocks backwards;
2) if the data block is a signature block, if the chain windows of M consecutive data blocks before the signature block are all S, the mining right chain window of the signature block is [ H-N +1+ N, H + N ]; n is the sliding step length of the mining weight chain window of the signature block; namely, the mining right chain window of the data block is the mining right chain window of the parent block of the data block and slides backwards for n blocks;
3) in other cases, the weighted window for the data block is S.
In some embodiments, the check value of the signature block is a weighted window count value. The check value of the data block is set according to the following rule:
1) if the data block is a POW block, the check value is a workload proof, even if the hash value of the block satisfies the positive random number of the workload proof condition;
2) if the data block is a signature block, the check value is a negative number determined by the following method, and is called a weighted window count value: if the check value of the signature block parent block is a positive number or a negative number smaller than-M, the check value of the signature block is-1; if the verification value of the signature block parent block is equal to 1-M, the verification value of the signature block is- (M + H + n); otherwise, the signature block check value is the check value of the parent block minus 1; h is the weighted chain window height of the parent block of the data block.
In this way, the block mining weight chain window of the data block can be quickly determined without tracing all data chains. For any data block, backtracking from the data block to a block with a first check value L smaller than-M along the data chain, and recording the number K of POW blocks in the backtracking process, wherein the height of the weighted chain window of the data block is as follows:
M–L+m×K。
as shown in fig. 6, M is 2, N is 1, N is 3, M is 3, and data block 1 and data block 2 are signature blocks, and their respective mining weight chain windows are [1,3 ]; data block 3 is a POW block with a weighted chain window of [3,5 ]; data block 4 and data block 5 are signature blocks, and their respective mining weight chain windows are [3,5 ]; data blocks 5, 6, 7 are signature blocks, their respective mining weight chain windows are [4,6 ]; data block 8 is a POW block with a weighted chain window of [6,8 ]; the data block 9 is a signature block whose weighted chain window is [6,8 ].
In some embodiments of the invention, the application data includes transaction data, to increase security, to prevent active miners from block signing two blocks containing different data at the same height, and to require active miners who generate signature blocks to provide a certain number of vouchers as mortgages that cannot be used within a certain time after the signature block is generated. An accounting mode commonly used in blockchains is UTXO, as used in bitcoin, which does not centrally record the assets of the user, the user verifies ownership of the transaction output and costs the transaction output in a manner of cryptographically unlocking the transaction output, a pass-through is the output of a transaction, and an unused pass-through refers to the output of a transaction that is not referenced as input by any transaction. In some embodiments of the invention where the transaction is recorded in a UTXO manner, the right of mine block further comprises a set of output points. An output point is a reference to the output of a transaction, typically including a hash value of the transaction and a sequence number of the output in the transaction. The transaction output includes a lock script and is only usable if the lock script is unlocked. The lock script contains an address, referred to as the destination address of the transaction output. Verifying the validity of the signature block further comprises:
verifying that all output points quoted by all output points in the mining right block corresponding to each miner address making the block signature are unused transaction output; if any block signature has a transaction output referenced by an output point in the corresponding right block used, the block signature is judged to be illegal.
Verifying the legitimacy of the right of mining block further comprises:
1. verifying whether all output points in the right block are unused transaction outputs; if not, determining that the right block is illegal;
2. verifying that the target addresses of the transaction outputs are all the miners' addresses in the right of mining block; if the target address output by any transaction is not the miner address, judging that the right of mining block is illegal;
3. and verifying that the sum of the values of the transaction outputs is not less than a preset value, and if not, judging that the mining right block is illegal.
It should be noted that, according to the method of the present invention, it is sufficient to ensure security even without the above-mentioned mortgage method. Because the weight block includes the optimal data block hash value, any side chain of the data chain with a bifurcation point before the optimal data block cannot be the main chain of the data chain any more as long as the weight block is finally confirmed. The final confirmation of the weighting block is also the final confirmation of the optimal data block of the weighting block.
However, the final confirmation is time-consuming, and for application data which is desired to be processed immediately, the mortgage method can increase the confidence of the user, accept the application data which is packed into the data chain but is not finally confirmed, and can compensate the loss of the user by mortgage when double signatures appear.
One embodiment of the invention is a method of adjusting a signature block generation rate. In this embodiment, the data block further includes a timestamp of when the block was generated, and verifying the validity of the signature block further includes:
the size of the verification signature block does not exceed a certain limit, referred to as the maximum signature block capacity. The maximum signature block size is a periodically adjusted value. The method for adjusting the maximum signature block size comprises setting the maximum signature block size of the next period to be close to an integral multiple of a base number (e.g. 4KB) of G/T × C according to the average block generation time (T) of the signature blocks in the last adjustment period, the average block size (C) of the signature blocks in the last adjustment period and the target block generation time (G).
Another embodiment of the present invention is a method for adjusting maximum signature block size, which includes setting the maximum signature block size of the next cycle to be close to an integral multiple of a base number (e.g. 4KB) of G/T × C/P, where P is a capacity target utilization rate and is a value between 0 and 1, according to an average block generation time (T) of signature blocks in a previous adjustment cycle, an average block size (C) of signature blocks in a previous adjustment cycle, and a target block generation time (G).
Another embodiment of the present invention is a method for adjusting maximum signature block size, comprising adjusting according to an average block generation time (T) and a target block generation time (G) of a signature block in a previous adjustment period, wherein if T > G × (1+ r), the maximum signature block size is increased, and if T < G × (1-r), the maximum signature block size is decreased. r is a constant used to control the adjusted threshold.
Because miners can charge for storing application data, miners have an incentive to pack as much application data as possible into a block. For signature blocks, since there is no other miners to compete for the right to produce blocks, if the block size is not limited, miners will wait for a long time to pack more application data, resulting in a long delay time for validation. By adopting the method, if the average block production time in one period is greater than the target block production time, the maximum signature block capacity is reduced in the next period; otherwise, the maximum signature block capacity is increased. Therefore, if the application data traffic is substantially stable, the average block time will approach the target block time after a number of cycles.
One embodiment of the invention is a method for generating a right of way block by a computing device, comprising the steps of:
1. determining the height h of a mining weight chain window of the last data block of the data chain;
2. verifying that no miner address of the computing equipment exists in the last N-1 mining right blocks of the mining right chain;
3. constructing a mine right block, wherein the mine right block comprises data shown in a table 2:
TABLE 2 data included in the mine Right Block
Figure BDA0002486990420000191
4. And adding the generated mining right blocks into a database and broadcasting the mining right blocks to the whole network.
One embodiment of the present invention is a method for generating a data block, comprising the steps of:
1. determining a mining weight chain window of the last data block of the main data chain;
2. generating a temporary data block; the temporary data block is a data block which contains a group of application data, the hash value of a parent data block of the temporary data block is the hash value of the last data block of the main data chain, and the workload certification and the block signature are undetermined;
3. if the miner address of the computing equipment is not the active miner address of the last data block of the main data chain and no new data block is received within the preset time after the data block is received last time or generated, generating a POW block according to the temporary data block, adding the generated POW block into the database, and broadcasting to the whole network;
4. if the miner address of the computing equipment is the active miner address of the last data block of the main data chain, and N is 1, performing block signature on the temporary data block by using the miner address of the computing equipment, adding the block signature into the temporary data block to form a signature block, adding the generated signature block into a database, and broadcasting the signature block to the whole network;
5. if the miner address of the computing device is the active miner address of the last data block of the primary data chain, and N >1, then:
a) executing a consensus algorithm, and determining a consensus data block together with other active miners of the last data block of the main data chain, wherein the consensus data block is a temporary data block selected from temporary data blocks of all the active miners;
b) the common identification data block is subjected to block signature by the miner address, and the block signature is added into the common identification data block and is sent to other active miners;
c) receiving block signatures of the consensus data block from other active miners, and adding the block signatures into the consensus data block; and when the total number of the signatures in the consensus data block exceeds N/2, the consensus data block becomes a signature block, and the generated signature block is added into the database and is broadcasted to the whole network.
There are many mature algorithms that can be used as the method for determining a common data block with other active miners, such as Paxos algorithm, bexating general algorithm, etc. for implementing the present invention.
One embodiment of the invention is a method of generating a POW chunk comprising finding a workload proof that meets the workload proof by a hash collision.
In another embodiment of the present invention, the application data includes transaction data of the database, and when a new data block is added to the data chain backbone, the corresponding database transaction is executed according to the database transaction data in the data block. In this way, the invention can generate the traditional database in a decentralized and distributed way, so that the application range of the decentralized and distributed database is no longer limited to the limited range of transaction processing, data storage and the like of a block chain, and the services which can be completed only by one process (so that low delay is an important factor) can be effectively processed.
An embodiment of the present invention is a decentralized distributed database system, as shown in FIG. 1, which is comprised of a number of computing devices connected to a network. The computer equipment is provided with a database formed based on any decentralized distributed database forming method.
Each computing device may receive data blocks, right blocks, from other computing devices. And the computing equipment receives the mining right block, verifies the legality of the mining right block and adds the legal mining right block into the local database. The computing device verifies the validity of the data block after receiving the data block and adds the valid data block into the local database.
Optionally, the computing device may also receive application data from the network and application data from other computing devices, generating new data blocks and new right blocks. The computing equipment finds out the hash value which meets the difficulty required by the current mining right chain state through hash collision, generates a legal mining right block, adds the generated legal mining right block into a local database and broadcasts the block to the whole network. There are two kinds of data blocks, one is a POW block and one is a signature block. The POW block is a block that contains a workload certificate. A signature block is a block that includes a signature of an active miner block. The computing device packages application data received over a period of time to produce an alternative data block. And the computing equipment judges whether the computing equipment is an active miner according to the states of the current data chain and the mining right chain. If the computing equipment is not an active miner and does not receive a new data block within a preset time, the computing equipment finds a hash value which meets the difficulty required by the current data link state through hash collision, generates a legal POW block, adds the generated legal POW block into a local database and broadcasts the POW block to the whole network.
In one embodiment of the invention, the signature block only needs the signature of one active miner, i.e., N ═ 1. If the computing device is an active miner, the node packages the received application data to generate an alternative data block, and performs block signature on the alternative data block to generate a legal signature block. And adding the generated legal signature block into a local database and broadcasting the legal signature block to the whole network.
In another embodiment of the present invention, the signature block needs to have signatures of multiple active miners, i.e., N > 1. And selecting one of the alternative data blocks generated by the active miners as a consensus block by executing a consensus protocol among the active miners, signing the working block by more than half of the active miners to generate a signature block, adding the signature block into a local database, and broadcasting the signature block to the whole network.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations (including flowchart illustrations, block diagrams, and text descriptions) of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow in the flow illustrations can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing one or more functions specified in the flowchart. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart illustration.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart illustration.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes may be made to the embodiment of the present invention by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to steps of methods, apparatus (systems), and computer program products according to embodiments of the application. It should be understood that each step can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the step or steps.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the step or steps.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the step(s).
Finally, it should be noted that: the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting the same, and although the present invention is described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications and equivalents may be made to the embodiments of the invention without departing from the spirit and scope of the invention, which is to be covered by the claims.

Claims (16)

1. A method for forming a decentralized distributed database is characterized by specifically comprising the following steps:
receiving a mining right block, verifying whether the mining right block is legal or not, and if so, adding the legal mining right block into a database;
receiving a data block, verifying whether the data block is legal or not, and if so, adding the legal data block into a database;
the data blocks contain references to another data block, the data blocks form a chain data structure through reference relations, the data structure is called a data chain, the mining right blocks contain references to another mining right block, and the mining right blocks form a chain data structure through reference relations, the mining right block is called a mining right chain;
the mining right block comprises a miner address, the data block comprises a signature block, the signature block comprises application data and a digital signature made by the miner address in the mining right block on the main chain of the mining right chain on the packaged application data, and the digital signature is called a block signature.
2. The method of claim 1, wherein the signature blocks are generated by miners 'addresses in the mine right block in the order of the mine right blocks in the mine right chain main chain, each miners' address generates a predetermined number of signature blocks, the generated signature blocks are added to the database in sequence and broadcast to other computing devices, and the signature blocks refer to data blocks containing signature blocks.
3. The method of claim 1, wherein the data block further comprises a POW block;
and within a preset time after receiving the previous data block, if a new data block is not received, packaging the received application data to generate a POW block, adding the newly generated POW block into the database, and broadcasting to other computing equipment.
4. The method of claim 1, wherein the right of way block contains a reference to a data block, the data block referenced by the right of way block is called an optimal data block, and the legal right of way block satisfies the following conditions:
the optimal data block height H of the mine right block is not less than the optimal data block height H of the parent mine right block, namely H is more than or equal to H.
5. The method of claim 1, wherein the legal signature block satisfies the following condition:
the signature block has legal block signatures made by miner addresses more than half of the amount of active miners.
6. The method of claim 5, wherein the mineworker address is the mineworker address in the mineworker block of the mineworker chain window of the parent block of the signature block.
7. The method of claim 6, wherein the signature block is determined by the method of mining weight chain window:
if the mining weight chain windows of M data blocks before the signature block are the same; the mining right chain window of the signature block is a mining right chain window formed by sliding the mining right chain window of the parent block of the signature block backwards by n mining right blocks; otherwise, the mining weight chain window of the signature block is the same as that of the parent block of the signature block, wherein n is the sliding step length of the mining weight chain window of the signature block, and M is the maximum value of the number of signature blocks which can correspond to each mining weight chain window.
8. The method of claim 4, wherein the legal right block further satisfies the following condition:
the workload of the mine weight block proves to satisfy a difficulty value determined according to a function of the waiting length, wherein the waiting length is the difference between the height of the mine weight block and the height of a mine weight chain window of the optimal data block of the mine weight block.
9. The method of claim 1, wherein the application data includes transaction data, the rights block includes a set of output points, the output points are references to transaction outputs, and verifying the legitimacy of the rights block further comprises:
verifying that all output points in the mining right block refer to unused transaction outputs, wherein the target address of the unused transaction outputs is the address of a miner in the mining right block, and the sum of the values of all the unused transaction outputs is not less than a preset value.
10. The method of claim 9, wherein the legal block signature satisfies the following condition:
all output points in the mine right block corresponding to the miner address of the block signature refer to unused transaction outputs.
11. The method of claim 1, wherein the legal signature region further satisfies the following condition:
the size of the signature block does not exceed the maximum signature block capacity of the periodic adjustment, and the periodic adjustment method is to determine the maximum signature block capacity of the next period according to the average block generation time of the signature blocks in the period.
12. The method of claim 1, wherein the application data comprises database transaction data, and the corresponding database transaction is executed according to the database transaction data in the data chain backbone data block, or according to the database transaction data in the legal data block.
13. A decentralized distributed database system, said system consisting of computing devices communicating with each other via a network, characterized in that the computer devices are provided with databases formed on the basis of the method for forming decentralized distributed databases according to any one of claims 1 to 12.
14. The decentralized distributed database system according to claim 13, wherein the signature blocks are collectively generated by the N computing devices, the generated signature blocks including block signatures for greater than N/2 miner addresses, the miner addresses being miner addresses in a miner authority chain window of a parent block of the signature blocks.
15. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of forming a decentralized distributed database according to any one of claims 1 to 12 when executing the program.
16. A computer-readable storage medium characterized by storing a program that realizes the decentralized distributed database formation method according to claims 1 to 12.
CN202010396756.8A 2020-05-11 2020-05-11 Method and system for forming decentralised distributed database, electronic device and computer readable storage medium Active CN111611311B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010396756.8A CN111611311B (en) 2020-05-11 2020-05-11 Method and system for forming decentralised distributed database, electronic device and computer readable storage medium
PCT/CN2021/090112 WO2021227867A1 (en) 2020-05-11 2021-04-27 Method and system for forming decentralized distributed database, electronic device, and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010396756.8A CN111611311B (en) 2020-05-11 2020-05-11 Method and system for forming decentralised distributed database, electronic device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111611311A true CN111611311A (en) 2020-09-01
CN111611311B CN111611311B (en) 2023-09-08

Family

ID=72200206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010396756.8A Active CN111611311B (en) 2020-05-11 2020-05-11 Method and system for forming decentralised distributed database, electronic device and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN111611311B (en)
WO (1) WO2021227867A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021227867A1 (en) * 2020-05-11 2021-11-18 徐皓 Method and system for forming decentralized distributed database, electronic device, and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109039646A (en) * 2018-07-12 2018-12-18 北京链享未来科技有限公司 A kind of packing of block chain block and verification method and system based on node capacity
CN109508987A (en) * 2018-12-06 2019-03-22 广东浪潮大数据研究有限公司 A kind of construction method, system and the associated component of block chain
CN109804374A (en) * 2016-10-20 2019-05-24 索尼公司 Digital Right Management based on block chain
CN110062923A (en) * 2016-10-17 2019-07-26 Arm有限公司 Mine is dug using the block chain of trusted node
US20190370793A1 (en) * 2018-06-04 2019-12-05 Decentralized Finance Labs, Inc. Hybrid consensus for blockchain using proof of work and proof of stake

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110490602B (en) * 2018-05-09 2022-11-25 本无链科技(深圳)有限公司 Three-layer block chain architecture construction method and system
TWI684100B (en) * 2018-06-12 2020-02-01 中華電信股份有限公司 Consensus system and method for public distributed ledgers
CN110705973B (en) * 2018-07-10 2023-05-16 深圳市红砖坊技术有限公司 Common identification method applied to miner nodes in blockchain system and blockchain system
CN110457926A (en) * 2019-08-13 2019-11-15 重庆邮电大学 It is a kind of industry Internet of Things in based on data encryption storage data sharing method
CN110730225A (en) * 2019-09-30 2020-01-24 北京中电拓方科技股份有限公司 Data processing method of Internet of things based on block chain, Internet of things and storage medium
CN111611311B (en) * 2020-05-11 2023-09-08 徐皓 Method and system for forming decentralised distributed database, electronic device and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110062923A (en) * 2016-10-17 2019-07-26 Arm有限公司 Mine is dug using the block chain of trusted node
CN109804374A (en) * 2016-10-20 2019-05-24 索尼公司 Digital Right Management based on block chain
US20190370793A1 (en) * 2018-06-04 2019-12-05 Decentralized Finance Labs, Inc. Hybrid consensus for blockchain using proof of work and proof of stake
CN109039646A (en) * 2018-07-12 2018-12-18 北京链享未来科技有限公司 A kind of packing of block chain block and verification method and system based on node capacity
CN109508987A (en) * 2018-12-06 2019-03-22 广东浪潮大数据研究有限公司 A kind of construction method, system and the associated component of block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
戴安博;陈恭亮;: "POW区块链共识算法分析与展望", 通信技术, no. 12 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021227867A1 (en) * 2020-05-11 2021-11-18 徐皓 Method and system for forming decentralized distributed database, electronic device, and computer readable storage medium

Also Published As

Publication number Publication date
WO2021227867A1 (en) 2021-11-18
CN111611311B (en) 2023-09-08

Similar Documents

Publication Publication Date Title
CN110580653B (en) Block chain consensus mechanism based on transaction
US20240064007A1 (en) Methods and systems for blockchain-implemented event-lock encryption
CN110213059B (en) Random number generation method, random number generation device and storage medium
Huang et al. Scalable and redactable blockchain with update and anonymity
CN111131209B (en) Improved efficient consensus method, system, computer device and storage medium
CN109949034B (en) Block chain consensus method based on credibility evaluation
Kim et al. SCC: Storage compression consensus for blockchain in lightweight IoT network
WO2018189658A1 (en) Secure transfer between blockchains
CN111080287B (en) Service data processing method, related equipment and system
CN113726913B (en) Backbone node access method and block chain system
Hentschel et al. Flow: Separating Consensus and Compute--Block Formation and Execution
CN111611311B (en) Method and system for forming decentralised distributed database, electronic device and computer readable storage medium
Asayag et al. Helix: A scalable and fair consensus algorithm resistant to ordering manipulation
CN113360951B (en) Electronic evidence preservation method based on partitioned block chain
CN110825806A (en) Distributed data storage
CN112751675B (en) Information monitoring method, system, equipment and storage medium based on block chain
CN116389040A (en) Reputation-based blockchain consensus method, device and computer equipment
KR20210127231A (en) Energized Identity based blockchain
Hasanaj Blockchain and its security issues and challenges
Ruan et al. Ursa: Robust performance for Nakamoto consensus with self-adaptive throughput
CN115664714B (en) Anonymous selection committee method, system and medium based on TEE (terminal equipment) on blockchain
Hu et al. Greedy‐Mine: A Profitable Mining Attack Strategy in Bitcoin‐NG
CN112749965B (en) Information monitoring method, system, equipment and storage medium
Song et al. Block Pruning with UTXO Aggregation
Wang et al. AMC: A PoS Blockchain Consensus Protocol for Scalable Nodes

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210401

Address after: Room 2502, unit 1, building 6, celebrity impression, No.3 middle Changjiang Road, Jinghu District, Wuhu City, Anhui Province

Applicant after: Xu Hao

Address before: 241000 629, building 1, Shicheng Xiangxie, Wuhu Economic and Technological Development Zone, Wuhu City, Anhui Province

Applicant before: Wuhu Mingxuan Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant