CN114362970B  Ring signature method, system, storage medium and equipment based on intelligent contract  Google Patents
Ring signature method, system, storage medium and equipment based on intelligent contract Download PDFInfo
 Publication number
 CN114362970B CN114362970B CN202210260900.4A CN202210260900A CN114362970B CN 114362970 B CN114362970 B CN 114362970B CN 202210260900 A CN202210260900 A CN 202210260900A CN 114362970 B CN114362970 B CN 114362970B
 Authority
 CN
 China
 Prior art keywords
 random number
 signature
 participants
 participant
 proportion
 Prior art date
 Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
 Active
Links
 230000000875 corresponding Effects 0.000 claims abstract description 26
 238000004364 calculation method Methods 0.000 claims description 16
 238000004422 calculation algorithm Methods 0.000 claims description 11
 230000002349 favourable Effects 0.000 claims description 8
 238000004590 computer program Methods 0.000 claims description 7
 238000003672 processing method Methods 0.000 claims 2
 230000004044 response Effects 0.000 abstract description 15
 239000000203 mixture Substances 0.000 description 17
 238000000034 method Methods 0.000 description 13
 238000010586 diagram Methods 0.000 description 10
 230000003993 interaction Effects 0.000 description 3
 239000000463 material Substances 0.000 description 2
 239000000126 substance Substances 0.000 description 2
 230000004075 alteration Effects 0.000 description 1
 239000000969 carrier Substances 0.000 description 1
 238000010276 construction Methods 0.000 description 1
 238000005516 engineering process Methods 0.000 description 1
 239000003365 glass fiber Substances 0.000 description 1
 230000004048 modification Effects 0.000 description 1
 238000006011 modification reaction Methods 0.000 description 1
 230000003287 optical Effects 0.000 description 1
 238000005457 optimization Methods 0.000 description 1
 239000004576 sand Substances 0.000 description 1
 230000002269 spontaneous Effects 0.000 description 1
 238000006467 substitution reaction Methods 0.000 description 1
