CN114710504A - Rotation method of common nodes in block chain system, nodes and block chain system - Google Patents

Rotation method of common nodes in block chain system, nodes and block chain system Download PDF

Info

Publication number
CN114710504A
CN114710504A CN202210333393.2A CN202210333393A CN114710504A CN 114710504 A CN114710504 A CN 114710504A CN 202210333393 A CN202210333393 A CN 202210333393A CN 114710504 A CN114710504 A CN 114710504A
Authority
CN
China
Prior art keywords
node
nodes
random number
consensus
transaction
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.)
Pending
Application number
CN202210333393.2A
Other languages
Chinese (zh)
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.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai 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 Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202210333393.2A priority Critical patent/CN114710504A/en
Publication of CN114710504A publication Critical patent/CN114710504A/en
Priority to PCT/CN2022/135275 priority patent/WO2023185046A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1051Group master selection mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1059Inter-group management mechanisms, e.g. splitting, merging or interconnection of groups

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A rotation method of common nodes in a blockchain system, nodes and the blockchain system are provided. The block chain system comprises a plurality of first nodes which are currently used as common nodes and a plurality of second nodes which are currently used as non-common nodes, intelligent contracts are deployed in the block chain system, a first set is stored in contract states of the intelligent contracts, the first set comprises identifications of the first nodes, and the method is executed by the first nodes. The method comprises the following steps: acquiring a first transaction, wherein the first transaction request calls an intelligent contract and is used for indicating that a third node in a plurality of first nodes is set as a non-consensus node and a fourth node in a plurality of second nodes is set as a consensus node; the identity of the third node is replaced with the identity of the fourth node in the first set based on the first transaction.

Description

