WO2021196473A1 - Electronic voting method and device, computer, and storage medium - Google Patents

Electronic voting method and device, computer, and storage medium Download PDF

Info

Publication number
WO2021196473A1
WO2021196473A1 PCT/CN2020/105885 CN2020105885W WO2021196473A1 WO 2021196473 A1 WO2021196473 A1 WO 2021196473A1 CN 2020105885 W CN2020105885 W CN 2020105885W WO 2021196473 A1 WO2021196473 A1 WO 2021196473A1
Authority
WO
WIPO (PCT)
Prior art keywords
voting
account
initiator
participating
terminal
Prior art date
Application number
PCT/CN2020/105885
Other languages
French (fr)
Chinese (zh)
Inventor
张宝
谢丹力
王梦寒
朱斌
贾牧
褚镇飞
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2021196473A1 publication Critical patent/WO2021196473A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/32User authentication using biometric data, e.g. fingerprints, iris scans or voiceprints
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C13/00Voting apparatus

Definitions

  • This application relates to the field of blockchain, in particular to an electronic voting method, device, computer equipment and storage medium.
  • the so-called hot account problem refers to: If multiple write or update operations are performed on the same address (or account) within time T on the blockchain, only one write or update operation can succeed at most, and all other writes or operations Both will fail; the time T here is mainly the time when the block chain is generated (ie: the time when the update operation takes effect); for example, suppose that during the time T, two voters A and B both voted on the articles of incorporation 1 vote in favor, and before the vote, the original vote in favor was 5.
  • voter A may initiate a vote on a node (voter A sees that his vote is completed , Vote for 6), and voter B initiates a vote on another node (after voter B sees that his vote is completed, the vote for vote is also 6), these two nodes are not aware of the existence of the vote of the other node, At this time, when the blockchain archives the proposals of each node and finally generates a block, only one voter can vote successfully, that is, one vote of yes is lost.
  • the main purpose of this application is to provide an electronic voting method, device, computer, and storage meson, aiming to solve the technical problem of hot accounts generated when using the blockchain for electronic voting in the prior art.
  • this application proposes an electronic voting method, including:
  • This application also provides an electronic voting device, including:
  • the receiving and initiating unit is configured to receive an electronic voting application sent by the initiating end, wherein the electronic voting application contains information about a proposal scheme and a voting agenda;
  • the qualification determining unit is used to determine whether the initiator is qualified to initiate electronic voting through a smart contract
  • the collection unit is used to collect all the balances in the voting account corresponding to acceptAcc1 ⁇ to the approval account for storing the approval votes, and to collect the balances in all the voting accounts corresponding to acceptAcc2 ⁇ to Store the disapproval account in the negative.
  • the present application also provides a computer device, including a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, an electronic voting method is implemented, including:
  • This application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, an electronic voting method is realized, including:
  • the electronic voting method, device, computer equipment and storage medium of this application solve the hot account problem; improve the privacy of voting; the participant end does not need to ask for the voting address from the initiator before voting, it can be directly provided by the initiator
  • the key to calculate the corresponding account address; this application also supports audit review.
  • FIG. 1 is a schematic flowchart of an electronic voting method according to an embodiment of the application
  • FIG. 2 is a schematic block diagram of the structure of an electronic voting device according to an embodiment of the application.
  • FIG. 3 is a schematic block diagram of the structure of a computer device according to an embodiment of the application.
  • an embodiment of the present application provides an electronic voting method, which includes the steps:
  • the method of this application is a voting method based on blockchain technology, and the above steps are carried out on a blockchain system that supports distributed voting.
  • the above-mentioned initiator refers to a terminal with an initiating account logged in, which can be a terminal that can log in to the blockchain system, such as a mobile phone, a computer, or a tablet computer.
  • the above-mentioned proposal is the specific content of this voting.
  • the above-mentioned voting agenda mainly requires the specific voting process, such as stipulating when the voting is closed.
  • the above smart contract is a set of promises defined in digital form, including an agreement on which contract participants can execute these promises. Only after the initiator has passed the verification of the smart contract, can it be truly qualified to initiate electronic voting.
  • the above smart contract verifies whether the initiator has the qualification to initiate an electronic vote. In fact, it does not verify the terminal of the initiator, but verifies the account of the initiator logged in the terminal. In other embodiments, if the terminal and the initiating account must be in a bound state, then the smart contract needs to verify whether the terminal and the initiating account are in a bound state, and whether the initiating account is eligible to initiate electronic voting, and only those that are fully satisfied At that time, it will be determined that the initiator is eligible to initiate electronic voting.
  • the three public keys uploaded by the initiator: B1, B2, and B3 can be published on the blockchain system when uploading the electronic voting application, or when it is determined that the initiator has Uploaded to the blockchain system when the eligibility for electronic voting is initiated.
  • B1, B2, and B3 are the public keys of the voting account of the initiator; among them, B1 is the main public key of the initiator account, which has the same meaning as the traditional account public key address; and B2 and B3 are the initiators
  • B1 is the main public key of the initiator account, which has the same meaning as the traditional account public key address; and B2 and B3 are the initiators
  • the end account is used to derive the derived public key of the following second account (shadow account), which has the effect of confusing the address of the sub-account; specifically, B2 is used to derive all agreed account public keys, and B3 is used to derive all Oppose the account public key.
  • the number of bits of n mentioned above is 2048 bits, which can further improve security.
  • the electronic vote from the participant terminal is received, where the participant terminal refers to a terminal that logs in to a participant account that can vote, which can be a mobile phone, a computer, a tablet, or the like, which can log in to the above-mentioned blockchain system.
  • the public and private key pair (r, R) selected by the participant is different.
  • the corresponding second voting account will be established according to the voting results of the participating terminals, and there is no need to generate two second voting accounts for each participating account.
  • step S4 before the above step S4, it further includes: S401, receiving the identity CA certificate of the participant, and using the first private key of the identity CA certificate to sign the electronic voting application to obtain Sig; S402, corresponding The participant and the voting agenda generate a second private key, and use the second private key to generate a certificate to apply for CSR; S403, send the identity CA certificate, Sig, CSR, and the account address of the participant Perform identity verification for the initiator; S404, if the identity verification passed information fed back by the initiator is received, a command of "receive the electronic voting of each participant participating in the voting" is generated. That is, to verify whether the participating terminal has the right to participate in voting, only the participating terminal with the right to participate in voting can conduct this electronic voting.
  • step S5 after the voting agenda is over, the voting results need to be collected.
  • the method further includes:
  • the above agreed and opposed accounts are the accounts used to deposit the agreed balance and the opposed balance.
  • the blockchain system will establish a consent account and an objection account.
  • the balance of the second voting account that voted for the approval can be collected into the approval account.
  • the balance of the second voting account that voted against is collected into the opposition account.
  • the approval account and the objection account are set up in advance, so that the participating users who participate in the voting know in advance where the results will be reflected, etc., so that the focus of the participating accounts is aggregated on the approval account and the objection account.
  • the method before the step S4 of receiving the electronic voting of each participant participating in the voting, the method further includes:
  • the number of votes on the participating terminal refers to the original number of votes of participating users who use the participating terminal.
  • the above voting weight value represents a weight value of the voting of the participating user.
  • the number of votes of the aforementioned participating user can be the user’s equity value a
  • the voting weight value is the weight value b of the participating user’s equity value.
  • the participating user is the original shareholder, and its voting weight value is 10.
  • its voting balance is 10a. For example, if the participating user is an ordinary shareholder and its voting weight value is 1, then its voting balance is 1a, etc.
  • the method of converting the statistics of the normal number of votes into a balance is more in the form of a blockchain.
  • the above-mentioned blockchain system pre-records the voting weight value and the number of votes of all users who may participate in electronic voting.
  • step S41 of obtaining the number of votes possessed by the participating terminal and the voting weight value of the participating terminal through a smart contract includes:
  • S411 Determine the application type of the electronic voting application
  • S412 Determine the number of votes held by the participating terminal and the voting weight value of the participating terminal according to the application type.
  • the application types of electronic voting applications include multiple types, such as electronic voting applications for whether a certain business is to be carried out.
  • the application type is an ordinary application type, and its original shareholders and ordinary shareholders participate in the corresponding end Users have the same or similar voting weight value; another example is the electronic voting application for the removal of a shareholder's right.
  • the application type is a special application type.
  • the original shareholder's electronic voting weight value is much higher than that of ordinary shareholders. For example, the voting weight of the original shareholders is 10 times the voting weight of ordinary shareholders, etc.
  • the initiator actively enters the application type when initiating an electronic voting application, so that the electronic voting application will carry an identification signal for smart contract identification.
  • the contract will determine the type of application; for example, in the second type, the smart contract traverses the proposed scheme through keyword identification. If the preset number of keywords in the proposed scheme reaches the set threshold, the application type can be determined, such as in the proposed scheme If a specified number of "recall" keywords appear, it is determined that the application type is a special application. It should be noted that the keywords set in different fields are different and will be set according to the specific application scenarios of the blockchain system.
  • step S2 of judging whether the initiator is qualified to initiate electronic voting through a smart contract the method includes:
  • the face recognition is performed first, and the specific facial information matching process can use any of the existing ones.
  • the method of face recognition matching such as live body detection first, and then face recognition, etc., will not be repeated here.
  • step S2 of judging whether the initiator is qualified to initiate electronic voting through a smart contract includes:
  • the blockchain system first judges whether the originating account of the originating end is a management account, if so, it judges whether the electronic voting application carries the joint signature of other management accounts, and if so, it judges the originating end Have the qualifications to initiate electronic voting. That is to say, the account that initiates the electronic voting can only be a pre-set management account, and correspondingly, ordinary users cannot initiate the electronic voting process. For example, if a shareholder account with a shareholder's share of more than 20% is set as a management account, and other shareholder accounts are ordinary accounts, then only shareholder accounts with a share of more than 20% have the right to initiate electronic voting.
  • the joint signature of other management accounts is not necessarily the joint signature of all management accounts. It can be more than half of the management accounts.
  • the signature of the account, etc. can be set in advance according to the specific situation. For example, different types of applications require different numbers of management accounts for joint signatures, etc. For important types of electronic voting, the more management accounts for joint signatures are required.
  • the application type of the electronic voting application is determined; according to the application type, the equity threshold that the shareholder who initiates the electronic voting application needs to have is determined; if the sum of the equity of each management user is greater than the equity Threshold, it is determined that the initiating account is qualified to initiate electronic voting.
  • the address of the account that is, only the voter and the initiator can know the address of the second account, which improves the privacy of voting; the participant does not need to ask the initiator for the voting address before voting, it can be directly provided by the initiator
  • the key calculates the corresponding account address; this application also supports audit review, because this application hides the address of the shadow account, if the initiator cheats, it will not be able to verify it; therefore, this solution needs to support auditing, the method is: the initiator Provide the private keys
  • an embodiment of the present application also provides an electronic voting device, including:
  • the receiving and initiating unit 10 is configured to receive an electronic voting application sent by the initiating end, wherein the electronic voting application contains information about a proposal and a voting agenda;
  • the eligibility determining unit 20 is used to determine whether the initiating terminal has the eligibility to initiate electronic voting through a smart contract
  • the collection unit 60 is used to collect all the balances in the voting account corresponding to acceptAcc1 ⁇ into the approval account for storing the approval votes, and to collect all the balances in the voting accounts corresponding to acceptAcc2 ⁇ to use In the objection account that stores the negative vote.
  • the above electronic voting device further includes:
  • the establishment unit is used to establish the consent account and the objection account.
  • the above electronic voting device further includes:
  • the command "receive the electronic voting of each participant participating in the voting" is generated.
  • the above electronic voting device further includes:
  • the quantity and weight obtaining unit is used to obtain the number of votes held by the participant terminal and the voting weight value of the participant terminal through a smart contract;
  • the balance calculation unit is used to obtain the balance of the participating terminal by multiplying the voting quantity by the voting weight value through a smart contract;
  • the account creation unit is used to create the first voting account with the balance and the opening key as the second private key through a smart contract.
  • the foregoing quantity and weight obtaining unit includes:
  • the judgment module is used to judge the application type of the electronic voting application
  • the determining module is configured to determine the number of votes held by the participating terminal and the voting weight value of the participating terminal according to the application type.
  • the above electronic voting device further includes:
  • the face information acquiring unit is used to acquire the face information of the terminal user corresponding to the initiating terminal;
  • the face matching unit is used to determine whether the face information matches the initiator
  • the execution unit is configured to determine whether the initiating terminal is qualified to initiate electronic voting through the smart contract if it matches.
  • execution unit includes:
  • the first judgment module is used to judge whether the originating terminal is a management account
  • the second judgment module is used for judging whether the electronic voting application carries joint signatures of other management accounts if the initiator is a management account;
  • the judging module is used for judging that the initiating end is qualified to initiate electronic voting if the joint signature is provided.
  • the above-mentioned units and modules are devices for performing the above-mentioned methods, and will not be discussed one by one here.
  • an embodiment of the present application also provides a computer device, and its internal structure may be as shown in FIG. 3.
  • the computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus.
  • the processor designed by the computer is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, a computer program, and a database.
  • the memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the database of the computer equipment is used to store data.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by the processor to implement the electronic voting method of any of the above embodiments.
  • FIG. 3 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
  • the address of the account that is, only the voter and the initiator can know the address of the second account, which improves the privacy of voting; the participant does not need to ask the initiator for the voting address before voting, it can be directly provided by the initiator
  • the key calculates the corresponding account address; this application also supports audit review, because this application hides the address of the shadow account, and if the initiator cheats, it will not be able to verify it; therefore, this solution needs to support auditing by: the organizer (Initiator) Provide the
  • An embodiment of the present application also provides a computer-readable storage medium.
  • the computer-readable storage medium may be non-volatile or volatile.
  • a computer program is stored thereon, and the computer program is executed when the computer program is executed by the processor.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present application relates to the field of blockchains, and discloses an electronic voting method and device, a computer, and a storage medium. When a participant end performs voting, a balance in a first voting account corresponding thereto is not directly transferred to a "yes" account or a "no" account. Instead, the balance is transferred to a shadow account of the "yes" account or a shadow account of the "no" account first. The shadow accounts are second voting accounts corresponding to: acceptAcc1 = B1*g KDF(DH(r, B2)) and acceptAcc2 = B1*g KDF(DH(r, B3)). The second voting accounts are found according to: acceptAcc1` = B1*gKDF(DH(R, b2)) and acceptAcc2` = B1*gKDF(DH(R, b3)). Merging is performed so as to complete electronic voting. In this process, the invention solves the problem of over-active accounts, improves security and privacy of voting, and allows an audit department to perform auditing.