Images
Abstract
The invention provides a ring signature method, a system, a storage medium and equipment based on an intelligent contract, wherein the method comprises the following steps: acquiring a public key of a participant and generating an initial random number; carrying out data encryption on the initial random number, and sending the obtained random number ciphertext to a corresponding participant so as to enable the participant to decrypt to obtain a random number original text and carry out data processing on the random number original text to obtain a target random number; and calculating the target random number to obtain the approval proportion, randomly generating an enforcer public and private key pair, and performing ring signature according to the public key of the participant, the enforcer public and private key pair and the approval proportion to generate a signature result. According to the ring signature method, the ring signature system, the storage medium and the equipment based on the intelligent contract, through research on the collective ring signature scene, the ring signature is unrelated to the number of participants, the quick response of transaction data is realized, the signature efficiency is improved, and the technical problem of low signature efficiency in the prior art is solved.
Description
Technical Field
The invention relates to the technical field of block chains, in particular to a ring signature method, a ring signature system, a storage medium and a device based on an intelligent contract.
Background
Ring signatures evolve from group signatures, as opposed to group signatures where there is one group administratorcentric, ring signatures do not rely on such one. In short, ring signatures are spontaneous, that is, a certain user in a ring arbitrarily selects the public keys of other users to form a ring required by a signature together, so as to hide the public key of the user, and the other users on the ring do not know that the user is added into the ring at all, thereby realizing the identity privacy of a signer.
In the prior art, the research range of ring signatures mainly focuses on identity information protection in a single transaction, the optimization direction is also the improvement of the internal structure of the ring signatures, and the research on a collective ring signature scene is lacked, so that the existing ring signature method cannot realize the quick response of highfrequency transaction data when facing an application scene needing a large number of signatures, and the signature efficiency of the existing ring signature method is low.
Disclosure of Invention
Based on this, the invention aims to provide a ring signature method, a ring signature system, a storage medium and a device based on an intelligent contract, which are used for solving the technical problem of low signature efficiency caused by the fact that the rapid response of highfrequency transaction data cannot be realized when a large number of signature application scenes are required in the ring signature scheme in the prior art.
One aspect of the present invention provides a ring signature method based on an intelligent contract, including:
acquiring public keys of all participants and generating a plurality of groups of initial random numbers corresponding to the number of the participants;
carrying out data encryption on the initial random number according to a public key of a participant, and sending a random number ciphertext obtained by data encryption to a corresponding participant so that the participant decrypts the random number ciphertext according to a private key of the participant to obtain a random number original text, and carrying out data processing on the random number original text by combining opinions of the participant to obtain a target random number;
and calculating the target random number and the number of participants to obtain the praise proportion, randomly generating an enforcer public and private key pair according to a key generation algorithm, and performing ring signature and generating a signature result according to the public key of the participants, the enforcer public and private key pair and the praise proportion.
The ring signature method based on the intelligent contract encrypts the data of the initial random number according to the public key of the participant and sends the random number ciphertext obtained by encrypting the data to the corresponding participant so that the participant decrypts the random number ciphertext according to the private key of the participant to obtain the random number original text and processes the data of the random number original text by combining the opinion of the participant to obtain the target random number so that the intelligent contract obtains the overall opinion condition of each participant, and then performs ring signature on the obtained overall opinion to realize the research on the collective ring signature scene, thereby realizing that the collection of the opinions of the participant can be completed only by one ring signature, so that the ring signature is unrelated to the number of the participants, realizing the quick response of transaction data, improving the signature efficiency, further performing the ring signature and generating the signature result according to the public key pair of the participant, the public and private key pair of an implementer and the praise proportion, the method has the advantages that the outside of the ring signature is optimized and then added into the existing ring signature scheme, so that the optimized scheme has transportability to the ring signature, the performance of the ring signature is further improved, and the technical problem that the rapid response of highfrequency transaction data cannot be realized to cause low signature efficiency when the scheme of the ring signature in the prior art faces an application scene needing a large amount of signatures is solved.
In addition, the ring signature method based on the intelligent contract according to the present invention may further have the following additional technical features:
further, in the step of performing data processing on the nonce text in combination with the opinion of the user to obtain the target nonce, the data processing includes:
if yes, adding 1 to the initial random number;
if the object or the disclaimer is rejected, the initial random number is kept unchanged.
Further, the step of performing ring signature and generating signature result according to the public key of the participant in combination with the enforcer publicprivate key pair and the approval proportion is followed by:
and acquiring the signature result, distributing the signature result to each participant, and performing signature verification on the signature result by combining a preset proportion.
Further, the step of verifying the signature of the signature result in combination with the preset ratio includes:
performing signature verification on the signature result by combining a preset proportion, and judging whether the signature result is valid;
if the signature is invalid, displaying that the verification result is invalid;
if the signature is valid, comparing the preset proportion with the approval proportion, and judging whether the approval proportion is greater than the preset proportion;
if yes, the generated final overall signature opinion is approved;
if not, the final overall signature opinion generated is against.
Further, the step of calculating the target random number in combination with the participant number to obtain the favorable ratio may be preceded by the steps of:
and uploading the target random number to a block chain without encryption.
Further, the step of calculating the target random number in combination with the participant number to obtain the favorable proportion comprises:
calculating a difference between the target random number and the initial random number to obtain a number of praise persons;
and obtaining the approval proportion according to the approval number and the number of participants.
Further, the target random number displays only the overall opinion situation of all participants, and does not relate to detailed opinion information of each participant.
Another aspect of the present invention provides a ring signature system based on an intelligent contract, the system including:
the acquisition module is used for acquiring public keys of all participants and generating a plurality of groups of initial random numbers corresponding to the number of the participants;
the data processing module is used for carrying out data encryption on the initial random number according to a public key of a participant and sending a random number ciphertext obtained by data encryption to a corresponding participant so that the participant decrypts the random number ciphertext according to a private key of the participant to obtain a random number original text and carries out data processing on the random number original text by combining opinions of the participant to obtain a target random number;
and the signature module is used for calculating the combination of the target random number and the number of participants to obtain a favorable proportion, randomly generating an enforcer public and private key pair according to a key generation algorithm, and performing ring signature and generating a signature result according to the combination of the public key of the participants and the enforcer public and private key pair and the favorable proportion.
Another aspect of the present invention provides a computerreadable storage medium, on which a computer program is stored, which when executed by a processor implements the smart contractbased ring signature method as described above.
Another aspect of the present invention also provides a data processing apparatus comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the smart contractbased ring signature method as described above when executing the program.
Drawings
FIG. 1 is a diagram of a prior art ring signature;
FIG. 2 is a diagram of the steps of a ring signature method based on smart contracts in a first embodiment of the present invention;
FIG. 3 is a schematic diagram of a ring signature in the present application;
FIG. 4 is a schematic diagram of a multiparty secure computing;
FIG. 5 is a flow chart of signature in ring signature of the present application;
FIG. 6 is a flow diagram of signature verification;
FIG. 7 is a diagram of the steps of a ring signature method based on smart contracts in a second embodiment of the present invention;
fig. 8 is a system block diagram of a ring signature system based on smart contracts in a third embodiment of the present invention.
The following detailed description will further illustrate the invention in conjunction with the abovedescribed figures.
Detailed Description
To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Several embodiments of the invention are presented in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
Fig. 1 is a schematic diagram of a ring signature in the prior art. The ring signature is essentially a signature composed of a plurality of keys, and a ring association is formed between partial parameters of the signature in the process of constructing the signature. Setting:pkis a set of public keys that are,Sis a random number group and is used as a random number group,Cto generate the challenge array, the subscripts of the different parameters represent the identity of the participant. Wherein, the challenge generated by the participant forms a ring association according to a specific rule, if the participants are arranged in sequence, the operation is performed according to the formula (1), and the formula (1) is as follows:
wherein the content of the first and second substances,Gis a base point of the elliptic curve, mthe data representing the signature is transmitted to the mobile device,I=SK _{ S } H _{ P } (P _{ S } )in order to be a mirror image of the key,P _{ S }in order to sign the private key of the implementer,HandH _{ P }two different hash functions are represented. In particular, the next participantiCorresponding challengeC _{ i }Is challenged by the last participantC _{ i1}Public keypk _{ i1}And random numberS _{ i1}Composition is performed sequentially according to this rule. When the last participant generates the challenge, the challenge of the first participant can be generated by adding its public key and random number. Finally, a loop is formed, and the representation form is annular. In this process, in order to be able to form a closed loop, it is necessary to start the signature with the private key, which, unlike the public key, generates the challenge as shown in equation (2), where equation (2) is as follows:
the owner of the private key using a random numberuReplacing random numbersS _{ s }Generate challenges, and in this process, need not use their own corresponding challengesC _{ s }Specifically, generated by formula (3)S _{ s }Substituting into equation (1) results in equation (2), i.e. as shown in equation (4), the remaining participants generate challenges according to equation (1). When the owner of the private key also obtains a corresponding challengeC _{ s }After that, the closed loop is completed. Random number of private key owner, unlike the rest of participantsS _{ s }Not randomly generated but by the private keySK _{ S }And random numberuThe construction process is shown as formula (3), and formula (3) is as follows:
S _{ s } =uC _{ s } ×SK _{ S }（3）
equation (4) is as follows:
In the prior art, the inside of the ring signature is generally optimized, so that when a large number of signature application scenes are needed, the scheme of the ring signature in the prior art cannot realize highfrequency quick response of transaction data, and the signature efficiency is low. In the scheme of the application, the current optimal ring signature algorithm can be transplanted by optimizing the outer part of the ring signature, and on the basis, the performance of the ring signature is further improved. On the other hand, in the scheme of the application, the application range of the ring signature is expanded by researching the collective signature, multiparty security calculation is introduced to realize opinion collection of a plurality of participants, and the intelligent contract is adopted as a trusted authority to implement the secure ring signature, so that the highfrequency collective signature has better performance.
Example one
Referring to fig. 2, a ring signature method based on smart contracts in a first embodiment of the present invention is shown, where the method includes steps S101 to S103:
s101, public keys of all participants are obtained, and multiple groups of initial random numbers corresponding to the number of the participants are generated.
Fig. 3 is a schematic diagram of a ring signature in the present application. The intelligent contract is an implementation subject of the ring signature in the invention application and is also a private key owner in the ring signature. In addition to the smart contract, the participants include the owner of the public key in the ring signature. The blockchain serves as a carrier for data interaction between the intelligent contract and the participants. The signature step is as follows: firstly, an intelligent contract initiates a ring signature event to acquire public keys of all members participating in the ring signature; then, the opinions of the participants are obtained by using multiparty security calculation; then, generating a public and private key pair in the intelligent contract, and carrying out ring signature by using a private key in the public and private key pair and public keys of all participants; and finally, publishing the signature to the block chain to complete the signature. In the whole ring signature process, the intelligent contract adopts a onetime secret signature scheme. The public key of the smart contract is randomly generated, the public key cannot be obtained by other participants, and the public key of all participants is required to be used for each round of signature, so that the signature of the smart contract cannot be forged. The participant opinions collected by the intelligent contracts are processed according to the formula (5), wherein the formula (5) is as follows:
wherein the content of the first and second substances,in order to favor the ratio of the ratio,vin order to increase the number of praise people,nrepresenting the number of participants in addition to a smart contract, which does not make an overall opinionQualitatively, but will favor the ratioAdded as a parameter to the signature, composing. In the signature verification stage, the approval proportion and the preset coefficient are compared, and then the final opinion is determined, so that the signature verification method is more suitable for actual needs. Finally, compared with the ring signature before improvement, the ring signature method can finish the collection of the opinions of the participants only by onetime ring signature.
S102, data encryption is carried out on the initial random number according to the public key of the participant, and the random number ciphertext obtained by data encryption is sent to the corresponding participant, so that the participant decrypts the random number ciphertext according to the private key of the participant to obtain the random number original text, and data processing is carried out on the random number original text by combining the opinion of the participant to obtain the target random number.
FIG. 4 is a schematic diagram of multiparty secure computing. The multiparty security computing is a method for completing a certain computing task by a plurality of participants without revealing privacy of the participants. The method and the device finish the collection of opinions of ring signature participants by utilizing the principle of multiparty security calculation. In the multiparty security calculation, an organization is needed to carry out comprehensive calculation on data, and in the scheme of the application, an intelligent contract is used as a calculation intermediary. The method comprises the following steps: firstly, collecting public keys of all participants by an intelligent contract; then, a random number (f) corresponding to the number of participants is generatedx _{ i }Is a random number for the corresponding participant,n is a positive integer), and encrypts the random numbers one by using the public key of the participant, and then sends the random number ciphertext to the corresponding participant; the participator uses the private key of the participator to decrypt and obtain the original text of the random number, then processes according to the opinion of the participator, if agreeing, adds one to the random number, if disagreement or abandon, the random number remains unchanged, and finally sends the processed random number to the participatorAn intelligent contract; after the intelligent contract collects the random numbers processed by all participants, the intelligent contract calculates according to a formula (6) to obtain the overall opinion condition of the participants, wherein the formula (6) is as follows:
v=N ^{ ’ } N（6）
whereinvIn order to keep the number of people who agree in favor,N ^{ ’ }the sum of the processed random numbers for all participants,Nis the sum of the generated random numbers. In the whole process, the intelligent contract and the participants do not directly carry out data interaction, but are stored through a block chain; the random number generated by the intelligent contract needs to be encrypted firstly when being transmitted, and the random number processed by the participant can be transmitted in original text. In the process, the random number processing condition of other people cannot be known among the participants, so that the opinions of the participants are hidden. In the application, the intelligent contract is taken as a trusted third party, so that the private data of the user cannot be disclosed, and the calculated result only displays the overall opinion of the participants and does not relate to the detailed opinions of the participants. Therefore, the multiparty safety calculation method can effectively hide the opinions of the participants and complete the overall opinion collection.
It should be further noted that the random number mentioned in the above steps is a random number used for multiparty secure computation, and the random number mentioned in fig. 5 is a random number used for participating in the ring signature, and the two numbers are different in nature.
S103, calculating the target random number and the number of participants to obtain the approval proportion, randomly generating an enforcer public and private key pair according to a key generation algorithm, and performing ring signature and generating a signature result according to the public key of the participants, the enforcer public and private key pair and the approval proportion.
In the application, the public and private key pair is generated randomly, and each ring signature needs to be regenerated, so that each signature corresponds to a different key, namely 'one signature one secret' is realized. The opinion collection of the signing party is carried out through multiparty security calculation, the privacy of the signing party in the data interaction process in the alliance chain is protected, the signing process organization is carried out by using an intelligent contract technology, a signing policy of one signing and one secret is formulated, and the fact that the signature cannot be forged is guaranteed.
Fig. 5 is a signature flow chart in the ring signature of the present application. The precondition is that the public keys of all participants are obtained in the intelligent contract and the voting approval opinions are obtained through multiparty security calculation. Firstly, dividing the praise opinion number by the participant number, and taking the quotient as the praise proportion; then, a key generation algorithm is called to obtain a group of public and private key pairs, the public key is added into a public key group formed by participants, and a mirror function is called by taking the private key as a parameter to generate a key mirror. Then, starting formal ring signature, starting processing from private key to generate a random numberuAnd calculating according to formula (2) to obtain the challenge of the next signerC _{ S+1 }；
Then, the public keys except the intelligent contract are processed one by one, and a random number needs to be generated when each public key is signedS _{ i }Calculating according to the formula (1) to obtain the next challenge, and replacing the challenge with the subscript of 0 when the subscript of the challenge value reaches the array length until the challenge of the subscript corresponding to the private key is calculatedC _{ S }At this time, all public keys are signed completely;
and then based on the resulting challengeC _{ S }Calculating the random number corresponding to the private key according to the formula (3)S _{ S }The random number group is S,S _{ S }=S[s]is an element of the array; finally signing the contentmPraise ratioAnd generatedC _{ 0 }And random arrays generated by all participantsSAnd adding the ring signature into the signature until the ring signature is finished.
The ring signature includes a signature phase and a verification phase, and fig. 6 shows a signature verification flowchart. First acquiring a ring signatureAnd a predetermined proportionPThen, from the ring labelName acquisition random arrayS(ii) a The challenge is then calculated according to equation (1), fromC _{ 1 }At the beginning, the calculation is repeated all the time in sequenceC _{ n }And assigned a value toC _{ 0 }，nIs a random arraySA length; after which the calculation is verifiedC _{ 0 }If the signature is consistent with the signature, if the signature is not consistent with the signature, the verification fails, and if the signature is consistent with the signature, the preset proportion is usedPAnd the like in the signatureAnd comparing to obtain the final overall signature opinion (the positive proportion is greater than or equal to the preset proportion, the positive is indicated, and the negative is not indicated), and finishing the verification.
In summary, in the ring signature method based on the intelligent contract in the above embodiments of the present invention, the initial random number is encrypted according to the public key of the participant, and the random number ciphertext obtained by encrypting the data is sent to the corresponding participant, so that the participant decrypts the random number ciphertext according to the private key of the participant to obtain the random number original text, and performs data processing on the random number original text in combination with the opinion of the participant to obtain the target random number, so that the intelligent contract obtains the overall opinion of each participant, and then performs ring signature on the obtained overall opinion to realize the research on the collective ring signature scenario, thereby realizing that the collection of the opinions of the participants can be completed only by one ring signature, so that the ring signature is unrelated to the number of the participants, thereby realizing the quick response of the transaction data, improving the signature efficiency, and further, combining the public key pair of the implementer with the public key of the participant according to the public key of the participant, and realizing the quick response of the transaction data, and improving the signature efficiency And the optimized scheme has portability to the ring signature, the performance of the ring signature is further improved, and the technical problem of low signature efficiency caused by the fact that the rapid response of highfrequency transaction data cannot be realized when the scheme of the ring signature in the prior art faces an application scene needing a large amount of signatures is solved.
Example two
Referring to fig. 7, a ring signature method based on smart contracts according to a second embodiment of the present invention is shown: the method comprises steps S201 to S205:
s201, public keys of all participants are obtained, and multiple groups of initial random numbers corresponding to the number of the participants are generated.
The scheme in the present application will be described by taking as an example that a certain class votes for zhang san and determines whether it serves as a chief task. If half or more votes are obtained, the election is successful. The voting system in the scheme of the application is adopted for the voting, and at the beginning stage, each member in a class registers an account number on a platform, and the system generates a unique public and private key pair for the members. The team master initiates a voting event on the platform, and the members on the team upload respective public keys to the system.
S202, data encryption is carried out on the initial random number according to the public key of the participant, and the random number ciphertext obtained by data encryption is sent to the corresponding participant, so that the participant decrypts the random number ciphertext according to the private key of the participant to obtain the random number original text, and data processing is carried out on the random number original text by combining the opinion of the participant to obtain the target random number.
In the above steps, it should be further noted that the target random number only displays the overall opinion situation of all participants, and does not relate to the detailed opinion information of each participant. Further, the data processing comprises: if yes, adding 1 to the initial random number; if the object or disclaimer is rejected, the initial random number remains unchanged.
As a specific example, inside the system (smart contract), each member on the shift is assigned a random number and encrypted using its uploaded public key, and the encrypted random number is sent to each member. After the members in class obtain the encrypted random numbers, the members in class can decrypt the encrypted random numbers through respective private keys to obtain the original texts of the random numbers. At this time, the interface pops up the selection columns of approval and disapproval, if approval is selected, the random number is automatically increased by one, and if disapproval is selected, the random number is kept unchanged. After the selection is completed, the processed random number is uploaded to the system (intelligent contract).
And S203, uploading the target random number to a block chain without encryption.
S204, calculating the target random number and the number of participants to obtain the approval proportion, randomly generating an enforcer public and private key pair according to a key generation algorithm, and performing ring signature and generating a signature result according to the public key of the participants, the enforcer public and private key pair and the approval proportion.
Specifically, calculating the difference between the target random number and the initial random number to obtain the number of praise people; the ratio of the praise is obtained according to the number of praise people and the number of participants.
As a specific example, the system can calculate the number of votes in favor based on the collected random numbers and the assigned random numbers, and in combination with the number of votes, can obtain the proportion of the favor. At this moment, the system triggers the signature event, firstly, a group of public and private key pairs are randomly generated in the system, then, the public key pairs of all voters and the public and private key pairs generated by the system are taken as parameters, a preset ring signature algorithm is called to generate a signature, and praise is proportionally added into the signature to be taken as the final signature result.
S205, obtaining the signature result, distributing the signature result to each participant, and performing signature verification on the signature result by combining a preset proportion.
Specifically, the signature verification step includes: performing signature verification on the signature result by combining a preset proportion, and judging whether the signature result is valid; if the signature is invalid, displaying that the verification result is invalid; if the signature is valid, comparing the preset ratio with the praise ratio, and judging whether the praise ratio is greater than the preset ratio; if yes, the generated final overall signature opinion is approved; if not, the final overall signature opinion generated is against.
After the signature is over, the system sends the signature to each shift member, and the shift member inputs a preset proportion (i.e., a minimum approved proportion satisfying the success of the election, such as 1/2) to perform signature verification. In the verification process, the system takes the public keys of all signatures (including the public key of the intelligent contract) and the signatures as parameters, calls a signature verification algorithm, verifies the validity of the signatures and compares the approval proportion with the preset proportion, if the approval proportion is greater than or equal to the preset proportion, the opinion is approved, otherwise, the opinion is objected; and finally, feeding back the verification result and the opinion to each class member. And the executive decides whether Zhang III becomes the class leader or not according to the obtained opinions.
In summary, in the ring signature method based on the intelligent contract in the above embodiments of the present invention, the initial random number is encrypted according to the public key of the participant, and the random number ciphertext obtained by encrypting the data is sent to the corresponding participant, so that the participant decrypts the random number ciphertext according to the private key of the participant to obtain the random number original text, and performs data processing on the random number original text in combination with the opinion of the participant to obtain the target random number, so that the intelligent contract obtains the overall opinion of each participant, and then performs ring signature on the obtained overall opinion to realize the research on the collective ring signature scenario, thereby realizing that the collection of the opinions of the participants can be completed only by one ring signature, so that the ring signature is unrelated to the number of the participants, thereby realizing the quick response of the transaction data, improving the signature efficiency, and further, combining the public key pair of the implementer with the public key of the participant according to the public key of the participant, and realizing the quick response of the transaction data, and improving the signature efficiency And the optimized scheme has portability to the ring signature, the performance of the ring signature is further improved, and the technical problem of low signature efficiency caused by the fact that the rapid response of highfrequency transaction data cannot be realized when the scheme of the ring signature in the prior art faces an application scene needing a large amount of signatures is solved.
EXAMPLE III
Referring to fig. 8, a ring signature system based on smart contracts according to a third embodiment of the present invention is shown, where the system includes:
the acquisition module is used for acquiring public keys of all participants and generating a plurality of groups of initial random numbers corresponding to the number of the participants;
the data processing module is used for carrying out data encryption on the initial random number according to a public key of a participant and sending a random number ciphertext obtained by data encryption to a corresponding participant so that the participant decrypts the random number ciphertext according to a private key of the participant to obtain a random number original text and carries out data processing on the random number original text by combining opinions of the participant to obtain a target random number;
and the signature module is used for calculating the combination of the target random number and the number of participants to obtain a favorable proportion, randomly generating an enforcer public and private key pair according to a key generation algorithm, and performing ring signature and generating a signature result according to the combination of the public key of the participants and the enforcer public and private key pair and the favorable proportion.
In some optional embodiments, the data processing module comprises:
a first execution unit, configured to, when granted, add 1 to the initial random number;
a second execution unit for holding the initial random number unchanged when a right is objected or discarded.
In some optional embodiments, the signature module comprises, after:
and the verification module is used for acquiring the signature result, distributing the signature result to each participant and verifying the signature of the signature result by combining a preset proportion.
In some optional embodiments, the verification module comprises:
the first judgment unit is used for carrying out signature verification on the signature result by combining a preset proportion and judging whether the signature result is valid;
the third execution unit is used for displaying that the verification result is invalid when the signature is invalid;
a fourth execution unit, configured to compare the preset ratio with the approval ratio when the signature is valid, and determine whether the approval ratio is greater than the preset ratio;
the first execution subunit is used for generating final overall signature opinions as approval when the approval proportion is greater than the preset proportion;
and the second execution subunit is used for generating the final overall signature opinion as an objection when the approval proportion is not greater than the preset proportion.
In some optional embodiments, the signature module previously comprises:
and the uploading module is used for uploading the target random number to a block chain without encryption.
In some optional embodiments, the signature module comprises:
a praise count calculation unit for calculating a difference between the target random number and the initial random number to obtain a number of praise counts;
and the approval proportion calculating unit is used for obtaining the approval proportion according to the approval number and the participant number.
In summary, in the ring signature system based on the intelligent contract in the above embodiments of the present invention, the initial random number is encrypted according to the public key of the participant, and the random number ciphertext obtained by encrypting the data is sent to the corresponding participant, so that the participant decrypts the random number ciphertext according to the private key of the participant to obtain the random number original text, and performs data processing on the random number original text in combination with the opinion of the participant to obtain the target random number, so that the intelligent contract obtains the overall opinion of each participant, and then performs ring signature on the obtained overall opinion to realize the research on the collective ring signature scenario, thereby realizing that the collection of the opinions of the participants can be completed only by one ring signature, so that the ring signature is unrelated to the number of the participants, thereby realizing the quick response of the transaction data, improving the signature efficiency, and further, combining the public key pair of the implementer with the public key of the participant according to the public key of the participant to realize the quick response of the transaction data, and improving the signature efficiency And the optimized scheme has portability to the ring signature, the performance of the ring signature is further improved, and the technical problem of low signature efficiency caused by the fact that the rapid response of highfrequency transaction data cannot be realized when the scheme of the ring signature in the prior art faces an application scene needing a large amount of signatures is solved.
Furthermore, an embodiment of the present invention also proposes a computerreadable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the method in the abovedescribed embodiment.
Furthermore, an embodiment of the present invention also provides a data processing apparatus, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps of the method in the abovementioned embodiment.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computerreadable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computerbased system, processorcontaining system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computerreadable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a nonexhaustive list) of the computerreadable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a readonly memory (ROM), an erasable programmable readonly memory (EPROM or flash memory), an optical fiber device, and a portable compact disc readonly memory (CDROM). Additionally, the computerreadable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims (10)
1. A ring signature method based on a smart contract, the method comprising:
acquiring public keys of all participants, and generating a plurality of groups of initial random numbers corresponding to the number of the participants;
carrying out data encryption on the initial random number according to a public key of a participant, and sending a random number ciphertext obtained by data encryption to a corresponding participant so that the participant decrypts the random number ciphertext according to a private key of the participant to obtain a random number original text, and carrying out data processing on the random number original text by combining opinions of the participant to obtain a target random number;
calculating the target random number and the number of participants to obtain a favorable proportion, randomly generating an enforcer public and private key pair according to a key generation algorithm, and performing ring signature according to the public key of the participants, the enforcer public and private key pair and the favorable proportion to generate a signature result;
in the step of obtaining the target random number by performing data processing on the random number original text in combination with the opinion of the user, the data processing method comprises the following steps:
processing according to the opinion of the user, if yes, adding one to the random number, if no, keeping the random number unchanged, and finally sending the processed random number to the intelligent contract; after the intelligent contract collects the random numbers processed by all participants, calculating according to a calculation formula to obtain the overall opinion condition of the participants so as to obtain a target random number;
wherein, the calculation formula is as follows:
v=N’N
where v is the number of votes approved, N' is the sum of the random numbers processed by all participants, and N is the sum of the generated random numbers.
2. The ring signature method based on smart contracts according to claim 1, wherein in the step of performing data processing on the random number original text in combination with the opinion thereof to obtain the target random number, the data processing comprises:
if yes, adding 1 to the initial random number;
if the object or the disclaimer, the initial random number remains unchanged.
3. The intelligent contractbased ring signature method according to claim 1, wherein said step of performing ring signature and generating a signature result according to the public key of the participant in combination with the enforcer publicprivate key pair and the approval proportion is followed by the steps of:
and acquiring the signature result, distributing the signature result to each participant, and performing signature verification on the signature result by combining a preset proportion.
4. A ring signature method based on a smart contract as claimed in claim 3, wherein said step of verifying the signature of said signature result in combination with a predetermined ratio comprises:
performing signature verification on the signature result by combining a preset proportion, and judging whether the signature result is valid;
if the signature is invalid, displaying that the verification result is invalid;
if the signature is valid, comparing the preset proportion with the approval proportion, and judging whether the approval proportion is greater than the preset proportion;
if yes, the generated final overall signature opinion is approved;
if not, the final overall signature opinion generated is objected.
5. A smart contractbased ring signature method as claimed in claim 1, wherein said step of calculating said target random number in combination with a number of participants to obtain a positive proportion is preceded by the steps of:
and uploading the target random number to a block chain without encryption.
6. A smart contractbased ring signature method as claimed in claim 1, wherein said step of calculating said target random number in combination with the number of participants to obtain a positive proportion comprises:
calculating a difference between the target random number and the initial random number to obtain a number of praise persons;
and obtaining the approval proportion according to the approval number and the number of participants.
7. A ring signature method based on a smart contract according to claim 1, wherein the target random number only shows the overall opinion status of all participants, not relating to detailed opinion information of individual participants.
8. A ring signature system based on smart contracts, the system comprising:
the acquisition module is used for acquiring public keys of all participants and generating a plurality of groups of initial random numbers corresponding to the number of the participants;
the data processing module is used for carrying out data encryption on the initial random number according to a public key of a participant and sending a random number ciphertext obtained by data encryption to a corresponding participant so that the participant decrypts the random number ciphertext according to a private key of the participant to obtain a random number original text and carries out data processing on the random number original text by combining opinions of the participant to obtain a target random number;
the signature module is used for calculating the target random number and the number of participants to obtain a praise proportion, randomly generating an enforcer public and private key pair according to a key generation algorithm, and performing ring signature and generating a signature result according to the public key of the participants, the enforcer public and private key pair and the praise proportion;
in the data processing module, the data processing method comprises the following steps:
processing according to the opinion of the user, if yes, adding one to the random number, if no, keeping the random number unchanged, and finally sending the processed random number to the intelligent contract; after the intelligent contract collects the random numbers processed by all participants, calculating according to a calculation formula to obtain the overall opinion condition of the participants so as to obtain a target random number;
wherein, the calculation formula is as follows:
v=N’N
where v is the number of votes approved, N' is the sum of the random numbers processed by all participants, and N is the sum of the generated random numbers.
9. A computerreadable storage medium, on which a computer program is stored which, when being executed by a processor, carries out a ring signature method based on smart contracts according to any one of claims 1 to 7.
10. A data processing apparatus comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the smart contractbased ring signature method of any one of claims 1 to 7 when executing the program.
Priority Applications (1)
Application Number  Priority Date  Filing Date  Title 

