Block node selection method, device and equipment based on verifiable random function

By building a system parameter set in ECDSA public key encryption, a collection of verified random numbers and proof value is generated, the problem of lack of verified random functions in the prior art is solved, and an efficient and secure consensus algorithm is realized.

CN117353934BActive Publication Date: 2025-02-14SSC HLDG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311277821.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2025-02-14
Estimated Expiration
2043-09-28

AI Technical Summary

Technical Problem

Currently, there is a lack of verifiable random functions based on ECDSA public key encryption, which cannot meet the scalability and security requirements of domestic alliance chains or licensed chains for consensus algorithms.

Method used

By constructing a system parameter set containing alpha group, generative element, and hash functions, using these parameters to generate a set of verified random numbers and proof values, a verified random function based on ECDSA is realized.

Benefits of technology

It improves the computing speed, ensures the correctness and verifiability of the hash results, and meets the scalability and security requirements of the alliance chain or licensed chain for consensus algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117353934B_ABST
    Figure CN117353934B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and equipment for selecting a block node based on a verifiable random function, and relates to the field of computer technology, including: constructing a system parameter set including an alpha group, any generator in the alpha group, the order of the generator, a first hash function, a second hash function and a third hash function; using the first hash function to calculate the hash value of the current message, and determining the horizontal coordinate of the hash value; using the second hash function, and calculating the first part of the proof value based on the randomly selected intermediate value, the generator and the hash value; using the horizontal coordinate of the hash value, the randomly selected private key, the intermediate value, the first part of the proof value, and the order of the generator to determine the second part of the proof value; using the private key and the hash value to determine the third part of the proof value; using the third hash function to perform hash calculation on the third part of the proof value to obtain a verifiable random number. The present invention can meet the scalability and security requirements of the domestic alliance chain or permission chain for the consensus algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device and equipment for selecting a block node based on a verifiable random function. Background Art

[0002] At present, there is a VRF (Verifiable Random Function) standard draft proposed by the IETF organization in the world. Among them, the verifiable random function is another application method combining public key cryptography with hash functions. The pseudo-random numbers generated by it can be verified, and only the holder of the private key can calculate and generate pseudo-random numbers. Anyone with a public key can verify the correctness of the random number. The verifiable random function can be regarded as a random oracle. Through any input, a random number output is obtained. However, the verifiable random function has an additional non-interactive zero-knowledge proof process compared to the random oracle, which can be used to verify the correctness of the random number output, indicating that the random number is indeed generated by a certain person or node. Using VRF, the purpose of randomly selecting nodes is similar to the result of selecting nodes using proof of work, but compared with the latter, using VRF can save a lot of computing power and electricity, and the block node is selected randomly, securely and secretly, which can effectively resist the selected target attack. However, there is currently no verifiable random function based on ECDSA (Elliptic Curve Digital Signature Algorithm) public key encryption, which cannot meet the scalability and security requirements of domestic alliance chains or permissioned chains for consensus algorithms. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a method, device, and equipment for selecting a block node based on a verifiable random function, which can improve the operation speed, ensure the correctness of the hash result, and ensure the verifiability of the hash result, and meet the scalability and security requirements of the domestic alliance chain or permission chain for the consensus algorithm. The specific scheme is as follows:

[0004] In a first aspect, the present invention discloses a method for selecting a block node based on a verifiable random function, comprising:

[0005] Constructing a system parameter set including an alpha group, any generator in the alpha group, an order of the generator, a first hash function, a second hash function, and a third hash function;

[0006] Using the first hash function to perform hash calculation on the current message to obtain a corresponding hash value, and determining the abscissa of the hash value;

[0007] Using the second hash function, and performing a hash calculation based on the randomly selected intermediate value, the generator, and the hash value to obtain a corresponding first partial proof value;

[0008] Determine a corresponding second partial proof value using the abscissa of the hash value, the randomly selected private key, the intermediate value, the first partial proof value, and the order of the generator;

[0009] Determine a corresponding third part of the proof value using the private key and the hash value;

[0010] A third hash function is used to perform a hash calculation on the third part of the proof value to obtain a corresponding verifiable random number, and a corresponding proof value set is constructed based on the first part of the proof value, the second part of the proof value and the third part of the proof value.

[0011] Optionally, the using the second hash function and performing hash calculation based on the randomly selected intermediate value, the generator and the hash value to obtain the corresponding first partial proof value includes:

[0012] Performing a dot product of the randomly selected intermediate value and the generator to obtain a corresponding first dot product result, and performing a dot product of the intermediate value and the hash value to obtain a corresponding second dot product result;

[0013] The second Hash function is used to perform a Hash calculation on the first dot product result and the second dot product result to obtain a corresponding first partial proof value.

[0014] Optionally, the determining a corresponding second partial proof value using the abscissa of the hash value, the randomly selected private key, the intermediate value, the first partial proof value, and the order of the generator includes:

[0015] The first preset formula is used to calculate the horizontal coordinate of the hash value, the randomly selected private key, the intermediate value, the first part of the proof value, and the order of the generator to obtain the corresponding second part of the proof value; the first preset formula is s=(k -1 ·(z+r·x))mod q and z=f x (Q);

[0016] Among them, s represents the second part of the proof value, k -1 represents the reciprocal of the intermediate value k, f x (Q) represents the abscissa of the determined hash value Q, z represents the abscissa, r represents the first partial proof value, x represents the private key, and q represents the order of the generator.

[0017] Optionally, the determining a corresponding third part of the proof value by using the private key and the hash value includes:

[0018] The private key and the hash value are point-multiplied to obtain the corresponding third part proof value.

[0019] Optionally, the block node selection method based on a verifiable random function further includes:

[0020] The randomly selected private key and the generator in the system parameter set are point multiplied to obtain the corresponding public key.

[0021] Optionally, the block node selection method based on a verifiable random function further includes:

[0022] Determine whether a process of performing hash calculation on the third part of the proof values ​​in the proof value set by using the third hash function to obtain the verifiable random number is established;

[0023] If so, reusing the first hash function to perform hash calculation on the message to obtain a corresponding target hash value;

[0024] Determining a target abscissa of the target hash value;

[0025] The first part of the proof value and the second part of the proof value in the proof value set, the target horizontal coordinate of the target hash value, the generator and the public key are calculated using a second preset formula to obtain a corresponding first verification value; wherein the second preset formula is U1=z′·s -1 ·G+r·s -1 PK and z′=f x (Q′), and U1 represents the first verification value, s -1 represents the reciprocal of the second part of the proof value s in the proof value set, G represents the generator, r represents the first part of the proof value in the proof value set, PK represents the public key, and f x (Q′) represents the target abscissa for determining the target hash value Q′, and z′ represents the target abscissa;

[0026] The first part of the proof value, the second part of the proof value, the third part of the proof value, the target horizontal coordinate and the target hash value in the proof value set are calculated using a third preset formula to obtain a corresponding second verification value; wherein the third preset formula is U2=z′·s -1 ·Q′+r·s -1 V, and U2 represents the second verification value, z′ represents the target horizontal coordinate, s -1represents the reciprocal of the second part of the proof value s in the proof value set, Q′ represents the target hash value, r represents the first part of the proof value in the proof value set, and V represents the third part of the proof value in the proof value set;

[0027] Using the second hash function to perform hash calculation on the first verification value and the second verification value to obtain a corresponding target partial proof value;

[0028] Determine whether the target partial proof value is consistent with the first partial proof value in the proof value set to obtain a corresponding determination result;

[0029] Based on the judgment result, it is determined whether the verifiable random number is valid.

[0030] Optionally, determining whether the verifiable random number is valid based on the judgment result includes:

[0031] If the judgment result indicates that the target partial proof value is consistent with the first partial proof value in the proof value set, then it is determined that the verifiable random number is valid and the verification is passed;

[0032] If the judgment result indicates that the target partial proof value is inconsistent with the first partial proof value in the proof value set, the verifiable random number is determined to be invalid and the verification fails.

[0033] In a second aspect, the present invention discloses a block node selection device based on a verifiable random function, comprising:

[0034] A construction module, configured to construct a system parameter set including an alpha group, any generator in the alpha group, an order of the generator, a first hash function, a second hash function, and a third hash function;

[0035] A first calculation module, configured to perform a hash calculation on the current message using the first hash function to obtain a corresponding hash value, and determine a horizontal coordinate of the hash value;

[0036] A first proof value determination module, configured to use the second hash function and perform a hash calculation based on the randomly selected intermediate value, the generator and the hash value to obtain a corresponding first partial proof value;

[0037] A second proof value determination module, configured to determine a corresponding second partial proof value using the abscissa of the hash value, the randomly selected private key, the intermediate value, the first partial proof value, and the order of the generator;

[0038] A third proof value determination module, configured to determine a corresponding third partial proof value using the private key and the hash value;

[0039] A verifiable random number generation module, configured to perform a hash calculation on the third part of the proof value using a third hash function to obtain a corresponding verifiable random number;

[0040] A proof value set construction module is used to construct a corresponding proof value set based on the first part of the proof value, the second part of the proof value and the third part of the proof value.

[0041] In a third aspect, the present invention discloses an electronic device, comprising:

[0042] Memory, used to store computer programs;

[0043] A processor is used to execute the computer program to implement the steps of the aforementioned disclosed method for selecting a block producing node based on a verifiable random function.

