Nothing Special   »   [go: up one dir, main page]

CN109086626B - Accounting method and system of block chain network - Google Patents

Accounting method and system of block chain network Download PDF

Info

Publication number
CN109086626B
CN109086626B CN201810900789.4A CN201810900789A CN109086626B CN 109086626 B CN109086626 B CN 109086626B CN 201810900789 A CN201810900789 A CN 201810900789A CN 109086626 B CN109086626 B CN 109086626B
Authority
CN
China
Prior art keywords
mining
node
block
mining node
timestamp
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
CN201810900789.4A
Other languages
Chinese (zh)
Other versions
CN109086626A (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.)
Iallchain Co Ltd
Original Assignee
Iallchain 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 Iallchain Co Ltd filed Critical Iallchain Co Ltd
Priority to CN201810900789.4A priority Critical patent/CN109086626B/en
Publication of CN109086626A publication Critical patent/CN109086626A/en
Application granted granted Critical
Publication of CN109086626B publication Critical patent/CN109086626B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6272Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database by registering files or documents with a third party

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a block chain network accounting method and a block chain network accounting system, wherein the block chain network accounting method comprises the following steps: the first mining node acquires transaction broadcast messages sent by the participating nodes, records transaction records in a current accounting period in a transaction pool, and generates mining records for robbing accounting rights of blocks in the current accounting period; the first mining node generates a corresponding hash value according to mining records, directionally sends the hash value to the timestamp server according to the IP address of the timestamp server for timestamp marking, and then signs the block broadcast message by using a private key of the first mining node and broadcasts the block broadcast message to the block chain network; the other mining nodes verify according to the block broadcast message sent by the first mining node, and send the block effective message of the first mining node to the block chain network after the verification; and recording the current accounting period block of the first mining node into a block chain account book of the first mining node. Therefore, a low-cost, reliable and fair accounting right competition mode is provided.

Description