CN202210260900.4A CN114362970B (en)  20220317  20220317  Ring signature method, system, storage medium and equipment based on intelligent contract 
Applications Claiming Priority (1)
Application Number  Priority Date  Filing Date  Title 

CN202210260900.4A CN114362970B (en)  20220317  20220317  Ring signature method, system, storage medium and equipment based on intelligent contract 
Publications (2)
Publication Number  Publication Date 

CN114362970A CN114362970A (en)  20220415 
CN114362970B true CN114362970B (en)  20220705 
Family
ID=81095201
Family Applications (1)
Application Number  Title  Priority Date  Filing Date 

CN202210260900.4A Active CN114362970B (en)  20220317  20220317  Ring signature method, system, storage medium and equipment based on intelligent contract 
Country Status (1)
Country  Link 

CN (1)  CN114362970B (en) 
Citations (2)
Publication number  Priority date  Publication date  Assignee  Title 

CN106779704A (en) *  20161206  20170531  杭州趣链科技有限公司  A kind of block chain anonymous deal method based on ring signatures 
CN109257184A (en) *  20181108  20190122  西安电子科技大学  Linkable ring signature method based on anonymous broadcast enciphering 
Family Cites Families (6)
Publication number  Priority date  Publication date  Assignee  Title 

CN107453865B (en) *  20170718  20200911  众安信息技术服务有限公司  Multiparty data sharing method and system for protecting privacy of data sending source 
US11232478B2 (en) *  20180906  20220125  MadHive, Inc.  Methods and system for collecting statistics against distributed private data 
CN109067547A (en) *  20180921  20181221  北京计算机技术及应用研究所  A kind of block chain method for secret protection based on disposable ring signatures 
US10790990B2 (en) *  20190626  20200929  Alibaba Group Holding Limited  Ring signaturebased anonymous transaction 
CN114730420A (en) *  20190801  20220708  科恩巴斯公司  System and method for generating signatures 
CN113360943A (en) *  20210623  20210907  京东数科海益信息科技有限公司  Block chain private data protection method and device 

