CN110445616B - Block packing node packing sequence determining method, equipment and storage medium - Google Patents

Block packing node packing sequence determining method, equipment and storage medium Download PDF

Info

Publication number
CN110445616B
CN110445616B CN201910633150.9A CN201910633150A CN110445616B CN 110445616 B CN110445616 B CN 110445616B CN 201910633150 A CN201910633150 A CN 201910633150A CN 110445616 B CN110445616 B CN 110445616B
Authority
CN
China
Prior art keywords
packing
node
random value
nodes
input data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910633150.9A
Other languages
Chinese (zh)
Other versions
CN110445616A (en
Inventor
曹平
王志文
吴思进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN201910633150.9A priority Critical patent/CN110445616B/en
Publication of CN110445616A publication Critical patent/CN110445616A/en
Application granted granted Critical
Publication of CN110445616B publication Critical patent/CN110445616B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3218Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using proof of knowledge, e.g. Fiat-Shamir, GQ, Schnorr, ornon-interactive zero-knowledge proofs
    • H04L9/3221Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using proof of knowledge, e.g. Fiat-Shamir, GQ, Schnorr, ornon-interactive zero-knowledge proofs interactive zero-knowledge proofs

Abstract

The invention discloses a method, equipment and a storage medium for determining a block packing sequence of block packing nodes, and belongs to the technical field of block chains. Aiming at the technical problems that the packaging sequence is easy to control by the malicious node and the safety of the system is weak; the packing node broadcasts a random value R, a zero knowledge proof P, a public key PK and input data M generated by a generating function to a block chain, and successfully uplinks; the block chain node verification function verifies whether the zero knowledge proof P is generated through the input data M or not, and whether the random value R can be calculated through the zero knowledge proof P or not is judged, so that whether the input data M and the random value R are correspondingly matched or not is deduced; and if the verification is passed, the random values R are credible, all credible random values R are spliced together to be used as random factors to calculate the packaging sequence of the packaging node in the next round, and the packaging sequence is sent to the packaging node. The rogue node cannot easily control the packaging sequence, and the safety of the system is enhanced.

Description

Block packing node packing sequence determining method, equipment and storage medium
Technical Field
The present invention relates to the field of block chain technology, and in particular, to a method, an apparatus, and a storage medium for determining a packing order of block packing nodes.
Background
DPoS is a consensus algorithm for blockchains, proposed and applied by Dan Larimer, the first developer of bitshas, 4 months 2014. Dan observed some of the problems of the bitcoin system consensus algorithm POW at that time: such as mine ponds, which result in more and more intensive calculations, excessive power consumption, etc. He proposed an algorithm that was faster, safer and less energy consuming, which was the DPoS of late.
In the DPoS consensus algorithm, the normal operation of a block chain depends on the trustees (Delegates), which are fully equivalent. The responsibilities of the assignee are mainly:
1. providing a server node to ensure the normal operation of the node;
2. the node server collects the transactions in the network;
3. the node verifies the transaction and packs the transaction into a block;
4. the node broadcasts the block, and other nodes add the block to the database of the node after verification;
5. lead and promote the development of blockchain projects;
the node server of the consignee is equivalent to an ore machine in the bitcoin network, and can collect block rewards and handling fees of transactions while finishing work.
The number of delegates for a blockchain project is determined by the project originator, typically 101 delegates. Any one of the holding users can participate in both the voting and contesting of the trustee. The users can vote and withdraw the vote at any time, and the weight of voting of each user is in direct proportion to the self coin-holding amount. Voting and vote withdrawing can be carried out at any time, and after each round (round) of election is finished, 101 (generally 101, or other numbers, specifically determined by a blockchain project party) users with the highest vote rate become trustees of the project, and are responsible for packing the blocks, maintaining the operation of the system and obtaining corresponding rewards.
The underlying goal of the election is to elect the 101 users in the community that are most favorable to project development and operation through each person's vote. The server nodes of the 101 users can not only efficiently maintain the operation of the system, but also contribute own abilities to promote the development of the block chain project, which is similar to the 'people representative' system of China (but with shorter period and higher efficiency). By the method, the centralized election consensus is achieved, the operation efficiency of the whole system is guaranteed, and energy waste is reduced.
The pseudo-code implementation of DPoS is:
Figure BDA0002129369810000021
it can be seen that in each round of the loop, the system will re-count the ranking of the votes. In the N highest acceptors, the system firstly breaks up the sequence, then the acceptors produce the blocks according to the sequence, and the next cycle is started after the production of one round of blocks is finished.
The order of each round of packing nodes in the DPOS consensus is changed, so that the randomness and the safety of the system are guaranteed. At present, various complex shuffling algorithms are mostly adopted to change the packing sequence of packing nodes, namely, the last packing node of each round calls the shuffling algorithm to calculate the packing sequence of the packing node of the next round. When the last packing node becomes the rogue node, the rogue node can easily control the packing sequence, and the security of the system is weak.
Disclosure of Invention
1. Technical problem to be solved by the invention
In order to overcome the technical problem, the invention provides a method, equipment and a storage medium for determining a packing sequence of block packing nodes. All block packing nodes participate in determining a packing sequence, so that the fairness and the randomness of the system are enhanced; the rogue node cannot easily control the packaging sequence, and the safety of the system is enhanced.
2. Technical scheme
In order to solve the problems, the technical scheme provided by the invention is as follows:
in a first aspect, the present invention provides a method for determining a packing order of block packing nodes, which is applicable to a packing node, and includes: broadcasting a random value R, a zero knowledge proof P, a public key PK and input data M generated by a generating function to a block chain, and receiving a packaging sequence sent by a block chain node; wherein:
the random value R generated by the generation function is VRF Hash (SK, M),
zero knowledge Proof P ═ VRF _ Proof (SK, M), SK is the private key.
In a further improvement, the method is performed after the next round of packing nodes and the number of the packing nodes are determined.
In a further improvement, the broadcasting of the random value R generated by the generating function, the zero proof of knowledge P, and the public key PK and the input data M onto the blockchain comprises: and constructing a random value R, a zero knowledge proof P, a public key PK and input data M generated by a generating function into a high-priority transaction, and broadcasting the transaction to a block chain to ensure that the transaction is packed into a block and successfully linked.
In a further refinement, the packing node constructs its own input data M.
In a second aspect, the invention provides a method for determining a packing sequence of a block packing node, which is suitable for a block chain node, receives a random value R, a zero knowledge proof P, a public key PK and input data M generated by a generating function sent by the packing node, and successfully links a chain; verifying whether the zero knowledge proof P is generated through the input data M or not through a verification function according to the zero knowledge proof P, the public key PK and the input data M, and whether a random value R can be calculated through the zero knowledge proof P or not, so that whether the input data M and the random value R are matched correspondingly or not and whether the content sent by a packaging node is in a problem or not are deduced;
verification function: a random value R ═ VRF _ P2H (P), True/False ═ VRF _ Verify (PK, M, P);
false indicates that the verification fails and the random value R is not credible;
and if the True indicates that the verification is passed, and the random value R is credible, all credible random values R are spliced together to be used as random factors to calculate the packing sequence of the next round of packing nodes, and the packing sequence is sent to the packing nodes.
In a further improvement, the method is executed after the next round of packing nodes and the number of the packing nodes are selected by the block chain link points.
In a further improvement, the block chain node receives a random value R generated by a generating function sent by the packing node, a zero knowledge proof P, a public key PK and input data M, and successfully chains up, including: receiving a high-priority transaction which is sent by a packaging node and contains a random value R generated by a generating function, a zero-knowledge proof P, a public key PK and input data M, wherein the transaction is packaged into a block and successfully linked up through consensus.
In a further improvement, the packing order of the next round of packing nodes is calculated by splicing all the credible random values R together as a random factor: and the random factor is cut into the number of the packing nodes, and the number is extracted by adopting a drawing method to determine the packing sequence of the packing nodes in the next round.
In a further improvement, all the credible random values R are spliced together to serve as a random factor, and the packing sequence of the next round of packing nodes is calculated through an intelligent contract on a block chain.
In a third aspect, the present invention provides an apparatus, comprising: one or more processors; memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to perform a method as described above.
In a fourth aspect, the invention also proposes a storage medium storing a computer program which, when executed by a processor, implements a method as defined in any one of the above.
3. Advantageous effects
Compared with the prior art, the technical scheme provided by the invention has the following beneficial effects:
the invention uses VRF to generate and verify unpredictable and non-falsifiable random factors in a block chain system, and is used for calculating a packing sequence in block packing node consensus; combining random factors to calculate the sequence of the packed nodes according to the information provided by the nodes, namely the random values, so as to enhance the randomness; all block packing nodes participate in determining a packing sequence, so that the fairness and the randomness of the system are enhanced; the rogue node cannot easily control the packaging sequence, and the safety of the system is enhanced.
Drawings
Fig. 1 is a flowchart of a method for determining a packing order of a block packing node according to embodiments 1 and 2 of the present invention.
Fig. 2 is a flowchart of a method applied to a packing node according to embodiment 3.
Fig. 3 is a flowchart of a method applied to a blockchain node according to embodiment 3.
Fig. 4 is a schematic diagram of node distribution corresponding to the method described in embodiment 3.
FIG. 5 is a diagram illustrating a process performed by the method described in embodiment 4.
Fig. 6 is a schematic diagram of node distribution corresponding to the method described in embodiment 4.
FIG. 7 is a schematic diagram of an apparatus according to the present invention.
Detailed Description
For a further understanding of the present invention, reference will now be made in detail to the embodiments illustrated in the drawings.
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
The terms first, second, and the like in the present invention are provided for convenience of describing the technical solution of the present invention, and have no specific limiting effect, but are all generic terms, and do not limit the technical solution of the present invention.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Example 1
The embodiment provides a method for determining a packing sequence of a block packing node, which is applicable to a packing node, and as shown in fig. 1, the method includes:
s101, broadcasting a random value R generated by a generating function, a zero knowledge proof P, a public key PK and input data M to a block chain;
s103, receiving a packaging sequence sent by a block chain node; wherein:
the random value R generated by the generation function is VRF Hash (SK, M),
VRF_Hash:FSK(x)=e(g,g)1/(x+SK)
zero knowledge Proof of knowledge P-VRF Proof (SK, M),
VRF_Proof:pSK(x)=g1/(x+SK)
where e (·, ·) is a bilinear map, and x ═ M.
The above method is executed after the next round of packing nodes and the number thereof are determined, wherein the broadcasting of the random value R generated by the generating function, the zero-knowledge proof P, the public key PK and the input data M to the block chain includes: and constructing a random value R, a zero knowledge proof P, a public key PK and input data M generated by a generating function into a high-priority transaction, and broadcasting the transaction to a block chain to ensure that the transaction is packed into a block and successfully linked.
The packing node constructs self input data M, and the construction method comprises the following steps: 1) constructing a random character string to form input data M; 2) splicing the public key and the timestamp, and calculating a hash value to form input data M; 3) and splicing the latest block hash and the random character string, and calculating the hash value to form input data M.
Example 2
The present embodiment provides a method for determining a packing order of block packing nodes, as shown in fig. 1, which is applicable to a block chain node, and includes:
s201, receiving a random value R generated by a generating function sent by a packaging node, a zero knowledge proof P, a public key PK and input data M, and successfully chaining;
s203, verifying whether the zero knowledge proof P is generated through the input data M or not through the zero knowledge proof P, the public key PK and the input data M and whether a random value R can be calculated through the zero knowledge proof P or not through a verification function, and therefore whether the input data M and the random value R are matched correspondingly or not and whether the content sent by a packaging node is in a problem or not are deduced;
verification function: the random value R is VRF _ P2H (P),
VRF_P2H:e(g,pSK(x))=FSK(x),
True/False=VRF_Verify(PK,M,P),
VRF_Verify:e(gxPK,pSK(x))=e(g,g);
wherein e (·, ·) is a bilinear map, x ═ M;
false indicates that the verification is not passed, the random value R is not credible, and the random value R is discarded;
true indicates that the verification is passed, the random value R is trusted, and the random value R is reserved;
s205, whether all verification is finished or not;
if not, acquiring a random value R, a zero knowledge proof P, a public key PK and input data M of the next packing node, and repeating the step S203;
and if so, splicing all the credible random values R together to serve as a random factor to calculate the packing sequence of the next round of packing nodes, and sending the packing sequence to the packing nodes.
The method is executed after the next round of packing nodes and the number of the packing nodes are selected by the block chain nodes, the block chain nodes receive a random value R generated by a generating function sent by the packing nodes, a zero knowledge proof P, a public key PK and input data M, and successfully uplink, and the method comprises the following steps:
receiving a high-priority transaction which is sent by a packaging node and contains a random value R generated by a generating function, a zero-knowledge proof P, a public key PK and input data M, wherein the transaction is packaged into a block and successfully linked up through consensus.
And splicing all the credible random values R together to be used as a random factor to calculate the packing sequence of the next round of packing nodes: the random factor is cut into numbers of the number of the packing nodes, and the numbers are extracted by adopting a drawing method to determine the packing sequence of the packing nodes in the next round;
alternatively, all the credible random values R are spliced together to serve as a random factor, and the packing order of the next round of packing nodes is calculated through an intelligent contract on the block chain.
Example 3
For further explanation and clarity of the technical solution of the present application, the example is illustrated by the Chain33 of the hamames 33, and the practical application is not limited by the non-essential features listed in the example, and is within the scope of the technical solution of the present application.
The male Chain33 of Hangzhou Complex Mei 33 comprises the following characteristics:
an application layer: the method is compatible with the intelligent contracts of the Ethernet, supports the native capabilities of issuing tokens, asset transaction, finding back wallets, hash locking and the like, and simultaneously supports the extensible executors (contracts) of users.
A consensus layer: the consensus algorithm can be plugged, and public chain consensus of POS and DPoS, Terdermint and Pbft alliance chain consensus, Raft private chain consensus, Para parallel chain consensus and the like are supported.
And (3) a data layer: the data storage mode supports the expansion, and currently supports multiple modes of MPT, MAVL, KVDB and MVCKVDB.
The DPoS consensus algorithm is one of algorithms supported by a public chain33, and a block packing sequence has the characteristic of being easily controlled by bad packing nodes. Assuming that the common Chain33 includes a plurality of block Chain nodes and a DPoS consensus algorithm is adopted, the packing nodes and the packing sequence of the blocks being packed in the current round are determined, as shown in fig. 4, assuming that the packing nodes and the packing sequence thereof are respectively: 1Block-node1, 1Block-node2, 1Block-node3, 1Block-node N (hereinafter referred to as 1Block-node 1-N); the non-packing nodes (common nodes) on the common Chain33 are respectively: chain33-node1, Chain33-node2, Chain33-node3, Chain33-node M (hereinafter referred to as Chain33-node 1-M); and sequentially carrying out block packaging consensus by the current round of packaging nodes according to the packaging sequence.
In the process of packing the block by the current round of packing nodes, the nodes (including packing nodes and common nodes) on the public Chain33 use a voting mechanism or a trust voting mechanism (which can be any mechanism used for voting packing nodes in the prior art) to select the packing node of the next round: 2Block-node1, 2Block-node2, 2Block-node3, 2Block-node N (hereinafter referred to as 2Block-node 1-N).
Meanwhile, the packing node of the current round of the common Chain33 adopts any one of the following construction methods to construct the input data M of the common Chain in the following steps: 1) constructing a random character string to form input data M; 2) splicing the public key and the timestamp, and calculating a hash value to form input data M; 3) and splicing the latest block hash and the random character string, and calculating the hash value to form input data M.
Suppose that the input data M constructed by the packing node 1Block-node1-N respectively correspond to: m11, M12, M13, M1N (hereinafter referred to as M11-1N).
Each packing node generates a respective random value R and a zero knowledge proof P by the following generating function:
the random value R ═ VRF _ Hash (SK, M),
VRF_Hash:FSK(x)=e(g,g)1/(x+SK)
zero knowledge Proof of knowledge P-VRF Proof (SK, M),
VRF_Proof:pSK(x)=g1/(x+SK)
where SK is the private key, e (·,) is the bilinear map, x ═ M, and M is M11-1N.
Assuming that the random value R and the zero knowledge proof P of each packing node correspond to each other: r11, R12, R13, R1N (hereinafter referred to as R11-1N), and P11, P12, P13, R1N (hereinafter referred to as P11-1N).
S1011, the packing node 1Block-node1-N constructs respective random values R11-1N, zero knowledge proof P11-1N, public keys PK11-1N and input data M11-1N into high-priority (higher commission charge when constructing transactions) transactions Tr11, Tr12, Tr13, Tr1N (transaction Tr11-1N for short) and broadcasts the transactions onto a public Chain Chann 33, as shown in FIG. 2.
The common node on the public Chain, Chain33, and other packing nodes except the broadcast transaction receive the transaction, and the block packing consensus is carried out by the packing node of the current round, because the handling charge is higher when the transaction is constructed, the transactions have higher priority and are packed into the block preferentially, and the successful Chain-up can be ensured by packing into the block before the packing of the packing node of the current round is finished.
S2011, receiving a transaction Tr11-1N sent by a packaging node 1Block-node1-N, and successfully linking;
s2031, verifying whether the zero knowledge proof P1i is generated through input data M1i through a zero knowledge proof P11-1N, a public key PK11-1N and the input data M11-1N by a verification function, and verifying whether a random value R1i can be calculated through the zero knowledge proof P1i, thereby deducing whether the input data M1i and the random value R1i are correspondingly matched and whether the content sent by a packaging node is in question;
verification function: the random value R is VRF _ P2H (P),
VRF_P2H:e(g,pSK(x))=FSK(x),
True/False=VRF_Verify(PK,M,P),
VRF_Verify:e(gxPK,pSK(x))=e(g,g);
wherein e (·,) is a bilinear map, x ═ M, M ═ M1i, i ═ 1-N;
false indicates that the verification is not passed, the random value R1i is not authentic, and the random value R1i is discarded;
true indicates that the verification is passed, the random value R1i is credible, and the random value R1i is reserved;
s2051, i > N?
If not, acquiring the random value R1i, the zero knowledge proof P1i, the public key PK1i and the input data M1i of the next packing node, and repeating the step S2031;
if yes, all the credible random values R1i are spliced together as RF1 to calculate the packing order of the next round of packing node 2Block-node1-N, and the packing order is sent to the current round of packing node 1Block-node1-N and the next round of packing node 2Block-node1-N, as shown in fig. 3.
The method is executed after the next round of packing nodes and the number of the packing nodes are selected from the Block chain links, and the method for calculating the packing sequence of the next round of packing nodes 2Block-node1-N through the random factor RF1 can be as follows:
1) the random factor RF1 is cut into N (the number of the packing nodes) two-digit numbers (or digits of other digits), the digits are extracted by adopting a drawing method and are randomly distributed to the next packing node 2Block-node1-N, and the packing sequence of the next packing node 2Block-node1-N is determined;
POS consensus algorithm, which determines packing nodes by calculating the percentage of total coins occupied and the time of the total coins occupied, wherein the time is reset and recalculated every time a block is output.
The DPOS consensus algorithm awards tickets, selects N nodes with the largest number of tickets, such as 12 nodes, sorts the N nodes into a first packing node, a second packing node, a third packing node, a fourth packing node and a fourth packing node according to the number of tickets, a random factor RF1 has 256 bits, one group of 8 bits is used as an integer from left to right, the integer modulo 12 is used as the number of the packing sequence of the first packing node, then the random factor RF1 is used as an integer from left to right, the integer modulo 11 is used as the number of the packing sequence of the second packing node, the random factor RF1 is used as an integer from left to right, and the integer modulo 10 is used as the number of the packing sequence of the third packing node, until the last packing node is left. If the condition of repeated numbers is met, the words are arranged in sequence.
When the consensus algorithm is DPOS, the number of the selected packing nodes is N, and the packing nodes are sorted into 1, 2, 3, N and N according to the number of tickets; when the consensus algorithm is POS, the number of packing nodes is N, and the packing nodes are ranked into 1, 2, 3, N and N according to the share ratio; other consensus algorithms may refer to this sort. For the random number factor RF1, according to a known constant bit M, the value of M is a group of 4, 5, 6 and other digit bits, as an integer T1, the integer T1 takes the number obtained by modulo the number N of packing nodes as the number of the first packing node packing sequence, then the second M digit is counted from left to right for the random number factor RF1 as an integer T2, the integer T2 takes the number obtained by modulo the N-1 as the number of the second packing node packing sequence, the third M digit is counted from left to right for the random number factor RF1 as an integer, and the number obtained by modulo the integer N-2 as the number of the third packing node packing sequence until the last packing node is left. If the condition of repeated numbers is met, the words are arranged in sequence.
2) It is also possible that the randomness factor RF1 calculates the packing order of the next round of packing nodes 2Block-node1-N by means of an intelligent contract on the blockchain.
In the POS or DPOS consensus algorithm, the drawing method is edited into an intelligent contract on each node, the random factor RF1, the number of packing nodes and the ticket number sequence of the packing nodes are used as input data of the intelligent contract, and the input data of the intelligent contract is the packing sequence of each packing node.
For the current round of packing node 1Block-node1-N and the next round of packing node 2Block-node1-N, S1031, receive the packing order from blockchain node Chain33-node1-M, as shown in fig. 2. Repeating the above process completes the determination of the packing order.
Example 4
In this embodiment, the original chain of the hangzhou majeu 33 is used as an example, and the practical application is not limited by the non-essential features listed in this embodiment, and all of them are within the protection scope of the present invention.
The original chain YCC uses a simple high-performance main chain and a flexible and diversified parallel chain to store and verify data by using a block chain at low cost and quickly under the condition of controlling privacy, so as to realize the affirmation and transfer of assets and debts, and uses an intelligent contract to develop and apply, so that the main chain has strong stability, no virtual machine and high concurrency, and the TPS can reach ten thousand levels in the future per second; the parallel chain is mainly used for writing the hash log into a main chain to ensure that the hash log cannot be tampered; the intelligent contract and the virtual machine can be flexibly used on the parallel chain, and the stability and the safety of the main chain cannot be influenced; the cross-chain interaction of the parallel chain and the main chain is efficient and stable, and the authority of the main chain and the diversity of the parallel chain are considered.
The consensus algorithm innovating DPOS + BFT, selecting part of the money-holding nodes as block producers and block verification nodes, similar to an accompanying and reviewing system, and giving consideration to fair and efficient consensus; the intelligent contracts of the Ethernet workshop can be seamlessly butted on the original chain.
The original chain YCC block packing sequence has the characteristic of being easy to be controlled by a bad packing node, and in order to solve the technical problem, the inventor of the application creatively provides a block packing node packing sequence determining method. Assuming that the original chain YCC includes a plurality of block chain nodes, and the packing nodes and the packing order of the blocks being packed in the current round are determined, as shown in fig. 6, assuming that the packing nodes in the current round are: 1Block-YCC-nodei (i ═ 1-N, N is an integer); the non-packed nodes (common nodes) on the original chain YCC are: YCC-nodei (i ═ 1-M, M is an integer); and sequentially carrying out block packing consensus by the packing nodes in the current round according to a set packing sequence.
SKi, PKi, namely packaging an account private key and a public key of the node control party;
mi, the packing node generates input data of a random number Ri, such as a time stamp or a random character string and the like;
ri: packing the random values generated by the nodes;
pi: packaging zero knowledge proofs generated by the nodes;
i is 1-N, N is an integer.
The VRF (VerifiableRandomFunctions) can verify random functions, the VRF comprises four functions which are divided into two types, and the functions and the verification functions are generated:
generating a function: r ═ VRF _ Hash (SKi, Mi), P ═ VRF _ Proof (SKi, Mi)
Verification function: r ═ VRF _ P2H (Pi), VRF _ Verify (PKi, Mi, Pi)
The generation function and the verification function VRF _ Hash, VRF _ Proof, VRF _ P2H (Pi), VRF _ Verify relate to the same formula as in examples 2 and 3.
As shown in fig. 5, the method for determining the packing order of the block packing node includes a generation and verification process:
(1) each round of packaging is divided into two stages: a commitment stage and a verification stage;
(2) in the commitment stage, the current round of packing nodes have respective private keys SKi and public keys PKi, respective input data Mi is constructed, then the public keys PKi and the input data Mi are broadcasted to a chain in a transaction mode, the priority of the transaction is high (higher commission is given), packing is guaranteed, and chain linking is successful;
(3) in the verification stage, the current round packaging node uses a VRF generation function to calculate a random value Ri and a zero knowledge proof Pi corresponding to the input Mi of the current round packaging node, the random value Ri, the zero knowledge proof Pi and a public key PKi are broadcasted to a chain in a transaction mode, and when other nodes execute the transaction, whether the random value Ri is credible or not is determined through the VRF verification function;
(4) and calculating the packing sequence of the next round of packing nodes 2Block-YCC-nodei (i is 1-N, and N is an integer) by taking all the credible random values Ri as random factors.
Since it is only published during the verification phase, the random value Ri cannot be predicted; and the random value Ri has already determined that the random value Ri cannot be tampered when all packing nodes publish the input data Mi. For the last packing node of each round, if the packing node is a rogue node, the range of the control random factor is only a limited set, and the randomness of the packing sequence of the next round is greatly enhanced.
As shown in fig. 6, in the process of packing the block by the current round of packing nodes, the nodes (including packing nodes and common nodes) on the original chain YCC select the packing nodes of the next round by using a co-pending team system, a voting election mechanism or a trust election mechanism (which may be any mechanism for electing packing nodes in the prior art): 2Block-YCC-nodei (i ═ 1-N, N is an integer). As shown in fig. 5, a next round of packing node should be selected before all packing nodes in the current round finish Block packing, and before the next round of packing sequence is determined by the above method, a next round of packing node 2Block-YCC-nodei (i is 1-N, N is an integer) should be selected, so that in the process of packing the current round of packing node, the next round of packing node is distributed on the original chain YCC in time, the next round of packing sequence is determined according to the next round of packing node, and after the current round of packing is finished, the next round of packing process is rapidly entered, and seamless connection is realized between two rounds of packing.
The VRF is used to generate and verify unpredictable and non-tamperable random factors in the blockchain system for computing the packing order of the packing nodes. All packing nodes participate in determining a packing sequence, so that the fairness and the randomness of the system are enhanced; the rogue node cannot easily control the packaging sequence, and the safety of the system is enhanced.
Example 5
An apparatus, the apparatus comprising: one or more processors; memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to perform a method as described above.
A storage medium storing a computer program which, when executed by a processor, implements a method as set forth in any of embodiments 1-4 above.
Fig. 7 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
As shown in fig. 7, as another aspect, the present application also provides an apparatus 500 including one or more Central Processing Units (CPUs) 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the apparatus 500 are also stored. The CPU501, ROM502, and RAM503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to embodiments disclosed herein, the method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments disclosed herein include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method described in any of the embodiments above. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described herein.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (10)

1. A method for determining a packing sequence of a block packing node is suitable for a packing node, and is characterized by comprising the following steps:
generating a random value R and a zero knowledge proof P through a generating function; wherein: the random value R is VRF _ Hash (SK, M), zero knowledge proves that P is VRF _ Proof (SK, M), SK is a private key, and M is input data;
broadcasting the random value R generated by the generating function, the zero knowledge proof P, the public key PK and the input data M to the block chain for the block chain nodes to:
successfully chaining the random value R, the zero knowledge proof P, the public key PK and the input data M;
verifying whether the zero knowledge proof P is generated through the input data M or not through a verification function according to the zero knowledge proof P, the public key PK and the input data M, and whether a random value R can be calculated through the zero knowledge proof P or not so as to deduce whether the input data M and the random value R are correspondingly matched or not;
verification function: a random value R ═ VRF _ P2H (P), True/False ═ VRF _ Verify (PK, M, P);
false indicates that the verification fails and the random value R is not credible;
if True indicates that the verification is passed, and the random value R is credible, all credible random values R are spliced together to be used as random factors to calculate the packing sequence of the next round of packing nodes, and the packing sequence is sent to the packing nodes;
receiving a packaging sequence sent by a block chain node;
the step of splicing all the credible random values R together to serve as a random factor to calculate the packing sequence of the next round of packing nodes comprises the following steps:
and the random factor is cut into the number of the packing nodes, and the number is extracted by adopting a drawing method to determine the packing sequence of the packing nodes in the next round.
2. The method of claim 1, wherein the method is performed after the next round of packing nodes and the number of packing nodes are determined.
3. The method of claim 1, wherein broadcasting the random value R generated by the generating function, the zero proof of knowledge P, and the public key PK and the input data M onto the blockchain comprises:
and constructing a random value R, a zero knowledge proof P, a public key PK and input data M generated by a generating function into a high-priority transaction, and broadcasting the transaction to a block chain to ensure that the transaction is packed into a block and successfully linked.
4. The method of claim 1, wherein the packing node constructs its own input data M.
5. A block packing node packing sequence determining method is suitable for a block chain node, and is characterized in that:
receiving a random value R, a zero knowledge proof P, a public key PK and input data M generated by a generating function sent by a packaging node, and successfully chaining; the random value R is VRF _ Hash (SK, M), the zero knowledge Proof P is VRF _ Proof (SK, M), SK is a private key, and M is input data;
verifying whether the zero knowledge proof P is generated through the input data M or not through a verification function according to the zero knowledge proof P, the public key PK and the input data M, and whether a random value R can be calculated through the zero knowledge proof P or not so as to deduce whether the input data M and the random value R are correspondingly matched or not;
verification function: a random value R ═ VRF _ P2H (P), True/False ═ VRF _ Verify (PK, M, P);
false indicates that the verification fails and the random value R is not credible;
if True indicates that the verification is passed, and the random value R is credible, all credible random values R are spliced together to be used as random factors to calculate the packing sequence of the next round of packing nodes, and the packing sequence is sent to the packing nodes;
the step of splicing all the credible random values R together to serve as a random factor to calculate the packing sequence of the next round of packing nodes comprises the following steps:
and the random factor is cut into the number of the packing nodes, and the number is extracted by adopting a drawing method to determine the packing sequence of the packing nodes in the next round.
6. The method of claim 5, wherein the method is performed after the block link points are selected for the next round of packing nodes and the number thereof.
7. The method of claim 5 wherein the receiving the random value R generated by the generating function from the packaging node, the zero proof of knowledge P, the public key PK and the input data M, and successfully chaining comprises:
receiving a high-priority transaction which is sent by a packaging node and contains a random value R generated by a generating function, a zero-knowledge proof P, a public key PK and input data M, wherein the transaction is packaged into a block and successfully linked up through consensus.
8. The method according to claim 5, wherein the step of splicing all the credible random values R together as a random factor calculates the packing order of the next round of packing nodes by an intelligent contract on a block chain.
9. A computer device, the device comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in any of claims 1-8.
10. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-8.
CN201910633150.9A 2019-07-15 2019-07-15 Block packing node packing sequence determining method, equipment and storage medium Active CN110445616B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910633150.9A CN110445616B (en) 2019-07-15 2019-07-15 Block packing node packing sequence determining method, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910633150.9A CN110445616B (en) 2019-07-15 2019-07-15 Block packing node packing sequence determining method, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110445616A CN110445616A (en) 2019-11-12
CN110445616B true CN110445616B (en) 2022-03-04