Rotation method of common nodes in block chain system, nodes and block chain system
Technical Field
The embodiment of the present specification belongs to the technical field of blockchain, and in particular, relates to a rotation method of common nodes in a blockchain system, a first node, and a blockchain system.
Background
The Blockchain (Blockchain) is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. In the block chain system, data blocks are combined into a chain data structure in a sequential connection mode according to a time sequence, and a distributed account book which is not falsifiable and counterfeitable is ensured in a cryptographic mode. Because the blockchain has the characteristics of decentralization, information non-tampering, autonomy and the like, the blockchain is also paid more and more attention and is applied by people.
Disclosure of Invention
The invention aims to provide a rotation method of common nodes in a block chain system, a first node and the block chain system.
In a first aspect, a rotation method of common nodes in a blockchain system is provided, where the blockchain system includes a plurality of first nodes currently serving as common nodes and a plurality of second nodes currently serving as non-common nodes, an intelligent contract is deployed in the blockchain system, and a first set is stored in a contract state of the intelligent contract, where the first set includes identifiers of the plurality of first nodes, and the method is performed by the first nodes. The method comprises the following steps: acquiring a first transaction, wherein the first transaction request calls the intelligent contract and is used for indicating that a third node in the plurality of first nodes is set as a non-consensus node and a fourth node in the plurality of second nodes is set as a consensus node; replacing, in the first set, the identity of the third node with the identity of the fourth node based on the first transaction.
In a second aspect, a blockchain link point in a blockchain system is provided, where the blockchain system includes a plurality of first nodes currently serving as common nodes and a plurality of second nodes currently serving as non-common nodes, an intelligent contract is deployed in the blockchain system, and a first set is stored in a contract state of the intelligent contract, where the first set includes identifiers of the plurality of first nodes. The block link point includes: a transaction obtaining unit configured to obtain a first transaction, where the first transaction request invokes the smart contract and is used to instruct a third node of the plurality of first nodes to be set as a non-consensus node and a fourth node of the plurality of second nodes to be set as a consensus node; a transaction execution unit configured to replace the identity of the third node with the identity of the fourth node in the first set based on the first transaction.
In a third aspect, a blockchain system is provided, where the blockchain system includes multiple first nodes currently serving as common nodes and multiple second nodes currently serving as non-common nodes, an intelligent contract is deployed in the blockchain system, and a contract state of the intelligent contract stores a first set, where the first set includes identifiers of the multiple first nodes; the first node is used for obtaining a first transaction, and the first transaction request calls the intelligent contract and is used for indicating that a third node in the plurality of first nodes is set as a non-consensus node and a fourth node in the plurality of second nodes is set as a consensus node; replacing, in the first set, the identity of the third node with the identity of the fourth node based on the first transaction.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed in a computing device, causes the computing device to perform the method of the first aspect.
In a fifth aspect, a computing device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the method of the first aspect when executing the computer program.
In the above embodiment, the first node currently serving as the consensus node may obtain the first transaction for invoking the intelligent contract, and then replace the identifier of the third node currently serving as the consensus node with the identifier of the fourth node to be the consensus node in the first set stored in the contract state of the intelligent contract based on the first transaction, thereby implementing the rotation of the consensus nodes in the block chain nodes by updating the identifiers of the block chain nodes in the set, which is beneficial to improving the fairness and the security of the block chain system.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and it is obvious for a person skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a schematic diagram of a consensus process in a PBFT consensus algorithm exemplarily provided in an embodiment of the present specification;
fig. 2 is a schematic diagram of a blockchain system exemplarily provided in an embodiment of the present specification;
fig. 3 is a flowchart of a rotation method of common nodes in a blockchain system according to an embodiment of the present disclosure;
fig. 4 is a flowchart of a method for generating a third random number exemplarily provided in an embodiment of the present specification;
FIG. 5 is a schematic diagram of an exemplary provided technical scenario of rotating consensus nodes;
fig. 6 is a schematic diagram of a first node in a blockchain system provided in an embodiment of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
In the block chain system, different participants can establish a distributed block chain network through deployed nodes (nodes). A decentralized (or referred to as multicentric) distributed ledger constructed using a chained blockchain structure is maintained at each node (or most nodes, such as consensus nodes) in the distributed blockchain network. Such a blockchain system needs to address the issue of consistency and correctness of the respective ledger data across multiple nodes that are decentralized (or multicenter). Each node runs a blockchain program, and under the design of certain fault tolerance requirements, all loyalty nodes are ensured to have the same transaction through a consensus (consensus) mechanism, so that the execution results of all loyalty nodes on the same transaction are ensured to be consistent, the transaction is packaged into blocks, and the world state is updated based on the execution results of the same transaction. The current mainstream consensus mechanisms include, but are not limited to: proof of Work (POW), Proof of stock (POS), Proof of commission rights (DPOS), Practical Byzantine Fault Tolerance (PBFT) algorithm, badger Byzantine Fault Tolerance (honeybadger bft) algorithm, and so on.
Fig. 1 is a schematic diagram of a consensus process in a PBFT consensus algorithm exemplarily provided in an embodiment of the present specification. As shown in fig. 1, the consensus process can be divided into four phases, request, prepare, and commit, according to the PBFT consensus algorithm. Assuming that a blockchain includes four common nodes, i.e., node n 1-node n4, where node n1 is a master node, and node n 2-node n4 is a slave node, according to the PBFT algorithm, 1 malicious node can be tolerated in node n 1-node n 4. In particular, during the request phase, the user of the blockchain may send a request, for example in the form of a blockchain transaction, to node n1 via his user device. In a preliminary phase, node n1, after receiving multiple transactions from one or more user devices, may package the multiple transactions into a consensus proposal, which may be sent to other consensus nodes (i.e., node n 2-node n4) along with the signatures of the consensus proposal by node n1 for use in generating blocks, which may include information about the transaction bodies of the multiple transactions and the order of submission of the multiple transactions. In the preparation phase, each slave node may sign the consensus proposal and send it to other respective nodes. Assuming node n4 is a malicious node, node n1, node n2, and node n3 may determine that the preparation phase is complete and may enter the commit phase after receiving the signatures for consensus proposals for 2f ═ 2 other consensus nodes, respectively. For example, node n1, after receiving the signatures of node n2 and node n3, verifies that the signatures of node n2 and node n3 are both correct signatures for consensus proposals, and determines that the preparation phase is complete, and node n2, after receiving the signature of node n3 and the signature of node n1 and verifying that they pass, determines that the preparation phase is complete. In the submission stage, each consensus node signs the consensus offer in the submission stage and sends the consensus offer to other consensus nodes, and after receiving the signatures of the submission stages of 2 f-2 other consensus nodes, each consensus node can determine that the submission stage is completed and the consensus is successful. For example, node n1, after receiving signatures of the commit phases of node n2 and node n3 and verifying, determines that the commit phase is complete, such that node n1 may perform performing the plurality of transactions according to consensus offers, generate and store tiles (e.g., tile B1) including the plurality of transactions, update the world state according to results of the performing of the plurality of transactions, and return results of the performing of the plurality of transactions to the user device. Similarly, node n2 and node n3 execute the plurality of transactions after determining that the commit phase is complete, generate and store block B1, and update the world state according to the execution results of the plurality of transactions. Through the above exemplary consensus process, storage consistency of node n1, node n2, and node n3 is achieved. That is, the node n 1-the node n4 can still achieve successful consensus on the consensus proposal in the presence of a malicious node, thereby completing the execution of the block.
A transaction in the blockchain domain may refer to a unit of a task that is performed in the blockchain and recorded in the blockchain. The transaction typically includes a send field (From), a receive field (To), and a Data field (Data). Where the transaction is a transfer transaction, the From field indicates the address of the account From which the transaction was initiated (i.e., From which a transfer task To another account was initiated), the To field indicates the address of the account From which the transaction was received (i.e., From which a transfer was received), and the Data field includes the transfer amount. In the case of a transaction calling an intelligent contract in a blockchain, a From field represents an account address for initiating the transaction, a To field represents an account address of the contract called by the transaction, and a Data field includes Data such as a function name in the calling contract and incoming parameters To the function, so as To obtain code of the function From the blockchain and execute the code of the function when the transaction is executed.
The block chain may provide the functionality of an intelligent contract. An intelligent contract on a blockchain is a contract that can be executed by a transaction trigger on the blockchain system. An intelligent contract may be defined in the form of code. Calling the intelligent contract in the block chain is to initiate a transaction pointing to the intelligent contract address, so that each node in the block chain runs the intelligent contract code in a distributed mode. It should be noted that, in addition to the creation of the smart contracts by the users, the smart contracts may also be set by the system in the creation block. Such contracts are generally referred to as foundational contracts. In general, the data structure, parameters, attributes and methods of some blockchains may be set in the startup contract. Further, an account with system administrator privileges may create a contract at the system level, or modify a contract at the system level (simply referred to as a system contract). Wherein the system contract is usable to add data structures for different services in a blockchain.
In a scenario of contract deployment, a transaction containing information to create an intelligent contract (i.e., a deployment contract) may be sent into the blockchain system, the data field of the transaction including the code (e.g., bytecode or machine code) of the contract to be created, and the to field of the transaction being empty to indicate that the transaction is for contract deployment. After the nodes achieve consensus through the various consensus mechanisms, the contract address of the contract is determined, the contract account corresponding to the contract address of the intelligent contract is added into the state database, the state storage corresponding to the contract account is allocated, and the contract code is stored in the state storage of the contract, so that the contract creation is successful.
In the scenario of invoking a contract, a transaction for invoking a smart contract may be sent into the blockchain system, the from field of the transaction being the address of the account of the transaction initiator, the to field being the contract address of the invoked smart contract, the data field of the transaction including the method and parameters that invoke the smart contract. After the transaction is identified in the blockchain system, each node in the blockchain system can execute the transaction respectively, so that the contract is executed respectively, and the state database is updated based on the execution of the contract.
For a block chain system constructed by large-scale nodes, a small number of nodes can be selected from the large-scale nodes as consensus nodes participating in executing a consensus mechanism. The consensus result obtained by executing the consensus mechanism by the relatively small number of consensus nodes can be distributed to other non-consensus nodes which are not selected as the consensus nodes in the large-scale nodes by the consensus nodes, so that the consensus efficiency of the block chain system can be improved. Referring to the block chain system exemplarily provided in fig. 2, in the block chain system, for example, Node 1, Node 2, Node 3, and Node 4 may be selected as common nodes to form a common Node set, and non-common nodes except for the common nodes may be divided into, for example, Node group 1, Node group 2, Node group 3, and Node group 4 corresponding to the 4 common nodes; after the aforementioned 4 consensus nodes jointly execute a certain consensus mechanism to obtain consensus results, each consensus node can distribute the consensus results to the non-consensus nodes in the corresponding node groups, so that the non-consensus nodes obtain corresponding blocks based on the consensus results and correspondingly update the stored world states of the blocks. The consensus result may be a block or related data used to generate a block.
The consensus Node may directly send the consensus result to the non-consensus Node corresponding to the consensus Node, for example, Node 1 may completely send the consensus result to n non-consensus nodes, such as Node 11 to Node 1n, in Node group 1. Or, the consensus node may also adopt an erasure code algorithm to split the consensus result to obtain a plurality of data blocks, and distribute different data blocks to different non-consensus nodes corresponding to the consensus node; the data blocks received by the non-consensus nodes from the consensus nodes can be broadcasted among the non-consensus nodes, so that after a single non-consensus node receives data blocks meeting the corresponding quantity from the consensus nodes and/or the rest of non-consensus nodes, the collected data blocks can be decoded to obtain the consensus result. Therefore, the data volume distributed to the non-consensus nodes by the consensus nodes is not increased along with the increase of the scale of the non-consensus nodes, the data volume distributed to the non-consensus nodes by the consensus nodes is relatively small, the consensus result can be distributed to the large-scale non-consensus nodes more quickly, and the efficiency is relatively high.
However, referring to the blockchain system exemplarily provided in fig. 2, in the case that the number of the consensus nodes is relatively small, if some blockchain nodes exist as the consensus nodes for a long time, the security and fairness of the whole blockchain system will be affected.
The embodiment of the specification provides a rotation method of common nodes in a blockchain system, a first node and the blockchain system. The first node which is currently used as the consensus node can acquire the first transaction for calling the intelligent contract, then the identifier of the third node which is currently used as the consensus node is replaced by the identifier of the fourth node which is used as the consensus node in the first set stored in the contract state of the intelligent contract based on the first transaction, and then the rotation of the consensus node in the block chain nodes is completed by updating the identifier of the block chain nodes in the set, so that the fairness and the safety of the block chain system are improved.
Fig. 3 is a method for rotating common nodes in a blockchain system according to an embodiment of the present disclosure. The block chain system comprises a plurality of first nodes which are currently used as common nodes and a plurality of second nodes which are currently used as non-common nodes, an intelligent contract is deployed in the block chain system, a first set is stored in a contract state of the intelligent contract, the first set comprises the identifications of the first nodes, and the method can be executed by any first node which is currently used as a common node. Referring to fig. 3, the method may include, but is not limited to, the following steps 32 and 34.
And step 32, acquiring a first transaction, wherein the first transaction request calls an intelligent contract for indicating that a third node in the plurality of first nodes is set as a non-consensus node and a fourth node in the plurality of second nodes is set as a consensus node.
The blockchain node may learn whether it is currently the first node that is the consensus node by the first set stored in the contract state of the intelligent contract (hereinafter referred to as contract c 1). With continued reference to fig. 2, the first Node currently being a consensus Node includes, for example, Node 1, Node 2, Node 3 and Node 4, the identities of the 4 nodes are all stored in the set c1, and the 4 nodes can learn that they are currently being a consensus Node by finding that their identities are stored in the set c 1.
Several second sets (hereinafter set c2) may also be stored in the contract state of the intelligent contract, different sets c2 corresponding to different first nodes, and a single set c2 containing the identity of one or more second nodes that are currently non-consensus nodes. Please continue to refer to fig. 2, if n second nodes such as Node 11 to Node 1n currently located in Node group 1 correspond to the same consensus Node 1, a set c2 corresponding to Node 1 may be stored in the contract state of the intelligent contract, where the set c2 includes respective identifiers of the n second nodes such as Node 11 to Node 1 n; similarly, the contract state of the smart contract may also store a set c2 corresponding to Node 2, a Node c2 corresponding to Node 3, and a union c2 corresponding to Node 4.
The block chain link points currently serving as the consensus nodes can also generate a third random number (hereinafter, referred to as a random number x1) and a fourth random number (hereinafter, referred to as a random number x2) which correspond to each other, and then a third node to be rotated is determined from a plurality of first nodes currently serving as the consensus nodes based on the random number x1, and a fourth node to be used as the consensus node is determined from a plurality of second nodes currently serving as non-consensus nodes based on the random number x2, so that the rotation process of the consensus nodes can be ensured to have randomness, and each block chain node has an opportunity to be selected as the consensus node. For example, the plurality of first nodes may be numbered sequentially, the random number x1 may be modulo-operated by the number of the plurality of first nodes, and the first node having the same number as the result of the modulo-operation may be selected as the third node; similarly, for example, several second nodes may be numbered sequentially, the random number x2 may be modulo by the number of the several second nodes, and the second node with the same number as the result of the modulo operation may be selected as the fourth node.
In order to ensure that the random number x1 and the random number x2 are unpredictable, a random number node set can be stored through a contract state of the intelligent contract, and the random number node set can store the identifications of a plurality of fifth nodes, wherein the fifth nodes are selected from a plurality of first nodes or a plurality of second nodes. Accordingly, the block chain node may discover itself as a fifth node for generating the random number based on the random number node set, and if so, generate a verifiable but unpredictable secure random number x3 based on the random number node in combination with the remaining fifth nodes to achieve multiparty cooperation, and further generate an unpredictable random number x1 and a random number x2 based on the random number x3, for example, generate a random number x1 and the aforementioned random number x2 with the random number x3 as a random seed.
It may be generally set in the blockchain system that 1 random number x3 is generated by the currently selected fifth nodes in each block time, and the random number x3 may be stored in a block generated in the corresponding block time, for example, in a block header generated in the corresponding block time, so as to be used for transactions in the block to which the random number x3 belongs or in other blocks located after the block to which the random number x3 belongs. In other words, the block link point currently serving as the consensus node may specifically read the random number x3 from the newly generated block, for example, read the random number x3 from the block header of the newly generated block, and generate the random number x1 and the random number x2 based on the read random number x 3; wherein the newly generated block may be the block to which the first transaction belongs or a block previous to the block to which the first transaction belongs. More specifically, the rotation process of the consensus node may be triggered at a certain preset time interval or block height increment, that is, the reading of the random number x3 from the newly generated block may be performed periodically at the preset time interval or block height increment, and the initiating of the step 32 is implemented based on the read random number x 3.
More specifically, the fifth nodes may be the same as the first nodes, in other words, the random number node set may be the set c 1. In a commit (commit) stage of the PBFT corresponding to the newly generated block, each first node may sign an original message including a unique value of an original transaction list in this consensus by using its own private key share based on a threshold signature algorithm, generate a signature share, and add the signature share to a broadcasted commit message; after collecting the commit messages of at least the threshold number, each first node obtains a complete signature by passing the signature shares of at least the threshold number through a recovery function corresponding to the private key shares generated by a threshold signature algorithm; each first node obtains a third random number based on the complete signature. In other words, in the process of generating the block including the first transaction, the first node may also generate a corresponding third random number through the foregoing process at the commit stage of the PBFT corresponding to the block, and the newly generated third random number may be stored in the block to which the first transaction belongs, specifically, in the block header of the block to which the first transaction belongs.
The process of generating the third random number, which is also denoted as a random seed, is described in detail below in connection with fig. 4.
First, in step 42, in the submission stage of the PBFT, each first node signs an original message containing a unique value of an original transaction list in this consensus with its own private key share based on a threshold signature algorithm, generates a signature share, and adds the signature share to a broadcasted submission message.
The threshold signature is an important branch of the common digital signature and is a combination of the threshold secret sharing technology and the digital signature. The traditional signature scheme can be realized by adopting an RSA algorithm. The RSA algorithm is an asymmetric encryption algorithm, proposed together in 1977 by ronard listeriost (Ron Rivest), addi samor (Adi Shamir) and lunard Adleman (Leonard Adleman). The RSA algorithm can complete decryption without directly transmitting the key, so that the information security can be ensured, and meanwhile, the risk of information cracking caused by directly transmitting the key is avoided. The RSA includes a private key and a public key, which are paired. After one piece of information is encrypted by the public key, the information can only be decrypted by the corresponding private key; similarly, a message is encrypted by a private key and then decrypted only by the corresponding public key. This is due to the fact that there is a correlation between the private and public keys in pairs in mathematical theory, for example, one underlying principle is that it is relatively simple to find two large prime numbers, and factoring the product of them is extremely difficult, so that the product can be disclosed as an encryption key, thereby ensuring security. The private key is typically kept strictly secret and cannot be revealed, while the public key is public (and can be held by multiple people). Because the private key is strictly kept secret by the holder, the signature of the holder of the private key cannot be forged by other people on the premise that the other people cannot obtain the private key.
The RSA signature mechanism can ensure the integrity of the message in the transmission process. For example, node a needs to transmit a message to node B, and may pass through several node relays in between. A may employ the RSA signature mechanism to transmit the message along with the signature to B via a number of intermediate nodes, and the verification of the signature by B may be confident that the received message was sent by a and not tampered with during transmission. One process of RSA signature is as follows:
b 1: a generates a pair of keys (public key and private key), the private key is not public, and the private key is reserved by itself. The public key is public and can be obtained by anyone.
b 2: a signs the hash value of the original message by using the private key of the A, and transmits the original message and the signing result to B. As previously mentioned, this transfer process may be forwarded through several intermediate nodes.
The hash algorithm, also called hash algorithm, can map the original content into a sequence of fixed length, which is the hash value. There are hash algorithms such as sha256, sha384, sha512, etc. The result of sha256 is 256 bits, which can represent 256 powers of the original content of 2. Similarly, the result for sha384 is 384bits, and the result for sha512 is 512 bits. These hash algorithms can be applied to original content with more contents and larger volume, and thus the hash value can be relatively much smaller than that of the original content. The good hash algorithm can ensure that different original contents are mapped into different hash values with a maximum probability, and the mapping is disordered, namely the relevance of the hash values obtained by the different original contents cannot be predicted; but also are anti-adversity, i.e. the original content cannot be obtained by backward pushing the hash value.
The original message may have more contents and a larger volume, and it may be time-consuming and computationally intensive to directly perform signature computation on the original message by using a private key. Therefore, the original message can be calculated to a hash value by adopting a hash algorithm, so that the hash value has a smaller length and can completely represent the original message. And then, carrying out encryption calculation on the hash value by adopting a private key, wherein the obtained result is the signature.
b 3: and B, after receiving the message, adopting the public key of A to check the signature.
On one hand, the hash value of the original message can be calculated by the B through the same hash algorithm as the A, and the hash value is calculated as hash 1; and on the other hand, B performs decryption calculation on the signature result by adopting the public key of A to obtain a hash 2. If the hash1 is the same as the hash2, it can be determined that the received original packet is sent by A and has not been tampered with in the transmission process.
The threshold signature scheme includes 1 total public key and n public and private key pairs. The 1 public key in each public-private key pair is called a public key share and the 1 private key in each public-private key pair is called a private key share. Secondly, there is a recovery function corresponding to the total public key and n public-private key pairs, which can recover the signature shares signed by at least a threshold number of different private key shares into a complete signature, and the generated complete signature can be verified as correct by the 1 total public key. Any signature shares less than the threshold number cannot be recovered from generating the full signature.
In addition to the RSA-based threshold Signature mechanism, a threshold Signature mechanism based on ECDSA (Elliptic Curve Digital Signature Algorithm), a threshold Signature mechanism based on Schnorr (a knowledge proof mechanism based on discrete logarithm puzzle), a threshold Signature mechanism based on BLS (Boneh-Lynn-Shacham Signature), and the like may be adopted.
It should be noted that, for the threshold signatures used in the block chain, the number of private key shares may be equal to the number of the first nodes, and the number of the least signature shares (i.e., the number of thresholds) for the recovery function to generate a complete signature may be equal to quorum in the PBFT algorithm. Of course, the number of the private keys may not be equal to the number of the first nodes, and the number of the minimum signature shares of the recovery function to generate the complete signature may not be equal to quorum in the PBFT algorithm. The former is described below as an example.
The 1 total public key and the n public and private key pairs can be generated by a centralized dealer and distributed to the n first nodes of the blockchain, which belongs to a centralized key distribution mode. Thus, in conjunction with the consensus algorithm, the n private key shares may be one of the first nodes holding per blockchain. Meanwhile, each blockchain first node may hold the same 1 total public key. In addition, there is a decentralized key distribution mode, i.e. dealer is removed, but n public and private key pairs and 1 total public key are obtained by n first nodes through negotiation of keys, each first node still holds one of n private key shares separately, and each first node holds the same total public key.
By adopting a threshold signature algorithm, each first node can adopt a private key (for example, in a block chain network which comprises 4 nodes and adopts a PBFT as a consensus algorithm, the private key shares of the nodes 0, 1, 2 and 3 which adopt the threshold signature algorithm are sk0, sk1, sk2 and sk3 respectively, and subscript numbers can represent the numbers of the nodes) to sign an original message which comprises the specific value of an original transaction list in the consensus, so as to obtain a signature result. Here, the unique value of the original transaction list may be used as the original message for which the signature is intended.
The unique value of the original transaction list may include the original transaction list itself or a hash value of the original transaction list. Generally, the transaction contents are different for different transactions, and thus, different original transaction lists or hash values thereof are generally different. Therefore, the original message may include at least the original transaction list or the hash value thereof, so that the property of the hash function is sufficient to distinguish the random number seeds generated after the consensus process corresponding to different blocks is completed.
Considering that a number is generated for the content of this consensus in the process of consensus, if the consensus is completed, the generated number can be used as the block number of the block corresponding to this consensus, and therefore, the block number (i.e., the number) can also be used as the content in the original message. No matter whether the original transaction list contained in the (N + 1) th block is the same as the original transaction list contained in the nth block, the block generation is sequential, which can be embodied as that the block number of the next block is the block number +1 of the previous block. Therefore, the block number is used as the content in the original message, even if the original transaction list contained in the (N + 1) th block is the same as the original transaction list contained in the nth block, different signatures are obtained by each node based on the (original transaction list + block number) by adopting the own private key, the master node still cannot be signed with other nodes, so that the complete signature of the (N + 1) th block cannot be predicted, therefore, the master node cannot predict the random number seed of the (N + 1) th block by using the published random number seed of the (N) th block, and the purpose of unpredictable is achieved. Similarly to the numbering, the time stamp is also specific to one block, and the time stamp of the following block follows the previous block. Therefore, the time stamp can also be the content in the original message.
In addition to the unique value of the original transaction list, the signed object may also have other content added, such as the random number seed generated in the previous block, i.e., the random number seed generated in the previous block may also be included in the original message. After the aforementioned a140 is performed, each node may generate the mth block based on the common transaction data, as described above. Since the mth block is generated by each node independently in the local area, if the hash values of the previous block generated by each node are not broadcast to each other among the link points of the block and compared, each node may not be able to determine whether the mth blocks generated in the block chain network are the same or whether the mth blocks generated on at least one of the quorum number of first nodes are the same from the viewpoint of the availability of the block chain system as a whole. Through the generation process of the random number seeds in the application, the random number seeds in the same block should be the same, and the random number seeds in different blocks should be different, so that the random number seeds can be added into the original message. Therefore, if the random number seeds corresponding to the mth block generated by each node are different, according to the property of the threshold signature algorithm, a complete signature may not be obtained by a recovery function method in the process of generating the random number seeds of the (m + 1) th block, so that the first node can be helped to confirm whether the previous block is consistent or not according to the scheme of the application. The hash value of the previous block can be used to replace the random number seed of the previous block, and since the hash value of one block is generally unique, the first node can also be helped to confirm whether the previous block is consistent.
And signing the original message containing the special value of the original transaction list in the consensus by adopting the own private key share, wherein the special value of the original transaction list which can be included in the original message can be the original transaction list. The original transaction list is generally already broadcast in the PP phase of the PBFT, and the commit message broadcast in the C phase is smaller, which is more favorable for propagation and bandwidth saving, so the unique value of the original transaction list can be the hash value of the original transaction list.
For the case that the original message includes multiple contents, for example, a hash value of the original transaction list, a block number, and a random number seed generated in a previous block, the hash value of the original message may be calculated first, and then the hash value of the original message is signed by using a private key share, so as to obtain a signature result.
And signing the original message, wherein the generated signature result and the original message can be added into the broadcast commit message. Thus, in the commit phase, each of the nodes participating in the consensus sends a commit message to the other first nodes and adds the commit message sent by itself to the local Log (representing its approval), and each node also receives commit messages broadcast by the other nodes.
Next, in step 44, after collecting all the submission messages of at least the threshold number, each first node obtains the complete signature by passing the signature shares of at least the threshold number through the recovery method corresponding to the private key shares generated by the threshold signature algorithm.
As described above, in the application of the threshold signature algorithm, 1 public key pair and n public and private key pairs may be generated, and recovery functions corresponding to the n public and private key pairs may be generated. As mentioned above, the recovery function may recover at least a threshold number of signatures that are verified to be correct to generate a complete signature, and the threshold value of the threshold signature algorithm, i.e. the threshold number, may be set as w. Of course, a complete signature can be generated by the recovery function when there are more than w correct signatures. That is, when the number of correct signatures is greater than or equal to the threshold number w, a complete signature can be generated by the recovery function, and the generated complete signature is determined and will not change due to the number of correct signatures input (as long as the number is greater than or equal to w).
This generated complete signature can be verified for correctness by the 1 total public key. In this way, any node or other device holding the total public key can use the total public key to verify the correctness of the full signature. For example, after the node 1 generates the complete signature, the integrity of the complete signature may be verified by using the total public key, for example, the complete signature is subjected to a cryptographic operation by using the total public key to obtain a first hash, and the original packet is subjected to a hash operation to obtain a second hash, and if the first hash is consistent with the second hash, the integrity of the complete signature may be determined. The integrity includes that the complete signature is for the original message and the original message has not been tampered with. For another example, after the node 1 generates the complete signature, the total public key, and the original packet may be sent to a device outside the block chain, and the device may use the total public key and the original packet to verify the correctness of the complete signature, which is not described in detail in the same principle. The message text here is still the aforementioned content containing the unique value of the original transaction list in this consensus, or further includes the block number and/or the timestamp of the current block and/or the random number seed generated in the previous block.
In addition, after each commit message is collected by each first node, the signature shares in the received commit messages are verified by adopting the corresponding public key shares, and then the signature shares of at least the threshold number are subjected to a recovery function corresponding to the private key shares generated by the threshold signature algorithm to obtain a complete signature. Compared with a mode of verifying the generated complete signature by adopting the total public key, the mode of verifying each signature share by adopting the public key shares and recovering the signature into the complete signature by a recovery function after the verification is passed can determine which signature is wrong, thereby determining which node is possibly a rogue node.
In the threshold signature algorithm, each first node has 1 public key and 1 private key share and corresponding 1 public key share in n public and private key pairs, which may be generated and distributed by the dealer or negotiated by each first node, as described above.
Each first node may verify the signature shares in the received commit message with the corresponding public key shares. In particular, for example in a federation chain employing a PBFT consensus algorithm containing 4 first nodes, node 0 broadcasts in step 42 a self-generated signature share σ to nodes 1, 2, 33,0Where σ is3,0 Subscript 3 of (a) may indicate a block number, 0 may indicate that this is a signature share of node 0; in step 44, node 0 also receives the signature shares σ broadcast by nodes 1 and 2, respectively3,1、σ3,2. Thus, node 0 has collected at least 3 signature shares, including its own broadcast signature share σ3,0And the signature share σ broadcast by the nodes 1, 23,1、σ3,2. Of course, node 0 may also collect all the signature shares σ3,0、σ3,1、σ3,2And σ3,3This, of course, also satisfies at least the quorum number.
Further, node 0 may verify the collected σ with the corresponding public key share3,0、σ3,1、σ3,2Or also includes sigma0,3(or is σ)3,0、σ3,1、σ3,3Or also includes sigma3,2Or is σ3,1、σ3,2、σ3,3Or also includes σ3,0Or is σ3,0、σ3,2、σ3,3Or also includes sigma3,1) Is correctAnd (4) sex. In particular, for example, node 0 may employ a corresponding public key share to share σ for the signature3,1Calculating to obtain a hash value which is recorded as hash3,1(ii) a Node 0 can also perform the same hash calculation on the original message to obtain hash'3,1. If hash3,1And hash'3,1And the original message is proved to be sent by the node 1 and has not been tampered in the transmission process. Thus, σ3,1The correctness of the test is verified. Similarly, node 0 may be paired with σ3,2And the verification is performed, which is not described in detail.
Likewise, node 1 may verify the collected σ with the corresponding public key share3,0、σ3,1、σ3,2Or also includes sigma3,3(or is σ)3,0、σ3,1、σ3,3Or also includes sigma3,2Or is σ3,1、σ3,2、σ3,3Or also includes sigma3,0Or is σ3,0、σ3,2、σ3,3Or also includes sigma3,1) The correctness of the data.
Likewise, node 2 may verify the collected σ with the corresponding public key share3,0、σ3,1、σ3,2Or also includes sigma3,3(or is σ)3,0、σ3,1、σ3,3Or also includes sigma3,2Or is σ3,1、σ3,2、σ3,3Or also includes sigma3,0Or is σ3,0、σ3,2、σ3,3Or also includes sigma3,1) The correctness of the operation.
Likewise, node 3 may verify the collected σ with the corresponding public key share3,0、σ3,1、σ3,2Or also includes σ3,3(or is σ)3,0、σ3,1、σ3,3Or also includes sigma3,2Or is σ3,1、σ3,2、σ3,3Or also includes sigma3,0Or is σ3,0、σ3,2、σ3,3Or also includes sigma3,1) The correctness of the operation.
Next, at step 46: each first node obtains a random number seed based on the complete signature.
Random seed (random seed) refers to the initial value used in a pseudo-random number generator to generate a pseudo-random number. For a pseudo-random number generator, the same random number sequence can be obtained starting from the same random number seed. For a single machine, the random number seed may be determined by the current state of the computer, such as the current time. For distributed systems, the same random number seed is generated at each node, so that the same random number is generated based on the same random number seed in system contracts/service contracts/blockchain platform functions, etc., and should not be generated by any node in a way that it can manipulate, predict, revoke. This needs to be determined jointly by the nodes participating in the consensus. Moreover, considering that the distributed network is often an asynchronous network or a semi-synchronous network, from the viewpoint of instantaneity, it is also necessary that the random number can be generated and adopted when the transaction in the current block is executed.
Through the above processes of steps 42 to 46, each first node can normally obtain the same complete signature. Of course, in consideration of the fault tolerance characteristic of the distributed system, at least a quorum number of first nodes in the block chain network adopting the PBFT consensus algorithm can respectively obtain the same complete signature. Thus, based on the complete signature, each first node may generate a random number seed using the same random number seed generation algorithm. A simpler random number seed generation algorithm is, for example, the sha256 algorithm. Of course, the complete signature can also be used directly as a random number seed.
Through the above process, the random number seed/third random number can be generated on the block chain.
The block chain node currently serving as the consensus node may find the identities of the first nodes currently serving as the consensus node based on the set c1, so that the consensus node may also agree on the first transaction with the other first nodes except for itself based on the set c1, for example, agree on a consensus proposal containing the first transaction through the aforementioned various consensus mechanisms, and after the first nodes currently serving as the consensus node agree on the first transaction, that is, after the first nodes agree on the consensus proposal, the first nodes may generate a block containing the first transaction and update the world state by executing each transaction in the block.
Returning to FIG. 3, at step 34, the identity of the third node is replaced with the identity of the fourth node in the first set based on the first transaction. That is, after the plurality of first nodes currently serving as consensus nodes successfully achieve the consensus on the first transaction, each first node serving as the consensus node may execute the first transaction, and more specifically, execute the intelligent contract requested to be invoked based on the first transaction, thereby completing the replacement of the identifier of the third node with the identifier of the fourth node in the set c 1.
Also, as previously described, sets c2 may be stored in the contract state of an intelligent contract, with the identity of a fourth node possibly being located in some set c 2. Accordingly, in step 34, the replacement of the identifier of the fourth node with the identifier of the third node in the set c2 to which the identifier of the fourth node belongs may be specifically completed through the execution of the first transaction.
For a third node currently serving as a consensus node, after a plurality of first nodes complete consensus on consensus proposals including a first transaction, distributing consensus results to each second node corresponding to the third node; the third node also needs to update the world state based on the execution result of the first transaction to find itself as a non-consensus node based on the updated set c 1. For the fourth node currently serving as the non-consensus node, it may obtain consensus results obtained by a plurality of first nodes after achieving consensus on consensus proposals including the first transaction through the distribution methods of various consensus results exemplarily described above, and at least perform each transaction including the first transaction based on the consensus results to update the stored world state thereof, thereby discovering itself as a consensus node based on the updated set c 1.
Referring to fig. 5, Node 1, Node 2, Node 3 and Node 4, which are currently identified as consensus nodes, may update their respective stored world states, e.g., replace the identification of Node 1 with the identification of Node 11 at least in the set c1, so that Node 1 may find itself to no longer be identified as a consensus Node at a later time based on the set c 1. In addition, Node 1 may also distribute corresponding consensus results, for example, a block including the first transaction, to n corresponding nodes 11 to Node 1n, which are currently non-consensus nodes, so that Node 11 to Node 1n may execute each transaction including the first transaction based on the consensus results distributed by Node 1 to seven, and update the world state stored in itself, for example, replace the identifier of Node 1 with the identifier of Node 11 in at least set c1, so that Node 11 may discover that itself will be used as a consensus Node to execute corresponding consensus mechanisms with the remaining consensus nodes, such as Node 2, Node 3, and Node 4, in the subsequent time based on updated set c 1.
The block chain link point which is currently used as the consensus node can also receive a second transaction from other block chain nodes set by the user, and the second transaction request invokes an intelligent contract for indicating that a sixth node in the plurality of second nodes is set as the consensus node; the identity of the sixth node is then added to the first set based on the second transaction, thereby completing the addition of the consensus node in the blockchain system.
The block chain link point which is currently used as the consensus node can also receive a third transaction from the user equipment or other block chain nodes, and the third transaction request calls an intelligent contract for indicating that a seventh node in the plurality of first nodes is set as a non-consensus node; the identification of the seventh node is deleted in the first set based on the third transaction, thereby completing the reduction of consensus nodes in the blockchain system.
The block link points currently used as the consensus nodes may also alternate the fifth node in the random number node set, and the process of alternating the fifth node is similar to the method for alternating the consensus nodes, and is not described herein again.
Based on the same concept as the foregoing method embodiment, in this specification embodiment, a first node in a blockchain system is further provided, where the blockchain system includes a plurality of first nodes currently serving as common nodes and a plurality of second nodes currently serving as non-common nodes, an intelligent contract is deployed in the blockchain system, and a contract state of the intelligent contract stores a first set, where the first set includes identifiers of the plurality of first nodes. As shown in fig. 6, the first node includes: a transaction obtaining unit 62 configured to obtain a first transaction, where the first transaction request invokes the smart contract, and is used to instruct that a third node in the plurality of first nodes is set as a non-consensus node and a fourth node in the plurality of second nodes is set as a consensus node; a transaction execution unit 64 configured to replace the identity of the third node with the identity of the fourth node in the first set based on the first transaction.
In a possible embodiment, the transaction execution unit 64 is further configured to replace the identification of the third node with the identification of the fourth node in the first set based on the first transaction.
In one possible embodiment, the method further comprises: a consensus processing unit configured to agree on the first transaction based on the first set and remaining ones of the plurality of first nodes other than the block link point.
In one possible embodiment, the method further comprises: a random processing unit configured to generate a first random number and a second random number; and the node selection unit is configured to determine the third node from the plurality of first nodes according to the first random number and determine the fourth node from the plurality of second nodes according to the second random number.
In a possible implementation, the random number processing unit is further configured to obtain a third random number cooperatively generated by a plurality of fifth nodes, the fifth nodes being selected from the plurality of first nodes or the plurality of second nodes, and the first random number and the second random number being generated based on the third random number.
In a possible embodiment, the random number processing unit is configured to read the third random number from a newly generated block.
In a possible embodiment, the element of random number processing is configured to read the third random number from the newly generated block based on a preset time step or a block height increment.
In a possible embodiment, said plurality of fifth nodes are identical to said plurality of first nodes; in the submission stage of the PBFT corresponding to the newly generated block, each first node signs an original message containing a unique value of an original transaction list in the current consensus by adopting a private key share of the first node based on a threshold signature algorithm, generates a signature share and adds the signature share into a broadcast submission message; after collecting at least threshold number of submitted messages, each first node obtains a complete signature by passing the at least threshold number of signature shares through a recovery function corresponding to a private key share generated by the threshold signature algorithm; each first node obtains the third random number based on the complete signature.
Although one or more embodiments of the present description provide method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or end product executes, it may execute sequentially or in parallel (e.g., parallel processors or multi-threaded environments, or even distributed data processing environments) according to the method shown in the embodiment or the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in a process, method, article, or apparatus that comprises the recited elements is not excluded. For example, if the terms first, second, etc. are used to denote names, they do not denote any particular order.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
As will be appreciated by one skilled in the art, one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
One or more embodiments of the present description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the present specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment. In the description of the specification, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means 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 specification. 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.
The above description is merely exemplary of one or more embodiments of the present disclosure and is not intended to limit the scope of one or more embodiments of the present disclosure. Various modifications and alterations to one or more embodiments described herein will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of the present specification should be included in the scope of the claims.

