CN111798234B - Lightweight block chain system and construction method - Google Patents

Lightweight block chain system and construction method Download PDF

Info

Publication number
CN111798234B
CN111798234B CN202010494135.3A CN202010494135A CN111798234B CN 111798234 B CN111798234 B CN 111798234B CN 202010494135 A CN202010494135 A CN 202010494135A CN 111798234 B CN111798234 B CN 111798234B
Authority
CN
China
Prior art keywords
transaction
node
information
nodes
state
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.)
Active
Application number
CN202010494135.3A
Other languages
Chinese (zh)
Other versions
CN111798234A (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.)
Institute of Information Engineering of CAS
Original Assignee
Institute of Information Engineering of CAS
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 Institute of Information Engineering of CAS filed Critical Institute of Information Engineering of CAS
Priority to CN202010494135.3A priority Critical patent/CN111798234B/en
Publication of CN111798234A publication Critical patent/CN111798234A/en
Application granted granted Critical
Publication of CN111798234B publication Critical patent/CN111798234B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a lightweight block chain system and a construction method thereof, wherein the system comprises one or more groups established by the trust of a node to other nodes set by each node, and each group comprises one or more nodes including a main node generated by the election of each node in the group. The invention divides the transaction into two types of intra-group transaction and inter-group transaction according to the group attribute of the node, then respectively processes the two transaction types according to different service logics and feeds back processing information in time; a consensus algorithm is designed based on a trust network so as to realize the safety, rapidness and high efficiency of system block output and distributed account book state updating.

Description