[0044] In a fourth aspect, the present invention discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed method for selecting a block producing node based on a verifiable random function are implemented.

[0045] It can be seen that the present invention provides a method for selecting a block node based on a verifiable random function, including: constructing a system parameter set including an alpha group, any generator in the alpha group, the order of the generator, a first hash function, a second hash function and a third hash function; using the first hash function to perform a hash calculation on the current message to obtain a corresponding hash value, and determining the horizontal coordinate of the hash value; using the second hash function, and based on a randomly selected intermediate value, the generator and the hash value to perform a hash calculation to obtain a corresponding first part of the proof value; using the horizontal coordinate of the hash value, a randomly selected private key, the intermediate value, the first part of the proof value, and the order of the generator to determine the corresponding second part of the proof value; using the private key and the hash value to determine the corresponding third part of the proof value; using the third hash function to perform a hash calculation on the third part of the proof value to obtain a corresponding verifiable random number, and constructing a corresponding proof value set based on the first part of the proof value, the second part of the proof value and the third part of the proof value. It can be seen that the present invention can improve the calculation speed by realizing the construction of a verifiable random function based on ECDSA and generating a corresponding verifiable random number and proof value set, which can not only ensure the correctness of the hash result, but also ensure the verifiability of the hash result, and meet the scalability and security requirements of the consensus algorithm of the domestic alliance chain or permission chain. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0047] Figure 1 A flow chart of a method for selecting a block node based on a verifiable random function disclosed in the present invention;

[0048] Figure 2 A specific verification method flow chart disclosed in the present invention;

[0049] Figure 3 A specific block node selection and verification schematic diagram based on a verifiable random function disclosed in the present invention;

[0050] Figure 4 A schematic diagram of the structure of a block node selection device based on a verifiable random function disclosed in the present invention;

[0051] Figure 5 The present invention is a structural diagram of an electronic device disclosed in the present invention. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0053] Currently, there is no verifiable random function based on ECDSA public key encryption, which cannot meet the scalability and security requirements of domestic alliance chains or permission chains for consensus algorithms. To this end, the present invention provides a block node selection scheme based on a verifiable random function, which can improve the operation speed, ensure the correctness of the hash result, and ensure the verifiability of the hash result, and meet the scalability and security requirements of domestic alliance chains or permission chains for consensus algorithms.

[0054] The embodiment of the present invention discloses a method for selecting a block node based on a verifiable random function, see Figure 1 As shown, the method includes:

[0055] Step S11: construct a system parameter set including an alpha group, any generator in the alpha group, the order of the generator, a first hash function, a second hash function and a third hash function.

[0056] It can be understood that, in the initialization phase, the system is initialized to obtain a system parameter set including an alpha group, any generator in the alpha group, the order of the generator, a first hash function, a second hash function, and a third hash function output by the system construction. For example, given a security parameter 1 n , initialize the Abelian group That is, the elliptic curve cyclic group, and then randomly select a generator from the Abelian group The order of the generator G is q, and the hash function is selected Output the corresponding system parameters in, represents the first hash function, represents the second hash function, and Represents the third hash function.

[0057] Among them, the Abelian group represents the elliptic curve group of prime order q. The elements of the Abelian group are points on the elliptic curve. G represents the Abelian group. A generator of , q represents the order of the generator G, that is, the Abelian group of order, and Represents the set of integers consisting of the integers 1, 2, …, q-1.

[0058] Step S12: using the first hash function to perform hash calculation on the current message to obtain a corresponding hash value, and determining the horizontal coordinate of the hash value.

[0059] In this embodiment, after determining the current public-private key pair, in the random number and proof generation stage, the first hash function is used to perform a hash calculation on the current message m to obtain a corresponding hash value. For example, the hash value of the message m is calculated using the first hash function, that is, Q = H 1(m), wherein Q represents the hash value.

[0060] In this embodiment, the horizontal coordinate of the hash value is determined. It can be understood that since the first hash function Therefore, the first hash function is used to calculate the hash value Q of the message m, that is, Q = H1 (m), and the hash value Q belongs to the Abelian group is an element in , that is, a point on the elliptic curve, so the horizontal coordinate of the hash value can be determined, that is, z = f x (Q), where f x (Q) represents the abscissa of the determined hash value Q, and z represents the abscissa.

[0061] Step S13: Utilize the second hash function and perform hash calculation based on the randomly selected intermediate value, the generator and the hash value to obtain the corresponding first partial proof value.