Accounting method and system of block chain network
Technical Field
The invention relates to the technical field of communication, in particular to a block chain network accounting method and system.
Background
Generally, an operation mechanism based on a block chain is applied based on a consensus mechanism, the consensus mechanism is an algorithm for establishing trust and obtaining rights and interests among different nodes in the block chain, the key point in the block chain lies in the contention of the accounting right, mining nodes which succeed in the contention have corresponding mining rewards, and mining nodes which fail in the contention link blocks generated by mining nodes which succeed in the contention to form the block chain, so that transaction supervision is performed on the block chain based on the whole network.
In the correlation technique, the mode of digging the ore through the miner strives for the book keeping right is the fairest mode, also is the universal mode that present block chain adopted, and the miner is the continuous resource of input in order to obtain digging the ore reward and digs the ore, and this kind of mechanism guarantees the continued development of block chain, and the resource that the spacious worker of the high of the ship that rises in water drops into simultaneously is more and more, has ensured higher security simultaneously, also consumes a large amount of energy investment income than lower and more, and this will be unfavorable for the popularization of block chain.
Disclosure of Invention
The invention provides a block chain network accounting method and system, and aims to solve the technical problem that in the prior art, accounting of a block chain is deprived of power and investment cost is high, so that the investment benefit ratio is reduced, and therefore popularization of the block chain is affected.
A first embodiment of the present invention provides a method for accounting in a blockchain network, including: a first mine digging node acquires a transaction broadcast message sent by a participating node, records a transaction record in a current accounting period in a transaction pool of the first mine digging node, and generates a mine digging record for the first mine digging node to rob accounting right of a block in the current accounting period when the current accounting period is ended; the first mining node calculates the mining record and the transaction record in the current accounting period to generate a corresponding hash value, inquires a block chain account book of the first mining node to obtain an IP address of a timestamp server of a block chain network, and directionally sends the hash value signed by a private key of the first mining node to the timestamp server according to the IP address; the first mining node acquires a hash value which is fed back by the timestamp server and has a timestamp after being signed by a timestamp server private key, and then the hash value is signed by the private key of the first mining node and broadcasted to a block chain network, wherein the block broadcast message comprises: the hash value which is signed by a private key of the timestamp server and carries a timestamp, and a current accounting period block generated by the first mining node; the other mining nodes receive the block broadcast message sent by the first mining node, account checking is carried out on the contents of the block in the current bookkeeping period generated by the first mining node according to the transaction record in the current bookkeeping period recorded in the transaction pool of the node, if the account checking result is consistent, the account checking success message of the first mining node is sent to the block chain network, the private key signature of the timestamp server broadcasted by the first mining node is verified by using the public key of the timestamp server stored by the node, if the verification is passed, whether the timestamp broadcasted by the first mining node belongs to the current bookkeeping period is judged, if the timestamp belongs to the current bookkeeping period is known, the timestamp verification success message of the first mining node is sent to the chain network, and the hash value broadcasted by the first mining node and the received block broadcast in the preset time are subjected to the condition of capturing the bookkeeping right of the preset block Comparing hash values in block broadcast messages sent by other mining nodes, and if the hash value broadcast by the first mining node meets the block accounting right robbing condition, sending a block effective message of the first mining node to a block chain network; the first mining node receives the block effective message of the first mining node sent by other mining nodes, detects whether the number of other mining nodes sending the block effective message of the first mining node exceeds a preset threshold value, learns that the block of the current accounting period of the first mining node obtains the approval of a block chain network if the number of other mining nodes exceeds the preset threshold value, and records the block of the current accounting period of the first mining node into the block chain account book of the first mining node.
A second embodiment of the present invention provides an accounting system for a blockchain network, including: the system comprises a first mining node and other mining nodes, wherein the first mining node is used for acquiring transaction broadcast messages sent by participating nodes, recording transaction records in a current accounting period in a transaction pool of the first mining node, and generating mining records for the first mining node to rob accounting rights of a block in the current accounting period when the current accounting period is ended; the first mining node is further configured to calculate the mining record and the transaction record in the current accounting period to generate a corresponding hash value, query a block chain account book of the first mining node to obtain an IP address of a timestamp server of a local block chain network, and directionally send the hash value signed by a private key of the first mining node to the timestamp server according to the IP address; the first mining node acquires a hash value which is fed back by the timestamp server and has a timestamp after being signed by a timestamp server private key, and then the hash value is signed by the private key of the first mining node and broadcasted to a block chain network, wherein the block broadcast message comprises: the hash value which is signed by a private key of the timestamp server and carries a timestamp, and a current accounting period block generated by the first mining node; the other ore mining nodes are used for receiving the block broadcast message sent by the first ore mining node, the current accounting period block content generated by the first ore mining node is subjected to account checking according to the transaction record in the current accounting period recorded in the transaction pool of the node, if the account checking result is consistent, the account checking success message of the first ore mining node is sent to the block chain network, the private key signature of the timestamp server stored by the node is used for verifying the private key signature of the timestamp server broadcasted by the first ore mining node, if the verification is passed, whether the timestamp broadcasted by the first ore mining node belongs to the current accounting period is judged, if the timestamp belongs to the current accounting period is known, the timestamp verification success message of the first ore mining node is sent to the block chain network, and the hash value broadcasted by the first ore mining node is compared with the hash value broadcasted by the preset time according to a preset accounting block right condition Comparing hash values in block broadcast messages sent by other mining nodes received in the network, and if the hash value broadcasted by the first mining node meets the block accounting right robbing condition, sending a block effective message of the first mining node to a block chain network; the first mining node is further configured to receive a block validation message of the first mining node sent by other mining nodes, detect whether the number of the other mining nodes sending the block validation message of the first mining node exceeds a preset threshold, learn that the current accounting period block of the first mining node obtains approval of a block chain network if the number of the other mining nodes exceeds the preset threshold, and record the current accounting period block of the first mining node into a block chain book of the first mining node.
A third embodiment of the present invention provides a computer apparatus including: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the accounting method of the blockchain network as described in the above embodiments when executing the computer program.
A fourth embodiment of the invention provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of accounting for a blockchain network as described in the previous embodiment.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
the competition verification environment of the accounting right is formed through communication interaction of the ore excavation nodes, the attribution judgment of the accounting right is carried out according to the received hash values of all the ore excavation nodes within a certain time, a fair judgment mechanism is realized, the resource calculation capacity depending on the ore excavation nodes is not used as a judgment mechanism according to the calculation time of the hash values, and the like, and the cost is reduced, and meanwhile, the competition fairness of accounting is guaranteed. In the embodiment of the invention, only one ore digging node is given an accounting right, and other ore digging node chains compete for the blocks generated by the successful ore digging nodes in the accounting right, so that the block chains cannot be tampered, the accounting is safe, and the phenomena of double-flower attack and the like are avoided.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which,
FIG. 1 is a schematic block diagram of an accounting system for a blockchain network according to one embodiment of the present invention;
FIG. 2 is an interaction diagram of a billing system for a blockchain network, according to one embodiment of the invention;
fig. 3 is a flow diagram of a method of billing for a blockchain network according to one embodiment of the invention;
fig. 4 is a schematic diagram of an application scenario of the billing method of the blockchain network according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
Based on the description of the background art, it is understood that in the prior art, the contention of the accounting right in the block chain depends on the ore excavation of the miner node, which requires a large amount of calculation by the ore mining machine, because the bit currency adopts the POW consensus algorithm, which is proof of work (workload certification), that is, a numerical value meeting the rule is calculated through and or operation, and the ore excavation node which calculates the numerical value most quickly obtains the accounting right in the time period. While the bitcoin processes 20 ten thousand transactions per day, which means that each transaction consumes at least about 300kWh of power on average, as the blockchain application is popularized, miners' nodes strive to increase the computing power of a computer in order to obtain much more mine digging rewards, which leads to the increase of the cost of power and machine equipment, thus the investment-benefit ratio is reduced, which is not beneficial to the popularization of the blockchain.
In order to solve the technical problem, the invention provides an accounting method of a block chain network, and in the method, an ore excavation method which gives consideration to fairness and safety and does not consume resources is provided. The attribute of the accounting right of each block is determined by miners completely depending on randomness instead of depending on resource investment, so that the income ratio of the mining nodes is ensured, and the popularization and the application of the block chain are facilitated.
Fig. 1 is a schematic structural diagram of an accounting system of a blockchain network according to an embodiment of the present invention, and as shown in fig. 1, the system includes a first mining node 100 and remaining mining nodes 200, where the first mining node 100 and the remaining mining nodes 200 are mining nodes, and for clarity of description, the first mining node is mainly used to represent a mining node that contends for success in accounting right.
Referring to fig. 2, in an actual execution process, a first mining node acquires a transaction broadcast message sent by a participating node, where the participating node refers to a relevant node initiating a transaction in a latest period, records a transaction record in a current accounting period in a transaction pool of the first mining node, and generates a mining record for the first mining node to rob a block accounting right of the current accounting period when the current accounting period is ended (step 1), that is, mining nodes in each blockchain network all contend for the current latest transaction.
Specifically, the first mining node calculates mining records and transaction records in the current accounting period to generate corresponding hash values, and queries a block chain book of the first mining node to obtain an IP address of a timestamp server of the block chain network, directionally sends the hash values signed by a private key of the first mining node to the timestamp server according to the IP address so that the timestamp server marks a timestamp, and after obtaining the hash values which are signed by the private key of the timestamp server and have the timestamp and are fed back by the timestamp server, the first mining node signs a block broadcast message by the private key of the first mining node and broadcasts the block broadcast message to the block chain network (step 2) so as to further compete for accounting rights, wherein the block broadcast message comprises: the hash value is signed by a private key of the timestamp server and carries the timestamp, and the current accounting period block is generated by the first mining node.
Further, after receiving the block broadcast message sent by the first mining node, the other mining nodes check the content of the block in the current bookkeeping period generated by the first mining node according to the transaction record recorded in the current bookkeeping period in the transaction pool of the node (step 31), if the check result is consistent, the check successful message of the first mining node is sent to the block chain network, the private key signature of the timestamp server broadcasted by the first mining node is verified by using the public key of the timestamp server stored by the node (step 32), if the verification is passed, whether the timestamp broadcasted by the first mining node belongs to the current bookkeeping period is judged (step 33), if the timestamp belongs to the current bookkeeping period is known, the timestamp verification successful message of the first mining node is sent to the block chain network, and the hash value broadcasted by the first mining node and the hash value of the other mining nodes received in the preset time are sent according to the preset bookkeeping block right condition And (6) comparing the hash values in the sent block broadcast messages (step 34), and if the hash value broadcast by the first mining node meets the block accounting right robbing condition, sending a block validation message of the first mining node to the blockchain network (step 35).
Further, after the first mining node receives the block validation message of the first mining node sent by the other mining nodes, it is detected whether the number of the other mining nodes sending the block validation message of the first mining node exceeds a preset threshold, if it is known that the number of the other mining nodes exceeds the preset threshold, for example, exceeds half of the other mining nodes, it is known that the block in the current accounting period of the first mining node obtains the approval of the block chain network, and the block in the current accounting period of the first mining node is recorded into the block chain account book of the first mining node (step 4).
Therefore, the accounting method of the block chain network in the embodiment of the invention conducts accounting right contention based on the communication interaction between the mining nodes in the block chain network and the mining nodes, and does not depend on the mining work of the mining nodes, so that the accounting right contention cost is reduced, and miners determine the attribution of the accounting right of each block completely by randomness instead of investment of resources.
In order to describe the details of the implementation of the accounting system of the blockchain network according to the embodiment of the present invention in more detail, so that the process of contention of accounting right of the present invention will be more clear to those skilled in the art, the following description focuses on the accounting method side of the blockchain to perform the details of the contention process.
Fig. 3 is a flowchart of a billing method of a blockchain network according to an embodiment of the present invention, as shown in fig. 3, the method including:
step 101, a first mining node acquires a transaction broadcast message sent by a participating node, records a transaction record in a current accounting period in a transaction pool of the first mining node, and generates a mining record for the first mining node to rob accounting rights of a block in the current accounting period when the current accounting period is finished.
The participating nodes are related nodes which initiate the transaction currently, and in order to determine that the transaction is successful, a block needs to be generated according to a current transaction record, wherein the transaction record may include related information which identifies the current transaction, such as transaction amount, identity information of both parties of the transaction, transaction time, and the like.
In order to compete for the accounting right, the first mining node acquires a transaction broadcast message sent by a participating node, the transaction broadcast message comprises transaction records and the like, and further records the transaction records in the current period in a transaction pool of the first mining node, wherein a certain time is required from the generation of a block to the determination, the transaction records generated after the generation of a previous block to before the generation of the current block are all stored in the transaction pool in the mining node, and the transaction record of the block to be generated in the transaction pool is the transaction record of the accounting right contended by the mining node in the current block chain.
In the current accounting period, the accounting right is robbed for the transaction records in the transaction pool, and at the end of the current accounting period, an ore excavation record that the first ore excavation node is robbed for the accounting right in the current accounting period block is generated, where the ore excavation record may include a node identifier of the first ore excavation node, an ore excavation reward amount (for example, the reward money of the transaction record is 8-bit currency, etc.), and the like, so that the ore excavation record is further used as a basis for participating in the accounting right contending and a reward basis after the successful contending, and the like.
102, the first mining node calculates mining records and transaction records in the current accounting period to generate corresponding hash values, inquires a block chain account book of the first mining node to obtain an IP address of a timestamp server of the block chain network, and directionally sends the hash values signed by a private key of the first mining node to the timestamp server according to the IP address.
103, the first mining node acquires a hash value which is fed back by the timestamp server and has a timestamp after being signed by the timestamp server private key, and then the hash value is signed by the private key of the first mining node and broadcasted to the block chain network, wherein the block broadcast message comprises: the hash value is signed by a private key of the timestamp server and carries the timestamp, and the current accounting period block is generated by the first mining node.
Specifically, the first mining node calculates mining records and transaction records in the current accounting period to generate corresponding hash values, namely marks the specific transaction records corresponding to the mining records of the current first mining node, inquires a block chain account book of the first mining node, obtains an IP address of a timestamp server of the block chain network, directionally sends the hash values to the timestamp server according to the IP address to mark the timestamp, namely marks the accounting contention time of the specific transaction records corresponding to the mining records of the current first mining node.
When the first mining node sends the hash value to the timestamp server, in order to avoid the first mining node being disguised, the sent hash value is signed by the private key of the first mining node, and therefore when the timestamp server verifies that the private key is matched with the public key of the broadcast of the first mining node, the hash value is determined to be sent by the first mining node, and therefore the timestamp server marks the hash value in a timestamp mode.
In this embodiment, the identity authentication is performed on the first mining node of the blockchain based on a public key certificate technology, where the core of the public key certificate technology is a pair of keys, and the basic principle is as follows: information content encrypted by one key can only be matched by another key with which it is paired. The encrypted public key can be widely sent to communicators related to the encrypted public key, namely other mining nodes, and the encrypted private key needs to be stored safely. In use, the first mining node uses the private key to sign the block broadcast information and transmits the block broadcast information to other mining nodes, and the other mining nodes can use the public key of the first mining node to complete identity authentication of the first mining node.
In this example, the block broadcast message is signed by a private key of the first mining node and then broadcast to the block chain network, where the block broadcast message includes: the private key signature of the timestamp server carries the hash value of the timestamp, and the current accounting period block generated by the first mining node, wherein based on the public key certificate mechanism described above, the hash value of the private key signature of the timestamp server ensures that the current timestamp is printed for the timestamp server, so that the illegal node is prevented from disguising the timestamp, and the timestamp is guaranteed to be true and effective.
104, the other mining nodes receive the block broadcast message sent by the first mining node, account checking is carried out on the block content of the current bookkeeping period generated by the first mining node according to the transaction record in the current bookkeeping period recorded in the transaction pool of the node, if the account checking result is consistent, the account checking success message of the first mining node is sent to the block chain network, the private key signature of the timestamp server broadcasted by the first mining node is verified by using the public key of the timestamp server stored in the node, if the verification is passed, whether the timestamp broadcasted by the first mining node belongs to the current bookkeeping period is judged, if the timestamp belongs to the current bookkeeping period is known, the timestamp verification success message of the first mining node is sent to the block chain network, and the hash value broadcasted by the first mining node is compared with the hash value in the block broadcast message sent by the other mining nodes and received in the preset time according to the preset block right robbing condition And if the hash value broadcasted by the first mining node meets the block accounting right robbing condition, sending a block effective message of the first mining node to the block chain network.
After the first mining node participates in the robbing of the accounting right, the accuracy of accounting needs to be verified firstly to ensure whether the first mining node has the robbing condition of the accounting right.
Specifically, after receiving the block broadcast message sent by the first mining node, the other mining nodes perform reconciliation on the block content in the current bookkeeping period generated by the first mining node according to the transaction record in the current bookkeeping period recorded in the transaction pool of the node, so as to judge whether the bookkeeping of the first mining node is correct, if the reconciliation results are consistent, the reconciliation result of the first mining node is judged to be correct, and a reconciliation success message of the first mining node is sent to the block chain network, for example, a character string code representing successful reconciliation is sent.
In an embodiment of the present invention, if it is known that the reconciliation results obtained by the remaining mining nodes are inconsistent, it is determined that the first mining node is incorrectly booked, and an accounting failure message of the first mining node is sent to the block chain network, wherein, in order to avoid erroneous determination caused by the accounting error of the mining node itself for performing the accounting accuracy verification in some application scenarios, in an embodiment of the present invention, the accounting accuracy of the first mining node is verified by combining the determination results of a plurality of other mining nodes, specifically, after the first mining node receives the accounting failure message of the first mining node sent by the other mining nodes, it is detected whether the number of other mining nodes sending the accounting failure message of the first mining node exceeds a preset threshold, and if it is known that the number of other mining nodes exceeds the preset threshold, it indicates that the current first mining node is actually booked incorrectly, and acquiring the block failure of the current accounting period of the first mining node, wherein the preset threshold is related to the total number of other mining nodes and the authority of other mining nodes in the block chain network, and the more the total number of other mining nodes, the lower the authority of other mining nodes (for example, only common mining nodes), the lower the corresponding preset threshold.
Further, whether the bookkeeping time of the first mining node is correct or not is ensured, the situation that an illegal node is disguised as a timestamp server to mark the bookkeeping time, illegal transactions and the like are realized is avoided, in this embodiment, the public key of the timestamp server stored in this node is used to verify the private key signature of the timestamp server broadcast by the first mining node, and if the public key matches the private key, the verification accounting time is passed, whether the timestamp broadcasted by the current first mining node is aiming at the transaction record to be contended for accounting right in the current period is further verified, namely, whether the timestamp broadcast by the first mining node belongs to the current accounting period is judged, so that the illegal nodes are prevented from being forged afterwards, if the timestamp is known to belong to the current accounting period, and sending a timestamp verification success message of the first mining node to the block chain network, so that the first mining node is ensured to meet the robbing condition of the current accounting right.
In an embodiment of the present invention, if the other mining nodes know that the private key signature of the timestamp server broadcast by the first mining node fails to be verified, indicating that the bookkeeping time of the first mining node is incorrect, the other mining nodes send a timestamp verification failure message of the first mining node to the blockchain network, or if the timestamp broadcast by the first mining node is not in the current bookkeeping period, the other mining nodes send a timestamp verification failure message of the first mining node to the blockchain network. Similarly, in this embodiment, in order to avoid erroneous determination caused by erroneous accounting time of the mining node performing accounting time accuracy verification in some application scenarios, in the embodiment of the present invention, the determination result of a plurality of other mining nodes is combined to perform verification of the accounting time accuracy of the first mining node, specifically, the first mining node receives the timestamp verification failure message of the first mining node sent by the other mining nodes, detects whether the number of the other mining nodes sending the timestamp verification failure message of the first mining node exceeds a preset threshold, and if it is known that the number of the other mining nodes exceeds the preset threshold, knows that the current accounting period block of the first mining node fails, where the preset threshold is related to the total number of the other mining nodes and the authority of the other mining nodes in the block chain network, the more the total number of other mining nodes, the lower the authority of the other mining nodes (e.g., only ordinary mining nodes), the lower the corresponding preset threshold.
And further, comparing the hash value broadcasted by the first mine digging node with hash values in the received block broadcast messages sent by other mine digging nodes within a preset time according to a preset block accounting right robbing condition, wherein the preset time is less than the corresponding time from the current block generation period to the next block generation period, and if the hash value broadcasted by the first mine digging node is known to meet the block accounting right robbing condition, sending a block validation message of the first mine digging node to the block chain network.
In the embodiment, the hash value broadcasted by the first mining node is compared with the hash values in block broadcast messages sent by other mining nodes received within a preset time, the mining node corresponding to the largest hash value is taken as a node which is successful in contending the accounting right currently, and other nodes are linked into a block generated by the node; as another possible implementation manner, if the preset block accounting right robbing condition is that the hash value is minimum, the robbing is successful, so in this embodiment, the hash value broadcast by the first mining node is compared with hash values in block broadcast messages sent by other mining nodes received within a preset time, the mining node corresponding to the minimum hash value is taken as a node currently contending for accounting right successfully, and the other nodes are linked to the block generated by the node.
In an embodiment of the present invention, if the remaining mining nodes know that the hash value broadcast by the first mining node does not meet the block accounting right robbing condition, then send a block failure message of the first mining node to the block chain network, for example, send "currently, other mining nodes a robbed successfully, please account, etc. to the first mining node, similarly, in this embodiment, in order to avoid that in some application scenarios, false messages sent by other illegal nodes affect the operation of the block chain, for example, false messages that the illegal nodes robbed failure to the first mining node are sent by the illegal nodes, so as to affect the fairness of competition, in an embodiment of the present invention, the determination of the result of the contention of the first mining node is performed in combination with the determination results of multiple other mining nodes, specifically, the first mining node receives the block failure message of the first mining node sent by other mining nodes, and detecting whether the number of other mining nodes sending the block failure message of the first mining node exceeds a preset threshold value or not, and if the number of the other mining nodes exceeds the preset threshold value, acquiring that the block in the current accounting period of the first mining node is failed. The preset threshold is related to the total number of other mining nodes and the authority of other mining nodes in the block chain network, and the more the total number of other mining nodes is, the lower the authority of other mining nodes is (for example, only a common mining node), the lower the corresponding preset threshold is.
And 105, the first mining node receives the block effective message of the first mining node sent by other mining nodes, detects whether the number of other mining nodes sending the block effective message of the first mining node exceeds a preset threshold value, learns that the block of the first mining node in the current accounting period obtains the approval of the block chain network if the number of other mining nodes exceeds the preset threshold value, and records the block of the first mining node in the block chain account book of the first mining node in the current accounting period.
Specifically, in this embodiment, after the first mining node receives the block validation message of the first mining node sent by the other mining nodes, similarly, to ensure the reliability of the block validation message, it is detected whether the number of the other mining nodes sending the block validation message of the first mining node exceeds a preset threshold, for example, whether the number of the other mining nodes exceeds a half of the total number of the other mining nodes, if it is known that the number of the other mining nodes exceeds the preset threshold, it is known that the block in the current accounting period of the first mining node obtains the approval of the block chain network, and the block in the current accounting period of the first mining node is recorded in the block chain book of the first mining node, the other mining nodes are linked to the block in the current accounting period generated by the first mining node, and all mining nodes start to compete for accounting right of the next round. The preset threshold is related to the total number of other mining nodes and the authority of other mining nodes in the block chain network, and the more the total number of other mining nodes is, the lower the authority of other mining nodes is (for example, only a common mining node), the lower the corresponding preset threshold is.
After the approval of the block chain network is obtained in the current accounting period block of the first mining node, the first mining node can be rewarded according to reward information and the like in the mining record of the first mining node, and the reward and the like can be carried out according to the operation rule of the block chain network.
In an embodiment of the present invention, when the mining node that succeeds in competing for the accounting right is not the first mining node but a second mining node in other mining nodes, the first mining node needs to link a corresponding block generated by the second mining node as a backup recording node of the corresponding transaction record, so as to form a monitoring environment for the current transaction record with other mining nodes, and the like.
Specifically, in this embodiment, the first mining node receives that the number of the block validation messages of the second mining node sent by other mining nodes exceeds a preset threshold, where the preset threshold is related to the total number of other mining nodes and authority of other mining nodes in the block chain network, and the larger the total number of other mining nodes is, the lower authority of other mining nodes is (for example, only common mining nodes are), the lower the corresponding preset threshold is, the approval of the block chain network obtained by the block in the current accounting period broadcast by the second mining node is known, and the block in the current accounting period broadcast by the second mining node is recorded in the block chain account book of the first mining node.
In addition, it should be emphasized that, since in the prior art, one ore mining node in the block chain may represent a plurality of machine devices, in this embodiment, in order to further ensure the preemption fairness of the accounting right, all the ore mining nodes may also be authenticated by real names, and each user is ensured to have only one chance, and the chances of everyone are equal.
Therefore, as shown in fig. 4, in the accounting method of the block chain network according to the embodiment of the present invention, the first mining node a and the other mining nodes B, C, D … are restricted and verified with each other, a contention verification environment for accounting rights is formed through mutual communication interaction, and the ownership of the accounting rights is determined according to the hash values of all mining nodes received within a certain time period, so that a fair determination mechanism is implemented, and the resource calculation capability depending on the corresponding mining nodes, such as the calculation time period of the hash values, is not used as a determination mechanism, so that while the cost is reduced, the fairness of accounting contention is ensured. In the embodiment of the invention, only one ore digging node is given an accounting right, and other ore digging node chains compete for the blocks generated by the successful ore digging nodes in the accounting right, so that the block chains cannot be tampered, the accounting is safe, and the phenomena of double-flower attack and the like are avoided.
In summary, in the accounting method of the block chain network according to the embodiment of the present invention, a contention verification environment of accounting rights is formed through communication interaction between the mining nodes, and the attribution of the accounting rights is determined according to the hash values of all the mining nodes received within a certain time period, so that a fair determination mechanism is implemented, and the computing time period of the hash values and other resource computing capabilities depending on the mining nodes are not used as the determination mechanism, so that the cost is reduced, and meanwhile, the contention fairness of accounting is ensured. In the embodiment of the invention, only one ore digging node is given an accounting right, and other ore digging node chains compete for the blocks generated by the successful ore digging nodes in the accounting right, so that the block chains cannot be tampered, the accounting is safe, and the phenomena of double-flower attack and the like are avoided.
In order to implement the foregoing embodiments, the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the computer program, the computer device implements the accounting method of the blockchain network as described in the foregoing embodiments.
In order to implement the above embodiments, the present invention also proposes a non-transitory computer readable storage medium having stored thereon a computer program which, when being executed by a processor, is capable of implementing the accounting method of a blockchain network as described in the foregoing embodiments.
In the present invention, the terms "first", "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A method for accounting in a blockchain network, comprising:
a first mine digging node acquires a transaction broadcast message sent by a participating node, records a transaction record in a current accounting period in a transaction pool of the first mine digging node, and generates a mine digging record for the first mine digging node to rob accounting right of a block in the current accounting period when the current accounting period is ended;
the first mining node calculates the mining record and the transaction record in the current accounting period to generate a corresponding hash value, inquires a block chain account book of the first mining node to obtain an IP address of a timestamp server of a block chain network, and directionally sends the hash value signed by a private key of the first mining node to the timestamp server according to the IP address;
the first mining node acquires a hash value which is fed back by the timestamp server and has a timestamp after being signed by a timestamp server private key, and then the hash value is signed by the private key of the first mining node and broadcasted to a block chain network, wherein the block broadcast message comprises: the hash value which is signed by a private key of the timestamp server and carries a timestamp, and a current accounting period block generated by the first mining node;
the other mining nodes receive the block broadcast message sent by the first mining node, account checking is carried out on the contents of the block in the current bookkeeping period generated by the first mining node according to the transaction record in the current bookkeeping period recorded in the transaction pool of the node, if the account checking result is consistent, the account checking success message of the first mining node is sent to the block chain network, the private key signature of the timestamp server broadcasted by the first mining node is verified by using the public key of the timestamp server stored by the node, if the verification is passed, whether the timestamp broadcasted by the first mining node belongs to the current bookkeeping period is judged, if the timestamp belongs to the current bookkeeping period is known, the timestamp verification success message of the first mining node is sent to the chain network, and the hash value broadcasted by the first mining node and the received block broadcast in the preset time are subjected to the condition of capturing the bookkeeping right of the preset block Comparing hash values in block broadcast messages sent by other mining nodes, and if the hash value broadcast by the first mining node meets the block accounting right robbing condition, sending a block effective message of the first mining node to a block chain network;
the first mining node receives the block effective message of the first mining node sent by other mining nodes, detects whether the number of other mining nodes sending the block effective message of the first mining node exceeds a preset threshold value, learns that the block of the current accounting period of the first mining node obtains the approval of a block chain network if the number of other mining nodes exceeds the preset threshold value, and records the block of the current accounting period of the first mining node into the block chain account book of the first mining node.
2. The method of claim 1, wherein after reconciling the current accounting period block content generated by the first mining node based on the transaction records recorded in the transaction pool of the own node for the current accounting period, further comprising:
if the other mining nodes acquire inconsistent reconciliation results, sending a reconciliation failure message of the first mining node to a block chain network;
the first mining node receives account checking failure messages of the first mining node sent by other mining nodes, detects whether the number of the other mining nodes sending the account checking failure messages of the first mining node exceeds a preset threshold value, and if the number of the other mining nodes exceeds the preset threshold value, learns that the current accounting period block of the first mining node is invalid.
3. The method of claim 1, wherein after the verifying, by the application local node stored public key of the timestamp server, the private key signature of the timestamp server broadcast by the first mining node, further comprising:
the other mining nodes acquire that the private key signature of the timestamp server broadcasted by the first mining node fails to be verified, and send a timestamp verification failure message of the first mining node to the block chain network, or acquire that the timestamp broadcasted by the first mining node does not belong to the current accounting period, and send a timestamp verification failure message of the first mining node to the block chain network;
the first mining node receives timestamp verification failure messages of the first mining node sent by other mining nodes, detects whether the number of the other mining nodes sending the timestamp verification failure messages of the first mining node exceeds a preset threshold value, and if the number of the other mining nodes exceeds the preset threshold value, learns that a current accounting period block of the first mining node is invalid.
4. The method of claim 1, wherein after said comparing said hash value broadcast by said first mine mining node with hash values in block broadcast messages sent by other mine mining nodes received within a predetermined time according to a predetermined block accounting right preemption condition, further comprising:
the other mining nodes acquire that the hash value broadcast by the first mining node does not accord with the block accounting right robbing condition, and then send a block failure message of the first mining node to a block chain network;
the first mining node receives the block failure message of the first mining node sent by other mining nodes, detects whether the number of other mining nodes sending the block failure message of the first mining node exceeds a preset threshold value, and if the number of other mining nodes exceeds the preset threshold value, learns that the block in the current accounting period of the first mining node is failed.
5. The method of claim 1, further comprising:
and the first mining node receives that the number of the effective block messages of the second mining node sent by other mining nodes exceeds a preset threshold value, acquires the approval of the block chain network obtained by the block in the current accounting period broadcast by the second mining node, and records the block in the block chain account book of the first mining node in the current accounting period broadcast by the second mining node.
6. An accounting system for a blockchain network, comprising: a first excavation node and the remaining excavation nodes, wherein,
the first mine digging node is used for acquiring transaction broadcast messages sent by the participating nodes, recording transaction records in the current accounting period in a transaction pool of the first mine digging node, and generating mine digging records for the first mine digging node to rob accounting rights of blocks in the current accounting period when the current accounting period is finished;
the first mining node is further configured to calculate the mining record and the transaction record in the current accounting period to generate a corresponding hash value, query a block chain ledger of the first mining node, obtain an IP address of a timestamp server of a block chain network, directionally send the hash value signed by a private key of the first mining node to the timestamp server according to the IP address, obtain the hash value with a timestamp of the hash value signed by the private key of the timestamp server and fed back by the timestamp server, sign a block broadcast message by the private key of the first mining node, and broadcast the block broadcast message to the block chain network, where the block broadcast message includes: the hash value which is signed by a private key of the timestamp server and carries a timestamp, and a current accounting period block generated by the first mining node;
the other ore mining nodes are used for receiving the block broadcast message sent by the first ore mining node, the current accounting period block content generated by the first ore mining node is subjected to account checking according to the transaction record in the current accounting period recorded in the transaction pool of the node, if the account checking result is consistent, the account checking success message of the first ore mining node is sent to the block chain network, the private key signature of the timestamp server stored by the node is used for verifying the private key signature of the timestamp server broadcasted by the first ore mining node, if the verification is passed, whether the timestamp broadcasted by the first ore mining node belongs to the current accounting period is judged, if the timestamp belongs to the current accounting period is known, the timestamp verification success message of the first ore mining node is sent to the block chain network, and the hash value broadcasted by the first ore mining node is compared with the hash value broadcasted by the preset time according to a preset accounting block right condition Comparing hash values in block broadcast messages sent by other mining nodes received in the network, and if the hash value broadcasted by the first mining node meets the block accounting right robbing condition, sending a block effective message of the first mining node to a block chain network;
the first mining node is further configured to receive a block validation message of the first mining node sent by other mining nodes, detect whether the number of the other mining nodes sending the block validation message of the first mining node exceeds a preset threshold, learn that the current accounting period block of the first mining node obtains approval of a block chain network if the number of the other mining nodes exceeds the preset threshold, and record the current accounting period block of the first mining node into a block chain book of the first mining node.
7. The system of claim 6, wherein the remaining mining nodes are further configured to:
when the account checking result is inconsistent, sending an account checking failure message of the first mining node to a block chain network;
the first mining node is further used for receiving account checking failure messages of the first mining node sent by other mining nodes, detecting whether the number of the other mining nodes sending the account checking failure messages of the first mining node exceeds a preset threshold value, and if the number of the other mining nodes exceeds the preset threshold value, knowing that the current bookkeeping period block of the first mining node is invalid.
8. The system of claim 6, wherein the remaining mining nodes are further configured to:
after the public key of the timestamp server stored by the application node verifies the private key signature of the timestamp server broadcast by the first mining node, if the private key signature of the timestamp server broadcast by the first mining node fails to be verified, sending a timestamp verification failure message of the first mining node to a block chain network, or if the timestamp broadcast by the first mining node is not in the current accounting period, sending a timestamp verification failure message of the first mining node to the block chain network; the first mining node is further used for receiving timestamp verification failure messages of the first mining node sent by other mining nodes, detecting whether the number of other mining nodes sending the timestamp verification failure messages of the first mining node exceeds a preset threshold value, and if the number of other mining nodes exceeds the preset threshold value, acquiring that the current accounting period block of the first mining node is invalid.
9. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a method of accounting for a blockchain network according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a method of accounting for a blockchain network according to any one of claims 1 to 5.
CN201810900789.4A 2018-08-09 2018-08-09 Accounting method and system of block chain network Active CN109086626B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810900789.4A CN109086626B (en) 2018-08-09 2018-08-09 Accounting method and system of block chain network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810900789.4A CN109086626B (en) 2018-08-09 2018-08-09 Accounting method and system of block chain network

Publications (2)

Publication Number Publication Date
CN109086626A CN109086626A (en) 2018-12-25
CN109086626B true CN109086626B (en) 2021-07-09

Family

ID=64833981

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810900789.4A Active CN109086626B (en) 2018-08-09 2018-08-09 Accounting method and system of block chain network

Country Status (1)

Country Link
CN (1) CN109086626B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508565B (en) * 2018-12-29 2021-04-09 西安纸贵互联网科技有限公司 Account book accounting method of block chain network with multi-chain sharing computing power
CN109918261B (en) * 2019-01-25 2022-11-22 中国联合网络通信集团有限公司 Fault monitoring method, device, equipment and computer readable storage medium
CN109672518B (en) * 2019-03-02 2022-04-12 西安安盟智能科技股份有限公司 Node data processing of quantum attack resistant blockchains
CN110084069B (en) * 2019-04-17 2021-05-11 江苏全链通信息科技有限公司 Server log monitoring method and system based on block chain
CN110489231B (en) * 2019-08-09 2023-08-22 全链通有限公司 Transaction information recording method, apparatus and computer readable storage medium
SG11202002467TA (en) 2019-09-02 2020-04-29 Alibaba Group Holding Ltd Managing blockchain-based centralized ledger systems
EP3808030B1 (en) 2019-09-02 2022-05-04 Advanced New Technologies Co., Ltd. Managing blockchain-based centralized ledger systems
CN110825810B (en) * 2019-10-28 2023-05-19 天津理工大学 Block chain-based crowd sensing dual privacy protection method
CN111464539B (en) * 2020-03-31 2022-11-04 中国联合网络通信集团有限公司 Block chain accounting method and accounting node
CN111656386B (en) 2020-04-22 2022-05-17 支付宝(杭州)信息技术有限公司 Managing transaction requests in ledger system
EP3841549B1 (en) 2020-04-22 2022-10-26 Alipay (Hangzhou) Information Technology Co., Ltd. Managing transaction requests in ledger systems
CN111630545B (en) 2020-04-22 2022-05-27 支付宝(杭州)信息技术有限公司 Managing transaction requests in ledger system
CN111581286B (en) * 2020-05-07 2023-03-24 桂勋 Energy block chain block storage method based on consistency hash
CN112199444B (en) * 2020-10-10 2023-01-17 中国联合网络通信集团有限公司 Accounting method and server
CN114726536B (en) * 2022-03-31 2024-08-09 南方电网科学研究院有限责任公司 Time stamp generation method and device, electronic equipment and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10713654B2 (en) * 2016-01-21 2020-07-14 International Business Machines Corporation Enterprise blockchains and transactional systems
CN106296191A (en) * 2016-08-13 2017-01-04 深圳市樊溪电子有限公司 A kind of PoW common recognition mechanism of block chain power-aware
US10862959B2 (en) * 2016-11-28 2020-12-08 Keir Finlow-Bates Consensus system and method for adding data to a blockchain
CN106411503B (en) * 2016-11-28 2019-11-08 中国银行股份有限公司 The bookkeeping methods and system, ballot and accounting nodes of block chain ballot accounting mode
CN107146087A (en) * 2017-04-11 2017-09-08 广东网金控股股份有限公司 A kind of quick common recognition bookkeeping methods and system based on block chain alliance chain
CN107276765B (en) * 2017-07-04 2020-05-05 中国联合网络通信集团有限公司 Processing method and device for consensus in block chain
CN108259235B (en) * 2018-01-04 2019-11-22 杭州复杂美科技有限公司 A kind of block chain accounting nodes selection method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Long-Term Public Blockchain: Resilience against Compromise of Underlying Cryptography;Masashi Sato等;《2017 26th International Conference on Computer Communication and Networks (ICCCN)》;20170918;第1-8页 *
区块链共识机制研究与分析;刘童桐;《信息通信技术与政策》;20180731;第26-30页 *
基于区块链的投票系统设计;郄九玲等;《通信技术》;20180731;第1746-1750页 *