Family

ID=68430265

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910633150.9A Active CN110445616B (en) 2019-07-15 2019-07-15 Block packing node packing sequence determining method, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110445616B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116739660A (en) * 2019-11-28 2023-09-12 湖南天河国云科技有限公司 Lottery drawing method and system based on block chain
CN111242614A (en) * 2020-01-12 2020-06-05 杭州复杂美科技有限公司 Wallet account asset retrieving method, collection guarantee method, equipment and storage medium
CN111291014B (en) * 2020-02-18 2023-05-30 杭州复杂美科技有限公司 Block chain consensus method, apparatus and storage medium
CN113010894B (en) * 2020-06-12 2022-12-09 腾讯科技(深圳)有限公司 Data processing method and device and computer readable storage medium
CN113225192A (en) * 2021-05-06 2021-08-06 杭州复杂美科技有限公司 Transaction storage method, computer device and storage medium
CN113489671B (en) * 2021-05-11 2023-07-11 深圳前海移联科技有限公司 Cross-alliance chain communication method and device based on verifiable random function

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108365960A (en) * 2017-12-29 2018-08-03 北京欧链科技有限公司 Random number providing method and device
CN109639837A (en) * 2019-01-31 2019-04-16 东南大学 Block chain DPoS common recognition method based on faith mechanism
CN109743173A (en) * 2018-12-20 2019-05-10 弗洛格(武汉)信息科技有限公司 Go out block node in block chain and determines method, block verification method and block catenary system
CN109785130A (en) * 2018-12-17 2019-05-21 金蝶软件(中国)有限公司 Block chain is known together method, apparatus, computer equipment and storage medium at random
CN110011814A (en) * 2019-04-16 2019-07-12 北京艾摩瑞策科技有限公司 A kind of DPoS common recognition method and its system that can verify that

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015017023A2 (en) * 2013-06-03 2015-02-05 Brown University Secure compression

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108365960A (en) * 2017-12-29 2018-08-03 北京欧链科技有限公司 Random number providing method and device
CN109785130A (en) * 2018-12-17 2019-05-21 金蝶软件(中国)有限公司 Block chain is known together method, apparatus, computer equipment and storage medium at random
CN109743173A (en) * 2018-12-20 2019-05-10 弗洛格(武汉)信息科技有限公司 Go out block node in block chain and determines method, block verification method and block catenary system
CN109639837A (en) * 2019-01-31 2019-04-16 东南大学 Block chain DPoS common recognition method based on faith mechanism
CN110011814A (en) * 2019-04-16 2019-07-12 北京艾摩瑞策科技有限公司 A kind of DPoS common recognition method and its system that can verify that

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"VRF-可验证随机函数";建怀;《www.janshu.com》;20180910;第1页 *