[0062] In this embodiment, the second hash function is used, and a hash calculation is performed based on the randomly selected intermediate value, the generator, and the hash value to obtain the corresponding first partial proof value. Specifically, the randomly selected intermediate value and the generator are point-multiplied to obtain the corresponding first point-multiplication result, and the intermediate value and the hash value are point-multiplied to obtain the corresponding second point-multiplication result; the first point-multiplication result and the second point-multiplication result are hashed using the second hash function to obtain the corresponding first partial proof value. For example, the intermediate value k is randomly selected, and The intermediate value is point multiplied with the generator G and the hash value respectively to obtain the corresponding first point product result and the second point product result, and then the first point product result and the second point product result are hashed using the second hash function to obtain the corresponding first partial proof value r, that is, r=H2(k·G, k·Q).

[0063] Step S14: Determine the corresponding second partial proof value using the horizontal coordinate of the hash value, the randomly selected private key, the intermediate value, the first partial proof value, and the order of the generator.

[0064] In this embodiment, the corresponding second part of the proof value is determined by using the horizontal coordinate of the hash value, the randomly selected private key, the intermediate value, the first part of the proof value, and the order of the generator. Specifically, the corresponding second part of the proof value is obtained by calculating the horizontal coordinate of the hash value, the randomly selected private key, the intermediate value, the first part of the proof value, and the order of the generator using a first preset formula; the first preset formula is s=(k -1 ·(z+r·x))mod q and z=f x (Q); where s represents the second part of the proof value, k -1 represents the reciprocal of the intermediate value k, f x (Q) represents the abscissa of the determined hash value Q, z represents the abscissa, r represents the first partial proof value, x represents the private key, and q represents the order of the generator.

[0065] Step S15: Determine a corresponding third part proof value using the private key and the hash value.

[0066] In this embodiment, after the hash value Q of the message m is calculated using the first hash function, that is, Q=H1(m), the corresponding third part of the proof value is determined using the private key and the hash value. Specifically, the private key and the hash value are multiplied to obtain the corresponding third part of the proof value. For example, the private key x and the hash value Q are multiplied to calculate the third part of the proof value V, that is, V=x·Q.

[0067] Step S16: Use a third hash function to perform hash calculation on the third part of the proof value to obtain a corresponding verifiable random number, and construct a corresponding proof value set based on the first part of the proof value, the second part of the proof value and the third part of the proof value.

[0068] In this embodiment, the third part of the proof value is hashed using a third hash function to obtain a corresponding verifiable random number. For example, the verifiable random number V is calculated, that is, v=H3(V).

[0069] In this embodiment, after calculating the first part proof value r, the second part proof value s and the third part proof value V, a corresponding proof value set, i.e. (V, r, s), is constructed based on the first part proof value, the second part proof value and the third part proof value.

[0070] It can be seen that in the embodiments of the present invention, by realizing the construction of a verifiable random function based on ECDSA and generating a corresponding verifiable random number and proof value set, the operation speed can be improved, and both the correctness and the verifiability of the hash result can be guaranteed, and the scalability and security requirements of the consensus algorithm of the domestic alliance chain or permission chain can be met.

[0071] It should be noted that in the key generation phase, the randomly selected private key and the generator in the system parameter set are multiplied to obtain the corresponding public key, where the private key is used to generate a partial hash value and the public key is used to verify the hash value. For example, a private key x is randomly selected, and The public key is calculated using the private key and the generator in the system parameter set, that is, PK = x G, thereby obtaining the corresponding public-private key pair (PK, x), where x represents the private key and PK represents the public key. Then, after generating the random number v and the proof value (V, r, s), the public key can be used for the corresponding verification.

[0072] Correspondingly, the embodiment of the present invention also discloses a specific verification method, see Figure 2 As shown, the method may include:

[0073] Step S21: Determine whether the process of using the third hash function to perform hash calculation on the third part of the proof value in the proof value set to obtain the verifiable random number is established.

[0074] In this embodiment, for the verifiable random number v, message m, and proof value (V, r, s), it is first determined whether the process of using the third hash function to perform hash calculation on the third part of the proof value in the proof value set to obtain the verifiable random number is established, that is, whether v=H3(V) is established. If not, it can be directly determined that the current verification fails.

[0075] Step S22: If established, the first hash function is used again to perform hash calculation on the message to obtain a corresponding target hash value.

[0076] In this embodiment, when judging whether the process of using the third hash function to perform hash calculation on the third part of the proof value in the proof value set to obtain the verifiable random number is established, if it is established, that is, v=H3(V), then the first hash function is reused to perform hash calculation on the message to obtain the corresponding target hash value for verification, that is, Q′=H1(m).

[0077] Step S23: Determine the target horizontal coordinate of the target hash value.

[0078] It can be understood that, in order to reuse the first hash function to perform hash calculation on the message to obtain the corresponding target hash value for verification, the abscissa of the target hash value is determined to obtain the target abscissa. For example, the target abscissa of the target hash value is determined, that is, z′=f x (Q′), where f x (Q′) represents the target abscissa for determining the target hash value Q′, and z′ represents the target abscissa.