Also Published As

Publication number Publication date
CN109086626A (en) 2018-12-25

Similar Documents

Publication Publication Date Title
CN109086626B (en) Accounting method and system of block chain network
CN109101836B (en) Accounting method and system of block chain network
US11301361B2 (en) Sidechain testing system and method for improving security and stability of a smart contract by generating sidechains having mirror image accounts of part or all mainchain assets
CN108900507B (en) Block chain real-name authentication method and system
CN107864115B (en) Method for user account login verification by using portable terminal
CN107483419B (en) Method, device and system for authenticating access terminal by server, server and computer readable storage medium
CN109542888B (en) Data modification and synchronization method, device, equipment and storage medium of block chain
CN108334753B (en) Pirate application verification method and distributed server node
KR20200016238A (en) Script-based Blockchain Interaction
CN108880832B (en) Block chain real-name authentication method and system
CN113708935B (en) Internet of things equipment unified authentication method and system based on block chain and PUF
KR20210059856A (en) Blockchain network system being capable of verifying a blockchain ledger and method for verifying a blockchain ledger
CN111865993B (en) Identity authentication management method, distributed system and readable storage medium
CN110611647A (en) Node joining method and device on block chain system
CN115378604A (en) Identity authentication method of edge computing terminal equipment based on credit value mechanism
CN111831974A (en) Interface protection method and device, electronic equipment and storage medium
US20230177501A1 (en) Methods and devices for double-spend relay in a blockchain network
CN104994085A (en) Identity authentication method and system in wireless sensor network
CN110391912B (en) Distributed evaluation decision method and system based on secret sharing mechanism
CN107948140B (en) Portable equipment verification method and system
CN113904869B (en) Method for detecting malicious nodes in blockchain and blockchain
CN112182547B (en) Trusted device authentication method, system, device and storage medium
CN115102697A (en) Method, device and storage medium for realizing participation of two transaction parties on blockchain in generation of random number
CN110443616B (en) Byzantine fault-tolerant consensus method based on random threshold signature mechanism
CN109784032B (en) Test equipment verification method, test equipment, verification equipment and storage device

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100191 1107c, 11 / F, Xueyuan international building, 1 Zhichun Road, Haidian District, Beijing

Applicant after: IALLCHAIN Co.,Ltd.

Address before: 100043 5158, 5 floor, 11 Shixing street, Shijingshan District, Beijing.

Applicant before: IALLCHAIN Co.,Ltd.

GR01 Patent grant
GR01 Patent grant