Also Published As

Publication number Publication date
CN110445616A (en) 2019-11-12

Similar Documents

Publication Publication Date Title
CN110445616B (en) Block packing node packing sequence determining method, equipment and storage medium
Lashkari et al. A comprehensive review of blockchain consensus mechanisms
Bach et al. Comparative analysis of blockchain consensus algorithms
CN110580653B (en) Block chain consensus mechanism based on transaction
CN108717630B (en) Block output method and implementation system thereof
Harkavy et al. Electronic auctions with private bids.
CN108512652B (en) Decentralized consensus method and system based on time certification and block chain system
CN107220130B (en) Method, device and system for realizing information consensus at nodes of block chain
US20200311678A1 (en) Smart contract execution using distributed coordination
Di Crescenzo et al. Non-interactive and non-malleable commitment
EP4102431A1 (en) Implementing logic gate functionality using a blockchain
US11475025B2 (en) Blockchain system comprising consensus protocol using search for good approximate solutions to any optimization problem and its computor program
CN112333251B (en) Block chain consensus distributed power transaction proxy node selection method and system
CN113822672A (en) Block chain consensus method based on zero knowledge proof
CN112651830A (en) Block chain consensus method applied to power resource sharing network
CN113568972A (en) Mixed consensus realization device and method for schema block chain
CN114519198A (en) Block chain consensus method and computer-readable storage medium
CN113645278B (en) Cross-chain message transmission method, device and storage medium of block chain
Hsueh et al. EPoW: Solving blockchain problems economically
US20220278854A1 (en) Unity Protocol Consensus
CN113448694A (en) Block chain consensus method for improving transaction processing capability
CN116233140A (en) Method, device, equipment and storage medium for determining block-out node based on weight
US20220060332A1 (en) Energized identity powered blockchain
US11575744B2 (en) Computer-implemented system and method for controlling processing steps of distributed system
CN113691632A (en) Dynamic scheduling method and system for block chain computing resources

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