[0079] Step S24: Calculate the first part of the proof value and the second part of the proof value in the proof value set, the target horizontal coordinate of the target hash value, the generator and the public key using a second preset formula to obtain a corresponding first verification value; wherein the second preset formula is U1=z′·s -1 ·G+r·s -1 PK and z′=f x (Q′), and U1 represents the first verification value, s -1 represents the reciprocal of the second part of the proof value s in the proof value set, G represents the generator, r represents the first part of the proof value in the proof value set, PK represents the public key, and f x (Q′) represents the target abscissa for determining the target hash value Q′, and z′ represents the target abscissa.

[0080] It can be understood that calculating the first verification value involves the target abscissa z′ of the target hash value Q′, the first part of the proof value r in the proof value set, the reciprocal of the second part of the proof value s in the proof value set, and the Abelian group A generator G and a public key calculated using the randomly selected private key and the generator in the system parameter set are randomly selected, and then these parameters are point multiplied and added according to a second preset formula to obtain a first verification value.

[0081] Step S25: Calculate the first part of the proof value, the second part of the proof value, the third part of the proof value, the target horizontal coordinate and the target hash value in the proof value set using a third preset formula to obtain a corresponding second verification value; wherein the third preset formula is U2=z′·s -1 ·Q′+r·s -1 V, and U2 represents the second verification value, z′ represents the target horizontal coordinate, s -1 represents the inverse of the second part of the proof value s in the proof value set, Q′ represents the target hash value, r represents the first part of the proof value in the proof value set, and V represents the third part of the proof value in the proof value set.

[0082] It can be understood that the calculation of the second verification value involves the target hash value Q′, the target horizontal coordinate z′ of the target hash value, the first part of the proof value r in the proof value set, the third part of the proof value V in the proof value set and the reciprocal of the second part of the proof value s in the proof value set, and these parameters are point multiplied and added according to the third preset formula to obtain the second verification value.

[0083] Step S26: Use the second hash function to perform hash calculation on the first verification value and the second verification value to obtain a corresponding target partial proof value.

[0084] In this embodiment, after calculating the first verification value and the second verification value using the second preset formula and the third preset formula, the first verification value and the second verification value are hashed using the second hash function to obtain the corresponding target partial proof value, that is, r′=H2(U1, U2), where r′ represents the target partial proof value.

[0085] Step S27: Determine whether the target partial proof value is consistent with the first partial proof value in the proof value set to obtain a corresponding judgment result.

[0086] In this embodiment, after determining the target partial proof value for verification, it is determined whether the target partial proof value is consistent with the first partial proof value in the proof value set to obtain a corresponding judgment result, that is, whether r=r′ holds.

[0087] Step S28: Determine whether the verifiable random number is valid based on the judgment result.

[0088] In this embodiment, whether the verifiable random number is valid is determined based on the judgment result. If the judgment result shows that the target partial proof value is consistent with the first partial proof value in the proof value set, the verifiable random number is determined to be valid and the verification passes; if the judgment result shows that the target partial proof value is inconsistent with the first partial proof value in the proof value set, the verifiable random number is determined to be invalid and the verification fails.

[0089] For example, see Figure 3 As shown, the system initialization is completed to obtain the corresponding system parameters After generating the corresponding public-private key pair (PK, x), for the current message m, in the proof part, the process of generating a verifiable random number and proof value is as follows:

[0090] (a) Calculate the hash value Q = H1(m) for message m;

[0091] (b) Randomly select an intermediate value k, and Calculate the partial proof value r = H2(k·G, k·Q);

[0092] (c) Calculate the partial proof value s = (k -1 ·(z+r·x))mod q;

[0093] (d) Calculate the partial proof value V = x·Q;

[0094] (e) Calculate a verifiable random number v = H3(V);

[0095] (f) Output a verifiable random number v and a proof value (V, r, s).

[0096] In the verification part, the output verifiable random number V and the proof value (V, r, s), as well as the message m are used for verification. The specific verification process is as follows:

[0097] (a) Determine whether v = H3(V) holds. If not, output a preset symbol ⊥ to indicate that the current verification fails;

[0098] (b) Recalculate the hash value of message m, i.e., Q′=H1(m), and calculate the horizontal coordinate of the hash value, i.e., z′=f x (Q′);

[0099] (c) Calculate U1 = z′·s -1 ·G+r·s -1 PK;

[0100] (d) Calculate U2 = z′·s -1 ·Q′+r·s -1 ·V;

[0101] (e) Calculate r′=H2(U1, U2);