Lightweight block chain system and construction method
Technical Field
The invention belongs to the technical field of computer application, and particularly relates to a lightweight block chain system and a construction method thereof.
Background
The block chain is a decentralized infrastructure and a distributed database technology which are gradually raised along with the increasing popularization of digital encryption currencies such as bitcoin and the like, and is a reliable data platform for decentralized and trust removal is maintained in a data block chain structure mode, and the chain structure of the reliable data platform can maintain continuously-growing and non-falsifiable data records.
The block chain technology is considered as the most subversive technical innovation since the invention of the Internet, the block chain technology ensures data security by a cryptographic method, ensures data consistency by a consensus mechanism, executes commands by an intelligent contract and transmits data by a P2P networking, so that a system based on the block chain technology has the characteristics of decentralization, non-falsification, distributed consensus, traceability, final consistency and the like, and solves the problem of reliable transmission of trust and value at extremely low cost, therefore, the block chain has very wide application prospects in various fields such as digital economy, the Internet of things, big data, public services and the like.
Currently, the most widely used block chain system includes a public chain system represented by bitcoin and ether house and a federation chain system represented by hyper ledger Fabric (hyper). In the public chain system, an identity authentication mechanism is not needed, and anyone can join the network and participate in the service operation of the block chain network, so that the complete decentralization in the real sense is realized; but public link system networks face the problems of high energy consumption, low efficiency, long transaction authentication time, difficulty in large-scale landing application and the like. In a alliance chain system, a user or an organization needs to have a specific authority to join the alliance chain system, participate in business operation and read-write maintenance of block chain data, separate transaction execution from consensus, support endorsement based on a strategy and have identity management integration based on an industry standard; the updated and iterated block chain system has the advantages of high throughput, high concurrency, low delay and the like, can freely correspond to block chain projects with complex scenes and large scales, and is widely applied to the scenes of Internet, supply chain finance, anti-counterfeiting traceability and the like at present.
The technical evolution from public links represented by Bizhou currency and Ether Fahrenheit to alliance links represented by Hyperridge Fabric realizes the great improvement of the performance of the blockchain system in certain application scenes through the restriction management of membership of participating blockchain networks. However, regardless of a alliance chain or a public chain, the existing mature technology is still too numerous and complex in application, and a block chain network designed for large-scale, thousands of member nodes inevitably causes huge resource consumption and data storage burden of a memory, a processor and the like for a certain single node; therefore, how to deploy nodes on a lightweight server and build a safe, stable, fast and efficient lightweight block chain system on dozens to hundreds of lightweight nodes is an urgent problem to be solved in order to meet the practical application scenarios that the business volume is relatively less, the requirement on the performance of the server is not high, and the deployment can be fast and conveniently carried out.
Disclosure of Invention
In order to solve the above problems, the present invention provides a lightweight block chain system and a construction method thereof, which aims at building a safe, stable, fast and efficient lightweight block chain system on a server with relatively low configuration and uncomplicated service logic.
The technical scheme of the invention is as follows:
a lightweight blockchain system comprises one or more groups established by the trust level of a node to other nodes, wherein each group comprises one or more nodes including a main node generated by the election of the nodes in the group; each node carries out transaction and updates the state of the account book through the following steps:
when two users belonging to the same group carry out transaction, the two users carrying out transaction complete the transaction after receiving the transaction confirmation information of the group master node, and the group master node stores and broadcasts the transaction information and the calculated pre-read-write information of the state of the account book to the block chain system;
when two users belonging to different groups carry out transaction, the two users carrying out transaction complete the transaction after receiving transaction confirmation messages sent by the two corresponding main nodes, and meanwhile, the two corresponding main nodes store and broadcast transaction information and pre-read and write information of the calculated account book state into the block chain system;
after a set time, each main node competes for the block priority according to the identity information;
and each node updates the state of the book according to the transaction information of the main node with the block priority and the pre-read-write information of the state of the book.
Furthermore, the trust level of the node to other nodes set by each node is stored in a local key ring list; the local key ring list comprises the node public key, the node identity information, the authentication signature and the signer ID of at least one other node to the node, the trust of the node to other nodes of the system and nodes to be authenticated of the system, and the priority of the group node participating in the election of the new master node.
Further, one or more groups include at least one slave node to assist the master node in maintaining global ledger status and block data information.
Further, the transaction information includes transaction time, transaction initiator, transaction acceptor, signature information of transaction initiator to transaction, and transaction data.
Further, when two nodes belonging to the same group carry out transaction, the group master node stores and broadcasts transaction information and calculated book state pre-read writing information to the block chain system through the following steps:
1) Acquiring and verifying transaction information;
2) Simulating and executing legal transaction to obtain transaction confirmation information and account book state pre-read writing information;
3) Returning the transaction confirmation information to the two users who perform the transaction;
4) And storing and broadcasting the transaction information and the book status pre-read-write information to the block chain system.
Further, the validity of the transaction information is verified by checking the transaction signature information, the transaction initiator account status and whether double flowers are present.
Further, transaction information and book state pre-reading and writing information are stored in a local transaction pool, and an index of transaction is established.
Further, when two users belonging to different groups carry out transaction, the two corresponding main nodes store and broadcast transaction information and the pre-read-write information of the calculated account book state to the block chain system through the following steps:
1) The main node corresponding to the transaction initiator acquires transaction information and sends the successfully verified transaction information to the main node corresponding to the transaction receiver;
2) The main node corresponding to the transaction receiver verifies the legality of the transaction information, simulates and executes legal transaction, stores and respectively sends the acquired first confirmation information of the transaction to the two nodes for transaction and the main node corresponding to the transaction initiator, and stores and sends the pre-read writing information of the first state of the ledger to the main node corresponding to the transaction initiator;
3) The host node corresponding to the transaction initiator simulates and executes the transaction, and acquires second confirmation information of the transaction and second state pre-read writing information of the account book;
4) The main node corresponding to the transaction initiator compares the pre-read writing information of the second state of the account book with the pre-read writing information of the first state of the account book, if the comparison is successful, a second transaction confirmation message is sent to the two nodes for transaction and the main node corresponding to the transaction receiver, and the pre-read writing information of the second state of the account book is stored as the pre-read writing information of the state of the account book;
5) The main node corresponding to the transaction receiver saves the pre-reading and writing information of the first state of the account book as the pre-reading and writing information of the state of the account book;
6) And the two corresponding main nodes broadcast the transaction information and the book status pre-read write information to the block chain system respectively.
Further, each main node calculates a hash value according to the identity information and a random seed, and the main node with the largest hash value obtains the block priority.
A construction method of a lightweight blockchain comprises the following steps:
1) Each node maintains a trust list locally according to the trust degree of the node to other nodes;
2) Dividing all nodes into one or more groups through a trust list;
3) Selecting a node as a main node in each group;
wherein, each node carries out transaction and updates the state of the account book through the following steps:
when two users belonging to the same group carry out transaction, the two users carrying out transaction complete the transaction after receiving the transaction confirmation information of the group main node, and the group main node stores the transaction information and the calculated book state pre-reading and writing information and broadcasts the information to the block chain system;
when two users belonging to different groups carry out transaction, the two users carrying out transaction complete the transaction after receiving transaction confirmation messages sent by two corresponding main nodes, and meanwhile, the two corresponding main nodes store and broadcast transaction information and calculated pre-read writing information of the state of the book to a block chain system;
after a set time, each main node competes for the block priority according to the identity information;
and each node updates the state of the book according to the transaction information of the main node with the block priority and the pre-read-write information of the state of the book.
Compared with the prior art, the invention has the following advantages:
1) Dividing the transaction into an intra-group transaction and an inter-group transaction according to the group attribute of the node, respectively processing the two transaction types according to different service logics and feeding back processing information in time;
2) The invention designs a consensus algorithm based on a trust network so as to realize the safety, rapidness and high efficiency of system block output and distributed account book state updating.
Drawings
Fig. 1 is an example of a lightweight blockchain network architecture.
Fig. 2 is a key ring structure.
Fig. 3 shows the contents of the key ring part of G1-Leader.
Fig. 4 is a schematic diagram of a lightweight blockchain consensus mechanism.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not delimit the invention.
The invention relates to a lightweight block chain system, which designs a lightweight and easily-realized trust network (Web of trust) based on a public Key PKI system based on a Key Ring (Key Ring) to construct a trust foundation and an identity management mechanism of the whole block chain network, and endows the identity and the attribute of nodes (Peer) in different groups (Group) and each Group, such as the priority order of a Leader node and other nodes of each Group inherited the Leader (for the reason that after a certain Leader node goes down, the affiliated Group can conveniently select a main node to process a service, the invention sets the priority order of the inherited Leader in the Key Ring); after different nodes establish trust, the blockchain network is started, and all the nodes maintain the global account book state and blockchain information together according to a consensus mechanism in the scheme. In order to improve the transmission and processing speed of the transaction, the invention adopts the Gossip communication protocol to broadcast and synchronize the information of the whole block chain network, divides the transaction into two types of intra-group transaction and inter-group transaction according to the group attribute of the node, and then respectively processes the two transaction types according to different service logics and feeds back the processing information in time.
A simple embodiment of the invention is shown in FIG. 1, which showsThe technical scheme comprises three aspects of block chain identity authentication, network organization, transaction form and common identification mechanism, wherein Group is a Group, t 1 …t n At n consensus time points, block is specified as follows:
1. block chain identity authentication aspects
The invention adopts a trust network (Web of Trust) based on a Key Ring as an identity authentication mechanism of the lightweight blockchain system, and the basic idea is that each node in the blockchain network mutually authenticates and signs according to the trust degree, and each Peer node locally maintains a Key Ring (Key Ring) list as a basic component to establish the trust basis of the network, wherein the list contains the trust signatures and the trust degrees of each node to other nodes in the network, and simultaneously, in order to quickly identify the identity of the member node, the Key Ring also contains the basic identity information (such as ID, communication address, belonging group and other related attributes) of each node. A simple example key ring structure is shown in fig. 2. The basic content is as follows:
public Key: the public key of the node;
user ID: identity information of the node;
signatures: the signature information of the node to the public key of the node is at least included in the authentication signature and the signer ID of one or more nodes, and other nodes can add the signatures of the nodes to authenticate the public key of the Peer node.
Owner Trust: the node pair trust degree of a public key owner (Peer) can be set to be three values of ultimate, complete and unknown according to the trust degree. The node is used for setting trust values between the Leader node in the block chain network and nodes in the same group; complete is a trust value set by the node to the nodes (except the Leader) of other groups; the unknown is used for setting a trust value for a node to be added into the network to wait for authentication, an inactive node or an untrusted node in the network;
Leader-Inherit: an integer, which can only be set by the Leader node, represents that after the Leader node of the same group is down, other Peer nodes of the group participate in the priority of new Leader election, and the value of the integer can be 1 to N or none, wherein a smaller value indicates a higher priority, and a none indicates that the node is not a member of the group.
Taking the Leader node of Group1 in fig. 1 as an example, part of the content of the key ring is as shown in fig. 3: the first part (marked 1) is the Leader self-related information of the group G1, and the second part is the information of the Peer1 node in the group G1 in the key ring (such as the priority of the inherited Leader, the trust signature and the trust degree of the G1-Leader); by analogy, the third part, the fourth part and the fifth part are related information such as trust signatures and trust degrees of the Leader or the Peer node pair G1-Leader in other groups.
From the above, the Peer node can conveniently and quickly obtain the relevant information (identity, group, trust level, etc.) of other nodes from the key ring, thereby performing the relevant service operation between nodes or groups.
2. Network organization and transaction form aspects
In order to reduce the number of nodes participating in consensus, simplify the consensus process, shorten the consensus time and simultaneously reduce the communication complexity and network overhead as much as possible, the invention provides a Group concept, namely, part of the nodes can be constructed into a Group based on trust or other factors, and then different groups jointly construct and maintain the lightweight blockchain network; each group selects a master node (Leader) according to a corresponding rule, if a certain group only contains one node, the node defaults to a Leader node of the group, and the main responsibilities of the Leader node include:
1) Network communications between groups;
2) Regularly sending live (active message, which indicates that the node works normally, the same below) information to other nodes in the group;
3) Processing transactions, wherein the confirmation of each transaction needs to be the signature confirmation of a Leader node of a group where both transaction parties are located;
4) Locally maintaining transaction pool information, and calculating a hash value as an index for each successful transaction to facilitate retrieval of the transaction;
5) Maintaining the state of the global account book and the block data information, and synchronizing the state and the block data information to other nodes in the group;
6) And maintaining the trust relationship of the group to other groups, the trust relationship of the nodes in the same group to other nodes, identity and other related information based on the key ring.
In the lightweight blockchain system, each Leader node needs to maintain a global account book state and blockchain information, in order to avoid the loss brought to a Group by the downtime of the Leader node, other nodes in the Group can take the role of a follow node, so that the global state data of the lightweight blockchain network is stored together with the Leader nodes in the Group, and the Leader nodes initiate and participate in the election of new Leader nodes under the downtime of the Leader node, so that the new Leader nodes participate in a common recognition mechanism of the network to maintain the normal operation of the network.
Meanwhile, in order to process the transaction in the lightweight blockchain network quickly and efficiently, the invention provides two different types of transaction modes of intra-group transaction and inter-group transaction, namely, the business logic of transaction processing is determined according to whether the two transaction parties are members of the same group, so that the transaction is processed quickly. The invention uses T x (t s Sed, rev, sig, data) represents a transaction, where t s Representing the time when the Leader confirms the exchange, sed is the initiator of the current transaction, rev represents the receiver of the transaction, sig is the signature information of the transaction initiator on the transaction, data represents the relevant data of the transaction, and simultaneously, two adjacent consensus time intervals of the front and back of the system are divided into a Period. The size of Period is determined by the throughput of the system processing transactions, the value of Period can be adjusted to avoid block bloat when the system transactions are frequent, and the value of Period can be adjusted to be high to enable the block to contain enough transactions when the system transactions are small.
The group transaction is the transaction between users managed by the same group node, and the transaction is processed more similar to a centralized processing mode, such as a group User i Initiating a transaction T x (n,User i ,User j Sig, data) to users in a group j The Peer node receives the transaction initiated by the userAfter transaction, the transaction information is directly forwarded to the Leader node, and the Leader node firstly confirms the validity of the transaction (checks transaction signature and User) after receiving the transaction information i The account status, whether double flowers exist, etc.), then the transaction is simulated and executed, the result and the transaction information are saved, finally, the change of the account status is pre-read and written once, and the transaction confirmation message is returned to both sides of the user (the confirmation message contains the signature information of the Leader node, the transaction is endorsed once, and the message is completely confirmed after the Period is finished and the block is confirmed). After both sides of the transaction user receive the transaction confirmation information, the transaction result can be inquired from the Leader node, and the account states of both sides of the transaction user can be changed according to the transaction result. The Leader node returns the transaction confirmation message to both sides of the user and simultaneously broadcasts the transaction related message to other Group groups (in order to reduce system traffic, the message can be directly broadcast to the Leader nodes of different groups, and then the Leader node broadcasts the message to other nodes of the same Group); otherwise, if the Leader node finds that the transaction is illegal, the Leader node directly sends a transaction failure message to the user.
Inter-group transactions refer to transactions between users managed by different groups, e.g. group G k User in i Initiating a transaction T x (n,G k -User i ,G m -User j Sig, data) to group G m Inner User j Group G k After receiving the transaction, the Leader node firstly confirms the validity of the transaction, and then retransmits the transaction to the group G after confirming the validity m The Leader node of (B) performs validity check (the rebroadcast information includes G) k -User i In Period n Pre-read and write information of ledger state generated by transaction in group to ensure that Leader nodes of two groups agree with basic information of both parties of transaction), G m The Leader node checks the transaction information by combining the local account book state and the received rebroadcasting information, simulates and executes the transaction after the check is passed, saves the result and the transaction information, pre-reads and writes the change of the account book state once, signs a transaction confirmation message and sends the transaction confirmation message to the user and the group G k Leader node of G k The Leader node of (A) simulates again the execution of the transaction, the associated state change and G caused to the transaction m -comparing the information sent by the leader, if the results are consistent, signing the transaction confirmation information to the user and forwarding it to G m -Leader to complete the interaction, the last two Leader nodes broadcasting the transaction to the network; for the inter-group transaction, the user must receive the signature confirmation of two Leader nodes to consider that the transaction is preliminarily confirmed, and of course, the final result must wait until Period n And the confirmation can be carried out after the completion and the block output. Otherwise, a problem occurs in any link in the transaction process (if the results of the two leader node simulation transactions are not matched), and the transaction is discarded.
3. Aspects of consensus mechanisms
The consensus algorithm adopted by the invention is shown in fig. 4, and is mainly explained from two aspects as follows:
1) Leader node election: in the initialization process of the lightweight blockchain network, a Leader node elects a node with the highest trust degree to act as the node in the group, then the Leader node appoints the inheritance order of the Leader after the shutdown according to the trust degree of other nodes in the group, writes the inheritance order into the Leader-Inherot information of a key ring, and synchronizes to other nodes in the network to serve as the inheritance priority of other nodes in the group after the shutdown of the Leader node; if the Leader node is down, other nodes send a message for re-election of the Leader through a Gossip communication protocol and vote for the node with the highest priority which can be contacted by the node, and when the node with higher priority in the residual active nodes receives more than 2/3 of votes, the node actively takes the responsibility of the Leader and sends live information to other nodes, which means that the new Leader node is successfully elected. However, if only a single node does not receive live information of the Leader due to network reasons, the re-election message sent by the single node is rejected by other nodes which can be connected to the Leader so as to avoid initiating a wrong election operation. It should be noted that the inheritance order refers to the priority when selecting the Leader, and not to say that the Leader is inherited according to the order after the Leader is down, this is mainly done to prevent the network fault caused when the node with the highest inheritance priority and the Leader are down together; or because the node with the highest inheritance priority loses communication with the Leader due to the network reason of the node, the node mistakenly takes the role of the Leader and sends live information to other nodes to cause system disorder; or inheriting that the node with the highest priority is not active in the block chain network and does not actively take the role of a Follower; this ensures the fairness and liveness of the blockchain network to some extent.
2) In order to enable a designed block chain system to meet the requirements of high speed and high efficiency, the invention adopts a method for decoupling two processes of distributed account book management and system block generation, and the specific process is as follows: in a Period of Period, the Leader node of each group processes the transaction logic of the block chain system according to the group transaction and the group transaction, and broadcasts the processed transaction to the Leader nodes of other groups through a gossip protocol, and the Leader nodes pre-read and write the local account book once according to the collected successful transaction so as to check whether the account states of both parties of the transaction are legal before the next consensus; meanwhile, each Leader node maintains a transaction information pool to store transaction information collected in a Period of Period; in order to facilitate the searching and comparison of the processed transaction, after the transaction is successfully processed, the Leader node calculates a hash value for the transaction information, so that the transaction can be quickly searched in a transaction pool; the Leader node can also pull the collected or processed transaction information from the Leader nodes of other groups; when period n When the time point arrives, each group of Leader nodes use a random function to generate a random string seed, after the seed is spliced with the identity information of the Leader node, a hash Value is calculated to obtain a special Value as the basis of competing out blocks (for convenience, the Value is represented by H-Value), the H-Value and a transaction hash Value index (for reducing communication traffic and not needing to broadcast specific information of transaction) collected in the time period in a transaction pool are broadcast to other Leader nodes together, the Leader nodes determine the priority of account state change and block out (so that the hash Value is calculated for the seed, the node is prevented from calling the random function for multiple times to obtain a Value with higher priority, and the hash Value is used for calculating the hash Value of the seedThe value is only used as a reference of the block output weight and does not relate to the system security, so that a fast-computing hash algorithm such as sha1 can be used for not wasting computing resources; after the Leader node receives the block output information of other Leader nodes, comparing the received H-Value values to determine the block priority; such as a node Leader N Taking out block priority, other nodes index the transaction collected by own transaction pool with Leader N Compares the sent transactions and Leader N Middle period n Sending complete information of transactions which are not collected to the Leader N (ii) a Node Leader N After receiving information sent by other nodes, simulating and executing uncontained transaction and writing the uncontained transaction into an account book state, packaging the transaction into blocks according to a time sequence, and packaging the blocks n And the state updating information of the account book is broadcasted to other nodes in the network within the Period; finally, other nodes in the network will follow the Leader N And updating the local block chain network state by the sent block and account book information and finishing the consensus.
Because each transaction passes through the verification endorsement of the Leader node of the group where both transaction parties are located, the processed transaction sequence does not influence the change of the account book, but influences the information of the system block, and the steps and time of consensus are greatly reduced by decoupling the change of the account book and the block output process in the system, and the Leader node of each group can be determined only by one-time interaction in the process of competing out the block. To prevent the Leader node from being down in the consensus process (by the Leader) m For the downed example), the system will be in Period N Time point t of the end n Triggering timeout, e.g. no Leader is received at the end of timeout m Feedback information of, leader N Directly entering the last block outlet ring section; leader m Middle Period N Transactions that are not contained in the block will be forced to be discarded; therefore, in order to avoid the loss caused by the downtime of the Leader node, the Leader node needs to broadcast the transaction processed by the Leader node in time through the Gossip communication protocol.
If the node with the highest block right is down after the hash value of the node is broadcasted, other Leader nodes of the system perform block consensus again according to the logic of the consensus algorithm after timeout is finished, and only for rapidly achieving the consensus, the seed and the corresponding hash value do not need to be generated again.
The lightweight block chain system designed by the invention is established based on the trust relationship among all nodes, so the problems of node collusion, deception and the like in the Byzantine consensus system are not discussed in the invention, and the consensus algorithm only considers the problem of downtime of the nodes.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. It will be apparent to those skilled in the art that various modifications and variations can be made in the present examples without departing from the spirit and scope of the invention. The embodiment was chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.