Claims (19)

1. A rotation method of common nodes in a blockchain system, the blockchain system including a plurality of first nodes currently serving as common nodes and a plurality of second nodes currently serving as non-common nodes, an intelligent contract being deployed in the blockchain system, a contract state of the intelligent contract having a first set stored therein, the first set including identifications of the plurality of first nodes, the method being performed by the first nodes, the method comprising:
acquiring a first transaction, wherein the first transaction request calls the intelligent contract and is used for indicating that a third node in the plurality of first nodes is set as a non-consensus node and a fourth node in the plurality of second nodes is set as a consensus node;
replacing, in the first set, the identity of the third node with the identity of the fourth node based on the first transaction.
2. The method of claim 1, further comprising: consensus is made on the first transaction based on the first set and remaining first nodes of the plurality of first nodes.
3. The method of claim 1, the intelligent contract having a second set stored in a contract state, the second set including at least an identification of the fourth node; the method further comprises the following steps: replacing, in the second set, the identity of the fourth node with the identity of the third node based on the first transaction.
4. The method of any of claims 1-3, further comprising: generating a first random number and a second random number; and determining the third node from the plurality of first nodes according to the first random number, and determining the fourth node from the plurality of second nodes according to the second random number.
5. The method of claim 4, further comprising: obtaining a third random number cooperatively generated by a plurality of fifth nodes, the fifth nodes being selected from the plurality of first nodes or the plurality of second nodes, the first random number and the second random number being generated based on the third random number.
6. The method of claim 5, the obtaining a third random number cooperatively generated by a plurality of fifth nodes, comprising: the third random number is read from the newly generated block.
7. The method of claim 6, the reading the third random number from the most recently generated block, comprising: and reading the third random number from the newly generated block based on a preset time step or a block height increment.
8. The method of claim 5, the plurality of fifth nodes being identical to the plurality of first nodes; in a submission stage of a practical Byzantine fault-tolerant PBFT algorithm corresponding to the newly generated block, each first node signs an original message containing a specific value of an original transaction list in the consensus by adopting a private key share of the first node based on a threshold signature algorithm, generates a signature share and adds the signature share into a submitted message of a broadcast; after collecting at least threshold number of submitted messages, each first node obtains a complete signature by passing the at least threshold number of signature shares through a recovery function corresponding to a private key share generated by the threshold signature algorithm; each first node obtains the third random number based on the complete signature.
9. A first node in a blockchain system, the blockchain system including a plurality of first nodes currently serving as common nodes and a plurality of second nodes currently serving as non-common nodes, an intelligent contract being deployed in the blockchain system, a contract state of the intelligent contract having a first set stored therein, the first set including identifications of the plurality of first nodes, the first node comprising:
a transaction obtaining unit configured to obtain a first transaction, where the first transaction request invokes the smart contract, and is used to instruct a third node of the plurality of first nodes to be set as a non-consensus node and a fourth node of the plurality of second nodes to be set as a consensus node;
a transaction execution unit configured to replace the identity of the third node with the identity of the fourth node in the first set based on the first transaction.
10. The first node of claim 9, the transaction execution unit further configured to replace the identity of the third node with the identity of the fourth node in the first set based on the first transaction.
11. The block link point of claim 9, further comprising: a consensus processing unit configured to agree on the first transaction based on the first set and remaining ones of the plurality of first nodes other than the block link point.
12. The first node of any of claims 9-11, further comprising: a random processing unit configured to generate a first random number and a second random number; and the node selection unit is configured to determine the third node from the plurality of first nodes according to the first random number and determine the fourth node from the plurality of second nodes according to the second random number.
13. The first node of claim 12, the random number processing unit further configured to obtain a third random number cooperatively generated by a plurality of fifth nodes, the fifth nodes being selected from the plurality of first nodes or the number of second nodes, the first random number and the second random number being generated based on the third random number.
14. The first node of claim 13, the random number processing unit configured to read the third random number from a most recently generated block.
15. The first node of claim 14, the random number processing element being configured to read the third random number from a newly generated block based on a predetermined time step or block height increment.
16. The first node of claim 13, the plurality of fifth nodes being identical to the plurality of first nodes; in a submission stage of a practical Byzantine fault-tolerant PBFT algorithm corresponding to the newly generated block, the first node signs an original message containing a specific value of an original transaction list in the consensus by adopting a private key share of the first node based on a threshold signature algorithm, generates a signature share and adds the signature share into a submitted message of a broadcast; after collecting the submission messages with at least threshold quantity, the first node obtains a complete signature by passing the signature shares with at least threshold quantity through a recovery function corresponding to the private key shares generated by the threshold signature algorithm; the first node obtains the third random number based on the complete signature.
17. A block chain system comprises a plurality of first nodes which are currently used as common nodes and a plurality of second nodes which are currently used as non-common nodes, wherein intelligent contracts are deployed in the block chain system, a first set is stored in contract states of the intelligent contracts, and the first set comprises identifications of the first nodes; the first node is used for obtaining a first transaction, and the first transaction request calls the intelligent contract and is used for indicating that a third node in the plurality of first nodes is set as a non-consensus node and a fourth node in the plurality of second nodes is set as a consensus node; replacing, in the first set, the identity of the third node with the identity of the fourth node based on the first transaction.
18. A computer-readable storage medium having stored thereon a computer program which, when executed in a computing device, causes the computing device to perform the method of any of claims 1-8.
19. A computing device comprising a memory having stored therein a computer program and a processor that, when executing the computer program, implements the method of any of claims 1-8.
CN202210333393.2A 2022-03-31 2022-03-31 Rotation method of common nodes in block chain system, nodes and block chain system Pending CN114710504A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210333393.2A CN114710504A (en) 2022-03-31 2022-03-31 Rotation method of common nodes in block chain system, nodes and block chain system
PCT/CN2022/135275 WO2023185046A1 (en) 2022-03-31 2022-11-30 Method for rotating consensus nodes in blockchain system, and nodes and blockchain system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210333393.2A CN114710504A (en) 2022-03-31 2022-03-31 Rotation method of common nodes in block chain system, nodes and block chain system