Description

电子投票方法、装置、计算机和存储介质Electronic voting method, device, computer and storage medium
本申请要求于2020年4月3日提交中国专利局、申请号为202010260573.3,发明名称为“电子投票方法、装置、计算机和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the Chinese Patent Office on April 3, 2020, the application number is 202010260573.3, and the invention title is "electronic voting method, device, computer and storage medium", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及到区块链领域,特别是涉及到一种电子投票方法、装置、计算机设备和存储介质。This application relates to the field of blockchain, in particular to an electronic voting method, device, computer equipment and storage medium.
背景技术Background technique
发明人发现,目前的区块链电子投票系统,存在热点账户问题。所谓热点账户问题是指:区块链上如果对同一个地址(或账户)在时间T内进行多次写或更新操作,则最多只有一次写或跟新操作能够成功,其余所有的写或操作都会失败;这里的时间T,主要是一次区块链生成区块的时间(即:更新操作生效的时间);比如:假设在时间T内,有两个投票人A和B都对公司章程投了1票赞成票,而在投票前,原始的已经投的赞成票为5,由于区块链是分布式系统,投票人A可能在一个节点上发起投票(投票人A看到自己的投票完成后,赞成票为6),而投票人B在另一个节点上发起投票(投票人B看到自己的投票完成后,赞成票也为6),这两个节点并不知晓对方节点投票的存在,此时,当区块链归档各个节点的提案,最终生成区块的时候,只能有一个投票人的投票成功,即丢失一票赞成票。The inventor found that the current blockchain electronic voting system has a hot account problem. The so-called hot account problem refers to: If multiple write or update operations are performed on the same address (or account) within time T on the blockchain, only one write or update operation can succeed at most, and all other writes or operations Both will fail; the time T here is mainly the time when the block chain is generated (ie: the time when the update operation takes effect); for example, suppose that during the time T, two voters A and B both voted on the articles of incorporation 1 vote in favor, and before the vote, the original vote in favor was 5. Because the blockchain is a distributed system, voter A may initiate a vote on a node (voter A sees that his vote is completed , Vote for 6), and voter B initiates a vote on another node (after voter B sees that his vote is completed, the vote for vote is also 6), these two nodes are not aware of the existence of the vote of the other node, At this time, when the blockchain archives the proposals of each node and finally generates a block, only one voter can vote successfully, that is, one vote of yes is lost.
技术问题technical problem
本申请的主要目的为提供一种电子投票方法、装置、计算机和存储介子,旨在解决现有技术中在利用区块链进行电子投票时产生的热点账户的技术问题。The main purpose of this application is to provide an electronic voting method, device, computer, and storage meson, aiming to solve the technical problem of hot accounts generated when using the blockchain for electronic voting in the prior art.
技术解决方案Technical solutions
为了实现上述发明目的,本申请提出一种电子投票方法,包括:In order to achieve the above-mentioned purpose of the invention, this application proposes an electronic voting method, including:
接收发起端发出的电子投票申请,其中,所述电子投票申请中带有提议方案、投票议程的信息;Receiving an electronic voting application sent by the initiating end, wherein the electronic voting application contains information about the proposed scheme and the voting agenda;
通过智能合约判断所述发起端是否具有发起电子投票的资格;Judge whether the initiator is qualified to initiate electronic voting through the smart contract;
若判断出所述发起端具有发起电子投票的资格,则获取所述发起端上传的三个公钥:B1,B2和B3,其中,三个公钥分别是公私钥对(b1,B1),(b2,B2),(b3,B3)中的公钥,B1=g b1mod n,B2=g b2mod n,B3=g b3mod n,其中n是两个大素数p、q的乘积,即n=pq;所述b1、b2和b3被所述发起端保存在本地; If it is judged that the initiator is qualified to initiate electronic voting, the three public keys uploaded by the initiator are obtained: B1, B2, and B3, where the three public keys are a public-private key pair (b1, B1), (b2,B2), the public key in (b3,B3), B1=g b1 mod n, B2=g b2 mod n, B3=g b3 mod n, where n is the product of two large prime numbers p and q, That is, n=pq; the b1, b2, and b3 are stored locally by the initiator;
接收各参与投票的参与端的电子投票,其中,所述参与端随机选取一个公私钥对(r,R),其中,R=g r;所述参与端计算出用于投同意票的账户地址acceptAcc1=B1*g KDF(DH(r, B2));或者,用于投反对票的账户地址acceptAcc2=B1*g KDF(DH(r,B3));然后将所述参与端对应的第一投票账户中的余额转账给所述acceptAcc1对应的第二投票账户中或acceptAcc2对应的第二投票账户中,以生成所述电子投票; Receive the electronic voting of each participating terminal participating in the voting, wherein the participating terminal randomly selects a public-private key pair (r, R), where R=g r ; the participating terminal calculates the account address acceptAcc1 for voting consent =B1*g KDF(DH(r, B2)) ; or, the account address used to vote against acceptAcc2=B1*g KDF(DH(r,B3)) ; then the first vote corresponding to the participant The balance in the account is transferred to the second voting account corresponding to acceptAcc1 or the second voting account corresponding to acceptAcc2 to generate the electronic vote;
当所述投票议程结束后,接收所述发起端的归集请求,其中,所述归集请求中包括需要归集的账户地址,其中,发起端利用acceptAcc1`=B1*gKDF(DH(R,b2))计算出每一个所述参与端对应的投票账户,以及通过公式acceptAcc2`=B1*gKDF(DH(R,b3))计算出每一个所述参与端对应的投票账户,其中,所述acceptAcc1=acceptAcc1`,acceptAcc2=acceptAcc2`;After the voting agenda is over, receive the collection request from the initiator, where the collection request includes the address of the account that needs to be collected, and the initiator uses acceptAcc1`=B1*gKDF(DH(R,b2 )) Calculate the voting account corresponding to each participating terminal, and calculate the voting account corresponding to each participating terminal through the formula acceptAcc2`=B1*gKDF(DH(R,b3)), where the acceptAcc1 =acceptAcc1`, acceptAcc2=acceptAcc2`;
将所有的所述acceptAcc1`对应的投票账户中的余额归集到用于存储同意票的同意账户中,以及将所有acceptAcc2`对应的投票账户中的余额归集到用于存储反对票的反对账户中。Collect all the balances in the voting account corresponding to acceptAcc1` into the approval account for storing approval votes, and collect all the balances in the voting account corresponding to acceptAcc2` into the opposition account for storing negative votes middle.
本申请还提供一种电子投票装置,包括:This application also provides an electronic voting device, including:
接收发起单元,用于接收发起端发出的电子投票申请,其中,所述电子投票申请中带有提议方案、投票议程的信息;The receiving and initiating unit is configured to receive an electronic voting application sent by the initiating end, wherein the electronic voting application contains information about a proposal scheme and a voting agenda;
判断资格单元,用于通过智能合约判断所述发起端是否具有发起电子投票的资格;The qualification determining unit is used to determine whether the initiator is qualified to initiate electronic voting through a smart contract;
获取单元,用于判断出所述发起端具有发起电子投票的资格,则获取所述发起端上传的三个公钥:B1,B2和B3,其中,三个公钥分别是公私钥对(b1,B1),(b2,B2),(b3,B3)中的公钥,B1=g b1mod n,B2=g b2mod n,B3=g b3mod n,其中n是两个大素数p、q的乘积,即n=pq;所述b1、b2和b3被所述发起端保存在本地; The obtaining unit is used to determine that the initiator is qualified to initiate electronic voting, and then obtain three public keys uploaded by the initiator: B1, B2, and B3, where the three public keys are a public-private key pair (b1 , B1), (b2, B2), (b3, B3) in the public key, B1 = g b1 mod n, B2 = g b2 mod n, B3 = g b3 mod n, where n is two large prime numbers p, The product of q, that is, n=pq; the b1, b2, and b3 are stored locally by the initiator;
接收投票单元,用于接收各参与投票的参与端的电子投票,其中,所述参与端随机选取一个公私钥对(r,R),其中,R=g r;所述参与端计算出用于投同意票的账户地址acceptAcc1=B1*g KDF(DH(r,B2));或者,用于投反对票的账户地址acceptAcc2=B1*g KDF(DH(r, B3));然后将所述参与端对应的第一投票账户中的余额转账给所述acceptAcc1对应的第二投票账户中或acceptAcc2对应的第二投票账户中,以生成所述电子投票; The receiving voting unit is used to receive the electronic voting of each participating terminal participating in the voting, wherein the participating terminal randomly selects a public-private key pair (r, R), where R=g r ; the participating terminal calculates for voting The account address of the consent vote acceptAcc1=B1*g KDF(DH(r,B2)) ; or the account address used to vote against the vote acceptAcc2=B1*g KDF(DH(r, B3)) ; then the said participation The balance in the first voting account corresponding to the terminal is transferred to the second voting account corresponding to acceptAcc1 or the second voting account corresponding to acceptAcc2 to generate the electronic vote;
接收归集单元,用于当所述投票议程结束后,接收所述发起端的归集请求,其中,所述归集请求中包括需要归集的账户地址,其中,发起端利用acceptAcc1`=B1*gKDF(DH(R,b2))计算出每一个所述参与端对应的投票账户,以及通过公式acceptAcc2`=B1*gKDF(DH(R,b3))计算出每一个所述参与端对应的投票账户,其中,所述acceptAcc1=acceptAcc1`,acceptAcc2=acceptAcc2`;The receiving collection unit is configured to receive the collection request from the initiator after the voting agenda is over, wherein the collection request includes the address of the account that needs to be collected, and the initiator uses acceptAcc1`=B1* gKDF(DH(R,b2)) calculates the voting account corresponding to each participating terminal, and calculates the voting corresponding to each participating terminal through the formula acceptAcc2`=B1*gKDF(DH(R,b3)) Account, wherein the acceptAcc1=acceptAcc1`, acceptAcc2=acceptAcc2`;
归集单元,用于将所有的所述acceptAcc1`对应的投票账户中的余额归集到用于存储同意票的同意账户中,以及将所有acceptAcc2`对应的投票账户中的余额归集到用于存储反对票的反对账户中。The collection unit is used to collect all the balances in the voting account corresponding to acceptAcc1` to the approval account for storing the approval votes, and to collect the balances in all the voting accounts corresponding to acceptAcc2` to Store the disapproval account in the negative.
本申请还提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现一种电子投票方法,包括:The present application also provides a computer device, including a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, an electronic voting method is implemented, including:
接收发起端发出的电子投票申请,其中,所述电子投票申请中带有提议方案、投票议程的信息;Receiving an electronic voting application sent by the initiating end, wherein the electronic voting application contains information about the proposed scheme and the voting agenda;
通过智能合约判断所述发起端是否具有发起电子投票的资格;Judge whether the initiator is qualified to initiate electronic voting through the smart contract;
若判断出所述发起端具有发起电子投票的资格,则获取所述发起端上传的三个公钥:B1,B2和B3,其中,三个公钥分别是公私钥对(b1,B1),(b2,B2),(b3,B3)中的公钥,B1=g b1mod n,B2=g b2mod n,B3=g b3mod n,其中n是两个大素数p、q的乘积,即n=pq;所述b1、b2和b3被所述发起端保存在本地; If it is judged that the initiator is qualified to initiate electronic voting, the three public keys uploaded by the initiator are obtained: B1, B2, and B3, where the three public keys are a public-private key pair (b1, B1), (b2,B2), the public key in (b3,B3), B1=g b1 mod n, B2=g b2 mod n, B3=g b3 mod n, where n is the product of two large prime numbers p and q, That is, n=pq; the b1, b2, and b3 are stored locally by the initiator;
接收各参与投票的参与端的电子投票,其中,所述参与端随机选取一个公私钥对(r,R),其中,R=g r;所述参与端计算出用于投同意票的账户地址acceptAcc1=B1*g KDF(DH(r, B2));或者,用于投反对票的账户地址acceptAcc2=B1*g KDF(DH(r,B3));然后将所述参与端对应的第一投票账户中的余额转账给所述acceptAcc1对应的第二投票账户中或acceptAcc2对应的第二投票账户中,以生成所述电子投票; Receive the electronic voting of each participating terminal participating in the voting, wherein the participating terminal randomly selects a public-private key pair (r, R), where R=g r ; the participating terminal calculates the account address acceptAcc1 for voting consent =B1*g KDF(DH(r, B2)) ; or, the account address used to vote against acceptAcc2=B1*g KDF(DH(r,B3)) ; then the first vote corresponding to the participant The balance in the account is transferred to the second voting account corresponding to acceptAcc1 or the second voting account corresponding to acceptAcc2 to generate the electronic vote;
当所述投票议程结束后,接收所述发起端的归集请求,其中,所述归集请求中包括需要归集的账户地址,其中,发起端利用acceptAcc1`=B1*gKDF(DH(R,b2))计算出每一个所述参与端对应的投票账户,以及通过公式acceptAcc2`=B1*gKDF(DH(R,b3))计算出每一个所述参与端对应的投票账户,其中,所述acceptAcc1=acceptAcc1`,acceptAcc2=acceptAcc2`;After the voting agenda is over, receive the collection request from the initiator, where the collection request includes the address of the account that needs to be collected, and the initiator uses acceptAcc1`=B1*gKDF(DH(R,b2 )) Calculate the voting account corresponding to each participating terminal, and calculate the voting account corresponding to each participating terminal through the formula acceptAcc2`=B1*gKDF(DH(R,b3)), where the acceptAcc1 =acceptAcc1`, acceptAcc2=acceptAcc2`;
将所有的所述acceptAcc1`对应的投票账户中的余额归集到用于存储同意票的同意账户中,以及将所有acceptAcc2`对应的投票账户中的余额归集到用于存储反对票的反对账户中。Collect all the balances in the voting account corresponding to acceptAcc1` into the approval account for storing approval votes, and collect all the balances in the voting account corresponding to acceptAcc2` into the opposition account for storing negative votes middle.
本申请还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现一种电子投票方法,包括:This application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, an electronic voting method is realized, including:
接收发起端发出的电子投票申请,其中,所述电子投票申请中带有提议方案、投票议程的信息;Receiving an electronic voting application sent by the initiating end, wherein the electronic voting application contains information about the proposed scheme and the voting agenda;
通过智能合约判断所述发起端是否具有发起电子投票的资格;Judge whether the initiator is qualified to initiate electronic voting through the smart contract;
若判断出所述发起端具有发起电子投票的资格,则获取所述发起端上传的三个公钥:B1,B2和B3,其中,三个公钥分别是公私钥对(b1,B1),(b2,B2),(b3,B3)中的公钥,B1=g b1mod n,B2=g b2mod n,B3=g b3mod n,其中n是两个大素数p、q的乘积,即n=pq;所述b1、b2和b3被所述发起端保存在本地; If it is judged that the initiator is qualified to initiate electronic voting, the three public keys uploaded by the initiator are obtained: B1, B2, and B3, where the three public keys are a public-private key pair (b1, B1), (b2,B2), the public key in (b3,B3), B1=g b1 mod n, B2=g b2 mod n, B3=g b3 mod n, where n is the product of two large prime numbers p and q, That is, n=pq; the b1, b2, and b3 are stored locally by the initiator;
接收各参与投票的参与端的电子投票,其中,所述参与端随机选取一个公私钥对(r,R),其中,R=g r;所述参与端计算出用于投同意票的账户地址acceptAcc1=B1*g KDF(DH(r, B2));或者,用于投反对票的账户地址acceptAcc2=B1*g KDF(DH(r,B3));然后将所述参与端对应的第一投票账户中的余额转账给所述acceptAcc1对应的第二投票账户中或acceptAcc2对应的第二投票账户中,以生成所述电子投票; Receive the electronic voting of each participating terminal participating in the voting, wherein the participating terminal randomly selects a public-private key pair (r, R), where R=g r ; the participating terminal calculates the account address acceptAcc1 for voting consent =B1*g KDF(DH(r, B2)) ; or, the account address used to vote against acceptAcc2=B1*g KDF(DH(r,B3)) ; then the first vote corresponding to the participant The balance in the account is transferred to the second voting account corresponding to acceptAcc1 or the second voting account corresponding to acceptAcc2 to generate the electronic vote;
当所述投票议程结束后,接收所述发起端的归集请求,其中,所述归集请求中包括需要归集的账户地址,其中,发起端利用acceptAcc1`=B1*gKDF(DH(R,b2))计算出每一个所述参与端对应的投票账户,以及通过公式acceptAcc2`=B1*gKDF(DH(R,b3))计算出每一个所述参与端对应的投票账户,其中,所述acceptAcc1=acceptAcc1`,acceptAcc2=acceptAcc2`;After the voting agenda is over, receive the collection request from the initiator, where the collection request includes the address of the account that needs to be collected, and the initiator uses acceptAcc1`=B1*gKDF(DH(R,b2 )) Calculate the voting account corresponding to each participating terminal, and calculate the voting account corresponding to each participating terminal through the formula acceptAcc2`=B1*gKDF(DH(R,b3)), where the acceptAcc1 =acceptAcc1`, acceptAcc2=acceptAcc2`;
将所有的所述acceptAcc1`对应的投票账户中的余额归集到用于存储同意票的同意账户中,以及将所有acceptAcc2`对应的投票账户中的余额归集到用于存储反对票的反对账户中。Collect all the balances in the voting account corresponding to acceptAcc1` into the approval account for storing approval votes, and collect all the balances in the voting account corresponding to acceptAcc2` into the opposition account for storing negative votes middle.
有益效果Beneficial effect
本申请的电子投票方法、装置、计算机设备和存储介质,解决了热点账户问题;提高了投票的隐私性;参与端在投票之前,不需要向发起端索要投票地址,其可以直接通过发起端提供的密钥计算出相应的账户地址;本申请还支持审计的审查。The electronic voting method, device, computer equipment and storage medium of this application solve the hot account problem; improve the privacy of voting; the participant end does not need to ask for the voting address from the initiator before voting, it can be directly provided by the initiator The key to calculate the corresponding account address; this application also supports audit review.
附图说明Description of the drawings
图1为本申请一实施例的电子投票方法的流程示意图;FIG. 1 is a schematic flowchart of an electronic voting method according to an embodiment of the application;
图2为本申请一实施例的电子投票装置的结构示意框图;2 is a schematic block diagram of the structure of an electronic voting device according to an embodiment of the application;
图3为本申请一实施例的计算机设备的结构示意框图。FIG. 3 is a schematic block diagram of the structure of a computer device according to an embodiment of the application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
本发明的最佳实施方式The best mode of the present invention
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions, and advantages of this application clearer and clearer, the following further describes the application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
参照图1,本申请实施例提供一种电子投票方法,包括步骤:1, an embodiment of the present application provides an electronic voting method, which includes the steps:
S1、接收发起端发出的电子投票申请,其中,所述电子投票申请中带有提议方案、投票议程的信息;S1. Receive an electronic voting application sent by the initiating end, wherein the electronic voting application contains information about a proposed scheme and a voting agenda;
S2、通过智能合约判断所述发起端是否具有发起电子投票的资格;S2. Judge whether the initiator is qualified to initiate electronic voting through the smart contract;
S3、若判断出所述发起端具有发起电子投票的资格,则获取所述发起端上传的三个公钥:B1,B2和B3,其中,三个公钥分别是公私钥对(b1,B1),(b2,B2),(b3,B3)中的公钥,B1=g b1mod n,B2=g b2mod n,B3=g b3mod n,其中n是两个大素数p、q的乘积,即n=pq;所述b1、b2和b3被所述发起端保存在本地; S3. If it is determined that the initiator is qualified to initiate electronic voting, obtain three public keys uploaded by the initiator: B1, B2, and B3, where the three public keys are a public-private key pair (b1, B1). ), (b2, B2), (b3, B3) in the public key, B1 = g b1 mod n, B2 = g b2 mod n, B3 = g b3 mod n, where n is two large prime numbers p, q The product, that is, n=pq; the b1, b2, and b3 are stored locally by the initiator;
S4、接收各参与投票的参与端的电子投票,其中,所述参与端随机选取一个公私钥对(r,R),其中,R=g r;所述参与端计算出用于投同意票的账户地址acceptAcc1=B1*g KDF(DH(r, B2));或者,用于投反对票的账户地址acceptAcc2=B1*g KDF(DH(r,B3));然后将所述参与端对应的第一投票账户中的余额转账给所述acceptAcc1对应的第二投票账户中或acceptAcc2对应的第二投票账户中,以生成所述电子投票; S4. Receive an electronic vote from each participating terminal participating in the voting, wherein the participating terminal randomly selects a public-private key pair (r, R), where R=g r ; the participating terminal calculates the account used to vote for approval The address acceptAcc1=B1*g KDF(DH(r, B2)) ; or, the account address used to vote against acceptAcc2=B1*g KDF(DH(r,B3)) ; then the first part corresponding to the participating terminal The balance in a voting account is transferred to the second voting account corresponding to acceptAcc1 or the second voting account corresponding to acceptAcc2 to generate the electronic vote;
S5、当所述投票议程结束后,接收所述发起端的归集请求,其中,所述归集请求中包括需要归集的账户地址,其中,发起端利用acceptAcc1`=B1*gKDF(DH(R,b2))计算出每一个所述参与端对应的投票账户,以及通过公式acceptAcc2`=B1*gKDF(DH(R,b3))计算出每一个所述参与端对应的投票账户,其中,所述acceptAcc1=acceptAcc1`,acceptAcc2=acceptAcc2`;S5. After the voting agenda is over, receive a collection request from the initiator, where the collection request includes the address of the account that needs to be collected, and the initiator uses acceptAcc1`=B1*gKDF(DH(R ,b2)) Calculate the voting account corresponding to each participating terminal, and calculate the voting account corresponding to each participating terminal through the formula acceptAcc2`=B1*gKDF(DH(R,b3)), where Say acceptAcc1=acceptAcc1`, acceptAcc2=acceptAcc2`;
S6、将所有的所述acceptAcc1`对应的投票账户中的余额归集到用于存储同意票的同意账户中,以及将所有acceptAcc2`对应的投票账户中的余额归集到用于存储反对票的反对账户中。S6. Collect all the balances in the voting account corresponding to acceptAcc1` into the approval account for storing approval votes, and aggregate all the balances in the voting accounts corresponding to acceptAcc2` into the one for storing negative votes. Object to the account.
本申请的方法是以区块链技术为基础的投票方法,上述各步骤是在一个支持分布式投票的区块链系统上进行的。The method of this application is a voting method based on blockchain technology, and the above steps are carried out on a blockchain system that supports distributed voting.
如上述步骤S1所述,上述发起端是指登录有发起账户的终端,其可以是手机、电脑、平板电脑等可以登录区块链系统的终端。上述提议方案即为本次投票的具体内容,上述投票议程主要要求投票的具体流程等,比如规定在什么时间截止投票等。As mentioned in the above step S1, the above-mentioned initiator refers to a terminal with an initiating account logged in, which can be a terminal that can log in to the blockchain system, such as a mobile phone, a computer, or a tablet computer. The above-mentioned proposal is the specific content of this voting. The above-mentioned voting agenda mainly requires the specific voting process, such as stipulating when the voting is closed.
如上述步骤S2所述,上述智能合约是一套以数字形式定义的承诺(promises),包括合约参与方可以在上面执行这些承诺的协议。发起端只有通过智能合约的验证后,才可以具有真正的发起电子投票的资格。上述智能合约验证发起端是否具有发起电子投票的资格,其实并不是对发起端的终端进行验证,而是对登录上述终端的发起账户进行验证。在其它实施例中,如果终端和发起账户必须为绑定状态的时候,那么智能合约就需要验证终端和发起账户是否为绑定状态,以及发起账户是否具有发起电子投票的资格,只有全部满足的时候,才会判定发起端具有发起电子投票的资格。As described in the above step S2, the above smart contract is a set of promises defined in digital form, including an agreement on which contract participants can execute these promises. Only after the initiator has passed the verification of the smart contract, can it be truly qualified to initiate electronic voting. The above smart contract verifies whether the initiator has the qualification to initiate an electronic vote. In fact, it does not verify the terminal of the initiator, but verifies the account of the initiator logged in the terminal. In other embodiments, if the terminal and the initiating account must be in a bound state, then the smart contract needs to verify whether the terminal and the initiating account are in a bound state, and whether the initiating account is eligible to initiate electronic voting, and only those that are fully satisfied At that time, it will be determined that the initiator is eligible to initiate electronic voting.
如上述步骤S3所述,上述发起端上传的三个公钥:B1,B2和B3,可以是在上传电子投票申请的时候一起发布到区块链系统上的,也可以是当判定发起端具有发起电子投票的资格的时候上传到区块链系统上的。上述的三个公钥:B1,B2和B3是作为发起端的投票账户公钥;其中,B1作为发起端账户的主公钥,和传统的账户公钥地址的意义相同;而B2和B3是发起端账户用于衍生下述的第二账户(影子账户)的衍生公钥,具有混淆子账户地址的作用;具体地,B2是用于衍生所有的同意账户公钥,B3是用于衍生所有的反对账户公钥。上述n的比特位数为2048位,可以进一步提高安全性。As described in step S3 above, the three public keys uploaded by the initiator: B1, B2, and B3 can be published on the blockchain system when uploading the electronic voting application, or when it is determined that the initiator has Uploaded to the blockchain system when the eligibility for electronic voting is initiated. The above three public keys: B1, B2, and B3 are the public keys of the voting account of the initiator; among them, B1 is the main public key of the initiator account, which has the same meaning as the traditional account public key address; and B2 and B3 are the initiators The end account is used to derive the derived public key of the following second account (shadow account), which has the effect of confusing the address of the sub-account; specifically, B2 is used to derive all agreed account public keys, and B3 is used to derive all Oppose the account public key. The number of bits of n mentioned above is 2048 bits, which can further improve security.
如上述步骤S4所述,接收参与端的电子投票,其中参与端是指登录可以投票的参与账户的终端,其可以为手机、电脑、平板电脑等具有登录上述区块链系统的终端。参与端在投票的过程中,会随机选取一个公私钥对(r,R),其中,R=g r,然后接收参与端的用户根据其投票的意愿投出同意票或反对票,其中,不同的参与端选择的公私钥对(r,R)不相同。具体地,当参与端的用户投出同意票的时候,参与端会利用上述的公钥B2,计算出一个第二投票账户的地址acceptAcc1=B1*g KDF(DH(r,B2));当参与端的用户投出反对票的时候,参与端会利用上述的公钥B3,计算出一个第二投票账户的地址acceptAcc2=B1*g KDF(DH(r, B2)),智能合约则会根据acceptAcc1=B1*g KDF(DH(r,B2))或acceptAcc2=B1*g KDF(DH(r,B2)),建立一个对应的第二投票账户,然后将参与端对应的第一账户的余额等转账到上述第二投票账户中,以生成所述电子投票。在本实施例中,会根据参与端的投票结果建立相应的第二投票账户,无需针对每一个参与账户都生成两个第二投票账户。 As described in the above step S4, the electronic vote from the participant terminal is received, where the participant terminal refers to a terminal that logs in to a participant account that can vote, which can be a mobile phone, a computer, a tablet, or the like, which can log in to the above-mentioned blockchain system. During the voting process, the participant will randomly select a public-private key pair (r, R), where R=g r , and then the user of the participant will vote for or against according to their willingness to vote. Among them, different The public and private key pair (r, R) selected by the participant is different. Specifically, when the user of the participating terminal casts a consent vote, the participating terminal will use the above public key B2 to calculate the address of a second voting account acceptAcc1=B1*g KDF(DH(r,B2)) ; when participating When users on the end vote against, the participating end will use the above public key B3 to calculate the address of a second voting account acceptAcc2=B1*g KDF(DH(r, B2)) , and the smart contract will be based on acceptAcc1= B1*g KDF(DH(r,B2)) or acceptAcc2=B1*g KDF(DH(r,B2)) , create a corresponding second voting account, and then transfer the balance of the first account corresponding to the participant To the aforementioned second voting account to generate the electronic vote. In this embodiment, the corresponding second voting account will be established according to the voting results of the participating terminals, and there is no need to generate two second voting accounts for each participating account.
在一个实施例中,在上述步骤S4之前还包括:S401、接收所述参与端的身份CA证书,并利用所述身份CA证书的第一私钥对电子投票申请进行签名,得到Sig;S402、对应所述参与端以及本次投票议程生成一个第二私钥,并利用所述第二私钥生成证书申请CSR;S403、将所述身份CA证书、Sig、CSR,以及所述参与端的账户地址发送给所述发起端,进行身份验证;S404、若接收到所述发起端反馈的身份验证通过的信息,则生成“接收各参与投票的参与端的电子投票”的命令。即为验证参与端是否具有参与投票的权限,只有具有参与投票权限的参与端才能进行本次电子投票。In an embodiment, before the above step S4, it further includes: S401, receiving the identity CA certificate of the participant, and using the first private key of the identity CA certificate to sign the electronic voting application to obtain Sig; S402, corresponding The participant and the voting agenda generate a second private key, and use the second private key to generate a certificate to apply for CSR; S403, send the identity CA certificate, Sig, CSR, and the account address of the participant Perform identity verification for the initiator; S404, if the identity verification passed information fed back by the initiator is received, a command of "receive the electronic voting of each participant participating in the voting" is generated. That is, to verify whether the participating terminal has the right to participate in voting, only the participating terminal with the right to participate in voting can conduct this electronic voting.
如上述步骤S5所述,上述投票议程结束之后,则需要将投票结果归集。在归集过程中,需要进行归集的账户的地址由发起端提供,而发起端提供的地址,则是通过R,以及b1或b2得出,具体地,acceptAcc1`=B1*gKDF(DH(R,b2)),acceptAcc2`=B1*gKDF(DH(R,b3))。因为,上述第二投票账户的地址是通过r,以及B2或B3计算得出的,所以可以通过对应的R,以及b1或b2求出相同的第二投票账户的地址,即acceptAcc1=acceptAcc1`,acceptAcc2=acceptAcc2`。然后将所有的所述acceptAcc1`对应的投票账户中的余额归集到用于存储同意票的同意账户中,以及将所有acceptAcc2`对应的投票账户中的余额归集到用于存储反对票的反对账户中,得到最终的投票结果。需要的注意的是,因为发起端不知道参与端的投票结果,所以会对应每一个参与端计算出两个地址,即acceptAcc1`和acceptAcc2,在归集的时候,如果没有找到对应的地址,则略过。当归集结束后,通过比较同意账户和反对账户中的余额,即可得到最终的投票结果。As described in step S5, after the voting agenda is over, the voting results need to be collected. In the collection process, the address of the account that needs to be collected is provided by the initiator, and the address provided by the initiator is obtained through R, and b1 or b2. Specifically, acceptAcc1`=B1*gKDF(DH( R,b2)), acceptAcc2`=B1*gKDF(DH(R,b3)). Because the address of the second voting account mentioned above is calculated by r and B2 or B3, the address of the same second voting account can be obtained from the corresponding R and b1 or b2, that is, acceptAcc1=acceptAcc1`, acceptAcc2=acceptAcc2`. Then all the balances in the voting account corresponding to acceptAcc1` are collected into the approval account used to store approval votes, and the balances in all the voting accounts corresponding to acceptAcc2` are collected into the objection for storing negative votes. In the account, get the final voting result. It should be noted that because the initiator does not know the voting results of the participating terminals, it will calculate two addresses for each participating terminal, namely acceptAcc1` and acceptAcc2. During the collection, if the corresponding address is not found, it will be omitted. pass. When the collection is over, the final voting result can be obtained by comparing the balances in the agreeing and disagreeing accounts.
在一个实施例中,上述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤S2之后,还包括:In one embodiment, after the above step S2 of judging whether the initiator is qualified to initiate electronic voting through the smart contract, the method further includes:
S201,建立所述同意账户和所述反对账户。S201: Establish the agreed account and the objection account.
上述同意账户和反对账户是用于存放同意余额和反对余额的账户。本申请中,只要发起端具有发起电子投票的资格,区块链系统就会建立同意账户和反对账户,当投票议程结束后,可以将投同意票的第二投票账户的余额归集到同意账户中,将投反对票的第二投票账户的余额归集到反对账户中。本申请提前将同意账户和反对账户设置完成,可以使参与投票的参与用户提前知道结果会体现在哪里等,使参与账户的聚焦点聚合在同意账户和反对账户上。The above agreed and opposed accounts are the accounts used to deposit the agreed balance and the opposed balance. In this application, as long as the initiator is qualified to initiate electronic voting, the blockchain system will establish a consent account and an objection account. When the voting agenda is over, the balance of the second voting account that voted for the approval can be collected into the approval account. , The balance of the second voting account that voted against is collected into the opposition account. In this application, the approval account and the objection account are set up in advance, so that the participating users who participate in the voting know in advance where the results will be reflected, etc., so that the focus of the participating accounts is aggregated on the approval account and the objection account.
在一个实施例中,所述接收各参与投票的参与端的电子投票的步骤S4之前,还包括:In an embodiment, before the step S4 of receiving the electronic voting of each participant participating in the voting, the method further includes:
S41、通过智能合约获取所述参与端所具有的投票数量,以及所述参与端的投票权重值;S41: Obtain the number of votes held by the participating terminal and the voting weight value of the participating terminal through a smart contract;
S42、通过智能合约将所述投票数量乘以所述投票权重值得到所述参与端的余额;S42: Multiply the voting quantity by the voting weight value through a smart contract to obtain the balance of the participating terminal;
S43、通过智能合约创建带有所述余额和打开密钥为所述第二私钥的所述第一投票账户。S43. Create the first voting account with the balance and the opening key as the second private key through a smart contract.
如上述步骤S41至S43所述,上述参与端的投票数量是指使用参与端的参与用户所具有的原始投票数量,上述投票权重值代表该参与用户的投票的一个权重值,具体的,在一次股东电子投票中,上述参与用户的投票数量可以是该用户的股权值a,投票权重值为该参与用户的这些股权值所具有的权重值b,比如,该参与用户为原始股东,其投票权重值为10,那么其投票的余额为10a,又比如,该参与用户为普通股东,其投票权重值为1,那么其投票的余额为1a等。本实施例中,将正常的投票数量的统计转换成余额的方式,更加是否区块链的形式。在上述智能合约中,上述区块链系统中预先记录有全部可能参与电子投票的全部用户的投票权重值和投票数量等。As described in the above steps S41 to S43, the number of votes on the participating terminal refers to the original number of votes of participating users who use the participating terminal. The above voting weight value represents a weight value of the voting of the participating user. Specifically, in a shareholder electronic In voting, the number of votes of the aforementioned participating user can be the user’s equity value a, and the voting weight value is the weight value b of the participating user’s equity value. For example, the participating user is the original shareholder, and its voting weight value is 10. Then its voting balance is 10a. For example, if the participating user is an ordinary shareholder and its voting weight value is 1, then its voting balance is 1a, etc. In this embodiment, the method of converting the statistics of the normal number of votes into a balance is more in the form of a blockchain. In the above-mentioned smart contract, the above-mentioned blockchain system pre-records the voting weight value and the number of votes of all users who may participate in electronic voting.
在一个实施例中,上述通过智能合约获取所述参与端所具有的投票数量,以及所述参与端的投票权重值的步骤S41,包括:In one embodiment, the above step S41 of obtaining the number of votes possessed by the participating terminal and the voting weight value of the participating terminal through a smart contract includes:
S411、判断所述电子投票申请的申请类型;S411: Determine the application type of the electronic voting application;
S412、根据所述申请类型确定所述参与端所具有的投票数量,以及所述参与端的投票权重值。S412: Determine the number of votes held by the participating terminal and the voting weight value of the participating terminal according to the application type.
如上述步骤S411和S422所述,电子投票申请的申请类型包括多种,比如某一业务是否开展的电子投票申请,该申请类型为普通申请类型,其原始股东和普通股东等参与端对应的参与用户具有相同或相近的投票权重值;再比如罢免某一股东的权利的电子投票申请,该申请类型为特殊申请类型,此时,原始股东的电子投票权值远高于普通股东的投票权重值,比如,原始股东的投票权重值是普通股东的投票权重值的10倍等。具体判断电子投票申请的申请类型的方法,包括多种,比如第一种,发起端在发起电子投票申请的时候主动输入申请类型,这样电子投票申请上会携带供智能合约识别的标识信号,智能合约会确定申请类型;比如第二种,智能合约通过关键字识别的方式遍历提议方案,如果提议方案中 出现预设的关键字次数达到设定阈值时,既可以确定申请类型,如提议方案中出现指定数量的“罢免”关键词,则判定申请类型为特殊申请。需要说明的,在不同的领域设定的关键词是不同的,会根据具体的区块链系统的应用场景而设定等。As described in the above steps S411 and S422, the application types of electronic voting applications include multiple types, such as electronic voting applications for whether a certain business is to be carried out. The application type is an ordinary application type, and its original shareholders and ordinary shareholders participate in the corresponding end Users have the same or similar voting weight value; another example is the electronic voting application for the removal of a shareholder's right. The application type is a special application type. At this time, the original shareholder's electronic voting weight value is much higher than that of ordinary shareholders. For example, the voting weight of the original shareholders is 10 times the voting weight of ordinary shareholders, etc. There are several methods for determining the application type of an electronic voting application. For example, in the first type, the initiator actively enters the application type when initiating an electronic voting application, so that the electronic voting application will carry an identification signal for smart contract identification. The contract will determine the type of application; for example, in the second type, the smart contract traverses the proposed scheme through keyword identification. If the preset number of keywords in the proposed scheme reaches the set threshold, the application type can be determined, such as in the proposed scheme If a specified number of "recall" keywords appear, it is determined that the application type is a special application. It should be noted that the keywords set in different fields are different and will be set according to the specific application scenarios of the blockchain system.
在一个实施例中,上述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤S2之前,包括:In one embodiment, before step S2 of judging whether the initiator is qualified to initiate electronic voting through a smart contract, the method includes:
S21、获取所述发起端所对应的终端使用者的人脸信息;S21: Obtain face information of the terminal user corresponding to the initiator;
S22、判断所述人脸信息是否与所述发起端匹配;S22: Determine whether the face information matches the initiator;
S23、若匹配,则执行所述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤。S23. If it matches, execute the step of judging whether the initiator is qualified to initiate electronic voting through the smart contract.
在本实施例中,是为了防止发起端的发起账户被盗后,有其他人恶意发起电子投票申请,所以先进行人脸识别等,具体的人脸信息的匹配过程可以利用现有的任何一种人脸识别匹配的方法,如先活体检测,然后再进行人脸识别等,在此不在赘述。In this embodiment, in order to prevent other people from maliciously initiating an electronic voting application after the initiating account of the initiating end is stolen, the face recognition is performed first, and the specific facial information matching process can use any of the existing ones. The method of face recognition matching, such as live body detection first, and then face recognition, etc., will not be repeated here.
在一个实施例中,上述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤S2,包括:In one embodiment, the above step S2 of judging whether the initiator is qualified to initiate electronic voting through a smart contract includes:
S211、通过所述智能合约判断所述发起端是不是管理账户;S211: Judge whether the initiator is a management account through the smart contract;
S212、若是,则通过所述智能合约判断所述电子投票申请中是否携带其它管理账户的联合签名;S212. If yes, judge whether the electronic voting application carries joint signatures of other management accounts through the smart contract;
S212、若带有所述联合签名,则判定所述发起端具有发起电子投票的资格。S212. If the joint signature is provided, it is determined that the initiating end is qualified to initiate an electronic voting.
在本实施例中,区块链系统首先判断发起端的发起账户是否为管理账户,如果是,则判断述电子投票申请中是否携带其它管理账户的联合签名,如果有,则判定判定所述发起端具有发起电子投票的资格。也就是说,发起电子投票的账户只能是预先设定好的管理账户,相对应的如普通用户则不能发起电子投票流程。比如,将股东的股权占比大于20%的股东账号设定为管理账号,其他的股东账号为普通账号,那么,只有股权占比大于20%的股东账号有权利发起发起电子投票。进一步地,即使管理账号有权利发起电子投票,但是还需要满足另一个条件,就是其他管理账户的联合签名,该联合签名并不一定是所有的管理账户的联合签名,其可以是一半以上的管理账户的签名等,可以根据具体的情况提前设定。比如,不同类型的申请,需要的联合签名的管理账户的数量不同等,重要类型的电子投票,需要的联合签名的管理账户越多。在另一个具体实施例中,判断所述电子投票申请的申请类型;根据所述申请类型确定发起电子投票申请的股东需要具有的股权阈值;若各所述管理用户的股权相加大于所述股权阈值,则判定所述发起账户具有发起电子投票的资格。In this embodiment, the blockchain system first judges whether the originating account of the originating end is a management account, if so, it judges whether the electronic voting application carries the joint signature of other management accounts, and if so, it judges the originating end Have the qualifications to initiate electronic voting. That is to say, the account that initiates the electronic voting can only be a pre-set management account, and correspondingly, ordinary users cannot initiate the electronic voting process. For example, if a shareholder account with a shareholder's share of more than 20% is set as a management account, and other shareholder accounts are ordinary accounts, then only shareholder accounts with a share of more than 20% have the right to initiate electronic voting. Further, even if the management account has the right to initiate electronic voting, another condition needs to be met, that is, the joint signature of other management accounts. The joint signature is not necessarily the joint signature of all management accounts. It can be more than half of the management accounts. The signature of the account, etc., can be set in advance according to the specific situation. For example, different types of applications require different numbers of management accounts for joint signatures, etc. For important types of electronic voting, the more management accounts for joint signatures are required. In another specific embodiment, the application type of the electronic voting application is determined; according to the application type, the equity threshold that the shareholder who initiates the electronic voting application needs to have is determined; if the sum of the equity of each management user is greater than the equity Threshold, it is determined that the initiating account is qualified to initiate electronic voting.
在本实施例中,在参与端进行投票的时候,并不是直接将其对应的第一投票账户中的余额直接转账到上述同意账户或者反对账户,而是先将余额转移到上述同意账户或者反对账户的影子账户中,影子账户即为上述acceptAcc1=B1*g KDF(DH(r,B2))和acceptAcc2=B1*g KDF(DH(r,B3))对应的第二投票账户,然后在根据acceptAcc1`=B1*gKDF(DH(R,b2))和acceptAcc2`=B1*gKDF(DH(R,b3))查找到各第二投票账户,进行归集,从而完成电子投票。再此过程中,解决了热点账户问题;参与端虽然能计算出发起端的影子账户地址,但是却没有办法计算出该影子账户的私钥;只有发起端能够计算出该子账户的私钥,因为发起端知道b1,方法为:g b1*g x=g (b1+x)=acceptAcc,(b1+x)就是发起端的私钥;只有拥有b1私钥或私钥r的人,可以计算出影子账户的地址,也就是只有投票人和发起端可以知晓第二账户的地址,提高了投票的隐私性;参与端在投票之前,不需要向发起端索要投票地址,其可以直接通过发起端提供的密钥计算出相应的账户地址;本申请还支持审计的审查,因为本申请将影子账户的地址隐藏,如果发起端作弊,将无法验证;由此,本方案需要支持审计,方法是:发起端将私钥b2和b3提供给审计方,因为公钥R在区块链上是公开的,所以审计方可以计算出所有的投票地址:acceptAcc=B1*g KDF(DH(R,b2)),以及RejectAcc=B1*g KDF(DH(R,b3))In this embodiment, when voting at the participating end, the balance in the corresponding first voting account is not directly transferred to the above agreed account or the opposed account, but the balance is first transferred to the above agreed account or opposed In the shadow account of the account, the shadow account is the second voting account corresponding to the above acceptAcc1=B1*g KDF(DH(r,B2)) and acceptAcc2=B1*g KDF(DH(r,B3)). acceptAcc1`=B1*gKDF(DH(R,b2)) and acceptAcc2`=B1*gKDF(DH(R,b3)) find each second voting account and collect them to complete electronic voting. In this process, the problem of hot account is solved; although the participant can calculate the shadow account address of the initiator, there is no way to calculate the private key of the shadow account; only the initiator can calculate the private key of the sub-account, because The initiator knows b1, the method is: g b1 *g x =g (b1+x) =acceptAcc, (b1+x) is the private key of the initiator; only the person who owns the b1 private key or the private key r can calculate the shadow The address of the account, that is, only the voter and the initiator can know the address of the second account, which improves the privacy of voting; the participant does not need to ask the initiator for the voting address before voting, it can be directly provided by the initiator The key calculates the corresponding account address; this application also supports audit review, because this application hides the address of the shadow account, if the initiator cheats, it will not be able to verify it; therefore, this solution needs to support auditing, the method is: the initiator Provide the private keys b2 and b3 to the auditor. Because the public key R is public on the blockchain, the auditor can calculate all voting addresses: acceptAcc=B1*g KDF(DH(R,b2)) , And RejectAcc=B1*g KDF(DH(R,b3)) .
参照图2,本申请实施例还提供一种电子投票装置,包括:2, an embodiment of the present application also provides an electronic voting device, including:
接收发起单元10,用于接收发起端发出的电子投票申请,其中,所述电子投票申请中带有提议方案、投票议程的信息;The receiving and initiating unit 10 is configured to receive an electronic voting application sent by the initiating end, wherein the electronic voting application contains information about a proposal and a voting agenda;
判断资格单元20,用于通过智能合约判断所述发起端是否具有发起电子投票的资格;The eligibility determining unit 20 is used to determine whether the initiating terminal has the eligibility to initiate electronic voting through a smart contract;
获取单元30,用于判断出所述发起端具有发起电子投票的资格,则获取所述发起端上传的三个公钥:B1,B2和B3,其中,三个公钥分别是公私钥对(b1,B1),(b2,B2),(b3,B3)中的公钥,B1=g b1mod n,B2=g b2mod n,B3=g b3mod n,其中n是两个大素数p、q的乘积,即n=pq;所述b1、b2和b3被所述发起端保存在本地; The obtaining unit 30 is configured to determine that the initiator is qualified to initiate electronic voting, and obtain three public keys uploaded by the initiator: B1, B2, and B3, where the three public keys are a public-private key pair ( b1, B1), (b2, B2), (b3, B3) in the public key, B1 = g b1 mod n, B2 = g b2 mod n, B3 = g b3 mod n, where n is two large prime numbers p , The product of q, that is, n=pq; the b1, b2, and b3 are stored locally by the initiator;
接收投票单元40,用于接收各参与投票的参与端的电子投票,其中,所述参与端随机选取一个公私钥对(r,R),其中,R=g r;所述参与端计算出用于投同意票的账户地址acceptAcc1=B1*g KDF(DH(r,B2));或者,用于投反对票的账户地址acceptAcc2=B1*g KDF(DH(r, B3));然后将所述参与端对应的第一投票账户中的余额转账给所述acceptAcc1对应的第二投票账户中或acceptAcc2对应的第二投票账户中,以生成所述电子投票; The receiving voting unit 40 is configured to receive electronic voting of each participating terminal participating in the voting, wherein the participating terminal randomly selects a public-private key pair (r, R), where R=g r ; the participating terminal calculates The address of the account for voting acceptAcc1=B1*g KDF(DH(r,B2)) ; or the address of the account used to vote against acceptAcc2=B1*g KDF(DH(r, B3)) ; then the said The balance in the first voting account corresponding to the participant terminal is transferred to the second voting account corresponding to acceptAcc1 or the second voting account corresponding to acceptAcc2 to generate the electronic vote;
接收地址单元50,用于当所述投票议程结束后,接收所述发起端的归集请求,其中,所述归集请求中包括需要归集的账户地址,其中,发起端利用acceptAcc1`=B1*gKDF(DH(R,b2))计算出每一个所述参与端对应的投票账户,以及通过公式acceptAcc2`=B1*gKDF(DH(R,b3))计算出每一个所述参与端对应的投票账户,其中,所述acceptAcc1=acceptAcc1`,acceptAcc2=acceptAcc2`;The address receiving unit 50 is configured to receive a collection request from the initiator after the voting agenda ends, wherein the collection request includes the address of the account that needs to be collected, and the initiator uses acceptAcc1`=B1* gKDF(DH(R,b2)) calculates the voting account corresponding to each participating terminal, and calculates the voting corresponding to each participating terminal through the formula acceptAcc2`=B1*gKDF(DH(R,b3)) Account, wherein the acceptAcc1=acceptAcc1`, acceptAcc2=acceptAcc2`;
归集单元60,用于将所有的所述acceptAcc1`对应的投票账户中的余额归集到用于存储同意票的同意账户中,以及将所有acceptAcc2`对应的投票账户中的余额归集到用于存储反对票的反对账户中。The collection unit 60 is used to collect all the balances in the voting account corresponding to acceptAcc1` into the approval account for storing the approval votes, and to collect all the balances in the voting accounts corresponding to acceptAcc2` to use In the objection account that stores the negative vote.
在一个实施例中,上述电子投票装置,还包括:In an embodiment, the above electronic voting device further includes:
建立单元,用于建立所述同意账户和所述反对账户。The establishment unit is used to establish the consent account and the objection account.
在一个实施例中,上述电子投票装置,还包括:In an embodiment, the above electronic voting device further includes:
接收所述参与端的身份CA证书,并利用所述身份CA证书的第一私钥对电子投票申请进行签名,得到Sig;Receiving the identity CA certificate of the participant, and using the first private key of the identity CA certificate to sign the electronic voting application to obtain the Sig;
对应所述参与端以及本次投票议程生成一个第二私钥,并利用所述第二私钥生成证书申请CSR;Generate a second private key corresponding to the participating end and the voting agenda, and use the second private key to generate a certificate to apply for CSR;
将所述身份CA证书、Sig、CSR,以及所述参与端的账户地址发送给所述发起端,进行身份验证;Sending the identity CA certificate, Sig, CSR, and the account address of the participant end to the initiating end for identity verification;
若接收到所述发起端反馈的身份验证通过的信息,则生成“接收各参与投票的参与端的电子投票”的命令。If the identity verification passed information fed back by the initiator is received, the command "receive the electronic voting of each participant participating in the voting" is generated.
在一个实施例中,上述电子投票装置,还包括:In an embodiment, the above electronic voting device further includes:
数量与权重获取单元,用于通过智能合约获取所述参与端所具有的投票数量,以及所述参与端的投票权重值;The quantity and weight obtaining unit is used to obtain the number of votes held by the participant terminal and the voting weight value of the participant terminal through a smart contract;
计算余额单元,用于通过智能合约将所述投票数量乘以所述投票权重值得到所述参与端的余额;The balance calculation unit is used to obtain the balance of the participating terminal by multiplying the voting quantity by the voting weight value through a smart contract;
创建账户单元,用于通过智能合约创建带有所述余额和打开密钥为所述第二私钥的所述第一投票账户。The account creation unit is used to create the first voting account with the balance and the opening key as the second private key through a smart contract.
在一个实施例中,上述数量与权重获取单元,包括:In an embodiment, the foregoing quantity and weight obtaining unit includes:
判断模块,用于判断所述电子投票申请的申请类型;The judgment module is used to judge the application type of the electronic voting application;
确定模块,用于根据所述申请类型确定所述参与端所具有的投票数量,以及所述参与端的投票权重值。The determining module is configured to determine the number of votes held by the participating terminal and the voting weight value of the participating terminal according to the application type.
在一个实施例中,上述电子投票装置,还包括:In an embodiment, the above electronic voting device further includes:
人脸信息获取单元,用于获取所述发起端所对应的终端使用者的人脸信息;The face information acquiring unit is used to acquire the face information of the terminal user corresponding to the initiating terminal;
人脸匹配单元,用于判断所述人脸信息是否与所述发起端匹配;The face matching unit is used to determine whether the face information matches the initiator;
执行单元,用于若匹配则通过智能合约判断所述发起端是否具有发起电子投票的资格。The execution unit is configured to determine whether the initiating terminal is qualified to initiate electronic voting through the smart contract if it matches.
进一步地,所述执行单元,包括:Further, the execution unit includes:
第一判断模块,用于判断所述发起端是不是管理账户;The first judgment module is used to judge whether the originating terminal is a management account;
第二判断模块,用于若所述发起端是管理账户,则判断所述电子投票申请中是否携带其它管理账户的联合签名;The second judgment module is used for judging whether the electronic voting application carries joint signatures of other management accounts if the initiator is a management account;
判定模块,用于若带有所述联合签名,则判定所述发起端具有发起电子投票的资格。The judging module is used for judging that the initiating end is qualified to initiate electronic voting if the joint signature is provided.
上述各单元和模块是执行上述方法的装置,在此不在展开一一论述。The above-mentioned units and modules are devices for performing the above-mentioned methods, and will not be discussed one by one here.
参照图3,本申请实施例中还提供一种计算机设备,其内部结构可以如图3所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现上述任一实施例的电子投票方法。Referring to FIG. 3, an embodiment of the present application also provides a computer device, and its internal structure may be as shown in FIG. 3. The computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor designed by the computer is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement the electronic voting method of any of the above embodiments.
本领域技术人员可以理解,图3中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定。Those skilled in the art can understand that the structure shown in FIG. 3 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
本申请实施例的计算机设备,在参与端进行投票的时候,并不是直接将其对应的第一投票账户中的余额直接转账到上述同意账户或者反对账户,而是先将余额转移到上述同意账户或者反对账户的影子账户中,影子账户即为上述acceptAcc1=B1*g KDF(DH(r,B2))和acceptAcc2=B1*g KDF(DH(r,B3))对应的第二投票账户,然后在根据acceptAcc1`=B1*gKDF(DH(R,b2))和acceptAcc2`=B1*gKDF(DH(R,b3))查找到各第二投票账户,进行归集,从而完成电子投票。再此过程中,解决了热点账户问题;参与端虽然能计算出发起端的影子账户地址,但是却没有办法计算出该影子账户的私钥;只有发起端能够计算出该子账户的私钥,因为发起端知道b1,方法为:g b1*g x=g (b1+x)=acceptAcc,(b1+x)就是发起端的私钥;只有拥有b1私钥或私钥r的人,可以计算出影子账户的地址,也就是只有投票人和发起端可以知晓第二账户的地址,提高了投票的隐私性;参与端在投票之前,不需要向发起端索要投票地址,其可以直接通过发起端提供的密钥计算出相应的账户地址;本申请还支持审计的审查,因为本申请将影子账户的地址隐藏,如果发起端作弊,将无法验证;由此,本方案需要支持审计,方法是:组织方(发起端)将私钥b2和b3提供给审计方,因为公钥R在区块链上是公开的,所以审计方可以计算出所有的投票地址:acceptAcc=B1*g KDF(DH(R,b2)),以及RejectAcc=B1*g KDF(DH(R,b3))The computer device of the embodiment of the application does not directly transfer the balance in the corresponding first voting account to the above agreed account or the opposed account when voting at the participant end, but first transfers the balance to the above agreed account Or in the shadow account of the opposition account, the shadow account is the second voting account corresponding to the above acceptAcc1=B1*g KDF(DH(r,B2)) and acceptAcc2=B1*g KDF(DH(r,B3)), and then According to acceptAcc1`=B1*gKDF(DH(R,b2)) and acceptAcc2`=B1*gKDF(DH(R,b3)), each second voting account is found and collected to complete electronic voting. In this process, the problem of hot account is solved; although the participant can calculate the shadow account address of the initiator, there is no way to calculate the private key of the shadow account; only the initiator can calculate the private key of the sub-account, because The initiator knows b1, the method is: g b1 *g x =g (b1+x) =acceptAcc, (b1+x) is the private key of the initiator; only the person who owns the b1 private key or the private key r can calculate the shadow The address of the account, that is, only the voter and the initiator can know the address of the second account, which improves the privacy of voting; the participant does not need to ask the initiator for the voting address before voting, it can be directly provided by the initiator The key calculates the corresponding account address; this application also supports audit review, because this application hides the address of the shadow account, and if the initiator cheats, it will not be able to verify it; therefore, this solution needs to support auditing by: the organizer (Initiator) Provide the private keys b2 and b3 to the auditor. Because the public key R is public on the blockchain, the auditor can calculate all voting addresses: acceptAcc=B1*g KDF(DH(R, b2)) , and RejectAcc=B1*g KDF(DH(R,b3)) .
本申请一实施例还提供一种计算机可读存储介质,所述计算机可读存储介质可以是非易失性,也可以是易失性,其上存储有计算机程序,计算机程序被处理器执行时实现一种上述任一实施例的电子投票方法。An embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium may be non-volatile or volatile. A computer program is stored thereon, and the computer program is executed when the computer program is executed by the processor. An electronic voting method of any of the above embodiments.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的和实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双速据率SDRAM(SSRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage. In the medium, when the computer program is executed, it may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and/or volatile memory. Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not a limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申 请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the preferred embodiments of this application, and do not limit the scope of this application. Any equivalent structure or equivalent process transformation made by using the content of the description and drawings of this application, or directly or indirectly applied to other related The technical field is equally included in the scope of patent protection of this application.

Claims (20)

  1. 一种电子投票方法,其中,包括:An electronic voting method, which includes:
    接收发起端发出的电子投票申请,其中,所述电子投票申请中带有提议方案、投票议程的信息;Receiving an electronic voting application sent by the initiating end, wherein the electronic voting application contains information about the proposed scheme and the voting agenda;
    通过智能合约判断所述发起端是否具有发起电子投票的资格;Judge whether the initiator is qualified to initiate electronic voting through the smart contract;
    若判断出所述发起端具有发起电子投票的资格,则获取所述发起端上传的三个公钥:B1,B2和B3,其中,三个公钥分别是公私钥对(b1,B1),(b2,B2),(b3,B3)中的公钥,B1=g b1mod n,B2=g b2mod n,B3=g b3mod n,其中n是两个大素数p、q的乘积,即n=pq;所述b1、b2和b3被所述发起端保存在本地; If it is judged that the initiator is qualified to initiate electronic voting, the three public keys uploaded by the initiator are obtained: B1, B2, and B3, where the three public keys are a public-private key pair (b1, B1), (b2,B2), the public key in (b3,B3), B1=g b1 mod n, B2=g b2 mod n, B3=g b3 mod n, where n is the product of two large prime numbers p and q, That is, n=pq; the b1, b2, and b3 are stored locally by the initiator;
    接收各参与投票的参与端的电子投票,其中,所述参与端随机选取一个公私钥对(r,R),其中,R=g r;所述参与端计算出用于投同意票的账户地址acceptAcc1=B1*g KDF(DH(r, B2));或者,用于投反对票的账户地址acceptAcc2=B1*g KDF(DH(r,B3));然后将所述参与端对应的第一投票账户中的余额转账给所述acceptAcc1对应的第二投票账户中或acceptAcc2对应的第二投票账户中,以生成所述电子投票; Receive the electronic voting of each participating terminal participating in the voting, wherein the participating terminal randomly selects a public-private key pair (r, R), where R=g r ; the participating terminal calculates the account address acceptAcc1 for voting consent =B1*g KDF(DH(r, B2)) ; or, the account address used to vote against acceptAcc2=B1*g KDF(DH(r,B3)) ; then the first vote corresponding to the participant The balance in the account is transferred to the second voting account corresponding to acceptAcc1 or the second voting account corresponding to acceptAcc2 to generate the electronic vote;
    当所述投票议程结束后,接收所述发起端的归集请求,其中,所述归集请求中包括需要归集的账户地址,其中,发起端利用acceptAcc1`=B1*gKDF(DH(R,b2))计算出每一个所述参与端对应的投票账户,以及通过公式acceptAcc2`=B1*gKDF(DH(R,b3))计算出每一个所述参与端对应的投票账户,其中,所述acceptAcc1=acceptAcc1`,acceptAcc2=acceptAcc2`;When the voting agenda is over, receive the collection request from the initiator, where the collection request includes the address of the account that needs to be collected, and the initiator uses acceptAcc1`=B1*gKDF(DH(R,b2 )) Calculate the voting account corresponding to each participating terminal, and calculate the voting account corresponding to each participating terminal through the formula acceptAcc2`=B1*gKDF(DH(R,b3)), where the acceptAcc1 =acceptAcc1`, acceptAcc2=acceptAcc2`;
    将所有的所述acceptAcc1`对应的投票账户中的余额归集到用于存储同意票的同意账户中,以及将所有acceptAcc2`对应的投票账户中的余额归集到用于存储反对票的反对账户中。Collect all the balances in the voting account corresponding to acceptAcc1` to the approval account used to store approval votes, and aggregate the balances in all the voting accounts corresponding to acceptAcc2` to the opposition account used to store negative votes middle.
  2. 根据权利要求1所述的电子投票方法,其中,所述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤之后,还包括:The electronic voting method according to claim 1, wherein after the step of judging whether the initiating terminal is qualified to initiate electronic voting through a smart contract, the method further comprises:
    建立所述同意账户和所述反对账户。Establish the consent account and the objection account.
  3. 根据权利要求1所述的电子投票方法,其中,所述接收各参与投票的参与端的电子投票的步骤之前,包括:The electronic voting method according to claim 1, wherein before the step of receiving the electronic voting of each participant participating in the voting, the method comprises:
    接收所述参与端的身份CA证书,并利用所述身份CA证书的第一私钥对电子投票申请进行签名,得到Sig;Receiving the identity CA certificate of the participant, and using the first private key of the identity CA certificate to sign the electronic voting application to obtain the Sig;
    对应所述参与端以及本次投票议程生成一个第二私钥,并利用所述第二私钥生成证书申请CSR;Generate a second private key corresponding to the participating end and the voting agenda, and use the second private key to generate a certificate to apply for CSR;
    将所述身份CA证书、Sig、CSR,以及所述参与端的账户地址发送给所述发起端,进行身份验证;Sending the identity CA certificate, Sig, CSR, and the account address of the participant end to the initiating end for identity verification;
    若接收到所述发起端反馈的身份验证通过的信息,则生成“接收各参与投票的参与端的电子投票”的命令。If the identity verification passed information fed back by the initiator is received, the command "receive the electronic voting of each participant participating in the voting" is generated.
  4. 根据权利要求3所述的电子投票方法,其中,所述接收各参与投票的参与端的电子投票的步骤之前,还包括:The electronic voting method according to claim 3, wherein, before the step of receiving the electronic voting of each participant participating in the voting, the method further comprises:
    通过智能合约获取所述参与端所具有的投票数量,以及所述参与端的投票权重值;Obtain the number of votes held by the participating terminal and the voting weight value of the participating terminal through a smart contract;
    通过智能合约将所述投票数量乘以所述投票权重值得到所述参与端的余额;Multiplying the number of votes by the voting weight value through a smart contract to obtain the balance of the participating terminal;
    通过智能合约创建带有所述余额和打开密钥为所述第二私钥的所述第一投票账户。The first voting account with the balance and the opening key being the second private key is created through a smart contract.
  5. 根据权利要求4所述的电子投票方法,其中,所述通过智能合约获取所述参与端所具有的投票数量,以及所述参与端的投票权重值的步骤,包括:The electronic voting method according to claim 4, wherein the step of obtaining the number of votes possessed by the participant terminal and the voting weight value of the participant terminal through a smart contract comprises:
    判断所述电子投票申请的申请类型;Determine the application type of the electronic voting application;
    根据所述申请类型确定所述参与端所具有的投票数量,以及所述参与端的投票权重值。The number of votes held by the participating terminal and the voting weight value of the participating terminal are determined according to the application type.
  6. 根据权利要求1所述的电子投票方法,其中,所述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤之前,包括:The electronic voting method according to claim 1, wherein before the step of judging whether the initiating terminal is qualified to initiate electronic voting through a smart contract, it comprises:
    获取所述发起端所对应的终端使用者的人脸信息;Acquiring face information of the terminal user corresponding to the initiator;
    判断所述人脸信息是否与所述发起端匹配;Judging whether the face information matches the initiator;
    若匹配,则执行所述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤。If it matches, execute the step of judging whether the initiator is qualified to initiate electronic voting through the smart contract.
  7. 根据权利要求1所述的电子投票方法,其中,所述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤,包括:The electronic voting method according to claim 1, wherein the step of judging whether the initiating terminal is qualified to initiate electronic voting through a smart contract comprises:
    判断所述发起端是不是管理账户;Determine whether the originating terminal is a management account;
    若是,则判断所述电子投票申请中是否携带其它管理账户的联合签名;If yes, judge whether the electronic voting application carries joint signatures of other management accounts;
    若带有所述联合签名,则判定所述发起端具有发起电子投票的资格。If the joint signature is provided, it is determined that the initiating terminal is qualified to initiate electronic voting.
  8. 一种电子投票装置,其中,包括:An electronic voting device, which includes:
    接收发起单元,用于接收发起端发出的电子投票申请,其中,所述电子投票申请中带有提议方案、投票议程的信息;The receiving and initiating unit is configured to receive an electronic voting application sent by the initiating end, wherein the electronic voting application contains information about a proposal scheme and a voting agenda;
    判断资格单元,用于通过智能合约判断所述发起端是否具有发起电子投票的资格;The qualification determining unit is used to determine whether the initiator is qualified to initiate electronic voting through a smart contract;
    获取单元,用于判断出所述发起端具有发起电子投票的资格,则获取所述发起端上传的三个公钥:B1,B2和B3,其中,三个公钥分别是公私钥对(b1,B1),(b2,B2),(b3,B3)中的公钥,B1=g b1mod n,B2=g b2mod n,B3=g b3mod n,其中n是两个大素数p、q的乘积,即n=pq;所述b1、b2和b3被所述发起端保存在本地; The obtaining unit is used to determine that the initiator is qualified to initiate electronic voting, and then obtain three public keys uploaded by the initiator: B1, B2, and B3, where the three public keys are a public-private key pair (b1 , B1), (b2, B2), (b3, B3) in the public key, B1 = g b1 mod n, B2 = g b2 mod n, B3 = g b3 mod n, where n is two large prime numbers p, The product of q, that is, n=pq; the b1, b2, and b3 are stored locally by the initiator;
    接收投票单元,用于接收各参与投票的参与端的电子投票,其中,所述参与端随机选取一个公私钥对(r,R),其中,R=g r;所述参与端计算出用于投同意票的账户地址acceptAcc1=B1*g KDF(DH(r,B2));或者,用于投反对票的账户地址acceptAcc2=B1*g KDF(DH(r, B3));然后将所述参与端对应的第一投票账户中的余额转账给所述acceptAcc1对应的第二投票账户中或acceptAcc2对应的第二投票账户中,以生成所述电子投票; The receiving voting unit is used to receive the electronic voting of each participating terminal participating in the voting, wherein the participating terminal randomly selects a public-private key pair (r, R), where R=g r ; the participating terminal calculates for voting The account address of the consent vote acceptAcc1=B1*g KDF(DH(r,B2)) ; or the account address used to vote against the vote acceptAcc2=B1*g KDF(DH(r, B3)) ; then the said participation The balance in the first voting account corresponding to the terminal is transferred to the second voting account corresponding to acceptAcc1 or the second voting account corresponding to acceptAcc2 to generate the electronic vote;
    接收地址单元,用于当所述投票议程结束后,接收所述发起端的归集请求,其中,所述归集请求中包括需要归集的账户地址,其中,发起端利用acceptAcc1`=B1*gKDF(DH(R,b2))计算出每一个所述参与端对应的投票账户,以及通过公式acceptAcc2`=B1*gKDF(DH(R,b3))计算出每一个所述参与端对应的投票账户,其中,所述acceptAcc1=acceptAcc1`,acceptAcc2=acceptAcc2`;The receiving address unit is used to receive the collection request of the initiator after the voting agenda ends, wherein the collection request includes the address of the account that needs to be collected, and the initiator uses acceptAcc1`=B1*gKDF (DH(R,b2)) calculate the voting account corresponding to each participant terminal, and calculate the voting account corresponding to each participant terminal through the formula acceptAcc2`=B1*gKDF(DH(R,b3)) , Wherein said acceptAcc1=acceptAcc1`, acceptAcc2=acceptAcc2`;
    归集单元,用于将所有的所述acceptAcc1`对应的投票账户中的余额归集到用于存储同意票的同意账户中,以及将所有acceptAcc2`对应的投票账户中的余额归集到用于存储反对票的反对账户中。The collection unit is used to collect all the balances in the voting account corresponding to acceptAcc1` to the approval account for storing the approval votes, and to collect the balances in all the voting accounts corresponding to acceptAcc2` to Store the disapproval account in the negative.
  9. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其中,所述处理器执行所述计算机程序时实现一种电子投票方法,该方法包括步骤:A computer device includes a memory and a processor, the memory stores a computer program, wherein the processor implements an electronic voting method when the computer program is executed, and the method includes the steps:
    接收发起端发出的电子投票申请,其中,所述电子投票申请中带有提议方案、投票议程的信息;Receiving an electronic voting application sent by the initiating end, wherein the electronic voting application contains information about the proposed scheme and the voting agenda;
    通过智能合约判断所述发起端是否具有发起电子投票的资格;Judge whether the initiator is qualified to initiate electronic voting through the smart contract;
    若判断出所述发起端具有发起电子投票的资格,则获取所述发起端上传的三个公钥:B1,B2和B3,其中,三个公钥分别是公私钥对(b1,B1),(b2,B2),(b3,B3)中的公钥,B1=g b1mod n,B2=g b2mod n,B3=g b3mod n,其中n是两个大素数p、q的乘积,即n=pq;所述b1、b2和b3被所述发起端保存在本地; If it is judged that the initiator is qualified to initiate electronic voting, the three public keys uploaded by the initiator are obtained: B1, B2, and B3, where the three public keys are a public-private key pair (b1, B1), (b2,B2), the public key in (b3,B3), B1=g b1 mod n, B2=g b2 mod n, B3=g b3 mod n, where n is the product of two large prime numbers p and q, That is, n=pq; the b1, b2, and b3 are stored locally by the initiator;
    接收各参与投票的参与端的电子投票,其中,所述参与端随机选取一个公私钥对(r,R),其中,R=g r;所述参与端计算出用于投同意票的账户地址acceptAcc1=B1*g KDF(DH(r, B2));或者,用于投反对票的账户地址acceptAcc2=B1*g KDF(DH(r,B3));然后将所述参与端对应的第一投票账户中的余额转账给所述acceptAcc1对应的第二投票账户中或acceptAcc2对应的第二投票账户中,以生成所述电子投票; Receive the electronic voting of each participating terminal participating in the voting, wherein the participating terminal randomly selects a public-private key pair (r, R), where R=g r ; the participating terminal calculates the account address acceptAcc1 for voting consent =B1*g KDF(DH(r, B2)) ; or, the account address used to vote against acceptAcc2=B1*g KDF(DH(r,B3)) ; then the first vote corresponding to the participant The balance in the account is transferred to the second voting account corresponding to acceptAcc1 or the second voting account corresponding to acceptAcc2 to generate the electronic vote;
    当所述投票议程结束后,接收所述发起端的归集请求,其中,所述归集请求中包括需要归集的账户地址,其中,发起端利用acceptAcc1`=B1*gKDF(DH(R,b2))计算出每一个所述参与端对应的投票账户,以及通过公式acceptAcc2`=B1*gKDF(DH(R,b3))计算出每一个所述参与端对应的投票账户,其中,所述acceptAcc1=acceptAcc1`,acceptAcc2=acceptAcc2`;After the voting agenda is over, receive the collection request from the initiator, where the collection request includes the address of the account that needs to be collected, and the initiator uses acceptAcc1`=B1*gKDF(DH(R,b2 )) Calculate the voting account corresponding to each participating terminal, and calculate the voting account corresponding to each participating terminal through the formula acceptAcc2`=B1*gKDF(DH(R,b3)), where the acceptAcc1 =acceptAcc1`, acceptAcc2=acceptAcc2`;
    将所有的所述acceptAcc1`对应的投票账户中的余额归集到用于存储同意票的同意账户中,以及将所有acceptAcc2`对应的投票账户中的余额归集到用于存储反对票的反对账户中。Collect all the balances in the voting account corresponding to acceptAcc1` into the approval account for storing approval votes, and collect all the balances in the voting account corresponding to acceptAcc2` into the opposition account for storing negative votes middle.
  10. 根据权利要求9所述的计算机设备,其中,所述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤之后,还包括:The computer device according to claim 9, wherein after the step of judging whether the initiating terminal is qualified to initiate electronic voting through a smart contract, the method further comprises:
    建立所述同意账户和所述反对账户。Establish the consent account and the objection account.
  11. 根据权利要求9所述的计算机设备,其中,所述接收各参与投票的参与端的电子投票的步骤之前,包括:9. The computer device according to claim 9, wherein, before the step of receiving electronic voting from each participating terminal participating in the voting, it comprises:
    接收所述参与端的身份CA证书,并利用所述身份CA证书的第一私钥对电子投票申请进行签名,得到Sig;Receiving the identity CA certificate of the participant, and using the first private key of the identity CA certificate to sign the electronic voting application to obtain the Sig;
    对应所述参与端以及本次投票议程生成一个第二私钥,并利用所述第二私钥生成证书申请CSR;Generate a second private key corresponding to the participating end and the voting agenda, and use the second private key to generate a certificate to apply for CSR;
    将所述身份CA证书、Sig、CSR,以及所述参与端的账户地址发送给所述发起端,进行身份验证;Sending the identity CA certificate, Sig, CSR, and the account address of the participant end to the initiating end for identity verification;
    若接收到所述发起端反馈的身份验证通过的信息,则生成“接收各参与投票的参与端的电子投票”的命令。If the identity verification passed information fed back by the initiator is received, the command "receive the electronic voting of each participant participating in the voting" is generated.
  12. 根据权利要求11所述的计算机设备,其中,所述接收各参与投票的参与端的电子投票的步骤之前,还包括:11. The computer device according to claim 11, wherein, before the step of receiving the electronic voting of each participant participating in the voting, the method further comprises:
    通过智能合约获取所述参与端所具有的投票数量,以及所述参与端的投票权重值;Obtain the number of votes held by the participating terminal and the voting weight value of the participating terminal through a smart contract;
    通过智能合约将所述投票数量乘以所述投票权重值得到所述参与端的余额;Multiplying the number of votes by the voting weight value through a smart contract to obtain the balance of the participating terminal;
    通过智能合约创建带有所述余额和打开密钥为所述第二私钥的所述第一投票账户。The first voting account with the balance and the opening key being the second private key is created through a smart contract.
  13. 根据权利要求12所述的计算机设备,其中,所述通过智能合约获取所述参与端所具有的投票数量,以及所述参与端的投票权重值的步骤,包括:The computer device according to claim 12, wherein the step of obtaining the number of votes held by the participant terminal and the voting weight value of the participant terminal through a smart contract comprises:
    判断所述电子投票申请的申请类型;Determine the application type of the electronic voting application;
    根据所述申请类型确定所述参与端所具有的投票数量,以及所述参与端的投票权重值。The number of votes held by the participating terminal and the voting weight value of the participating terminal are determined according to the application type.
  14. 根据权利要求9所述的计算机设备,其中,所述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤之前,包括:The computer device according to claim 9, wherein before the step of judging whether the initiating terminal is qualified to initiate electronic voting through a smart contract, it comprises:
    获取所述发起端所对应的终端使用者的人脸信息;Acquiring face information of the terminal user corresponding to the initiator;
    判断所述人脸信息是否与所述发起端匹配;Judging whether the face information matches the initiator;
    若匹配,则执行所述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤。If it matches, execute the step of judging whether the initiator is qualified to initiate electronic voting through the smart contract.
  15. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现一种电子投票方法,该方法包括步骤:A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, an electronic voting method is implemented. The method includes the steps:
    接收发起端发出的电子投票申请,其中,所述电子投票申请中带有提议方案、投票议程的信息;Receiving an electronic voting application sent by the initiating end, wherein the electronic voting application contains information about the proposed scheme and the voting agenda;
    通过智能合约判断所述发起端是否具有发起电子投票的资格;Judge whether the initiator is qualified to initiate electronic voting through the smart contract;
    若判断出所述发起端具有发起电子投票的资格,则获取所述发起端上传的三个公钥:B1,B2和B3,其中,三个公钥分别是公私钥对(b1,B1),(b2,B2),(b3,B3)中的公钥,B1=g b1mod n,B2=g b2mod n,B3=g b3mod n,其中n是两个大素数p、q的乘积,即n=pq;所述b1、b2和b3被所述发起端保存在本地; If it is judged that the initiator is qualified to initiate electronic voting, the three public keys uploaded by the initiator are obtained: B1, B2, and B3, where the three public keys are a public-private key pair (b1, B1), (b2,B2), the public key in (b3,B3), B1=g b1 mod n, B2=g b2 mod n, B3=g b3 mod n, where n is the product of two large prime numbers p and q, That is, n=pq; the b1, b2, and b3 are stored locally by the initiator;
    接收各参与投票的参与端的电子投票,其中,所述参与端随机选取一个公私钥对(r,R),其中,R=g r;所述参与端计算出用于投同意票的账户地址acceptAcc1=B1*g KDF(DH(r, B2));或者,用于投反对票的账户地址acceptAcc2=B1*g KDF(DH(r,B3));然后将所述参与端对应的第一投票账户中的余额转账给所述acceptAcc1对应的第二投票账户中或acceptAcc2对应的第二投票账户中,以生成所述电子投票; Receive the electronic voting of each participating terminal participating in the voting, wherein the participating terminal randomly selects a public-private key pair (r, R), where R=g r ; the participating terminal calculates the account address acceptAcc1 for voting consent =B1*g KDF(DH(r, B2)) ; or, the account address used to vote against acceptAcc2=B1*g KDF(DH(r,B3)) ; then the first vote corresponding to the participant The balance in the account is transferred to the second voting account corresponding to acceptAcc1 or the second voting account corresponding to acceptAcc2 to generate the electronic vote;
    当所述投票议程结束后,接收所述发起端的归集请求,其中,所述归集请求中包括需要归集的账户地址,其中,发起端利用acceptAcc1`=B1*gKDF(DH(R,b2))计算出每一个所述参与端对应的投票账户,以及通过公式acceptAcc2`=B1*gKDF(DH(R,b3))计算出每一个所述参与端对应的投票账户,其中,所述acceptAcc1=acceptAcc1`,acceptAcc2=acceptAcc2`;After the voting agenda is over, receive the collection request from the initiator, where the collection request includes the address of the account that needs to be collected, and the initiator uses acceptAcc1`=B1*gKDF(DH(R,b2 )) Calculate the voting account corresponding to each participating terminal, and calculate the voting account corresponding to each participating terminal through the formula acceptAcc2`=B1*gKDF(DH(R,b3)), where the acceptAcc1 =acceptAcc1`, acceptAcc2=acceptAcc2`;
    将所有的所述acceptAcc1`对应的投票账户中的余额归集到用于存储同意票的同意账户中,以及将所有acceptAcc2`对应的投票账户中的余额归集到用于存储反对票的反对账户中。Collect all the balances in the voting account corresponding to acceptAcc1` into the approval account for storing approval votes, and collect all the balances in the voting account corresponding to acceptAcc2` into the opposition account for storing negative votes middle.
  16. 根据权利要求15所述的计算机可读存储介质,其中,所述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤之后,还包括:The computer-readable storage medium according to claim 15, wherein after the step of judging whether the initiating terminal is qualified to initiate electronic voting through a smart contract, the method further comprises:
    建立所述同意账户和所述反对账户。Establish the consent account and the objection account.
  17. 根据权利要求15所述的计算机可读存储介质,其中,所述接收各参与投票的参与端的电子投票的步骤之前,包括:15. The computer-readable storage medium according to claim 15, wherein before the step of receiving the electronic voting of each participant participating in the voting, it comprises:
    接收所述参与端的身份CA证书,并利用所述身份CA证书的第一私钥对电子投票申请进行签名,得到Sig;Receiving the identity CA certificate of the participant, and using the first private key of the identity CA certificate to sign the electronic voting application to obtain the Sig;
    对应所述参与端以及本次投票议程生成一个第二私钥,并利用所述第二私钥生成证书申请CSR;Generate a second private key corresponding to the participating end and the voting agenda, and use the second private key to generate a certificate to apply for CSR;
    将所述身份CA证书、Sig、CSR,以及所述参与端的账户地址发送给所述发起端,进行身份验证;Sending the identity CA certificate, Sig, CSR, and the account address of the participant end to the initiating end for identity verification;
    若接收到所述发起端反馈的身份验证通过的信息,则生成“接收各参与投票的参与端的电子投票”的命令。If the identity verification passed information fed back by the initiator is received, the command "receive the electronic voting of each participant participating in the voting" is generated.
  18. 根据权利要求17所述的计算机可读存储介质,其中,所述接收各参与投票的参与端的电子投票的步骤之前,还包括:18. The computer-readable storage medium according to claim 17, wherein before the step of receiving the electronic voting of each participant participating in the voting, the method further comprises:
    通过智能合约获取所述参与端所具有的投票数量,以及所述参与端的投票权重值;Obtain the number of votes held by the participating terminal and the voting weight value of the participating terminal through a smart contract;
    通过智能合约将所述投票数量乘以所述投票权重值得到所述参与端的余额;Multiplying the number of votes by the voting weight value through a smart contract to obtain the balance of the participating terminal;
    通过智能合约创建带有所述余额和打开密钥为所述第二私钥的所述第一投票账户。The first voting account with the balance and the opening key being the second private key is created through a smart contract.
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述通过智能合约获取所述参与端所具有的投票数量,以及所述参与端的投票权重值的步骤,包括:18. The computer-readable storage medium according to claim 18, wherein the step of obtaining the number of votes held by the participant terminal and the voting weight value of the participant terminal through a smart contract comprises:
    判断所述电子投票申请的申请类型;Determine the application type of the electronic voting application;
    根据所述申请类型确定所述参与端所具有的投票数量,以及所述参与端的投票权重值。The number of votes held by the participating terminal and the voting weight value of the participating terminal are determined according to the application type.
  20. 根据权利要求15所述的计算机可读存储介质,其中,所述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤之前,包括:The computer-readable storage medium according to claim 15, wherein before the step of judging whether the initiating terminal is qualified to initiate electronic voting through a smart contract, the method comprises:
    获取所述发起端所对应的终端使用者的人脸信息;Acquiring face information of the terminal user corresponding to the initiator;
    判断所述人脸信息是否与所述发起端匹配;Judging whether the face information matches the initiator;
    若匹配,则执行所述通过智能合约判断所述发起端是否具有发起电子投票的资格的步骤。If it matches, execute the step of judging whether the initiator is qualified to initiate electronic voting through the smart contract.
PCT/CN2020/105885 2020-04-03 2020-07-30 Electronic voting method and device, computer, and storage medium WO2021196473A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010260573.3A CN111159683B (en) 2020-04-03 2020-04-03 Electronic voting method, device, computer and storage medium
CN202010260573.3 2020-04-03

Publications (1)

Publication Number Publication Date
WO2021196473A1 true WO2021196473A1 (en) 2021-10-07

Family

ID=70567763

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/105885 WO2021196473A1 (en) 2020-04-03 2020-07-30 Electronic voting method and device, computer, and storage medium

Country Status (2)

Country Link
CN (1) CN111159683B (en)
WO (1) WO2021196473A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111159683B (en) * 2020-04-03 2020-08-21 深圳壹账通智能科技有限公司 Electronic voting method, device, computer and storage medium
CN117061089B (en) * 2023-10-12 2024-02-06 腾讯科技(深圳)有限公司 Voting management method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109274505A (en) * 2018-11-22 2019-01-25 浙江工商大学 A kind of anonymous electronic voting method based on block chain technology
CN109617695A (en) * 2018-12-28 2019-04-12 无锡井通网络科技有限公司 Voting method, device, electronic equipment and storage medium based on block chain
US20190114707A1 (en) * 2017-10-16 2019-04-18 Shinestack LLC Distribution of Blockchain Tokens
CN110519059A (en) * 2019-09-29 2019-11-29 四川师范大学 A kind of block chain dual key concealment address processing method based on bilinear map
CN110933098A (en) * 2019-12-05 2020-03-27 全链通有限公司 Electronic voting method, device and storage medium based on block chain
CN111159683A (en) * 2020-04-03 2020-05-15 深圳壹账通智能科技有限公司 Electronic voting method, device, computer and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108109257A (en) * 2018-01-05 2018-06-01 杭州电子科技大学 A kind of Anonymous Electronic Voting method based on block chain
CN109934988B (en) * 2019-02-15 2021-05-28 三亚哈尔滨工程大学南海创新发展基地 Electronic voting method based on block chain
CN110675265B (en) * 2019-09-29 2022-07-08 四川师范大学 Method for realizing block chain double-key hiding address protocol without temporary key leakage
CN110912705B (en) * 2019-11-14 2022-07-05 山东师范大学 Distributed electronic voting method and system based on block chain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190114707A1 (en) * 2017-10-16 2019-04-18 Shinestack LLC Distribution of Blockchain Tokens
CN109274505A (en) * 2018-11-22 2019-01-25 浙江工商大学 A kind of anonymous electronic voting method based on block chain technology
CN109617695A (en) * 2018-12-28 2019-04-12 无锡井通网络科技有限公司 Voting method, device, electronic equipment and storage medium based on block chain
CN110519059A (en) * 2019-09-29 2019-11-29 四川师范大学 A kind of block chain dual key concealment address processing method based on bilinear map
CN110933098A (en) * 2019-12-05 2020-03-27 全链通有限公司 Electronic voting method, device and storage medium based on block chain
CN111159683A (en) * 2020-04-03 2020-05-15 深圳壹账通智能科技有限公司 Electronic voting method, device, computer and storage medium

Also Published As

Publication number Publication date
CN111159683B (en) 2020-08-21
CN111159683A (en) 2020-05-15

Similar Documents

Publication Publication Date Title
US20240152913A1 (en) Method and system for secure data record distribution using a blockchain
RU2708344C1 (en) Protection of these block chains using homomorphic encryption
US20240007291A1 (en) System and method for authenticating user identity
Çabuk et al. A survey on feasibility and suitability of blockchain techniques for the e-voting systems
US20170109955A1 (en) Blockchain electronic voting system and method
CN109509518A (en) Management method, server and the computer storage medium of electronic health record
CN112199714A (en) Privacy protection method and device based on block chain and electronic equipment
WO2021196473A1 (en) Electronic voting method and device, computer, and storage medium
CN110633963A (en) Electronic bill processing method, electronic bill processing device, computer-readable storage medium and equipment
US20180131667A1 (en) Systems and methods to verify ownership of a telephone number and to track ownership reassignments
US20210110384A1 (en) Ad Hoc Neural Network for Proof of Wallet
CN112231769A (en) Block chain-based numerical verification method and device, computer equipment and medium
CN109587154A (en) Digital identity verification method, device, computer equipment and storage medium
CN114584294A (en) Method and device for careless scattered arrangement
CN112632574A (en) Multi-mechanism data processing method and device based on alliance chain and related equipment
CN112884562B (en) Mortgage processing method and device based on blockchain and readable storage medium
CN111861737B (en) Block chain-based wind control model optimization method and device and computer equipment
CN113657616B (en) Updating method and device of federal learning model
CN111861736B (en) Block chain based government affair data processing method, device, equipment and medium
CN114238914A (en) Digital certificate application system, method, device, computer equipment and storage medium
CN116866009B (en) Authentication network-based cross-chain identity verification method and device, electronic equipment and storage medium
CN111402037A (en) User data processing method and device
CN111027992A (en) Asset transaction method and device based on blockchain system and hardware equipment
Cheng et al. Correlation trust authentication model for peer-to-peer networks
Pee et al. Online test and management system using blockchain network

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20928422

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 12/01/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20928422

Country of ref document: EP

Kind code of ref document: A1