[0102] (f) Determine whether r=r′ holds. If r=r′ holds, determine that the verifiable random number is valid and the verification is successful; if r=r′ does not hold, determine that the verifiable random number is invalid and the verification is unsuccessful.

[0103] Correspondingly, the embodiment of the present invention also discloses a block node selection device based on a verifiable random function, see Figure 4 As shown, the device comprises:

[0104] A construction module 11, used to construct a system parameter set including an alpha group, any generator in the alpha group, an order of the generator, a first hash function, a second hash function, and a third hash function;

[0105] A first calculation module 12, configured to perform a hash calculation on the current message using the first hash function to obtain a corresponding hash value, and determine a horizontal coordinate of the hash value;

[0106] A first proof value determination module 13, configured to use the second hash function and perform a hash calculation based on the randomly selected intermediate value, the generator and the hash value to obtain a corresponding first partial proof value;

[0107] A second proof value determination module 14, configured to determine a corresponding second partial proof value using the horizontal coordinate of the hash value, the randomly selected private key, the intermediate value, the first partial proof value, and the order of the generator;

[0108] A third proof value determination module 15, configured to determine a corresponding third partial proof value using the private key and the hash value;

[0109] A verifiable random number generating module 16, configured to perform a hash calculation on the third partial proof value using a third hash function to obtain a corresponding verifiable random number;

[0110] The proof value set construction module 17 is used to construct a corresponding proof value set based on the first part of the proof value, the second part of the proof value and the third part of the proof value.

[0111] It can be seen from the above that in the embodiments of the present invention, by realizing the construction of a verifiable random function based on ECDSA and generating a corresponding verifiable random number and proof value set, the operation speed can be improved, the correctness of the hash result can be guaranteed, and the verifiability of the hash result can be guaranteed, and the scalability and security requirements of the consensus algorithm of the domestic alliance chain or permission chain can be met.

[0112] In some specific embodiments, the first certification value determination module 14 may specifically include:

[0113] A first dot product unit, used for performing a dot product on the randomly selected intermediate value and the generator to obtain a corresponding first dot product result;

[0114] A second dot product unit, used for performing a dot product on the intermediate value and the hash value to obtain a corresponding second dot product result;

[0115] The first proof value determining unit is used to use the second Hash function to perform a Hash calculation on the first dot product result and the second dot product result to obtain a corresponding first partial proof value.

[0116] In some specific embodiments, the second proof value determination module 15 may specifically include:

[0117] The second proof value determination unit is used to calculate the horizontal coordinate of the hash value, the randomly selected private key, the intermediate value, the first part of the proof value, and the order of the generator to obtain the corresponding second part of the proof value by using a first preset formula; the first preset formula is s=(k -1 ·(z+r·x))mod q and z=f x (Q);

[0118] Among them, s represents the second part of the proof value, k -1 represents the reciprocal of the intermediate value k, f x (Q) represents the abscissa of the determined hash value Q, z represents the abscissa, r represents the first partial proof value, x represents the private key, and q represents the order of the generator.

[0119] In some specific embodiments, the third proof value determination module 16 may specifically include:

[0120] The third proof value determination unit is used to perform a point multiplication on the private key and the hash value to obtain a corresponding third partial proof value.

[0121] In some specific embodiments, the block node selection device based on a verifiable random function may further include:

[0122] The public key calculation module is used to perform a point multiplication on the randomly selected private key and the generator in the system parameter set to obtain a corresponding public key.

[0123] In some specific embodiments, the block node selection device based on a verifiable random function may further include:

[0124] A first judgment module is used to judge whether a process of performing hash calculation on the third part of the proof value in the proof value set by using the third hash function to obtain the verifiable random number is established;

[0125] a target hash value determination module, configured to, when the process of performing hash calculation on the third part of the proof value in the proof value set by using the third hash function to obtain the verifiable random number is established, re-use the first hash function to perform hash calculation on the message to obtain a corresponding target hash value;

[0126] A target hash value determination module, used to determine a target horizontal coordinate of the target hash value;

[0127] A first verification value determination module is used to calculate the first part of the proof value and the second part of the proof value in the proof value set, the target horizontal coordinate of the target hash value, the generator and the public key using a second preset formula to obtain a corresponding first verification value; wherein the second preset formula is U1=z′·s -1 ·G+r·s -1 PK and z′=f x (Q′), and U1 represents the first verification value, s -1 represents the reciprocal of the second part of the proof value s in the proof value set, G represents the generator, r represents the first part of the proof value in the proof value set, PK represents the public key, and f x (Q′) represents the target abscissa for determining the target hash value Q′, and z′ represents the target abscissa;