Claims (9)

1. A lightweight blockchain system comprises one or more groups established by the trust of a node to other nodes set by each node, wherein each group comprises one or more nodes including a main node generated by the election of each node in the group; each node transacts and updates the state of the account book through the following steps:
when two users belonging to the same group carry out transaction, the two users carrying out transaction complete the transaction after receiving the transaction confirmation information of the group master node, and the group master node stores and broadcasts the transaction information and the calculated pre-read-write information of the state of the account book to the block chain system;
when two users belonging to different groups carry out transaction, the two users carrying out transaction complete the transaction after receiving transaction confirmation messages sent by two corresponding main nodes, and meanwhile, the two corresponding main nodes store and broadcast transaction information and calculated pre-read writing information of the state of the book to a block chain system;
after a set time, each main node calculates a hash value according to the identity information and a random seed, and the main node with the maximum hash value obtains the block priority;
and each node updates the state of the book according to the transaction information of the main node with the block priority and the pre-read-write information of the state of the book.
2. The blockchain system of claim 1, wherein the trust level of the local node set by each node to other nodes is stored in a local key ring list; the local key ring list comprises the node public key, the node identity information, the authentication signature and the signer ID of at least one other node to the node, the trust of the node to other nodes of the system and nodes to be authenticated of the system, and the priority of the group node participating in the election of the new master node.
3. The blockchain system of claim 1, wherein at least one slave node is included in one or more groups to assist a master node in maintaining global ledger status and blockdata information.
4. The blockchain system of claim 1, wherein the transaction information includes transaction time, transaction initiator, transaction recipient, signature information of the transaction initiator for the transaction, and transaction data.
5. The blockchain system of claim 1, wherein when two nodes belonging to the same group conduct transactions, the group master node saves and broadcasts the transaction information and the calculated book status pre-read write information to the blockchain system by:
1) Acquiring and verifying transaction information;
2) Simulating and executing legal transaction to obtain transaction confirmation information and account book state pre-read writing information;
3) Returning the transaction confirmation information to the two users who perform the transaction;
4) And storing and broadcasting the transaction information and the book state pre-read writing information to the block chain system.
6. The blockchain system of claim 5, wherein the validity of the transaction information is verified by checking the transaction signature information, the transaction initiator account status, and whether double flowers are present.
7. The blockchain system of claim 5, wherein transaction information and ledger state pre-read write information are stored in a local transaction pool and an index of transactions is established.
8. The blockchain system of claim 1, wherein when two users belonging to different groups conduct transactions, two corresponding master nodes store and broadcast transaction information and calculated book state pre-read write information into the blockchain system by:
1) The main node corresponding to the transaction initiator acquires transaction information and sends the successfully verified transaction information to the main node corresponding to the transaction receiver;
2) The main node corresponding to the transaction receiver verifies the legality of the transaction information, simulates and executes legal transaction, stores and respectively sends the acquired first confirmation information of the transaction to the two nodes for transaction and the main node corresponding to the transaction initiator, and stores and sends the pre-read writing information of the first state of the ledger to the main node corresponding to the transaction initiator;
3) The host node corresponding to the transaction initiator simulates and executes the transaction, and acquires second confirmation information of the transaction and second state pre-read writing information of the account book;
4) The main node corresponding to the transaction initiator compares the pre-read writing information of the second state of the account book with the pre-read writing information of the first state of the account book, if the comparison is successful, a second transaction confirmation message is sent to the two nodes for transaction and the main node corresponding to the transaction receiver, and the pre-read writing information of the second state of the account book is stored as the pre-read writing information of the state of the account book;
5) The main node corresponding to the transaction receiver saves the pre-read writing information of the first state of the ledger as the pre-read writing information of the state of the ledger;
6) And the two corresponding main nodes broadcast the transaction information and the book status pre-reading and writing information to the block chain system respectively.
9. A construction method of a lightweight blockchain comprises the following steps:
1) Each node maintains a trust list locally for the trust of the node to other nodes;
2) Dividing all nodes into one or more groups through a trust list;
3) Selecting a node as a main node in each group;
wherein, each node carries out transaction and updates the state of the account book through the following steps:
when two users belonging to the same group carry out transaction, the two users carrying out transaction complete the transaction after receiving the transaction confirmation information of the group master node, and the group master node stores and broadcasts the transaction information and the calculated pre-read-write information of the state of the account book to the block chain system;
when two users belonging to different groups carry out transaction, the two users carrying out transaction complete the transaction after receiving transaction confirmation messages sent by two corresponding main nodes, and meanwhile, the two corresponding main nodes store and broadcast transaction information and calculated pre-read writing information of the state of the book to a block chain system;
after a set time, each main node calculates a hash value according to the identity information and a random seed, and the main node with the maximum hash value obtains the block priority;
and each node updates the state of the book according to the transaction information of the main node with the block priority and the pre-read-write information of the state of the book.
CN202010494135.3A 2020-06-03 2020-06-03 Lightweight block chain system and construction method Active CN111798234B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010494135.3A CN111798234B (en) 2020-06-03 2020-06-03 Lightweight block chain system and construction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010494135.3A CN111798234B (en) 2020-06-03 2020-06-03 Lightweight block chain system and construction method

