CN115664714B - Anonymous selection committee method, system and medium based on TEE (terminal equipment) on blockchain - Google Patents
Anonymous selection committee method, system and medium based on TEE (terminal equipment) on blockchain Download PDFInfo
- Publication number
- CN115664714B CN115664714B CN202211158843.5A CN202211158843A CN115664714B CN 115664714 B CN115664714 B CN 115664714B CN 202211158843 A CN202211158843 A CN 202211158843A CN 115664714 B CN115664714 B CN 115664714B
- Authority
- CN
- China
- Prior art keywords
- node
- committee
- block
- trusted
- anonymous
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 30
- 238000013507 mapping Methods 0.000 claims abstract description 32
- 238000012856 packing Methods 0.000 claims abstract description 4
- 238000012795 verification Methods 0.000 claims description 14
- 238000004590 computer program Methods 0.000 claims description 11
- 230000006870 function Effects 0.000 claims description 8
- 238000003860 storage Methods 0.000 claims description 6
- 230000007246 mechanism Effects 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 11
- 238000005516 engineering process Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 2
- 241001589086 Bellapiscis medius Species 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005304 joining Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Landscapes
- Storage Device Security (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a method, a system and a medium for anonymity selection committee based on TEE on a blockchain, which comprises the steps of generating trusted anonymity numbers for all nodes through a numbering module in a TEE environment of a main node, packing mapping relations between original numbers of the nodes and the trusted anonymity numbers into numbering blocks and linking the numbering blocks, and determining own trusted anonymity numbers by each node according to the linking numbering blocks; when the blockchain needs to execute the consensus selection committee, each node generates the same pseudo-random sequence to represent a committee list based on the same parameters and the same pseudo-random algorithm; each node respectively compares the pseudo-random sequence with the own trusted anonymous number to judge whether the node is a committee node or not. The invention combines the TEE safety mechanism of the computer with the existing Bayesian-preemption fault-tolerant consensus method, and has the advantages of safety, reliability, good portability and dynamic expansion.
Description
Technical Field
The invention relates to a blockchain technology in the field of computers, in particular to a method, a system and a medium for anonymizing selection committee based on TEE on a blockchain.
Background
In the increasingly popular large environment of internet + applications, a large number of applications need to record the events, behaviors and states that occur permanently for later inquiry, and at the same time, there is no complete trust relationship between the parties involved in the transaction, and a typical application scenario is electronic money. However, there are two major dilemmas with traditional payment and billing approaches: the third party payment mechanism on which the payment depends has a huge risk of funds exposure; the centralized accounting node has huge risk of being attacked and diverged, and the risk cannot be effectively eliminated. The blockchain is used as a distributed network protocol for constructing a deterministic trust relationship on the premise of uncertainty, has the basic characteristics of openness, collaboration, sharing, tamper resistance, traceability and the like, and is very likely to remodel the payment paradigm of the whole digital space.
The consensus algorithm is the key to the blockchain technique. Compared with the conventional currency transaction system VISA which can process tens of thousands of transactions per second, the throughput rate of 7 TPS and the confirmation delay of 6 blocks brought by the POW consensus algorithm enable the VISA to far not meet the commercial-grade requirements. In order to solve the performance problem of the block chain consensus algorithm, a large amount of related work attempts to elect the committee to reduce the consensus scale and obtain more efficient consensus. However, the committee election mechanism also introduces security issues, as the action of election violates real desire the blockchain itself is decentralised, the attack objective of an attacker is also reduced. Therefore, how to ensure that the committee is unpredictable at random and protect the committee anonymity from being attacked becomes a problem to be solved urgently.
Disclosure of Invention
The currently emerging TEE technology utilizes the hardware support of the bottom layer of a computer to provide a strongly isolated trusted execution environment such as a CPU, a memory, a Cache and the like for upper-layer software, and the CPU has higher running level, thereby providing a trust foundation for constructing a safe and trusted computing environment for the upper-layer software. Currently, security technologies break through in aspects of operating system monitoring, trusted computing and the like based on TEE, and with the advancement of technical research, more and more operating system services and applications depend on TEE to perform security enhancement. Therefore, the method for realizing the credible enhancement of the block chain consensus algorithm based on the TEE technology has good application prospect, and is a key technical problem to be researched urgently. The invention aims to solve the technical problems: the method, the system and the medium for anonymizing selection committee based on the TEE on the blockchain are provided by combining the TEE safety mechanism of the computer with the existing Bayesian fault tolerance consensus method, and have the advantages of safety, reliability, good portability and dynamic expansion.
In order to solve the technical problems, the invention adopts the following technical scheme:
A TEE-based anonymous selection committee method on a blockchain, comprising:
S101, generating trusted anonymous numbers for all nodes through a numbering module in a TEE environment of a master node, packing mapping relations between original numbers of the nodes and the trusted anonymous numbers into a numbering block, directly uploading the numbers if the numbering block is an originating block, otherwise, executing consensus on the numbering block and uploading the numbers, and determining own trusted anonymous numbers by each node according to the numbering block after uploading;
S102, when the blockchain needs to execute a consensus selection committee, each node generates the same pseudo-random sequence based on the same parameter and the same pseudo-random algorithm, wherein the value range of elements in the pseudo-random sequence is consistent with the value range of the trusted anonymous numbers of the nodes, and the number of the elements is equal to the number of the committees, so that the pseudo-random sequence is represented as a committee list; each node compares the pseudo random sequence with the own credible anonymous number, and if the pseudo random sequence is matched with the element in the pseudo random sequence, the node is determined to be a committee node.
Optionally, the value range of the elements in the pseudo-random sequence is [0 to the number of nodes in the system ].
Optionally, when the nodes generate the same pseudo-random sequence based on the same parameters, the same parameters include a comprehensive character string obtained by connecting the hash value, the round number and the consensus phase of the last block, a maximum number of nodes and a committee number, and the step of generating the same pseudo-random sequence includes:
S201, initializing a pseudo random sequence List to be empty;
S202, connecting the hash value, the round number and the consensus stage of the last block to obtain a comprehensive character string, taking the comprehensive character string as a seed of a Meissen rotation algorithm, generating a random number R by utilizing the Meissen rotation algorithm, carrying out modular operation on a node maximum number N by using the random number R to obtain a modular operation result R, wherein the value range of the modular operation result R is 0 to N-1, mapping the random number R into a certain node number in the system through modular operation, repeating the step S202 if the modular operation result R appears in a pseudo-random sequence List, otherwise, adding the pseudo-random sequence R into the pseudo-random sequence List;
S203, if the size of the pseudo-random sequence List is equal to the number of committees, ending and outputting the pseudo-random sequence List; otherwise, the step 2 is skipped to continue to generate a pseudo-random sequence List.
Optionally, the execution condition for generating the trusted anonymous numbers for all nodes by the numbering module in the TEE environment of the master node in step S1 is at system initialization and at x data chunks specified per uplink.
Optionally, the functional expression of the mapping relationship between the original number of the node and the trusted anonymous number in step S1 is:
ha,hb,i->indexi
Wherein h a and h b respectively represent heights of blocks in the blockchain, i- > indexi represents a trusted anonymous number corresponding to an i-th node as indexi, and the function expression represents a trusted anonymous number corresponding to an i-th node in x data blocks between heights a-b in the blockchain as indexi.
Optionally, in step S1, when the mapping relationship between the original number of the node and the trusted anonymous number thereof is packaged as a numbered block, a hash value is calculated for any ith node, including calculating a mapping relationship between the original number of the ith node and the trusted anonymous number thereof, encrypting the mapping relationship by using the TEE public key of the ith node, and after the mapping relationship encrypted by all the current nodes of the system is packaged as a numbered block with the corresponding hash value, signing the whole numbered block by using the TEE private key of the master node.
Optionally, the step of performing the consensus on the numbered blocks in step S101 and the step of performing the consensus on the blockchain in step S102 includes:
S401, each node locally executes a selection committee operation of a proposal phase and a voting phase to judge whether the node is selected as a master node of the proposal phase or a committee node of the voting phase, each node calls a selection committee module to obtain a consistent pseudo-random sequence, a node corresponding to a first trusted number in the pseudo-random sequence is the master node, and the rest nodes are committee nodes; the master node packs the transaction from the transaction pool into a new block or acquires a block from a locally locked block which does not reach consensus, so as to obtain a block v which needs to execute the consensus in the round, wherein the block v is a transaction block or a numbering block, and the master node generates a proposal message according to the block v, adds a trusted anonymous number of the master node and broadcasts the proposal message; each committee node judges whether to receive the proposal message or not based on the set timeout period, if not, the committee node votes for the proposal message, and if not, the committee node votes for the legal proposal message, otherwise, the committee node empties; adding a trusted anonymous number of the voting message to the voting message and broadcasting the voting message;
S402, each node locally executes a selection committee operation in a pre-commit stage, then each committee node in the pre-commit stage judges whether voting messages are received or not based on a set timeout period, if the number of legal voting messages which are not received overtime exceeds a set proportion, pre-commit messages are generated and broadcast, otherwise pre-commit blank tickets are generated and broadcast; the legal voting message means that the signature of the voting message passes through the verification, and the validity of the trusted anonymous number added on the voting message passes through the verification;
S403, all nodes judge whether pre-submitted messages are received or not based on a set timeout period, if the number of the pre-submitted messages which are legal and are not received overtime exceeds a set proportion, the block v is submitted to be uplink, otherwise, the block v is judged to fail in the round of common identification, the legal pre-submitted messages are the signature verification of the pre-submitted messages and the validity verification of the trusted anonymous numbers attached to the pre-submitted messages.
Optionally, determining, by each node in step S101, the own trusted anonymous number according to the number block after the uplink includes: after each node is in the uplink of the numbered block, verifying the numbered block of the uplink by using the TEE public key of the corresponding master node, taking out the transaction in the numbered block, and decrypting by using the TEE private key of the transaction to obtain the trusted anonymous number of the transaction; when any committee needs to vote, adding a trusted anonymous number of the committee to the original consensus voting message for broadcasting, checking the validity of the trusted anonymous number of the committee node by the numbered blocks after other nodes receive the message, and counting the votes passing the checking, otherwise discarding the votes; after any node i receives the voting message from another any node j, the node i performs validity check of the trusted anonymous number attached to the voting message, including: the node i analyzes the added trusted anonymous number in the message, uses the number to construct the mapping relation between the original number of the node j and the trusted anonymous number thereof, calculates the hash value of the mapping relation, compares the hash value with the hash value corresponding to the node j on the latest numbered block, and if the comparison result is consistent, the committee identity of the node j is verified by the node i, and the voting is legal.
In addition, the invention also provides a TEE-based anonymous selection committee system on a blockchain, which comprises a microprocessor and a memory which are connected with each other, wherein the microprocessor is programmed or configured to execute the steps of the TEE-based anonymous selection committee method on the blockchain.
Furthermore, the present invention provides a computer readable storage medium having stored therein a computer program for programming or configuring by a microprocessor to perform the steps of a TEE-based anonymity selection committee method on the blockchain.
Compared with the prior art, the invention has the following advantages: generating trusted anonymous numbers for all nodes through a numbering module in a TEE environment of a master node, packaging the mapping relation between the original numbers of the nodes and the trusted anonymous numbers into a numbering block and uploading the numbering block, and determining the trusted anonymous numbers of the nodes according to the numbering block after uploading; when the blockchain needs to execute the consensus selection committee, each node generates the same pseudo-random sequence to represent a committee list based on the same parameters and the same pseudo-random algorithm; each node respectively compares the pseudo-random sequence with the own trusted anonymous number to judge whether the node is a committee node or not. The invention can realize the selection of fixed number committee by combining the TEE safety mechanism of the computer with the existing Bayesian fault-tolerant consensus method, and can reduce the message complexity to the original m/n by combining a plurality of BFT consensus algorithms, wherein m is the number of committees and n is the number of system nodes, and the invention has the advantages of safety, reliability, good portability, dynamic expansion and high performance.
Drawings
FIG. 1 is a schematic diagram of a basic flow of a method according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of a data format of a numbered block according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of updating an anonymous number of each node after numbering a block uplink according to an embodiment of the present invention.
FIG. 4 is a schematic diagram illustrating steps for performing consensus in an embodiment of the present invention.
Detailed Description
As shown in fig. 1, the anonymity selection committee method based on TEE on blockchain of the present embodiment includes:
S101, generating trusted anonymous numbers for all nodes through a numbering module in a TEE environment of a master node, packing mapping relations between original numbers of the nodes and the trusted anonymous numbers into a numbering block, directly uploading the numbers if the numbering block is an originating block, otherwise, executing consensus on the numbering block and uploading the numbers, and determining own trusted anonymous numbers by each node according to the numbering block after uploading;
S102, when the blockchain needs to execute a consensus selection committee, each node generates the same pseudo-random sequence based on the same parameter and the same pseudo-random algorithm, wherein the value range of elements in the pseudo-random sequence is consistent with the value range of the trusted anonymous numbers of the nodes, and the number of the elements is equal to the number of the committees, so that the pseudo-random sequence is represented as a committee list; each node compares the pseudo random sequence with the own credible anonymous number, and if the pseudo random sequence is matched with the element in the pseudo random sequence, the node is determined to be a committee node.
In this embodiment, the value range of the elements in the pseudo-random sequence is [0 to the number of nodes in the system ]. In addition, the upper boundary of the range of values may be less than the number of nodes in the system, so long as the minimum number required for blockchain consensus is met.
In step S101, the master node and the other nodes are both blockchain nodes, and the master node may be manually specified or may be determined by a blockchain consensus algorithm, and the specific determination manner is not discussed in this embodiment. To enhance the security of the blockchain, the nodes of the blockchain need to authenticate to a CA (authentication center) before joining the blockchain system, and each node in the system is classified into TEE and re environments. The CA issues a public-private key pair to the node's TEE, which public key is included in the certificate issued to the TEE by the CA, which private stores its own private key.
In this embodiment, when each node generates the same pseudo-random sequence based on the same parameter, the same parameter includes a comprehensive string obtained by connecting the hash value, the round number and the consensus phase of the previous block, and three parameters including a maximum number of nodes and a committee number, and the step of generating the same pseudo-random sequence includes:
S201, initializing a pseudo random sequence List to be empty;
S202, connecting the hash value, the round number and the consensus stage of the last block to obtain a comprehensive character string, taking the comprehensive character string as a seed of a Meissen rotation algorithm, generating a random number R by utilizing the Meissen rotation algorithm, carrying out modular operation on a node maximum number N by using the random number R to obtain a modular operation result R, wherein the value range of the modular operation result R is 0 to N-1, mapping the random number R into a certain node number in the system through modular operation, repeating the step S202 if the modular operation result R appears in a pseudo-random sequence List, otherwise, adding the pseudo-random sequence R into the pseudo-random sequence List; it should be noted that, the generation of the random number r based on the seed meisen rotation algorithm (MERSENNE TWISTER) is an existing method, and its specific implementation is not described in detail herein;
S203, if the size of the pseudo-random sequence List is equal to the number of committees, ending and outputting the pseudo-random sequence List; otherwise, the step 2 is skipped to continue to generate a pseudo-random sequence List.
In this embodiment, in step S1, the execution condition for generating the trusted anonymous numbers for all the nodes by the numbering module in the TEE environment of the master node is that the value of x can be dynamically set when the system is initialized and when x data blocks are designated in each uplink, so that the system implementation is more flexible.
The present embodiment designs a numbering block different from the normal transaction data block (data block) for storing anonymous numbering information. Fig. 2 is a schematic diagram of a data format of a numbered block in the present embodiment. In fig. 2, the fields { h1, h2, i- > indexi } indicate that the node i is indexi when the heights h 1 to h 2 are commonly known, in order to ensure the anonymity of the numbers, the master node encrypts the fields and the signature with the TEE public key pk_i of the node i, then generates the hash value of the fields, and finally packages the hash value and the encrypted fields into the i-th transaction of the numbered block. The first numbered block is an originating block, and a master node directly uplinks without consensus; after the subsequent numbered blocks are constructed, the same consensus algorithm is used as the data blocks. The TEE of the master node takes the numbered block as a proposal which needs to be commonly known, the master node TEE signature of the node i of the numbered block is received, the ith transaction is checked by using the private key of the node i of the numbered block, the numbered evidence { h 1,h2,i->indexi}Sk_i is obtained, the number mapping relation is decrypted by using the private key of the own TEE, the ticket is approved after the verification passes, and after the numbered block is uplink, each node updates the anonymous number of the node i, as shown in figure 3. In this embodiment, the functional expression of the mapping relationship between the original number of the node and the trusted anonymous number in step S1 is:
ha,hb,i->indexi
Wherein h a and h b respectively represent heights of blocks in the blockchain, i- > indexi represents a trusted anonymous number corresponding to an i-th node as indexi, and the function expression represents a trusted anonymous number corresponding to an i-th node in x data blocks between heights a-b in the blockchain as indexi.
In this embodiment, when the mapping relationship between the original number of the node and the trusted anonymous number thereof is packaged as the number block in step S1, a hash value is calculated for any ith node including the mapping relationship between the original number of the ith node and the trusted anonymous number thereof, the mapping relationship is encrypted by using the TEE public key of the ith node, and after the mapping relationship encrypted by all the current nodes of the system is packaged as the number block together with the corresponding hash value, the whole number block is signed by using the TEE private key of the master node.
In this embodiment, the step of performing the consensus on the numbered blocks in step S101 and the step of performing the consensus on the blockchain in step S102 includes:
S401, each node locally executes a selection committee operation of a proposal phase (PROPOSAL) and a voting Phase (PREVOTE) to judge whether the node is selected as a master node of the proposal phase or a committee node of the voting phase, each node calls a selection committee module to obtain a consistent pseudo-random sequence, a node corresponding to a first trusted number in the pseudo-random sequence is the master node, and the rest nodes are committee nodes; the master node packs the transaction from the transaction pool into a new block or acquires a block from a locally locked block which does not reach consensus, so as to obtain a block v which needs to execute the consensus in the round, wherein the block v is a transaction block or a numbering block, and the master node generates a proposal message according to the block v, adds a trusted anonymous number of the master node and broadcasts the proposal message; each committee node judges whether to receive the proposal message or not based on the set timeout period, if not, the committee node votes for the proposal message, and if not, the committee node votes for the legal proposal message, otherwise, the committee node empties; adding a trusted anonymous number of the voting message to the voting message and broadcasting the voting message;
S402, each node locally executes the selection committee operation of a pre-submitting stage (PRECOMMIT), then each committee node of the pre-submitting stage judges whether voting messages are received or not based on a set timeout period, if the number of legal voting messages which are not received overtime exceeds a set proportion, pre-submitting messages are generated and broadcast, otherwise, pre-submitting blank tickets are generated and broadcast; the legal voting message means that the signature of the voting message passes through the verification, and the validity of the trusted anonymous number added on the voting message passes through the verification;
S403, all nodes judge whether pre-submitted messages are received or not based on a set timeout period, if the number of the pre-submitted messages which are legal and are not received overtime exceeds a set proportion, the block v is submitted to be uplink, otherwise, the block v is judged to fail in the round of common identification, the legal pre-submitted messages are the signature verification of the pre-submitted messages and the validity verification of the trusted anonymous numbers attached to the pre-submitted messages.
Different committees need to be elected at different stages of the consensus algorithm. On the basis of anonymous numbering, each node is locally pre-installed with a consistent pseudo-random function. Each node uses the character string connected by the hash value of the last block, the number of rounds and the number of steps as the input of the committee selecting module to generate a committee list. When indexi hits the committee, no third node knows this message, except the node i itself and the TEE environment of the numbering node, thus guaranteeing the anonymity of the numbering. The node i broadcasts its own vote (PROPOSAL/PREVOTE/PRECOMMIT) together with an anonymized numbered insignia relationship such as { h 1,h2, i- > indexi }. The other nodes receive the votes (PROPOSAL/PREVOTE/PRECOMMIT) and the anonymous number mapping relations { h 1,h2, i- > indexi } sent by the node i, the corresponding hash values of the mapping relations on the chain are used for verifying that the node i has the anonymous number indexi at the moment, and then the local commission list is checked for verifying the committee identity of the node i, namely indexi is in the committee list. If the verification is passed, the voting message is added into the message pool of the voting message. As shown in fig. 4, the step of selecting a trust zone as a specific TEE environment according to the present embodiment, the combination of the trust zone-based anonymous selection committee scheme and TENDERMINT includes: each node in the system is deployed with a TEE environment, and a numbering module is built in the TEE for giving each node in the system a trusted number. The node can join the system at any time through CA authentication. When a plurality of blocks are generated after the system is deployed for the first time or the consensus operation is carried out, the current master node regenerates the trusted anonymous numbers for all nodes in the current system, and the nodes newly added into the system can acquire the trusted anonymous numbers at the latest numbering time, so that the dynamic expandability of the system is ensured. Before the PROPOSAL step of the consensus algorithm starts, each node calls a local committee selecting module by taking the hash value of the last block, the round number and the round number of PROPOSAL as parameters, and the committee selecting module generates a committee 1 at the moment and returns the first number, namely the number of the main node. It is checked whether it hits the master node itself, and the hit node runs the code of the master node. Before the start of PREVOTE steps of the consensus algorithm, each node calls a local committee selection module by taking the hash value of the last block, the round number and the round number of PREVOTE as parameters, and the committee selection module returns the number of the rest nodes of the committee 1 except the main node. It is checked whether itself hits committee 1, and the hit node generates and broadcasts its own PREVOTE message. Before the start of PRECOMMIT steps of the consensus algorithm, each node calls a local committee selection module by taking the hash value of the last block, the round number and the round number of PRECOMMIT as parameters, and the committee selection module generates and returns the overall number of committee 2. It is checked whether itself hits committee 2, and the hit node generates and broadcasts its own PRECOMMIT message. In the previous step, the node receiving the message needs to check whether the message comes from the corresponding committee, only the message sent by the legal committee will be recorded in the message pool, and at the same time, one of the conditions triggering the state machine, "more than two-thirds of consistent messages of the node are received in the message pool" is changed to "more than two-thirds of consistent messages of the committee are received in the message pool".
In this embodiment, determining, by each node in step S101, its own trusted anonymous number according to the number block after the uplink includes: after each node is in the uplink of the numbered block, verifying the numbered block of the uplink by using the TEE public key of the corresponding master node, taking out the transaction in the numbered block, and decrypting by using the TEE private key of the transaction to obtain the trusted anonymous number of the transaction; when any committee needs to vote, adding a trusted anonymous number of the committee to the original consensus voting message for broadcasting, checking the validity of the trusted anonymous number of the committee node by the numbered blocks after other nodes receive the message, and counting the votes passing the checking, otherwise discarding the votes; after any node i receives the voting message from another any node j, the node i performs validity check of the trusted anonymous number attached to the voting message, including: the node i analyzes the added trusted anonymous number in the message, uses the number to construct the mapping relation between the original number of the node j and the trusted anonymous number thereof, calculates the hash value of the mapping relation, compares the hash value with the hash value corresponding to the node j on the latest numbered block, and if the comparison result is consistent, the committee identity of the node j is verified by the node i, and the voting is legal.
In addition, the present embodiment also provides a TEE-based anonymous selection committee on a blockchain, comprising a microprocessor and a memory, which are interconnected, the microprocessor being programmed or configured to perform the steps of the TEE-based anonymous selection committee method on a blockchain. Furthermore, the present embodiment provides a computer readable storage medium having stored therein a computer program for programming or configuring by a microprocessor to perform the steps of the TEE-based anonymity selection committee method on a blockchain as described above.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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.
The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above examples, and all technical solutions belonging to the concept of the present invention belong to the protection scope of the present invention. It should be noted that modifications and adaptations to the present invention may occur to one skilled in the art without departing from the principles of the present invention and are intended to be within the scope of the present invention.
Claims (8)
1. A TEE-based anonymous selection committee method on a blockchain, comprising:
S101, generating trusted anonymous numbers for all nodes through a numbering module in a TEE environment of a master node, packing mapping relations between original numbers of the nodes and the trusted anonymous numbers into a numbering block, directly uploading the numbers if the numbering block is an originating block, otherwise, executing consensus on the numbering block and uploading the numbers, and determining own trusted anonymous numbers by each node according to the numbering block after uploading;
s102, when the blockchain needs to execute a consensus selection committee, each node generates the same pseudo-random sequence based on the same parameter and the same pseudo-random algorithm, wherein the value range of elements in the pseudo-random sequence is consistent with the value range of the trusted anonymous numbers of the nodes, and the number of the elements is equal to the number of the committees, so that the pseudo-random sequence is represented as a committee list; each node respectively compares the pseudo-random sequence with the own credible anonymous number, and if the pseudo-random sequence is matched with the elements in the pseudo-random sequence, the node is judged to be a committee node;
the step of performing the consensus on the numbered blocks in step S101 and the step of performing the consensus on the blockchain in step S102 includes:
S401, each node locally executes a selection committee operation of a proposal phase and a voting phase to judge whether the node is selected as a master node of the proposal phase or a committee node of the voting phase, each node calls a selection committee module to obtain a consistent pseudo-random sequence, a node corresponding to a first trusted number in the pseudo-random sequence is the master node, and the rest nodes are committee nodes; the master node packs the transaction from the transaction pool into a new block or acquires a block from a locally locked block which does not reach consensus, so as to obtain a block v which needs to execute the consensus in the round, wherein the block v is a transaction block or a numbering block, and the master node generates a proposal message according to the block v, adds a trusted anonymous number of the master node and broadcasts the proposal message; each committee node judges whether to receive the proposal message or not based on the set timeout period, if not, the committee node votes for the proposal message, and if not, the committee node votes for the legal proposal message, otherwise, the committee node empties; adding a trusted anonymous number of the voting message to the voting message and broadcasting the voting message;
S402, each node locally executes a selection committee operation in a pre-commit stage, then each committee node in the pre-commit stage judges whether voting messages are received or not based on a set timeout period, if the number of legal voting messages which are not received overtime exceeds a set proportion, pre-commit messages are generated and broadcast, otherwise pre-commit blank tickets are generated and broadcast; the legal voting message means that the signature of the voting message passes through the verification, and the validity of the trusted anonymous number added on the voting message passes through the verification;
S403, all nodes judge whether pre-submitted messages are received or not based on a set timeout period, if the number of the pre-submitted messages which are legal and are not received overtime exceeds a set proportion, the block v is submitted to be uplink, otherwise, the block v is judged to fail in common, the legal pre-submitted messages are the signature verification of the pre-submitted messages and the validity verification of the trusted anonymous numbers attached to the pre-submitted messages;
In step S101, each node determines its own trusted anonymous number according to the number block after the uplink includes: after each node is in the uplink of the numbered block, verifying the numbered block of the uplink by using the TEE public key of the corresponding master node, taking out the transaction in the numbered block, and decrypting by using the TEE private key of the transaction to obtain the trusted anonymous number of the transaction; when any committee needs to vote, adding a trusted anonymous number of the committee to the original consensus voting message for broadcasting, checking the validity of the trusted anonymous number of the committee node by the numbered blocks after other nodes receive the message, and counting the votes passing the checking, otherwise discarding the votes; after any node i receives the voting message from another any node j, the node i performs validity check of the trusted anonymous number attached to the voting message, including: the node i analyzes the added trusted anonymous number in the message, uses the number to construct the mapping relation between the original number of the node j and the trusted anonymous number thereof, calculates the hash value of the mapping relation, compares the hash value with the hash value corresponding to the node j on the latest numbered block, and if the comparison result is consistent, the committee identity of the node j is verified by the node i, and the voting is legal.
2. The TEE-based anonymous selection committee method of claim 1, wherein the range of values of elements in the pseudorandom sequence is [0 to the number of nodes in the system ].
3. The method for anonymizing and selecting a committee on a blockchain based on TEE as claimed in claim 1, wherein when each node generates the same pseudo-random sequence based on the same parameters, the same parameters include a comprehensive string obtained by connecting the hash value, the round number and the consensus phase of the last block, and three parameters including a maximum number of nodes and a committee number, and the step of generating the same pseudo-random sequence includes:
S201, initializing a pseudo random sequence List to be empty;
S202, connecting the hash value, the round number and the consensus stage of the last block to obtain a comprehensive character string, taking the comprehensive character string as a seed of a Meissen rotation algorithm, generating a random number R by utilizing the Meissen rotation algorithm, carrying out modular operation on a node maximum number N by using the random number R to obtain a modular operation result R, wherein the value range of the modular operation result R is 0 to N-1, mapping the random number R into a certain node number in the system through modular operation, repeating the step S202 if the modular operation result R appears in a pseudo-random sequence List, otherwise, adding the pseudo-random sequence R into the pseudo-random sequence List;
S203, if the size of the pseudo-random sequence List is equal to the number of committees, ending and outputting the pseudo-random sequence List; otherwise, the step 2 is skipped to continue to generate a pseudo-random sequence List.
4. The TEE-based anonymous selection committee method of claim 1, wherein the execution condition for generating trusted anonymous numbers for all nodes by the numbering module in the TEE environment of the master node in step S1 is at system initialization and at x data chunks per uplink designation.
5. The TEE-based anonymous selection committee method of claim 4, wherein the functional expression of the mapping relationship between the original number of the node and its trusted anonymous number in step S1 is:
ha,hb,i->indexi
Wherein h a and h b respectively represent heights of blocks in the blockchain, i- > indexi represents a trusted anonymous number corresponding to an i-th node as indexi, and the function expression represents a trusted anonymous number corresponding to an i-th node in x data blocks between heights a-b in the blockchain as indexi.
6. The method for anonymity selection committee based on TEE on blockchain of claim 1, wherein when the mapping relation between the original number of the node and the trusted anonymity number thereof is packaged into a numbered block in step S1, a hash value is calculated for any ith node including the mapping relation between the original number of the ith node and the trusted anonymity number thereof, the mapping relation is encrypted by using TEE public key of the ith node, and after the mapping relation encrypted by all the current nodes of the system is packaged into the numbered block with the corresponding hash value, the whole numbered block is signed by using TEE private key of the master node.
7. A TEE-based anonymous selection committee on a blockchain comprising a microprocessor and a memory interconnected, wherein the microprocessor is programmed or configured to perform the steps of the TEE-based anonymous selection committee method on a blockchain of any of claims 1-6.
8. A computer readable storage medium having a computer program stored therein, wherein the computer program is for programming or configuring by a microprocessor to perform the steps of the TEE-based anonymous selection committee method on a blockchain as defined in any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211158843.5A CN115664714B (en) | 2022-09-22 | 2022-09-22 | Anonymous selection committee method, system and medium based on TEE (terminal equipment) on blockchain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211158843.5A CN115664714B (en) | 2022-09-22 | 2022-09-22 | Anonymous selection committee method, system and medium based on TEE (terminal equipment) on blockchain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115664714A CN115664714A (en) | 2023-01-31 |
CN115664714B true CN115664714B (en) | 2024-05-14 |
Family
ID=84985813
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211158843.5A Active CN115664714B (en) | 2022-09-22 | 2022-09-22 | Anonymous selection committee method, system and medium based on TEE (terminal equipment) on blockchain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115664714B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118051934A (en) * | 2024-03-20 | 2024-05-17 | 南京国瑞能源科技有限公司 | Data management method and device for transformer substation and electronic equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112487468A (en) * | 2020-12-21 | 2021-03-12 | 暨南大学 | Traceable complete anonymous electronic voting method and system based on block chain |
US11100743B1 (en) * | 2017-12-30 | 2021-08-24 | S&S Crypto Technologies | Blockchain-based election system |
CN113691512A (en) * | 2021-08-13 | 2021-11-23 | 北京理工大学 | Data hiding transmission system and method combining block chain and onion network |
WO2022027531A1 (en) * | 2020-08-03 | 2022-02-10 | 西安电子科技大学 | Blockchain construction method and system, and storage medium, computer device and application |
CN114422146A (en) * | 2022-01-25 | 2022-04-29 | 北京航空航天大学 | Anonymous sorting method for block chain main nodes |
CN114528565A (en) * | 2022-01-21 | 2022-05-24 | 广东海洋大学 | Efficient sensitive data uplink algorithm based on block chain |
-
2022
- 2022-09-22 CN CN202211158843.5A patent/CN115664714B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11100743B1 (en) * | 2017-12-30 | 2021-08-24 | S&S Crypto Technologies | Blockchain-based election system |
WO2022027531A1 (en) * | 2020-08-03 | 2022-02-10 | 西安电子科技大学 | Blockchain construction method and system, and storage medium, computer device and application |
CN112487468A (en) * | 2020-12-21 | 2021-03-12 | 暨南大学 | Traceable complete anonymous electronic voting method and system based on block chain |
CN113691512A (en) * | 2021-08-13 | 2021-11-23 | 北京理工大学 | Data hiding transmission system and method combining block chain and onion network |
CN114528565A (en) * | 2022-01-21 | 2022-05-24 | 广东海洋大学 | Efficient sensitive data uplink algorithm based on block chain |
CN114422146A (en) * | 2022-01-25 | 2022-04-29 | 北京航空航天大学 | Anonymous sorting method for block chain main nodes |
Non-Patent Citations (9)
Title |
---|
A Fair Anonymous Auction Scheme Utilizing Trusted Hardware and Blockchain;Batnyam Enkhtaivan;《2019 17th International Conference on Privacy, Security and Trust (PST)》;20200106;全文 * |
Blockchain-based Access Control Mechanism of Federated Data Sharing System;Yan Ding;《2020 IEEE Intl Conf on Parallel & Distributed Processing with Applications, Big Data & Cloud Computing, Sustainable Computing & Communications, Social Computing & Networking》;20210604;全文 * |
Privacy preserving divisible double auction with a hybridized TEE-blockchain system;Bingyu Liu;《Cybersecurity》;20211201;全文 * |
区块链BFT共识算法研究进展;冯了了;《计算机科学》;20220403;全文 * |
基于区块链技术的车联网匿名身份认证技术研究;周启扬;李飞;章嘉彦;李亚林;宋佳琦;;汽车技术;20201031(10);全文 * |
基于区块链技术的车联网高效匿名认证方案;陈葳葳;曹利;邵长虹;;计算机应用;20201031(10);全文 * |
基于区块链的IoV隐私保护认证方案研究;陈志娟;《中国优秀硕士学位论文全文数据库 信息科技辑》;20220415;全文 * |
基于区块链的IoV隐私保护认证方案设计;曾萍;《计算机应用研究》;20210622;全文 * |
基于区块链的可追踪匿名电子投票方案;孙萌;王昀飚;;网络空间安全;20190925(09);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN115664714A (en) | 2023-01-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11818269B2 (en) | Computer-implemented system and method providing a decentralised protocol for the recovery of cryptographic assets | |
US11212081B2 (en) | Method for signing a new block in a decentralized blockchain consensus network | |
WO2022095244A1 (en) | Cross-chain transaction method, system and apparatus, device, and storage medium | |
CN109889497B (en) | Distrust-removing data integrity verification method | |
EP3859647A1 (en) | Blockchain transaction generation method and device | |
TW201141173A (en) | Verifiable, leak-resistant encryption and decryption | |
US20220086009A1 (en) | Method for generating stateful hash based signatures of messages to be signed | |
CN112132577B (en) | Multi-supervision transaction processing method and device based on block chain | |
Fischer et al. | A public randomness service | |
CN115664714B (en) | Anonymous selection committee method, system and medium based on TEE (terminal equipment) on blockchain | |
CN113822675A (en) | Block chain based message processing method, device, equipment and storage medium | |
CN113939821A (en) | System and method for non-parallel mining on a workload justification blockchain network | |
JP2002529778A (en) | Incorporating shared randomness into distributed encryption | |
Bezuidenhout et al. | Permissionless blockchain systems as pseudo-random number generators for decentralized consensus | |
Sui et al. | AuxChannel: Enabling efficient bi-directional channel for scriptless blockchains | |
CN111770163A (en) | Block chain technique for digital currency encryption algorithm | |
CN112422294B (en) | Anonymous voting method and device based on ring signature, electronic equipment and storage medium | |
CN113869901A (en) | Key generation method, key generation device, computer-readable storage medium and computer equipment | |
Vijayakumaran | An introduction to bitcoin | |
CN113542251B (en) | Data reporting method and device | |
CN115208629B (en) | Data integrity verification method based on intelligent contract | |
CN117473557B (en) | Trusted setting method and device | |
Lim et al. | Specification and analysis of n-way key recovery system by Extended Cryptographic Timed Petri Net | |
CN117978395A (en) | Block chain generation method based on true random numbers | |
Li | A privacy preserving ethereum-based E-voting 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |