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
- smart contract
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000012545 processing Methods 0.000 claims abstract description 23
- 238000012795 verification Methods 0.000 claims description 27
- 238000004364 calculation method Methods 0.000 claims description 12
- 238000004422 calculation algorithm Methods 0.000 claims description 11
- 238000004590 computer program Methods 0.000 claims description 6
- 238000003672 processing method Methods 0.000 claims 2
- 230000004044 response Effects 0.000 abstract description 12
- 238000011160 research Methods 0.000 abstract description 9
- 238000005516 engineering process Methods 0.000 abstract description 3
- 230000008569 process Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000008520 organization Effects 0.000 description 2
- 108010001267 Protein Subunits Proteins 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000002269 spontaneous effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本发明提供一种基于智能合约的环签名方法、系统、存储介质及设备,方法包括:获取参与者公钥并生成初始随机数;对初始随机数进行数据加密,并将得到的随机数密文发送至对应参与者,以使参与者解密得到随机数原文、并对随机数原文进行数据处理得到目标随机数;对目标随机数通过计算以获得赞成比例,并随机生成实施者公私钥对,根据参与者的公钥结合实施者公私钥对、以及赞成比例进行环签名并生成签名结果。上述基于智能合约的环签名方法、系统、存储介质及设备,通过对集体环签名场景的研究,使得环签名与参与者的数量无关,实现了交易数据的快速响应,提高了签名效率,解决现有技术中签名效率低的技术问题。
The present invention provides a smart contract-based ring signature method, system, storage medium and device. The method includes: obtaining a public key of a participant and generating an initial random number; encrypting the data of the initial random number, and encrypting the obtained random number ciphertext Send it to the corresponding participants, so that the participants can decrypt the original random number, and perform data processing on the original random number to obtain the target random number; the target random number is calculated to obtain the approval ratio, and the public and private key pairs of the implementer are randomly generated. The participant's public key is combined with the implementer's public-private key pair and the approval ratio to perform ring signature and generate the signature result. The above-mentioned ring signature method, system, storage medium and device based on smart contracts, through the research on the collective ring signature scenario, makes the ring signature independent of the number of participants, realizes the rapid response of transaction data, improves the signature efficiency, and solves the problem of existing problems. There is a technical problem of low signature efficiency in technology.
Description
技术领域technical field
本发明涉及区块链技术领域,特别涉及一种基于智能合约的环签名方法、系统、存储介质及设备。The present invention relates to the technical field of blockchain, in particular to a ring signature method, system, storage medium and device based on a smart contract.
背景技术Background technique
环签名由群签名演变而来,与群签名存在一个群管理员为中心而不同的是,环签名不依赖这样的一个中心。简单来说,环签名是自发性的,即环中的某一用户任意选择其他用户的公钥来共同构成一个签名所需的环,用于隐藏该用户的公钥,而环上的其他用户根本不知道他们被加入到环中,以此实现签名者的身份隐私。Ring signatures are evolved from group signatures. Unlike group signatures, which have a group administrator as the center, ring signatures do not rely on such a center. In simple terms, ring signatures are spontaneous, that is, a user in the ring arbitrarily selects the public keys of other users to jointly form a ring required for a signature, which is used to hide the user's public key, and other users on the ring. The signer's identity is kept private without any knowledge that they are added to the ring.
现有技术当中,对环签名的研究范围主要集中在单次交易中的身份信息保护,优化的方向也是对环签名内部结构的改进,缺乏对集体环签名场景的研究,导致现有的环签名方法在面对需要大量签名应用场景时,无法实现高频率的交易数据的快速响应,使得现有的环签名方法的签名效率低。Among the existing technologies, the research scope of ring signatures mainly focuses on the protection of identity information in a single transaction, and the direction of optimization is also to improve the internal structure of ring signatures. The lack of research on collective ring signature scenarios has led to the existing ring signature In the face of application scenarios that require a large number of signatures, the method cannot achieve fast response to high-frequency transaction data, which makes the signature efficiency of the existing ring signature method low.
发明内容SUMMARY OF THE INVENTION
基于此,本发明的目的是提供一种基于智能合约的环签名方法、系统、存储介质及设备,用于解决现有技术中的环签名的方案在面对需要大量签名应用场景时,无法实现高频率的交易数据的快速响应导致签名效率低的技术问题。Based on this, the purpose of the present invention is to provide a smart contract-based ring signature method, system, storage medium and device, which are used to solve the ring signature solution in the prior art when faced with application scenarios that require a large number of signatures. The rapid response of high-frequency transaction data leads to the technical problem of low signature efficiency.
本发明一方面提供一种基于智能合约的环签名方法,所述方法包括:One aspect of the present invention provides a ring signature method based on a smart contract, the method comprising:
获取所有参与者的公钥,并生成和参与者数量对应的多组初始随机数;Obtain the public keys of all participants, and generate multiple sets of initial random numbers corresponding to the number of participants;
根据参与者的公钥对所述初始随机数进行数据加密,并将数据加密得到的随机数密文发送至对应参与者,以使参与者根据自身私钥解密所述随机数密文得到随机数原文、并结合自身意见对所述随机数原文进行数据处理得到目标随机数;Perform data encryption on the initial random number according to the public key of the participant, and send the ciphertext of the random number obtained by the data encryption to the corresponding participant, so that the participant can decrypt the ciphertext of the random number according to his own private key to obtain a random number The original text, and combined with their own opinions, perform data processing on the original random number to obtain the target random number;
对所述目标随机数结合参与者数量通过计算以获得赞成比例,并根据密钥生成算法随机生成实施者公私钥对,根据参与者的公钥结合所述实施者公私钥对、以及所述赞成比例进行环签名并生成签名结果。Calculate the target random number combined with the number of participants to obtain the approval ratio, and randomly generate a public-private key pair of the implementer according to the key generation algorithm, and combine the public-private key pair of the implementer and the approval according to the public key of the participant. Proportionally performs ring signatures and generates signature results.
上述基于智能合约的环签名方法,通过根据参与者的公钥对初始随机数进行数据加密,并将数据加密得到的随机数密文发送至对应参与者,以使参与者根据自身私钥解密随机数密文得到随机数原文、并结合自身意见对随机数原文进行数据处理得到目标随机数,以使智能合约得到各个参与者的整体意见情况,而后再对得到的整体意见进行环签名,实现对集体环签名场景的研究,从而实现只需一次环签名即可完成参与者意见的收集,使得环签名与参与者的数量无关,实现了交易数据的快速响应,提高了签名效率,进一步的,根据参与者的公钥结合实施者公私钥对、以及赞成比例进行环签名并生成签名结果,通过对环签名的外部进行优化而后加入至现有的环签名方案中,使得优化后的方案对于环签名具有可移植性,进一步提升了环签名的性能,解决现有技术中的环签名的方案在面对需要大量签名应用场景时,无法实现高频率的交易数据的快速响应导致签名效率低的技术问题。The above smart contract-based ring signature method encrypts the data of the initial random number according to the public key of the participant, and sends the ciphertext of the random number obtained by the data encryption to the corresponding participant, so that the participant can decrypt the random number according to his own private key. The original random number is obtained by counting the ciphertext, and the target random number is obtained by data processing of the original random number in combination with its own opinions, so that the smart contract can obtain the overall opinion of each participant, and then the ring signature is performed on the obtained overall opinion to realize the right Research on the collective ring signature scenario, so that only one ring signature can complete the collection of participants' opinions, so that the ring signature has nothing to do with the number of participants, realizes the rapid response of transaction data, and improves the efficiency of signatures. Further, according to The participant's public key is combined with the implementer's public-private key pair and the approval ratio to perform a ring signature and generate a signature result. By optimizing the outside of the ring signature and then adding it to the existing ring signature scheme, the optimized scheme is suitable for the ring signature. It has portability, further improves the performance of ring signatures, and solves the technical problem of low signature efficiency due to the inability to achieve rapid response to high-frequency transaction data when faced with application scenarios that require a large number of signatures in the ring signature scheme in the prior art. .
另外,根据本发明上述的基于智能合约的环签名方法,还可以具有如下附加的技术特征:In addition, according to the above-mentioned smart contract-based ring signature method of the present invention, it can also have the following additional technical features:
进一步地,在所述结合自身意见对所述随机数原文进行数据处理得到目标随机数的步骤中,所述数据处理包括:Further, in the step of performing data processing on the original text of the random number to obtain the target random number in combination with one's own opinion, the data processing includes:
若赞成则将所述初始随机数加1;If yes, add 1 to the initial random number;
若反对或者弃权,所述初始随机数保持不变。In the event of objection or abstention, the initial random number remains unchanged.
进一步地,所述根据参与者的公钥结合所述实施者公私钥对、以及所述赞成比例进行环签名并生成签名结果的步骤之后包括:Further, the step of performing ring signature according to the public key of the participant in combination with the public-private key pair of the implementer and the approval ratio and generating the signature result includes:
获取所述签名结果并将所述签名结果分发至每一参与者,结合预设比例对所述签名结果进行签名验证。Obtain the signature result and distribute the signature result to each participant, and perform signature verification on the signature result in combination with a preset ratio.
进一步地,所述结合预设比例对所述签名结果进行签名验证的步骤包括:Further, the step of performing signature verification on the signature result in combination with a preset ratio includes:
结合预设比例对所述签名结果进行签名验证,判断签名结果是否有效;Perform signature verification on the signature result in combination with a preset ratio, and determine whether the signature result is valid;
若签名无效,则显示验证结果为无效;If the signature is invalid, the verification result is displayed as invalid;
若签名有效,则结合所述赞成比例对比所述预设比例,判断所述赞成比例是否大于所述预设比例;If the signature is valid, comparing the preset ratio with the approval ratio to determine whether the approval ratio is greater than the preset ratio;
若是,则生成的最终总体签名意见为赞成;If so, the final overall signature opinion generated is in favor;
若否,则生成的最终总体签名意见为反对。If not, the final overall signature opinion generated is against.
进一步地,所述对所述目标随机数结合参与者数量通过计算以获得赞成比例的步骤之前包括:Further, before the step of obtaining the approval ratio by calculating the target random number in combination with the number of participants includes:
将所述目标随机数无需加密上传至区块链上。The target random number is uploaded to the blockchain without encryption.
进一步地,所述对所述目标随机数结合参与者数量通过计算以获得赞成比例的步骤包括:Further, the step of obtaining the approval ratio by calculating the target random number in combination with the number of participants includes:
计算所述目标随机数与所述初始随机数之差以获得赞成人数;calculating the difference between the target random number and the initial random number to obtain the number of approvals;
根据所述赞成人数结合参与者数量获得赞成比例。The approval ratio is obtained according to the number of approvals combined with the number of participants.
进一步地,所述目标随机数仅显示所有参与者的整体意见情况,不涉及各个参与者的详细意见信息。Further, the target random number only displays the overall opinion of all participants, and does not involve detailed opinion information of each participant.
本发明另一方面提供一种基于智能合约的环签名系统,所述系统包括:Another aspect of the present invention provides a ring signature system based on a smart contract, the system comprising:
获取模块,用于获取所有参与者的公钥,并生成和参与者数量对应的多组初始随机数;The acquisition module is used to acquire the public keys of all participants and generate multiple groups of initial random numbers corresponding to the number of participants;
数据处理模块,用于根据参与者的公钥对所述初始随机数进行数据加密,并将数据加密得到的随机数密文发送至对应参与者,以使参与者根据自身私钥解密所述随机数密文得到随机数原文、并结合自身意见对所述随机数原文进行数据处理得到目标随机数;The data processing module is used for performing data encryption on the initial random number according to the public key of the participant, and sending the ciphertext of the random number obtained by the data encryption to the corresponding participant, so that the participant can decrypt the random number according to the private key of the participant. The original random number is obtained by counting the ciphertext, and the original random number is obtained by data processing in combination with its own opinions;
签名模块,用于对所述目标随机数结合参与者数量通过计算以获得赞成比例,并根据密钥生成算法随机生成实施者公私钥对,根据参与者的公钥结合所述实施者公私钥对、以及所述赞成比例进行环签名并生成签名结果。The signature module is used to calculate the target random number combined with the number of participants to obtain the approval ratio, and randomly generate a public-private key pair of the implementer according to the key generation algorithm, and combine the public-private key pair of the implementer according to the public key of the participant , and the approval ratio to perform ring signature and generate a signature result.
本发明另一方面提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述的基于智能合约的环签名方法。Another aspect of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements the above-mentioned smart contract-based ring signature method.
本发明另一方面还提供一种数据处理设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述的基于智能合约的环签名方法。Another aspect of the present invention also provides a data processing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the above-mentioned smart contract-based program when the processor executes the program the ring signature method.
附图说明Description of drawings
图1为现有技术中的环签名示意图;1 is a schematic diagram of a ring signature in the prior art;
图2为本发明第一实施例中基于智能合约的环签名方法的步骤图;Fig. 2 is the step diagram of the ring signature method based on the smart contract in the first embodiment of the present invention;
图3为本发明申请中的环签名原理图;3 is a schematic diagram of a ring signature in the application of the present invention;
图4为多方安全计算示意图;Fig. 4 is a schematic diagram of multi-party secure computing;
图5为本发明申请中的环签名中的签名流程图;Fig. 5 is the signature flow chart in the ring signature in the application of the present invention;
图6为签名验证流程图;Fig. 6 is the signature verification flow chart;
图7为本发明第二实施例中基于智能合约的环签名方法的步骤图;Fig. 7 is the step diagram of the ring signature method based on the smart contract in the second embodiment of the present invention;
图8为本发明第三实施例中基于智能合约的环签名系统的系统框图。FIG. 8 is a system block diagram of a ring signature system based on a smart contract in a third embodiment of the present invention.
如下具体实施方式将结合上述附图进一步说明本发明。The following specific embodiments will further illustrate the present invention in conjunction with the above drawings.
具体实施方式Detailed ways
为了便于理解本发明,下面将参照相关附图对本发明进行更全面的描述。附图中给出了本发明的若干实施例。但是,本发明可以以许多不同的形式来实现,并不限于本文所描述的实施例。相反地,提供这些实施例的目的是使对本发明的公开内容更加透彻全面。In order to facilitate understanding of the present invention, the present invention will be described more fully hereinafter with reference to the related drawings. Several embodiments of the invention are presented in the accompanying drawings. However, the present invention may be embodied in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中在本发明的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本发明。本文所使用的术语“及/或”包括一个或多个相关的所列项目的任意的和所有的组合。Unless otherwise defined, 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 terms used herein in the description of the present invention are for the purpose of describing specific embodiments only, and are not intended to limit the present invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
如图1所示为现有技术中的环签名示意图。环签名其本质是由多个密钥组成的签名,在构造签名的过程中,其部分参数之间会形成环形关联。设:pk是公钥集,S为随机数组,C为生成的挑战数组,不同参数的下标表示参与者的身份。其中,参与者生成的挑战会按照特定的规则形成一个环形关联,若参与者已按顺序排列,按公式(1)进行操作,公式(1)如下:FIG. 1 is a schematic diagram of a ring signature in the prior art. The essence of a ring signature is a signature composed of multiple keys. In the process of constructing a signature, a ring association is formed between some of its parameters. Let: pk is the public key set, S is a random array, C is the generated challenge array, and the subscripts of different parameters indicate the identity of the participants. Among them, the challenges generated by the participants will form a circular association according to specific rules. If the participants have been arranged in order, operate according to formula (1), formula (1) is as follows:
其中,G为椭圆曲线的基点, m表示签名的数据,I=SK S H P (P S )为密钥镜像,P S 为签名实施者的私钥,H和H P 表示两个不同的哈希函数。具体为,下一个参与者i对应的挑战C i 是由上一个参与者的挑战C i-1,公钥pk i-1以及随机数S i-1组成,按照这个规则顺序执行。当最后一个参与者生成挑战后,加上其公钥和随机数可以生成第一个参与者的挑战。最后形成一个循环,在表现形式上呈现环形。在这个过程中,为了能够形成闭环,需要从私钥开始签名,不同于公钥,私钥生成的挑战如公式(2)所示,公式(2)如下:Among them, G is the base point of the elliptic curve, m represents the signed data, I=SK S H P (P S ) is the key image, P S is the private key of the signature implementer, H and H P represent two different hash Hierarchy function. Specifically, the challenge C i corresponding to the next participant i is composed of the previous participant's challenge C i- 1 , the public key pk i- 1 and the random number S i - 1 , which are executed sequentially according to this rule. When the last participant generates the challenge, adding its public key and random number can generate the challenge for the first participant. Finally, a loop is formed, showing a ring in the form of expression. In this process, in order to be able to form a closed loop, it is necessary to start the signature from the private key. Unlike the public key, the challenge of generating the private key is shown in formula (2). The formula (2) is as follows:
私钥拥有者通过使用随机数u替换随机数S s 生成挑战,并且在这个过程中,无需使用自身对应的挑战C s ,具体的,将公式(3)生成的S s 代入公式(1)中,得到公式(2),即如公式(4)所示,其余参与者按照公式(1)生成挑战。当私钥拥有者也获得了对应的挑战C s 后,完成了闭环。不同于其余参与者,私钥拥有者的随机数S s 并非随机生成,而是由私钥SK S 和随机数u构造,其构造过程如公式(3)所示,公式(3)如下:The private key owner generates the challenge by replacing the random number S s with the random number u , and in this process, there is no need to use its own corresponding challenge C s . Specifically, the S s generated by the formula (3) is substituted into the formula (1). , and formula (2) is obtained, that is, as shown in formula (4), the remaining participants generate challenges according to formula (1). When the private key owner also obtains the corresponding challenge C s , the closed loop is completed. Different from other participants, the random number S s of the private key owner is not randomly generated, but constructed from the private key SK S and the random number u . The construction process is shown in formula (3), and formula (3) is as follows:
S s =u-C s ×SK S (3) S s =uC s ×SK S (3)
公式(4)如下:Formula (4) is as follows:
此时,环签名完成,签名为。At this point, the ring signature is complete and the signature is .
现有技术中一般是对环签名的内部进行优化,使得现有技术中的环签名的方案在面对需要大量签名应用场景时,无法实现高频率的交易数据的快速响应导致签名效率低。在本申请方案中,通过对环签名外部进行优化,可移植当前最佳的环签名算法,在此基础上,进一步提升了环签名的性能。另一方面,现有技术是针对单次签名进行研究,在本申请方案中,针对集体签名进行研究,扩展了环签名的应用范围,引入多方安全计算实现多个参与者的意见收集,采用智能合约作为可信机构实施安全的环签名,面对高频率的集体签名具有较好的性能。In the prior art, the interior of the ring signature is generally optimized, so that the ring signature solution in the prior art cannot achieve a rapid response to high-frequency transaction data when faced with application scenarios requiring a large number of signatures, resulting in low signature efficiency. In the solution of the present application, by optimizing the outside of the ring signature, the current best ring signature algorithm can be transplanted, and on this basis, the performance of the ring signature is further improved. On the other hand, the prior art researches on single signature. In this application scheme, research on collective signature expands the application scope of ring signature, introduces multi-party secure computing to collect opinions from multiple participants, and adopts intelligent As a trusted organization, the contract implements a secure ring signature, and has better performance in the face of high-frequency collective signatures.
实施例一Example 1
请参阅图2,所示为本发明第一实施例中的基于智能合约的环签名方法,所述方法包括步骤S101至步骤S103:Please refer to FIG. 2 , which shows the smart contract-based ring signature method in the first embodiment of the present invention. The method includes steps S101 to S103:
S101、获取所有参与者的公钥,并生成和参与者数量对应的多组初始随机数。S101. Obtain public keys of all participants, and generate multiple groups of initial random numbers corresponding to the number of participants.
图3为本发明申请中的环签名原理图。智能合约为发明申请中的环签名的实施主体,也是环签名中的私钥拥有方。除智能合约之外,参与者还包括环签名中的公钥拥有者。区块链作为智能合约和参与者之间数据交互的载体。签名步骤为:首先,智能合约发起环签名事件,获取所有参与本次环签名成员的公钥;然后,使用多方安全计算获取参与者的意见;之后,在智能合约中生成公私钥对,使用公私钥对中的私钥以及所有参与者的公钥进行环签名;最后,将签名公布到区块链中,完成签名。在整个环签名过程中,智能合约采用一次性密签方案。智能合约的公钥是随机生成的,其他参与者无法获得该公钥,而每一轮环签名都需要使用所有参与者的公钥密钥,因此无法伪造智能合约的签名。智能合约收集的参与者意见将按公式(5)进行处理,公式(5)如下:FIG. 3 is a schematic diagram of the ring signature in the application of the present invention. The smart contract is the implementation subject of the ring signature in the invention application and the owner of the private key in the ring signature. In addition to smart contracts, participants also include public key owners in ring signatures. Blockchain acts as the carrier of data interaction between smart contracts and participants. The signing steps are: first, the smart contract initiates a ring signature event to obtain the public keys of all members participating in this ring signature; then, uses multi-party secure computing to obtain the opinions of the participants; after that, generates a public-private key pair in the smart contract, using The private key in the key pair and the public keys of all participants are ring signed; finally, the signature is published to the blockchain to complete the signature. In the whole ring signature process, the smart contract adopts the one-time secret signature scheme. The public key of the smart contract is randomly generated, and other participants cannot obtain the public key, and each round of ring signature requires the use of the public key of all participants, so the signature of the smart contract cannot be forged. The participant opinions collected by the smart contract will be processed according to formula (5), which is as follows:
其中,为赞成比例,v为赞成人数,n代表除智能合约外的参与者人数,智能合约不对总体意见进行定性,而是将赞成比例作为参数添加到签名中,组成。在签名验证阶段,赞成比例和预先设定的系数将进行比较,然后确定最终意见,从而更符合实际需要。最后,与改进前的环签名相比,本申请使用的环签名方法只需要一次环签名就可完成参与者意见的收集。in, is the approval ratio, v is the number of approvals, n represents the number of participants except for the smart contract, the smart contract does not characterize the overall opinion, but the percentage of approval added as a parameter to the signature, consisting of . In the signature verification stage, the approval ratio and the pre-set coefficients will be compared, and then the final opinion will be determined, which is more in line with the actual needs. Finally, compared with the ring signature before the improvement, the ring signature method used in this application only needs one ring signature to complete the collection of participants' opinions.
S102、根据参与者的公钥对初始随机数进行数据加密,并将数据加密得到的随机数密文发送至对应参与者,以使参与者根据自身私钥解密随机数密文得到随机数原文、并结合自身意见对随机数原文进行数据处理得到目标随机数。S102: Encrypt the data of the initial random number according to the public key of the participant, and send the ciphertext of the random number obtained by the data encryption to the corresponding participant, so that the participant can decrypt the ciphertext of the random number according to the private key of the participant to obtain the original text of the random number, And combined with their own opinions, the original random number data is processed to obtain the target random number.
图4为多方安全计算示意图。多方安全计算是一种多个参与者在不泄露自身隐私的前提下完成某个计算任务的方法。本申请利用多方安全计算的原理完成对环签名参与者意见的收集。在多方安全计算中需要一个机构对数据进行综合计算,在本申请方案中,采用智能合约作为计算中介。具体分两步:首先,智能合约收集所有参与者的公钥;然后,生成对应参与者数量的随机数(x i 为对应参与者的随机数,,N*为正整数),并使用参与者的公钥对这些随机数逐一加密,之后将随机数密文发送给对应的参与者;参与者使用自身的私钥进行解密获取随机数原文,然后根据自身意见进行处理,如果赞成就将随机数进行加一,如果反对或者弃权,随机数保持不变,最后将处理完毕的随机数发送给智能合约;智能合约收集完所有参与者处理后的随机数后,将根据公式(6)进行计算,获取参与者的整体意见情况,公式(6)具体如下:Figure 4 is a schematic diagram of multi-party secure computing. Multi-party secure computing is a method in which multiple participants complete a computing task without revealing their privacy. This application uses the principle of multi-party secure computing to complete the collection of ring signature participants' opinions. In the multi-party secure calculation, an organization is required to comprehensively calculate the data. In this application scheme, a smart contract is used as a calculation intermediary. It is divided into two steps: first, the smart contract collects the public keys of all participants; then, generates a random number corresponding to the number of participants ( x i is the random number of the corresponding participant, , N* is a positive integer), and use the public key of the participant to encrypt these random numbers one by one, and then send the random number ciphertext to the corresponding participant; the participant uses his own private key to decrypt the random number to obtain the original text, and then According to their own opinions, the random number will be increased by one if they are in favor. If they are opposed or abstained, the random number will remain unchanged. Finally, the processed random number will be sent to the smart contract; the smart contract will collect the random number processed by all participants. After counting, it will be calculated according to the formula (6) to obtain the overall opinions of the participants. The formula (6) is as follows:
v=N ’ -N(6) v=N ' -N (6)
其中v为持赞成意见人数,N ’ 为所有参与者处理后的随机数之和,N为生成的随机数之和。在整个过程中,智能合约和参与者并不是直接进行数据交互,而是要经过区块链的存储;智能合约生成的随机数传输时需要先进行加密处理,而参与者处理后的随机数可原文传输。在这个过程中,参与者之间无法得悉其他人的随机数处理情况,从而隐藏了参与者的意见。智能合约在本申请中作为可信第三方不会泄露用户的隐私数据,且其计算出的结果仅显示参与者整体的意见情况,不涉及各参与者详细的意见。因此,本申请使用的多方安全计算方法可有效隐藏参与者意见并完成总体意见收集。Where v is the number of people who agree, N ' is the sum of the random numbers processed by all participants, and N is the sum of the generated random numbers. In the whole process, the smart contract and the participants do not directly interact with data, but need to be stored in the blockchain; the random number generated by the smart contract needs to be encrypted before being transmitted, and the random number processed by the participants can be original transmission. In this process, the participants cannot learn about the random number processing of others, thus hiding the participants' opinions. In this application, as a trusted third party, the smart contract will not disclose the user's private data, and the calculated result only shows the overall opinions of the participants, and does not involve the detailed opinions of each participant. Therefore, the multi-party secure computing method used in this application can effectively hide participants' opinions and complete the overall opinion collection.
需要进一步说明的是,在上述步骤中提及到的随机数是用于多方安全计算的随机数,而图5中所提及到的随机数,是用于参与环签名的随机数,两者性质不同。It should be further noted that the random number mentioned in the above steps is a random number used for multi-party secure calculation, while the random number mentioned in Figure 5 is a random number used for participating in ring signatures. different in nature.
S103、对目标随机数结合参与者数量通过计算以获得赞成比例,并根据密钥生成算法随机生成实施者公私钥对,根据参与者的公钥结合实施者公私钥对、以及赞成比例进行环签名并生成签名结果。S103. Calculate the target random number combined with the number of participants to obtain the approval ratio, and randomly generate a public-private key pair of the implementer according to the key generation algorithm, and perform a ring signature according to the public key of the participant combined with the public-private key pair of the implementer and the approval ratio and generate the signature result.
在本申请中,公私钥对是随机生成,且每次环签名都需要重新生成,从而使得每次签名都对应不同的密钥,即实现“一签一密”。通过多方安全计算进行签字方的意见收集,保护了联盟链中数据交互过程中的签名方隐私,并使用智能合约技术进行签名过程组织,制订的“一签一密”签名策略,保障了签名不可伪造。In this application, the public-private key pair is randomly generated, and each ring signature needs to be regenerated, so that each signature corresponds to a different key, that is, "one-sign-one-crypto" is realized. Collecting the opinions of the signatory through multi-party secure calculation, protecting the privacy of the signatory in the process of data interaction in the alliance chain, and using smart contract technology to organize the signature process, the "one-sign-one-secret" signature strategy formulated to ensure that the signature cannot be forgery.
图5为本发明申请中的环签名中的签名流程图。前提条件为在智能合约中已获得所有参与者的公钥以及通过多方安全计算获取投票赞成意见数。首先,将赞成意见数除以参加人数,其商作为赞成比例;然后调用密钥生成算法,得到一组公私钥对,将公钥加入参与者组成的公钥组中,把私钥作为参数调用镜像函数生成密钥镜像。之后,开始正式环签名,先从私钥开始处理,生成一个随机数u,并按照公式(2)进行计算得到下一个签名者的挑战C S+1 ;FIG. 5 is a flow chart of the signature in the ring signature in the application of the present invention. The prerequisites are that the public keys of all participants have been obtained in the smart contract and the number of votes in favor of votes has been obtained through multi-party secure calculation. First, divide the number of approval opinions by the number of participants, and the quotient is used as the approval ratio; then call the key generation algorithm to obtain a set of public and private key pairs, add the public key to the public key group composed of participants, and call the private key as a parameter The mirror function generates a key mirror. After that, start the formal ring signature, start processing from the private key, generate a random number u , and calculate according to formula (2) to obtain the challenge C S+1 of the next signer;
接着对除智能合约之外的公钥进行逐一处理,每个公钥签名时需要生成一个随机数S i ,并按照公式(1)进行计算得到下一个挑战,当挑战值的下标达到数组长度时替换成下标为0的挑战,直至计算出私钥对应下标的挑战C S ,此时,所有公钥都签名完毕;Next, the public keys other than the smart contract are processed one by one. When signing each public key, a random number S i needs to be generated, and the next challenge is calculated according to formula (1). When the subscript of the challenge value reaches the length of the array Replace the challenge with the subscript 0 until the challenge CS corresponding to the subscript of the private key is calculated. At this time, all public keys are signed;
然后根据所得的挑战C S ,按照公式(3)计算出私钥对应的随机数S S ,随机数组是S,S S =S[s],是数组的一个元素;最后将签名的内容m,赞成比例以及生成的C 0 和所有参与者生成的随机数组S一并加入签名中,到此环签名完成。Then according to the obtained challenge C S , the random number S S corresponding to the private key is calculated according to formula (3). The random array is S, S S =S[s], which is an element of the array; finally, the content m of the signature, Approval ratio And the generated C 0 and the random array S generated by all participants are added to the signature, and the ring signature is completed.
环签名包括签名阶段和验证阶段,如图6所示为签名验证流程图。先获取环签名和预设比例P,再从环签名中获取随机数组S;然后按照公式(1)计算出挑战,从C 1 开始,按顺序一直重复计算出C n ,并赋值给C 0 ,n为随机数组S长度;之后验证计算的C 0 和签名中的是否一致,不一致则验证失败,一致则使用预设比例P和签名中的赞成比例进行对比,得出最终总体签名意见(赞成比例大于等于预设比例,表示赞成,否则反对),验证结束。Ring signature includes a signature phase and a verification phase, as shown in Figure 6 for the signature verification flow chart. Get the ring signature first and the preset ratio P , and then obtain the random array S from the ring signature; then calculate the challenge according to formula (1), starting from C 1 , repeatedly calculate C n in sequence, and assign it to C 0 , n is a random array S length; then verify whether the calculated C 0 is consistent with that in the signature. If they are inconsistent, the verification fails. If they are consistent, the preset ratio P and the approval ratio in the signature are used. Make a comparison to get the final overall signature opinion (the percentage of approval is greater than or equal to the preset percentage, indicating approval, otherwise disapproval), and the verification is over.
综上,本发明上述实施例当中的基于智能合约的环签名方法,通过根据参与者的公钥对初始随机数进行数据加密,并将数据加密得到的随机数密文发送至对应参与者,以使参与者根据自身私钥解密随机数密文得到随机数原文、并结合自身意见对随机数原文进行数据处理得到目标随机数,以使智能合约得到各个参与者的整体意见情况,而后再对得到的整体意见进行环签名,实现对集体环签名场景的研究,从而实现只需一次环签名即可完成参与者意见的收集,使得环签名与参与者的数量无关,实现了交易数据的快速响应,提高了签名效率,进一步的,根据参与者的公钥结合实施者公私钥对、以及赞成比例进行环签名并生成签名结果,通过对环签名的外部进行优化而后加入至现有的环签名方案中,使得优化后的方案对于环签名具有可移植性,进一步提升了环签名的性能,解决现有技术中的环签名的方案在面对需要大量签名应用场景时,无法实现高频率的交易数据的快速响应导致签名效率低的技术问题。To sum up, the ring signature method based on the smart contract in the above-mentioned embodiments of the present invention encrypts the data of the initial random number according to the public key of the participant, and sends the ciphertext of the random number obtained by encrypting the data to the corresponding participant, so that the Let the participants decrypt the random number ciphertext according to their own private keys to obtain the original random number, and combine their own opinions to process the original random number to obtain the target random number, so that the smart contract can obtain the overall opinion of each participant, and then the obtained random number is obtained. The overall opinion of the network is ring signed, and the research on the collective ring signature scene is realized, so that only one ring signature can complete the collection of participants' opinions, so that the ring signature has nothing to do with the number of participants, and realizes the rapid response of transaction data. The efficiency of signing is improved. Further, according to the public key of the participant, the public and private key pair of the implementer, and the approval ratio, the ring signature is performed and the signature result is generated. After optimizing the outside of the ring signature, it is added to the existing ring signature scheme. , making the optimized scheme portable for ring signatures, further improving the performance of ring signatures, and solving the ring signature scheme in the prior art, when faced with application scenarios that require a large number of signatures, it cannot achieve high-frequency transaction data. Quick response to technical issues that lead to inefficient signatures.
实施例二Embodiment 2
请查阅图7,所示为本发明第二实施例中的基于智能合约的环签名方法:所述方法包括步骤S201至步骤S205:Please refer to FIG. 7, which shows a smart contract-based ring signature method in the second embodiment of the present invention: the method includes steps S201 to S205:
S201、获取所有参与者的公钥,并生成和参与者数量对应的多组初始随机数。S201. Obtain public keys of all participants, and generate multiple groups of initial random numbers corresponding to the number of participants.
以某一班级对张三投票,决定其是否担任班长职务为例对本申请中的方案进行说明。规定,若获取半数及以上赞成投票,则代表竞选成功。本次投票采用本申请方案中的投票系统,开始阶段,班上每个成员在平台上注册账号,系统会为其生成独有的公私钥对。班主任在平台上发起投票事件,班上成员上传各自的公钥到系统中。The scheme in this application is explained by taking the example of a class voting on Zhang San to decide whether to hold the position of monitor. It is stipulated that if half or more of the affirmative votes are obtained, the election will be successful. This voting adopts the voting system in the application scheme. In the initial stage, each member of the class registers an account on the platform, and the system will generate a unique public and private key pair for it. The class teacher initiates a voting event on the platform, and class members upload their public keys to the system.
S202、根据参与者的公钥对初始随机数进行数据加密,并将数据加密得到的随机数密文发送至对应参与者,以使参与者根据自身私钥解密随机数密文得到随机数原文、并结合自身意见对随机数原文进行数据处理得到目标随机数。S202: Encrypt the data of the initial random number according to the public key of the participant, and send the ciphertext of the random number obtained by the data encryption to the corresponding participant, so that the participant can decrypt the ciphertext of the random number according to the private key of the participant to obtain the original text of the random number, And combined with their own opinions, the original random number data is processed to obtain the target random number.
在上述步骤中,需要进一步说明的是,目标随机数仅显示所有参与者的整体意见情况,不涉及各个参与者的详细意见信息。进一步的,数据处理包括:若赞成则将初始随机数加1;若反对或者弃权,初始随机数保持不变。In the above steps, it should be further explained that the target random number only displays the overall opinion of all participants, and does not involve the detailed opinion information of each participant. Further, the data processing includes: adding 1 to the initial random number if approved; if opposing or abstaining, the initial random number remains unchanged.
作为一个具体示例,在系统内部(智能合约),会为每个班上成员分配一个随机数,并使用其上传的公钥进行加密,然后将加密的随机数发送给各个成员。班上成员获取加密的随机数后,通过各自的私钥进行解密可获取随机数原文。此时,在界面上会弹出赞成和反对的选择栏,若选择赞成,随机数会自动加一,若选择反对,随机数保持不变。当选择完毕后,处理后的随机数会上传到系统中(智能合约)。As a specific example, inside the system (smart contract), each class member is assigned a random number, encrypted with its uploaded public key, and then the encrypted random number is sent to each member. After the members of the class obtain the encrypted random number, they can obtain the original random number by decrypting with their private key. At this point, a selection bar for yes and no will pop up on the interface. If you choose yes, the random number will automatically increase by one. If you choose no, the random number will remain unchanged. When the selection is complete, the processed random number will be uploaded to the system (smart contract).
S203、将目标随机数无需加密上传至区块链上。S203, upload the target random number to the blockchain without encryption.
S204、对目标随机数结合参与者数量通过计算以获得赞成比例,并根据密钥生成算法随机生成实施者公私钥对,根据参与者的公钥结合实施者公私钥对、以及赞成比例进行环签名并生成签名结果。S204: Calculate the target random number combined with the number of participants to obtain the approval ratio, and randomly generate a public-private key pair of the implementer according to the key generation algorithm, and perform a ring signature according to the public key of the participant combined with the public-private key pair of the implementer and the approval ratio and generate the signature result.
具体的,计算目标随机数与初始随机数之差以获得赞成人数;根据赞成人数结合参与者数量获得赞成比例。Specifically, the difference between the target random number and the initial random number is calculated to obtain the number of approvals; the approval ratio is obtained according to the number of approvals combined with 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 allocated random numbers, and combine the number of votes to obtain the approval ratio. At this point, the system triggers a signature event. First, a set of public and private key pairs are randomly generated in the system, and then the preset ring signature algorithm is called with the obtained public keys of all voters and the public and private key pairs generated by the system as parameters. Generate a signature, and add the approval ratio to the signature as the final signature result.
S205、获取签名结果并将签名结果分发至每一参与者,结合预设比例对签名结果进行签名验证。S205: Obtain the signature result and distribute the signature result to each participant, and perform signature verification on the signature result in combination with a preset ratio.
具体的,进行签名验证的步骤包括:结合预设比例对所述签名结果进行签名验证,判断签名结果是否有效;若签名无效,则显示验证结果为无效;若签名有效,则结合赞成比例对比预设比例,判断赞成比例是否大于预设比例;若是,则生成的最终总体签名意见为赞成;若否,则生成的最终总体签名意见为反对。Specifically, the step of performing signature verification includes: performing signature verification on the signature result in combination with a preset ratio, 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 pre-approved ratio Set the ratio to determine whether the approval ratio is greater than the preset ratio; if so, the final overall signature opinion generated is in favour; if not, the final overall signature opinion generated is against.
签名结束后,系统会将签名发送给每个班上成员,班上成员输入预设比例(即,满足竞选成功的最小赞成比例,例如1/2)可进行签名验证。在验证过程中,系统会将所有签名的公钥(包括智能合约的公钥)以及签名作为参数,调用签名验证算法,验证签名的有效性并对比赞成比例和预设比例的大小,若赞成比例大于等于预设比例,则输出意见为赞成,否则,为反对;最后,将验证结果和意见反馈给各个班上成员。班主任根据得到的意见决定张三是否成为班长。After the signing, the system will send the signature to each class member, and the class members can enter a preset ratio (that is, the minimum approval ratio that satisfies the election success, such as 1/2) for signature verification. During the verification process, the system will use the public key of all signatures (including the public key of the smart contract) and the signature as parameters, call the signature verification algorithm, verify the validity of the signature, and compare the approval ratio with the preset ratio. If it is greater than or equal to the preset ratio, the output opinion is in favor, otherwise, it is against; finally, the verification results and opinions are fed back to each class member. The head teacher decides whether Zhang San will become the head of the squad based on the opinions obtained.
综上,本发明上述实施例当中的基于智能合约的环签名方法,通过根据参与者的公钥对初始随机数进行数据加密,并将数据加密得到的随机数密文发送至对应参与者,以使参与者根据自身私钥解密随机数密文得到随机数原文、并结合自身意见对随机数原文进行数据处理得到目标随机数,以使智能合约得到各个参与者的整体意见情况,而后再对得到的整体意见进行环签名,实现对集体环签名场景的研究,从而实现只需一次环签名即可完成参与者意见的收集,使得环签名与参与者的数量无关,实现了交易数据的快速响应,提高了签名效率,进一步的,根据参与者的公钥结合实施者公私钥对、以及赞成比例进行环签名并生成签名结果,通过对环签名的外部进行优化而后加入至现有的环签名方案中,使得优化后的方案对于环签名具有可移植性,进一步提升了环签名的性能,解决现有技术中的环签名的方案在面对需要大量签名应用场景时,无法实现高频率的交易数据的快速响应导致签名效率低的技术问题。To sum up, the ring signature method based on the smart contract in the above-mentioned embodiments of the present invention encrypts the data of the initial random number according to the public key of the participant, and sends the ciphertext of the random number obtained by encrypting the data to the corresponding participant, so that the Let the participants decrypt the random number ciphertext according to their own private keys to obtain the original random number, and combine their own opinions to process the original random number to obtain the target random number, so that the smart contract can obtain the overall opinion of each participant, and then the obtained random number is obtained. The overall opinion of the network is ring signed, and the research on the collective ring signature scene is realized, so that only one ring signature can complete the collection of participants' opinions, so that the ring signature has nothing to do with the number of participants, and realizes the rapid response of transaction data. The efficiency of signing is improved. Further, according to the public key of the participant, the public and private key pair of the implementer, and the approval ratio, the ring signature is performed and the signature result is generated. After optimizing the outside of the ring signature, it is added to the existing ring signature scheme. , making the optimized scheme portable for ring signatures, further improving the performance of ring signatures, and solving the ring signature scheme in the prior art, when faced with application scenarios that require a large number of signatures, it cannot achieve high-frequency transaction data. Quick response to technical issues that lead to inefficient signatures.
实施例三Embodiment 3
请参阅图8,所示为本发明第三实施例中的基于智能合约的环签名系统,所述系统包括:Please refer to FIG. 8 , which shows a ring signature system based on a smart contract in a third embodiment of the present invention. The system includes:
获取模块,用于获取所有参与者的公钥,并生成和参与者数量对应的多组初始随机数;The acquisition module is used to acquire the public keys of all participants and generate multiple groups of initial random numbers corresponding to the number of participants;
数据处理模块,用于根据参与者的公钥对所述初始随机数进行数据加密,并将数据加密得到的随机数密文发送至对应参与者,以使参与者根据自身私钥解密所述随机数密文得到随机数原文、并结合自身意见对所述随机数原文进行数据处理得到目标随机数;The data processing module is used for performing data encryption on the initial random number according to the public key of the participant, and sending the ciphertext of the random number obtained by the data encryption to the corresponding participant, so that the participant can decrypt the random number according to the private key of the participant. The original random number is obtained by counting the ciphertext, and the original random number is obtained by data processing in combination with its own opinions;
签名模块,用于对所述目标随机数结合参与者数量通过计算以获得赞成比例,并根据密钥生成算法随机生成实施者公私钥对,根据参与者的公钥结合所述实施者公私钥对、以及所述赞成比例进行环签名并生成签名结果。The signature module is used to calculate the target random number combined with the number of participants to obtain the approval ratio, and randomly generate a public-private key pair of the implementer according to the key generation algorithm, and combine the public-private key pair of the implementer according to the public key of the participant , and the approval ratio to perform ring signature and generate a signature result.
在一些可选实施例中,数据处理模块包括:In some optional embodiments, the data processing module includes:
第一执行单元,用于当赞成时,则将所述初始随机数加1;a first execution unit, for adding 1 to the initial random number when it is approved;
第二执行单元,用于当反对或者弃权时,所述初始随机数保持不变。The second execution unit is used to keep the initial random number unchanged when objecting or abstaining.
在一些可选实施例中,签名模块之后包括:In some optional embodiments, the signature module includes:
验证模块,用于获取所述签名结果并将所述签名结果分发至每一参与者,结合预设比例对所述签名结果进行签名验证。A verification module, configured to obtain the signature result and distribute the signature result to each participant, and perform signature verification on the signature result in combination with a preset ratio.
在一些可选实施例中,验证模块包括:In some optional embodiments, the verification module includes:
第一判断单元,结合预设比例对所述签名结果进行签名验证,判断签名结果是否有效;a first judgment unit, performing signature verification on the signature result in combination with a preset ratio, and judging whether the signature result is valid;
第三执行单元,用于当签名无效时,则显示验证结果为无效;The third execution unit is used to display 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;
第一执行子单元,用于当赞成比例大于所述预设比例时,则生成的最终总体签名意见为赞成;a first execution sub-unit, configured to generate a final overall signature opinion as approval when the approval ratio is greater than the preset ratio;
第二执行子单元,用于当赞成比例不大于所述预设比例时,则生成的最终总体签名意见为反对。The second execution sub-unit is configured to generate the final overall signature opinion as disapproval when the approval ratio is not greater than the preset ratio.
在一些可选实施例中,签名模块之前包括:In some optional embodiments, the signature module includes:
上传模块,用于将所述目标随机数无需加密上传至区块链上。The uploading module is used to upload the target random number to the blockchain without encryption.
在一些可选实施例中,签名模块包括:In some optional embodiments, the signature module includes:
赞成人数计算单元,用于计算所述目标随机数与所述初始随机数之差以获得赞成人数;a number of likes calculation unit, used to calculate the difference between the target random number and the initial random number to obtain the number of likes;
赞成比例计算单元,用于根据所述赞成人数结合参与者数量获得赞成比例。The approval ratio calculation unit is used to obtain the approval ratio according to the approval number combined with the number of participants.
综上,本发明上述实施例当中的基于智能合约的环签名系统,通过根据参与者的公钥对初始随机数进行数据加密,并将数据加密得到的随机数密文发送至对应参与者,以使参与者根据自身私钥解密随机数密文得到随机数原文、并结合自身意见对随机数原文进行数据处理得到目标随机数,以使智能合约得到各个参与者的整体意见情况,而后再对得到的整体意见进行环签名,实现对集体环签名场景的研究,从而实现只需一次环签名即可完成参与者意见的收集,使得环签名与参与者的数量无关,实现了交易数据的快速响应,提高了签名效率,进一步的,根据参与者的公钥结合实施者公私钥对、以及赞成比例进行环签名并生成签名结果,通过对环签名的外部进行优化而后加入至现有的环签名方案中,使得优化后的方案对于环签名具有可移植性,进一步提升了环签名的性能,解决现有技术中的环签名的方案在面对需要大量签名应用场景时,无法实现高频率的交易数据的快速响应导致签名效率低的技术问题。To sum up, the ring signature system based on the smart contract in the above-mentioned embodiments of the present invention encrypts the data of the initial random number according to the public key of the participant, and sends the ciphertext of the random number obtained by encrypting the data to the corresponding participant, so that the Let the participants decrypt the random number ciphertext according to their own private keys to obtain the original random number, and combine their own opinions to process the original random number to obtain the target random number, so that the smart contract can obtain the overall opinion of each participant, and then the obtained random number is obtained. The overall opinion of the network is ring signed, and the research on the collective ring signature scene is realized, so that only one ring signature can complete the collection of participants' opinions, so that the ring signature has nothing to do with the number of participants, and realizes the rapid response of transaction data. The efficiency of signing is improved. Further, according to the public key of the participant, the public and private key pair of the implementer, and the approval ratio, the ring signature is performed and the signature result is generated. After optimizing the outside of the ring signature, it is added to the existing ring signature scheme. , making the optimized scheme portable for ring signatures, further improving the performance of ring signatures, and solving the ring signature scheme in the prior art, when faced with application scenarios that require a large number of signatures, it cannot achieve high-frequency transaction data. Quick response to technical issues that lead to inefficient signatures.
此外,本发明的实施例还提出一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述实施例中方法的步骤。In addition, an embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, implements the steps of the method in the foregoing embodiment.
此外,本发明的实施例还提出一种数据处理设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,处理器执行程序时实现上述实施例中方法的步骤。In addition, an embodiment of the present invention also provides a data processing device, including a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the steps of the methods in the above embodiments when the processor executes the program.
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,“计算机可读介质”可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。The logic and/or steps represented in flowcharts or otherwise described herein, for example, may be considered an ordered listing of executable instructions for implementing the logical functions, may be embodied in any computer-readable medium, For use with, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch instructions from and execute instructions from an instruction execution system, apparatus, or apparatus) or equipment. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport the program for use by or in connection with an instruction execution system, apparatus, or apparatus.
计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得程序,然后将其存储在计算机存储器中。More specific examples (non-exhaustive list) of computer readable media include the following: electrical connections with one or more wiring (electronic devices), portable computer disk cartridges (magnetic devices), random access memory (RAM), Read Only Memory (ROM), Erasable Editable Read Only Memory (EPROM or Flash Memory), Fiber Optic Devices, and Portable Compact Disc Read Only Memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program may be printed, as may be done, for example, by optically scanning the paper or other medium, followed by editing, interpretation, or other suitable means as necessary process to obtain the program electronically and then store it in computer memory.
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that various parts of the present invention may be implemented in hardware, software, firmware or a combination thereof. In the above-described embodiments, 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, it can be implemented by any one or a combination of the following techniques known in the art: Discrete logic circuits, ASICs with suitable combinational logic gates, Programmable Gate Arrays (PGA), Field Programmable Gate Arrays (FPGA), etc.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、 “示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of this specification, description with reference to the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples", etc., mean specific features described in connection with the embodiment or example , structure, material or feature is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms 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.
尽管已经示出和描述了本发明的实施例,本领域的普通技术人员可以理解:在不脱离本发明的原理和宗旨的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由权利要求及其等同物限定。Although embodiments of the present 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 in these embodiments without departing from the principles and spirit of the invention, The scope of the invention is defined by the claims and their equivalents.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210260900.4A CN114362970B (en) | 2022-03-17 | 2022-03-17 | 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) | 2022-03-17 | 2022-03-17 | Ring signature method, system, storage medium and equipment based on intelligent contract |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114362970A CN114362970A (en) | 2022-04-15 |
CN114362970B true CN114362970B (en) | 2022-07-05 |
Family
ID=81095201
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210260900.4A Active CN114362970B (en) | 2022-03-17 | 2022-03-17 | Ring signature method, system, storage medium and equipment based on intelligent contract |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114362970B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115619947B (en) * | 2022-12-19 | 2023-12-26 | 江西农业大学 | Three-dimensional modeling cooperation method and system based on blockchain |
CN117040928B (en) * | 2023-10-08 | 2024-02-09 | 广州市悦智计算机有限公司 | Method for realizing voting right privacy distribution based on blockchain intelligent contract |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106779704A (en) * | 2016-12-06 | 2017-05-31 | 杭州趣链科技有限公司 | A kind of block chain anonymous deal method based on ring signatures |
CN109257184A (en) * | 2018-11-08 | 2019-01-22 | 西安电子科技大学 | Linkable Ring Signature Method Based on Anonymous Broadcast Encryption |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107453865B (en) * | 2017-07-18 | 2020-09-11 | 众安信息技术服务有限公司 | A multi-party data sharing method and system for protecting the privacy of data transmission source |
US11062054B2 (en) * | 2018-09-06 | 2021-07-13 | MadHive, Inc. | Methods and system for providing oversight and auditing of advertisement impressions and for running advertisement campaigns |
CN109067547A (en) * | 2018-09-21 | 2018-12-21 | 北京计算机技术及应用研究所 | A kind of block chain method for secret protection based on disposable ring signatures |
US10790990B2 (en) * | 2019-06-26 | 2020-09-29 | Alibaba Group Holding Limited | Ring signature-based anonymous transaction |
WO2021022246A1 (en) * | 2019-08-01 | 2021-02-04 | Coinbase, Inc. | Systems and methods for generating signatures |
CN113360943B (en) * | 2021-06-23 | 2024-10-18 | 京东科技信息技术有限公司 | Block chain privacy data protection method and device |
-
2022
- 2022-03-17 CN CN202210260900.4A patent/CN114362970B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106779704A (en) * | 2016-12-06 | 2017-05-31 | 杭州趣链科技有限公司 | A kind of block chain anonymous deal method based on ring signatures |
CN109257184A (en) * | 2018-11-08 | 2019-01-22 | 西安电子科技大学 | Linkable Ring Signature Method Based on Anonymous Broadcast Encryption |
Non-Patent Citations (1)
Title |
---|
基于联盟链的匿名电子投票方案;于天娇等;《网络空间安全》;20191225(第12期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN114362970A (en) | 2022-04-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
RU2652443C1 (en) | Voters votes quantity collected by electronic voting determining system and method | |
Ziegeldorf et al. | Coinparty: Secure multi-party mixing of bitcoins | |
CN108418689B (en) | Zero-knowledge proof method and medium suitable for block chain privacy protection | |
Eskandarian et al. | Clarion: Anonymous communication from multiparty shuffling protocols | |
Wei et al. | SecCloud: Bridging secure storage and computation in cloud | |
Damgård et al. | Unclonable group identification | |
US9218623B2 (en) | System and method for providing private stable matchings | |
JP2008503966A (en) | Anonymous certificate for anonymous certificate presentation | |
CN114362970B (en) | Ring signature method, system, storage medium and equipment based on intelligent contract | |
Li et al. | Zerocross: A sidechain-based privacy-preserving cross-chain solution for monero | |
CN110224984A (en) | A kind of multi-party authorization method and device based on block chain technology | |
Zhang et al. | Blockchain-based secure and fair crowdsourcing scheme | |
JPWO2007105749A1 (en) | Group signature system and information processing method | |
CN115336224A (en) | Adaptive attack-resistant distributed symmetric encryption | |
Li et al. | AvecVoting: Anonymous and verifiable E-voting with untrustworthy counters on blockchain | |
Abe et al. | Universally composable adaptive oblivious transfer (with access control) from standard assumptions | |
Chenli et al. | Fairtrade: Efficient atomic exchange-based fair exchange protocol for digital data trading | |
CN112887399B (en) | Privacy security management system based on block chain | |
Wei et al. | Efficient dynamic replicated data possession checking in distributed cloud storage systems | |
Bera et al. | Designing attribute-based verifiable data storage and retrieval scheme in cloud computing environment | |
CN117972717A (en) | Trusted security multiparty computing method and device based on blockchain | |
Wüller | Privacy-preserving electronic bartering | |
Xiao et al. | Tightly secure two-pass authenticated key exchange protocol in the CK model | |
Huang et al. | Ambiguous optimistic fair exchange: Definition and constructions | |
Wen et al. | A new efficient authorized private set intersection protocol from Schnorr signature and its applications |
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 |