2022
 20220317 CN CN202210260900.4A patent/CN114362970B/en active Active
Patent Citations (2)
Publication number  Priority date  Publication date  Assignee  Title 

CN106779704A (en) *  20161206  20170531  杭州趣链科技有限公司  A kind of block chain anonymous deal method based on ring signatures 
CN109257184A (en) *  20181108  20190122  西安电子科技大学  Linkable ring signature method based on anonymous broadcast enciphering 
NonPatent Citations (1)
Title 

基于联盟链的匿名电子投票方案;于天娇等;《网络空间安全》;20191225(第12期);全文 * 
Also Published As
Publication number  Publication date 

CN114362970A (en)  20220415 
Similar Documents
Publication  Publication Date  Title 

Ziegeldorf et al.  Coinparty: Secure multiparty mixing of bitcoins  
Khader et al.  A fair and robust voting system by broadcast  
Kiayias et al.  DEMOS2: scalable E2E verifiable elections without random oracles  
WO2007071265A1 (en)  Group signature scheme with improved efficiency, in particular in a join procedure  
Alwen et al.  CollusionFree Multiparty Computation in the Mediated Model.  
DE102013215970A1 (en)  Unique code in a signature generation message in an asymmetric cryptographic device  
Damgård et al.  Unclonable group identification  
CN107248909A (en)  It is a kind of based on SM2 algorithms without CredentialSecurity endorsement method  
WO2021081866A1 (en)  Transaction method, device, and system based on account model, and storage medium  
Cai et al.  Privacyprotected deletable blockchain  
CN110912705A (en)  Distributed electronic voting method and system based on block chain  
Eskandarian et al.  Clarion: Anonymous communication from multiparty shuffling protocols  
Tian et al.  Policybased chameleon hash for blockchain rewriting with blackbox accountability  
Guasch et al.  How to challenge and cast your evote  
CN114005217A (en)  Electronic voting system and method based on block chain  
CN112651830B (en)  Block chain consensus method applied to power resource sharing network  
CN114362970B (en)  Ring signature method, system, storage medium and equipment based on intelligent contract  
Fischlin  Anonymous signatures made easy  
CN110851804B (en)  Alliance chain identity authentication mode based on electronic contract  
Kiraz  Secure and fair twoparty computation  
Jiang  Timed encryption with application to deniable key exchange  
WO2019174404A1 (en)  Digital group signature method, device and apparatus, and verification method, device and apparatus  
Tso et al.  Identitybased blind multisignature from lattices  
Wei et al.  A general compiler for passwordauthenticated group key exchange protocol in the standard model  
Guo et al.  Scalable protocol for crossdomain group passwordbased authenticated key exchange 
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 