Publications (2)

Publication Number Publication Date
CN111798234A CN111798234A (en) 2020-10-20
CN111798234B true CN111798234B (en) 2023-04-07

Family

ID=72806160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010494135.3A Active CN111798234B (en) 2020-06-03 2020-06-03 Lightweight block chain system and construction method

Country Status (1)

Country Link
CN (1) CN111798234B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112419060B (en) * 2020-11-20 2024-03-22 上海树图区块链研究院 Asset hosting system, asset management method, node and medium
CN113516557B (en) * 2021-07-14 2022-09-23 桂林电子科技大学 Block chain with directed acyclic graph structure and implementation method thereof
CN114444090B (en) * 2021-12-17 2023-06-20 中国科学院信息工程研究所 Efficient secret unique leader election method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109150972B (en) * 2018-07-17 2021-07-23 湖南宸瀚信息科技有限责任公司 Working method of consensus mechanism of double-layer partitioned efficient block chain
CN109995850B (en) * 2019-03-05 2022-04-26 深圳前海微众银行股份有限公司 Block chain system and transaction processing method thereof
CN110569675B (en) * 2019-09-18 2021-07-09 上海海事大学 Multi-Agent transaction information protection method based on block chain technology

Also Published As

Publication number Publication date
CN111798234A (en) 2020-10-20