Publications (1)

Publication Number Publication Date
CN114710504A true CN114710504A (en) 2022-07-05

Family

ID=82170101

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210333393.2A Pending CN114710504A (en) 2022-03-31 2022-03-31 Rotation method of common nodes in block chain system, nodes and block chain system

Country Status (2)

Country Link
CN (1) CN114710504A (en)
WO (1) WO2023185046A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023185046A1 (en) * 2022-03-31 2023-10-05 蚂蚁区块链科技(上海)有限公司 Method for rotating consensus nodes in blockchain system, and nodes and blockchain system
WO2024066012A1 (en) * 2022-09-30 2024-04-04 蚂蚁区块链科技(上海)有限公司 Method and apparatus for converting peer type in blockchain system, and blockchain system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018111295A1 (en) * 2016-12-16 2018-06-21 Hitachi, Ltd. Blockchain monitoring and management
CN108810077A (en) * 2018-04-19 2018-11-13 深圳市网心科技有限公司 Block chain common recognition processing method, electronic device and computer readable storage medium
CN111444210A (en) * 2020-03-26 2020-07-24 腾讯科技(深圳)有限公司 Block chain consensus node management method, device, equipment and storage medium
CN111556120A (en) * 2020-04-23 2020-08-18 财付通支付科技有限公司 Data processing method and device based on block chain, storage medium and equipment
CN112132579A (en) * 2020-09-30 2020-12-25 深圳前海微众银行股份有限公司 Block chain consensus node updating method and device
CN112953981A (en) * 2019-11-26 2021-06-11 北京沃东天骏信息技术有限公司 Node selection method, block chain consensus method, device, system and equipment
CN113837758A (en) * 2021-09-27 2021-12-24 深圳前海微众银行股份有限公司 Consensus method and device for block chain system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11797866B2 (en) * 2018-07-18 2023-10-24 Salesforce.Com, Inc. Systems and methods for accelerating execution of processes based on artificial intelligence (AI) prediction of blockchain consensus
CN111464353B (en) * 2020-03-31 2022-12-09 财付通支付科技有限公司 Block link point management method, device, computer and readable storage medium
CN114710504A (en) * 2022-03-31 2022-07-05 蚂蚁区块链科技(上海)有限公司 Rotation method of common nodes in block chain system, nodes and block chain system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018111295A1 (en) * 2016-12-16 2018-06-21 Hitachi, Ltd. Blockchain monitoring and management
CN108810077A (en) * 2018-04-19 2018-11-13 深圳市网心科技有限公司 Block chain common recognition processing method, electronic device and computer readable storage medium
CN112953981A (en) * 2019-11-26 2021-06-11 北京沃东天骏信息技术有限公司 Node selection method, block chain consensus method, device, system and equipment
CN111444210A (en) * 2020-03-26 2020-07-24 腾讯科技(深圳)有限公司 Block chain consensus node management method, device, equipment and storage medium
CN111556120A (en) * 2020-04-23 2020-08-18 财付通支付科技有限公司 Data processing method and device based on block chain, storage medium and equipment
CN112132579A (en) * 2020-09-30 2020-12-25 深圳前海微众银行股份有限公司 Block chain consensus node updating method and device
CN113837758A (en) * 2021-09-27 2021-12-24 深圳前海微众银行股份有限公司 Consensus method and device for block chain system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023185046A1 (en) * 2022-03-31 2023-10-05 蚂蚁区块链科技(上海)有限公司 Method for rotating consensus nodes in blockchain system, and nodes and blockchain system
WO2024066012A1 (en) * 2022-09-30 2024-04-04 蚂蚁区块链科技(上海)有限公司 Method and apparatus for converting peer type in blockchain system, and blockchain system