[0128] A second verification value determination module is used to calculate the first part of the proof value, the second part of the proof value and the third part of the proof value in the proof value set, the target horizontal coordinate and the target hash value to obtain a corresponding second verification value using a third preset formula; wherein the third preset formula is U2=z′·s -1 ·Q′+r·s -1 V, and U2 represents the second verification value, z′ represents the target horizontal coordinate, s -1represents the reciprocal of the second part of the proof value s in the proof value set, Q′ represents the target hash value, r represents the first part of the proof value in the proof value set, and V represents the third part of the proof value in the proof value set;

[0129] a target partial proof value determination module, configured to perform a hash calculation on the first verification value and the second verification value using the second hash function to obtain a corresponding target partial proof value;

[0130] A second judgment module is used to judge whether the target partial proof value is consistent with the first partial proof value in the proof value set to obtain a corresponding judgment result;

[0131] The third judgment module is used to determine whether the verifiable random number is valid based on the judgment result.

[0132] In some specific embodiments, the third judgment module may specifically include:

[0133] A first determination unit, configured to determine that the verifiable random number is valid and the verification is passed when the determination result indicates that the target partial proof value is consistent with the first partial proof value in the proof value set;

[0134] The second determination unit is configured to determine that the verifiable random number is invalid and the verification fails when the determination result indicates that the target partial proof value is inconsistent with the first partial proof value in the proof value set.

[0135] Furthermore, an embodiment of the present invention also provides an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the diagram cannot be regarded as any limitation on the scope of application of the present invention.

[0136] Figure 5 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present invention. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the block node selection method based on a verifiable random function disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0137] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present invention, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0138] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0139] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the block node selection method based on a verifiable random function executed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0140] Furthermore, an embodiment of the present invention also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the method for selecting a block node based on a verifiable random function disclosed in any of the aforementioned embodiments are implemented.

[0141] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0142] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0143] The above is a detailed introduction to the block node selection method, device and equipment based on verifiable random function provided by the present invention. Specific examples are used in this article to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for selecting a block node based on a verifiable random function, characterized in that: The verifiable random function is a function constructed based on the ECDSA algorithm, characterized in that it includes: Constructing a system parameter set including an alpha group, any generator in the alpha group, an order of the generator, a first hash function, a second hash function, and a third hash function; Using the first hash function to perform hash calculation on the current message to obtain a corresponding hash value, and determining the abscissa of the hash value; Using the second hash function, and performing a hash calculation based on the randomly selected intermediate value, the generator, and the hash value to obtain a corresponding first partial proof value; Determine a corresponding second partial proof value using the abscissa of the hash value, the randomly selected private key, the intermediate value, the first partial proof value, and the order of the generator; Determine a corresponding third part of the proof value using the private key and the hash value; The third part of the proof value is hashed by using a third hash function to obtain a corresponding verifiable random number, and a corresponding proof value set is constructed based on the first part of the proof value, the second part of the proof value and the third part of the proof value; the verifiable random function is applied in the field of cryptography, and the verifiable random function is used to select a block node and resist target selection attacks; Selecting a block producing node from the blockchain based on the verifiable random function that outputs the verifiable random number and the proof value set; The using the second Hash function and performing a Hash calculation based on the randomly selected intermediate value, the generator and the hash value to obtain the corresponding first partial proof value includes: performing a dot product on the randomly selected intermediate value and the generator to obtain a corresponding first dot product result, and performing a dot product on the intermediate value and the hash value to obtain a corresponding second dot product result; performing a Hash calculation on the first dot product result and the second dot product result using the second Hash function to obtain the corresponding first partial proof value; The method of determining the corresponding second part of the proof value by using the abscissa of the hash value, the randomly selected private key, the intermediate value, the first part of the proof value, and the order of the generator includes: using a first preset formula to calculate the abscissa of the hash value, the randomly selected private key, the intermediate value, the first part of the proof value, and the order of the generator to obtain the corresponding second part of the proof value; the first preset formula is s=(k -1 ·(z+r·x))modq and z=f x (Q); where s represents the second part of the proof value, k -1 represents the reciprocal of the intermediate value k, f x (Q) represents the abscissa for determining the hash value Q, z represents the abscissa, r represents the first partial proof value, x represents the private key, and q represents the order of the generator; The determining the corresponding third part proof value by using the private key and the hash value includes: performing a point multiplication on the private key and the hash value to obtain the corresponding third part proof value.

2. The method for selecting a block node based on a verifiable random function according to claim 1, characterized in that: Also includes: The randomly selected private key and the generator in the system parameter set are point multiplied to obtain the corresponding public key.