Similar Documents

Publication Publication Date Title
CN110784346B (en) Reputation value-based PBFT consensus system and method
US12038937B2 (en) Computer-implemented system and method for managing transactions over a blockchain network
Abraham et al. The blockchain consensus layer and BFT
CN107528886B (en) Block chain full-network splitting method and system
CN111798234B (en) Lightweight block chain system and construction method
Stewart et al. Grandpa: a byzantine finality gadget
CN111092896B (en) Food source tracing distributed data synchronization method based on optimized PAXOS
EP4209980A1 (en) Computer-implemented system and method for managing a large distributed memory pool in a blockchain network
CN112541758A (en) Multi-round voting type fault-tolerant sequencing consensus mechanism and method based on block chain
CN111082943B (en) Efficient block chain consensus method
CN107231299A (en) A kind of chain route and realized the system that block chain communicates across chain
Hassanzadeh-Nazarabadi et al. Lightchain: A dht-based blockchain for resource constrained environments
Wang et al. A trusted consensus fusion scheme for decentralized collaborated learning in massive IoT domain
CN111371905B (en) Block chain layering consensus proving system and method based on cloud computing
Zhang et al. Cycledger: A scalable and secure parallel protocol for distributed ledger via sharding
Wang et al. Beh-Raft-Chain: a behavior-based fast blockchain protocol for complex networks
CN112907252A (en) Block chain transaction method and system based on multi-person down-chain channel
CN114003584B (en) Bayesian-preemption fault-tolerant consensus method based on evolution game
CN112636905B (en) System and method for extensible consensus mechanism based on multiple roles
CN112769580A (en) Block chain layered excitation consensus algorithm
KR20200081533A (en) Blockchain Consensus Method based Improved Dynamic Blind Voting for Internet of Things Environment
Liu et al. Cross-shard transaction processing in sharding blockchains
CN110098938B (en) Trusted committee under-chain acceleration solution method and system
Vizier et al. Comchain: Bridging the gap between public and consortium blockchains
JP2022551874A (en) Method and Apparatus for Secure Symbiosis Mining

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
GR01 Patent grant
GR01 Patent grant