Also Published As

Publication number Publication date
WO2023185046A1 (en) 2023-10-05

Similar Documents

Publication Publication Date Title
US10067810B2 (en) Performing transactions between application containers
US20210004366A1 (en) Methods and systems for controlling access to, and integrity of, resources on a blockchain
WO2023185046A1 (en) Method for rotating consensus nodes in blockchain system, and nodes and blockchain system
CN111625593A (en) Data processing method and device based on block chain and computer equipment
WO2014112548A1 (en) Secure-computation system, computing device, secure-computation method, and program
JP2021515271A (en) Computer-based voting process and system
CN113612604B (en) Asynchronous network-oriented safe distributed random number generation method and device
JP3910538B2 (en) How to share a secret verifiably in a potentially asynchronous network
Wan et al. HIBEChain: A hierarchical identity-based blockchain system for large-scale IoT
Buchnik et al. Fireledger: A high throughput blockchain consensus protocol
KR20230078767A (en) Redistribution of secret shares
Fu et al. Privacy-preserving composite modular exponentiation outsourcing with optimal checkability in single untrusted cloud server
CN114640451A (en) Method, system and consensus node for realizing distributed key generation on block chain
US20150023498A1 (en) Byzantine fault tolerance and threshold coin tossing
Kate et al. Flexirand: Output private (distributed) vrfs and application to blockchains
CN113988831A (en) Transfer method based on alliance chain
US20230318857A1 (en) Method and apparatus for producing verifiable randomness within a decentralized computing network
CN111784338A (en) Information processing method, device, system and storage medium
CN114362958B (en) Intelligent home data security storage auditing method and system based on blockchain
RU2452111C1 (en) Method for threshold key generating for protection system based on identity data
Cachin State machine replication with Byzantine faults
CN115174069A (en) Mimicry distributed SM9 rapid identification key generation method and system
CN114884968A (en) Situation awareness method based on block chain privacy transaction and related device
CN114398651A (en) Secret data sharing method and distributed system
CN115296843B (en) Transaction execution method, first node and second node in blockchain system

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20220705