3. The method for selecting a block node based on a verifiable random function according to claim 2, characterized in that: Also includes: Determine whether a process of performing hash calculation on the third part of the proof values ​​in the proof value set by using the third hash function to obtain the verifiable random number is established; If so, reusing the first hash function to perform hash calculation on the message to obtain a corresponding target hash value; Determining a target abscissa of the target hash value; The first part of the proof value and the second part of the proof value in the proof value set, the target horizontal coordinate of the target hash value, the generator and the public key are calculated using a second preset formula to obtain a corresponding first verification value; wherein the second preset formula is U1=z′·s -1 ·G+r·s -1 PK and z′=f x (Q′), and U1 represents the first verification value, s -1 represents the reciprocal of the second part of the proof value s in the proof value set, G represents the generator, r represents the first part of the proof value in the proof value set, PK represents the public key, and f x (Q′) represents the target abscissa for determining the target hash value Q′, and z′ represents the target abscissa; The first part of the proof value, the second part of the proof value, the third part of the proof value, the target horizontal coordinate and the target hash value in the proof value set are calculated using a third preset formula to obtain a corresponding second verification value; wherein the third preset formula is U2=z′·s -1 ·Q′+r·s -1 V, and U2 represents the second verification value, z′ represents the target horizontal coordinate, s -1 represents the reciprocal of the second part of the proof value s in the proof value set, Q′ represents the target hash value, r represents the first part of the proof value in the proof value set, and V represents the third part of the proof value in the proof value set; Using the second hash function to perform hash calculation on the first verification value and the second verification value to obtain a corresponding target partial proof value; Determine whether the target partial proof value is consistent with the first partial proof value in the proof value set to obtain a corresponding determination result; Based on the judgment result, it is determined whether the verifiable random number is valid.

4. The method for selecting a block node based on a verifiable random function according to claim 3, characterized in that: The determining whether the verifiable random number is valid based on the judgment result includes: If the judgment result indicates that the target partial proof value is consistent with the first partial proof value in the proof value set, then it is determined that the verifiable random number is valid and the verification is passed; If the judgment result indicates that the target partial proof value is inconsistent with the first partial proof value in the proof value set, the verifiable random number is determined to be invalid and the verification fails.

5. A block node selection device based on a verifiable random function, characterized in that: The verifiable random function is a function constructed based on the ECDSA algorithm, including: A construction module, configured to construct a system parameter set including an alpha group, any generator in the alpha group, an order of the generator, a first hash function, a second hash function, and a third hash function; A first calculation module, configured to perform a hash calculation on the current message using the first hash function to obtain a corresponding hash value, and determine a horizontal coordinate of the hash value; A first proof value determination module, configured to use the second hash function and perform a hash calculation based on the randomly selected intermediate value, the generator and the hash value to obtain a corresponding first partial proof value; A second proof value determination module, configured to determine a corresponding second partial proof value using the abscissa of the hash value, the randomly selected private key, the intermediate value, the first partial proof value, and the order of the generator; A third proof value determination module, configured to determine a corresponding third partial proof value using the private key and the hash value; A verifiable random number generation module, configured to perform a hash calculation on the third part of the proof value using a third hash function to obtain a corresponding verifiable random number; A proof value set construction module, used to construct a corresponding proof value set based on the first part of the proof value, the second part of the proof value and the third part of the proof value, wherein the verifiable random function is applied in the field of cryptography, and the verifiable random function is used to select a block node and resist target selection attacks; The device is also used to select a block-producing node from the blockchain based on the verifiable random function that outputs the verifiable random number and the proof value set; The first proof value determination module specifically includes: a first dot multiplication unit, used to perform dot multiplication on the randomly selected intermediate value and the generator to obtain a corresponding first dot multiplication result; a second dot multiplication unit, used to perform dot multiplication on the intermediate value and the hash value to obtain a corresponding second dot multiplication result; a first proof value determination unit, used to perform hash calculation on the first dot multiplication result and the second dot multiplication result using the second hash function to obtain a corresponding first partial proof value; The second proof value determination module specifically includes: The second proof value determination unit is used to calculate the horizontal coordinate of the hash value, the randomly selected private key, the intermediate value, the first part of the proof value, and the order of the generator to obtain the corresponding second part of the proof value by using a first preset formula; the first preset formula is s=(k -1 ·(z+r·x))mod q and z=f x (Q); Among them, s represents the second part of the proof value, k -1 represents the reciprocal of the intermediate value k, f x (Q) represents the abscissa for determining the hash value Q, z represents the abscissa, r represents the first partial proof value, x represents the private key, and q represents the order of the generator; The third proof value determination module specifically includes: The third proof value determination unit is used to perform a point multiplication on the private key and the hash value to obtain a corresponding third partial proof value.

6. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the method for selecting a block producing node based on a verifiable random function as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Implementation method of block chain election based on verifiable random function

    CN115834096A

  • Assertion message signatures

    US20110013771A1