Electronic voting method and device based on blockchain
By generating multiple data identifiers and valid identifiers for voters on the blockchain, and generating valid ticket data and invalid ticket data, the problems of voting fairness and insufficient privacy protection in the existing technology are solved, and anonymity and privacy are achieved. Improved security.
Patent Information
- Application Number
- CN202010749775.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-30
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2040-07-30
AI Technical Summary
In existing blockchain electronic voting technology, transfer transaction records affect voting fairness, and anonymity and privacy protection are poor.
By generating multiple data identifiers and valid identifiers for each voter on the blockchain, valid ticket data and invalid ticket data are generated. Voters use these data to vote, calculate the number of votes for candidates and determine the voting results, improving anonymity. and privacy security.
It improves the anonymity and privacy security of voting, prevents other voters or candidates from knowing the voter’s voting intention, and enhances the fairness and security of voting.
Smart Images

Figure CN114093079B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of blockchain technology, and in particular to a blockchain-based electronic voting method and device, and a computer-storable medium. Background Art
[0002] Blockchain has the characteristics of decentralization, immutability, traceability and anonymity, has high security, and is often used to implement electronic voting.
[0003] In the related technology, a smart contract allocates a ticket to each voter, and the voter initiates a transfer transaction request for a candidate to the smart contract, thereby enabling the voter to cast the ticket for the corresponding candidate. Summary of the invention
[0004] The inventor believes that: in the related technology, transfer transaction records will be recorded on the blockchain, and users can infer the number of votes for candidates through transfer transaction records, which affects the fairness of voting, has poor anonymity, and has poor privacy protection.
[0005] In response to the above technical problems, the present disclosure proposes a solution that can improve the anonymity and privacy security of voting.
[0006] According to a first aspect of the present disclosure, there is provided a blockchain-based electronic voting method, which is executed by a smart contract of the blockchain, and the blockchain-based electronic voting method comprises: in response to receiving ticket transaction requests from multiple voters, for each voter, generating multiple data identifiers and a valid identifier that are the same as the number of multiple candidates, each data identifier is used to identify the uniqueness of ticket data, and the valid identifier is used to identify the validity of the ticket data, and the ticket data is used by the voter to vote for the candidate; for each voter, based on the multiple data identifiers and the valid identifiers, generating and returning a valid ticket data and at least one invalid ticket data, the valid ticket data includes a data identifier and the valid identifier, and each invalid ticket data includes a data identifier; receiving multiple voting transaction requests sent from each voter based on the one valid ticket data and the at least one invalid ticket data, each voting transaction request includes a valid ticket data or an invalid ticket data, and a blockchain address of a candidate; according to the voting transaction requests of the multiple voters, calculating the number of valid ticket data for the blockchain address of each candidate as the number of votes for the multiple candidates; and determining the voting result based on the number of votes for the multiple candidates.
[0007] In some embodiments, determining the voting result based on the number of votes for the multiple candidates includes: sorting the number of votes for the multiple candidates to obtain sorting numbers for the multiple candidates; and determining the sorting numbers for the multiple candidates as the voting result.
[0008] In some embodiments, the blockchain-based electronic voting method also includes: receiving a ticket inquiry transaction request from any voter, the ticket inquiry transaction request including a data identifier of the voter's valid ticket data; querying the blockchain address of the candidate corresponding to the data identifier based on the data identifier of the voter's valid ticket data; and sending the blockchain address of the candidate corresponding to the data identifier to the voter.
[0009] In some embodiments, the electronic voting method also includes: receiving a ticket transfer transaction request from any voter, the ticket transfer transaction request including the blockchain address of any other voter except the any voter; storing the correspondence between the blockchain address of the any other voter and the valid ticket data and invalid ticket data of the any other voter, so that the any other voter sends a voting transaction request including the valid ticket data or invalid ticket data of the any voter to the smart contract.
[0010] In some embodiments, the electronic voting method also includes: before receiving ticket collection transaction requests from multiple voters, receiving encrypted identity information of each voter; for each voter, authenticating the encrypted identity information; if the identity authentication is passed, sending the blockchain address of each voter to each voter, so that each voter sends a ticket collection transaction request to the smart contract based on the blockchain address.
[0011] In some embodiments, authenticating the encrypted identity information includes: matching the encrypted identity information with at least one pre-stored valid encrypted identity information.
[0012] In some embodiments, the encrypted identity information is obtained through an RSA algorithm.
[0013] In some embodiments, each voter's ticket transaction request includes a seed of ticket data, and generating multiple data identifiers equal to the number of candidates and a valid identifier includes: for each voter, generating the multiple data identifiers according to preset rules; and generating the valid identifier according to the seed.
[0014] In some embodiments, the preset rule is to perform hash processing on a character string consisting of each voter's blockchain address, the time of the ticket transaction request, and a number of random numbers that is the same as the number of candidates.
[0015] According to a second aspect of the present disclosure, there is provided an electronic voting device based on blockchain, comprising: a first generating module, configured to, in response to receiving ticket collection transaction requests from a plurality of voters, generate, for each voter, a plurality of data identifiers and a valid identifier which are the same in number as a plurality of candidates, each data identifier being used to identify the uniqueness of ticket data, the valid identifier being used to identify the validity of the ticket data, and the ticket data being used by the voter to vote for the candidate; a second generating module, configured to, for each voter, generate, based on the plurality of data identifiers and the valid identifiers, a valid ticket data and at least one invalid ticket data, the valid ticket data comprising a data identifier and the valid identifier, and each invalid ticket data comprising a valid ticket data and a valid identifier. The ticket data includes a data identifier; a return module is configured to return the one valid ticket data and at least one invalid ticket data for each voter; a receiving module is configured to receive multiple voting transaction requests sent from each voter based on the one valid ticket data and at least one invalid ticket data, each voting transaction request includes one valid ticket data or one invalid ticket data, and a blockchain address of a candidate; a calculation module is configured to calculate the number of valid ticket data for the blockchain address of each candidate as the number of votes for each candidate based on the voting transaction requests of the multiple voters; a determination module is configured to determine the voting result based on the number of votes for the multiple candidates.
[0016] According to the third aspect of the present disclosure, there is provided a blockchain-based electronic voting device, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the blockchain-based electronic voting method described in any of the above embodiments based on instructions stored in the memory.
[0017] According to a fourth aspect of the present disclosure, a computer-storable medium is provided, on which computer program instructions are stored, and when the instructions are executed by a processor, the blockchain-based electronic voting method described in any of the above embodiments is implemented.
[0018] In the above embodiments, the anonymity and privacy security of voting can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0020] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0021] Figure 1 is a flow chart illustrating a blockchain-based electronic voting method according to some embodiments of the present disclosure;
[0022] Figure 2is a schematic diagram showing the structure of a blockchain-based electronic voting system according to some embodiments of the present disclosure;
[0023] Figure 3 is a flowchart illustrating a blockchain-based electronic voting method according to other embodiments of the present disclosure;
[0024] Figure 4 is a signaling diagram illustrating a blockchain-based electronic voting method according to some embodiments of the present disclosure;
[0025] Figure 5 is a block diagram illustrating a blockchain-based electronic voting device according to some embodiments of the present disclosure;
[0026] Figure 6 is a block diagram showing a blockchain-based electronic voting device according to some other embodiments of the present disclosure;
[0027] Figure 7 is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION
[0028] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0029] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0030] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0031] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0032] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0033] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0034] The blockchain-based electronic voting method of some embodiments of the present disclosure will be described in detail below with reference to the figures.
[0035] Figure 1 is a flow chart illustrating a blockchain-based electronic voting method according to some embodiments of the present disclosure.
[0036] Figure 2 It is a schematic diagram showing the structure of a blockchain-based electronic voting system according to some embodiments of the present disclosure.
[0037] like Figure 1 As shown, the electronic voting method based on blockchain includes: step S110, for each voter, generating multiple data identifiers and a valid identifier that are the same as the number of multiple candidates; step S120, for each voter, generating a valid ticket data and at least one invalid ticket data; step S130, for each voter, returning a valid ticket data and at least one invalid ticket data; step S140, receiving multiple voting transaction requests sent from each voter based on a valid ticket data and at least one invalid ticket data; step S150, calculating the number of valid ticket data for each candidate's blockchain address; and step S160, determining the voting result according to the number of votes for multiple candidates. For example, steps S110-step S160 are executed by a smart contract of the blockchain.
[0038] In the above embodiment, each voter generates ticket data of the same number as that of multiple candidates, so that the voter will initiate a voting transaction request to each candidate during the voting process. Since the transaction records on the blockchain will not display the specific transaction content, other voters or candidates cannot know the voter's voting intention, thereby interfering with other nodes' query of voting decisions, which can improve anonymity and the privacy security of voters.
[0039] In step S110, in response to receiving a ticket transaction request from a plurality of voters, a plurality of data identifiers and a valid identifier equal to the number of candidates are generated for each voter. Each data identifier is used to identify the uniqueness of the ticket data. The valid identifier is used to identify the validity of the ticket data. The ticket data is used by the voter to vote for the candidate. The data identifier is, for example, a ballot ID. The valid identifier can be, for example, a Nonce value, and the valid identifier is only visible to the voter himself.
[0040] In some embodiments, each voter's ticket transaction request includes a seed of ticket data. For each voter, multiple data identifiers are generated according to preset rules; and a valid identifier is generated according to the seed. For example, the preset rule is to perform hash processing on a string consisting of each voter's blockchain address, the time of the ticket transaction request, and multiple random numbers equal to the number of candidates. The hash algorithm is collision-resistant and irreversible, further improving security.
[0041] For example, the voter's blockchain address 0x01888b20FBa148, the time of the ticket transaction request 20200110, and the string 0x01888b20FBa148202001101 consisting of the random number 1 can be hashed to obtain a unique hash value as a data identifier. Through multiple hashing processes, multiple data identifiers equal to the number of candidates can be obtained.
[0042] For example, multiple voters pass Figure 2 The user system 23 sends multiple ticket-collecting transaction requests to the blockchain 22, so that the blockchain 22 forwards the multiple ticket-collecting transaction requests to the smart contract 21 respectively, and then the smart contract 21 receives the multiple ticket-collecting transaction requests from multiple voters. The blockchain 22 is, for example, a consortium chain, which is built on the infrastructure platform 24 and consists of relevant parties such as the election committee, the audit department, the regulatory department, the competent department, and other departments.
[0043] In step S120, for each voter, one valid ticket data and at least one invalid ticket data are generated based on multiple data identifiers and valid identifiers. The valid ticket data includes a data identifier and a valid identifier, and each invalid ticket data includes a data identifier. Figure 2 The smart contract 21 executes step S120.
[0044] In step S130, for each voter, one valid ticket data and at least one invalid ticket data are returned. For example, Figure 2 After the smart contract 21 generates valid ticket data and invalid ticket data for each voter, the valid ticket data and invalid ticket data of the voter are sent to the blockchain 22, and then the blockchain 22 forwards it to the user system 23 of the voter.
[0045] In step S140, multiple voting transaction requests are received from each voter based on one valid ticket data and at least one invalid ticket data. Each voting transaction request includes one valid ticket data or one invalid ticket data, and a blockchain address of a candidate.
[0046] For example, each voter Figure 2 The user system 23 sends multiple voting transaction requests for multiple candidates to the blockchain 22, and the blockchain 22 forwards the multiple voting transaction requests to the smart contract 21. Multiple voting transaction requests can be sent at the same time or in sequence.
[0047] Taking voter 1 as an example, his valid ticket [ballotID1, nonce1] is cast for candidate 1, and invalid tickets are transferred to candidate 2 and candidate 3 respectively. Other voters can only see that voter 1 has initiated a transfer transaction of ticket data (ticket token) for all candidates, but they do not know which candidate voter 1's valid ticket was cast for.
[0048] In step S150, based on the voting transaction requests of multiple voters, the number of valid ticket data for each candidate's blockchain address is calculated as the number of votes for each candidate. Figure 2 The smart contract 21 executes step S150. Smart contracts are decentralized and cannot be intervened by humans. By screening the valid ticket tokens of candidates through on-chain contracts, the decentralized approach can effectively avoid the drawbacks of tampering with voting results in the traditional centralized approach.
[0049] In step S160, the voting result is determined based on the votes of the multiple candidates. Figure 2 The smart contract 21 executes step S160. For example, the smart contract 21 stores the voting results in the memory of the smart contract 21. The voting results are stored in the memory of the smart contract for query by nodes of the entire network. No node can modify them, and a single point of failure has no impact on the entire network.
[0050] In some embodiments, the votes of multiple candidates are sorted to obtain the sorting numbers of the multiple candidates, and the sorting numbers of the multiple candidates are determined as the voting results. By only disclosing the sorting numbers of the multiple candidates but not the votes of the candidates, the anonymity and privacy security of the voting are further improved.
[0051] The above steps S150 to S160 are fully automatically executed by the smart contract in a secure sandbox environment. No node can see the specific number of votes for the candidate and can only query the final ranking result of the contract, thereby achieving anonymity of the candidate's vote number.
[0052] Figure 3 is a flowchart illustrating a blockchain-based electronic voting method according to some other embodiments of the present disclosure.
[0053] like Figure 3 As shown, the blockchain-based electronic voting method includes steps S101 to S173. Figure 3 and Figure 1 The difference is that Figure 3The following shows steps S101-S103, S131-S132, and S171-S173 of the blockchain-based electronic voting method of other embodiments. Figure 3 and Figure 1 The differences are shown below, and the similarities will not be repeated here.
[0054] For example, before receiving ticket collection transaction requests from multiple voters, the blockchain-based electronic voting method also includes steps S101 to S103.
[0055] In step S101, the encrypted identity information of each voter is received. For example, the voter Figure 2 The user system 23 encrypts the voter's identity, password, photo and other personal sensitive information to obtain encrypted identity information. The encrypted identity information can be obtained by Figure 2 The user system 23 is obtained through the RSA encryption algorithm. Based on the RSA algorithm, the user information and the blockchain address are separated, and the identity authentication system publishes the public key pub key , used for users to encrypt personal information.
[0056] In step S102, for each voter, the encrypted identity information is authenticated.
[0057] For example, by Figure 2 The identity authentication system 25 performs a matching operation on the encrypted identity information with at least one pre-stored valid encrypted identity information to implement identity authentication. If the voter's encrypted identity information matches the pre-stored valid encrypted identity information, the identity authentication is successful. If the voter's encrypted identity information does not match the pre-stored valid encrypted identity information, the identity authentication fails. Figure 2 The identity authentication system 25 can be integrated into the smart contract 21, or can exist independently in the electronic voting system. The identity authentication system 25 is, for example, a CA (Certification Authority) authentication system.
[0058] In step S103, if the identity authentication is passed, the blockchain address of each voter is sent to each voter, so that each voter can send a ticket collection transaction request to the smart contract according to the blockchain address. Figure 2 The identity authentication system 25 sends each voter’s blockchain address to each voter. Figure 2 The identity authentication system 25 will also register the RSA public key and the voter's blockchain address on the blockchain 22. The process of generating a blockchain address is a prior art and will not be described in detail in this disclosure.
[0059] The identity authentication process of steps S101 to S103 is not only applicable to voters, but also to any other users such as candidates.
[0060] For example, the blockchain-based electronic voting method also includes steps S131-S132.
[0061] In step S131, a ticket transfer transaction request is received from any voter. The ticket transfer transaction request includes the blockchain address of any other voter except the any voter.
[0062] In step S132, the correspondence between the blockchain address of any other voter and the valid ticket data and invalid ticket data of any other voter is stored so that any other voter can send a voting transaction request including the valid ticket data or invalid ticket data of any other voter to the smart contract.
[0063] In the above embodiment, voters are supported to transfer votes, that is, the ticket data of a certain voter can be operated by other voters. Those skilled in the art should understand that the ticket transfer operation should be performed at any time after the voter obtains the ticket data and before voting.
[0064] For example, the blockchain-based electronic voting method also includes steps S171-S173.
[0065] In step S171, a ticket inquiry transaction request is received from any voter. The ticket inquiry transaction request includes the data identifier of the voter's valid ticket data. Figure 2 The user system 23 sends a ticket inquiry transaction request to the blockchain 22, and then the blockchain 22 sends the ticket inquiry transaction request to the smart contract 21.
[0066] In step S172, based on the data identifier of the voter's valid ticket data, the blockchain address of the candidate corresponding to the data identifier is queried. For example, Figure 2 The smart contract 21 will store the correspondence between the candidate's blockchain address and the data identifier of the valid ticket data in the memory, so as to find the candidate's blockchain address corresponding to the corresponding data identifier according to the ticket query transaction request.
[0067] In step S173, the blockchain address of the candidate corresponding to the data identifier is sent to the voter. For example, Figure 2 The smart contract 21 sends the blockchain address of the candidate corresponding to the data identifier to the blockchain 22, and then the blockchain 22 sends the blockchain address of the candidate to the user system 23, so that the voters can manually judge whether the vote is correct.
[0068] In the above embodiment, voters are supported to check their votes, thereby improving the reliability of electronic voting.
[0069] Figure 4 is a signaling diagram illustrating a blockchain-based electronic voting method according to some embodiments of the present disclosure.
[0070] like Figure 4 As shown, the blockchain-based electronic voting method includes steps S401 to S417.
[0071] In step S401, the voter sends the RSA-encrypted personal valid information to the identity authentication system. The identity authentication system can be integrated into the smart contract or exist independently in the electronic voting system.
[0072] In step S402, the identity authentication system authenticates the voter's valid personal information.
[0073] In step S403, if the identity authentication is passed, a blockchain address (also called an account address) is randomly assigned to the voter.
[0074] In step S404, the voter sends a ticket transaction request to the blockchain, which includes a seed of the ticket data.
[0075] In step S405, the blockchain forwards the ticket collection transaction request to the smart contract.
[0076] In step S406, the smart contract generates multiple ticket data and sends them to the blockchain. The multiple ticket data include one valid ticket data and at least one invalid ticket data.
[0077] In step S407, the blockchain sends multiple ticket data to the voters.
[0078] In step S408, the voter sends a voting transaction request to the blockchain. The voting transaction request includes a valid ticket data or an invalid ticket data, and a candidate's blockchain address.
[0079] In step S409, the blockchain forwards the voting transaction request to the smart contract.
[0080] In step S410, the smart contract calculates the number of valid ticket data for each candidate's blockchain address as the number of votes for each candidate.
[0081] In step S411, the smart contract sorts the votes of multiple candidates and obtains the sorting result as the voting result.
[0082] In step S412, the smart contract stores the voting results in memory.
[0083] In step S413, the voter sends a ticket inquiry transaction request to the blockchain, which includes a data identifier of the voter's valid ticket data.
[0084] In step S414, the blockchain forwards the ticket inquiry transaction request to the smart contract.
[0085] In step S415, the smart contract queries the blockchain address of the corresponding candidate based on the data identifier of the valid ticket data in the ticket query transaction request.
[0086] In step S416, the smart contract sends the queried blockchain address to the blockchain.
[0087] In step S417, the blockchain forwards the blockchain address to the voter for verification.
[0088] Figure 5 is a block diagram illustrating a blockchain-based electronic voting device according to some embodiments of the present disclosure.
[0089] like Figure 5 As shown, the blockchain-based electronic voting device includes a first generation module 51, a second generation module 52, a return module 53, a receiving module 54, a calculation module 55 and a determination module 56.
[0090] The first generating module 51 is configured to generate, in response to receiving a ticket collection transaction request from a plurality of voters, a plurality of data identifiers and a valid identifier for each voter, which are equal to the number of the plurality of candidates, for example, by performing the following steps: Figure 1 Step S110 is shown. Each data identifier is used to identify the uniqueness of the ticket data. The valid identifier is used to identify the validity of the ticket data. The ticket data is used by voters to vote for candidates.
[0091] The second generating module 52 is configured to generate, for each voter, one valid ticket data and at least one invalid ticket data according to a plurality of data identifiers and valid identifiers, for example, by performing the following steps: Figure 1 Step S120 shown. The valid ticket data includes a data identifier and a valid identifier. Each invalid ticket data includes a data identifier.
[0092] The return module 53 is configured to return one valid ticket data and at least one invalid ticket data to each voter, for example, by executing Figure 1 Step S130 is shown.
[0093] The receiving module 54 is configured to receive multiple voting transaction requests sent from each voter based on one valid ticket data and at least one invalid ticket data, for example, by performing the following steps: Figure 1Step S140 is shown. Each voting transaction request includes a valid ticket data or an invalid ticket data, and a candidate's blockchain address.
[0094] The calculation module 55 is configured to calculate the number of valid ticket data for each candidate's blockchain address as the number of votes for each candidate according to the voting transaction requests of multiple voters, for example, by performing the following steps: Figure 1 Step S150 is shown.
[0095] The determination module 56 is configured to determine the voting result according to the votes of the multiple candidates, for example, by performing the following steps: Figure 1 Step S160 is shown.
[0096] Figure 6 is a block diagram showing a blockchain-based electronic voting device according to some other embodiments of the present disclosure.
[0097] like Figure 6 As shown, the blockchain-based electronic voting device 6 includes a memory 61; and a processor 62 coupled to the memory 61. The memory 61 is used to store instructions for executing the corresponding embodiment of the blockchain-based electronic voting method. The processor 62 is configured to execute the blockchain-based electronic voting method in any of the embodiments of the present disclosure based on the instructions stored in the memory 61.
[0098] Figure 7 is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure.
[0099] like Figure 7 As shown, the computer system 70 may be embodied in the form of a general purpose computing device. The computer system 70 includes a memory 710, a processor 720, and a bus 700 that connects the various system components.
[0100] The memory 710 may include, for example, a system memory, a non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application, a boot loader, and other programs. The system memory may include a volatile storage medium, such as a random access memory (RAM) and / or a cache memory. The non-volatile storage medium may store, for example, instructions for executing at least one of the corresponding embodiments of the blockchain-based electronic voting method. The non-volatile storage medium includes, but is not limited to, a disk memory, an optical memory, a flash memory, and the like.
[0101] The processor 720 can be implemented by a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistors, etc. Discrete hardware components. Accordingly, each module such as the judgment module and the determination module can be implemented by a central processing unit (CPU) running instructions in a memory that execute corresponding steps, or can be implemented by a dedicated circuit that executes corresponding steps.
[0102] The bus 700 may use any of a variety of bus architectures, including, but not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, and a Peripheral Component Interconnect (PCI) bus.
[0103] The computer system 70 may also include an input / output interface 730, a network interface 740, a storage interface 750, etc. These interfaces 730, 740, 750, the memory 710, and the processor 720 may be connected via a bus 700. The input / output interface 730 may provide a connection interface for input / output devices such as a display, a mouse, and a keyboard. The network interface 740 may provide a connection interface for various networked devices. The storage interface 750 may provide a connection interface for external storage devices such as a floppy disk, a USB flash drive, and an SD card.
[0104] Here, various aspects of the present disclosure are described with reference to flowcharts and / or block diagrams of methods, devices, and computer program products according to embodiments of the present disclosure. It should be understood that each frame of the flowchart and / or block diagram and the combination of frames can be implemented by computer-readable program instructions.
[0105] These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable device to produce a machine, so that the processor executes the instructions to produce means for implementing the functions specified in one or more blocks in the flowchart and / or block diagram.
[0106] These computer-readable program instructions may also be stored in a computer-readable memory, which cause the computer to work in a specific manner to produce an article of manufacture, including instructions for implementing the functions specified in one or more blocks in the flowchart and / or block diagram.
[0107] The present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
[0108] Through the blockchain-based electronic voting method and device, and computer-storable medium in the above-mentioned embodiments, the anonymity and privacy security of voting are improved.
[0109] So far, the blockchain-based electronic voting method and device, and computer-storable medium according to the present disclosure have been described in detail. In order to avoid obscuring the concept of the present disclosure, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solution disclosed here.
Claims
1. A blockchain-based electronic voting method, executed by a smart contract of the blockchain, the blockchain-based electronic voting method comprising: In response to receiving a ticket transaction request from a plurality of voters, for each voter, a plurality of data identifiers and a valid identifier are generated, which are the same as the number of the plurality of candidates, each data identifier is used to identify the uniqueness of the ticket data, and the valid identifier is used to identify the validity of the ticket data, and the ticket data is used by the voter to vote for the candidate; For each voter, based on the multiple data identifiers and the valid identifiers, one valid ticket data and at least one invalid ticket data are generated and returned, wherein the valid ticket data includes a data identifier and the valid identifier, and each invalid ticket data includes a data identifier, and for each voter, the same number of ticket data as the number of candidates is generated; Receiving multiple voting transaction requests sent by each voter based on the one valid ticket data and at least one invalid ticket data, each voting transaction request includes one valid ticket data or one invalid ticket data, and a blockchain address of a candidate, and each voter initiates one voting transaction request for each candidate; Calculate the number of valid ticket data for each candidate's blockchain address according to the voting transaction requests of the multiple voters as the number of votes for each candidate; determining voting results based on the votes for the multiple candidates; Receiving a ticket inquiry transaction request from any voter, wherein the ticket inquiry transaction request includes a data identifier of the voter's valid ticket data; According to the data identifier of the voter's valid ticket data, query the blockchain address of the candidate corresponding to the data identifier; Send the blockchain address of the candidate corresponding to the data identifier to the voter.
2. The blockchain-based electronic voting method according to claim 1, wherein: Determining the voting result according to the votes of the multiple candidates includes: Sorting the votes of the multiple candidates to obtain ranking numbers of the multiple candidates; The ranking sequence numbers of the multiple candidates are determined as the voting results.
3. The blockchain-based electronic voting method according to claim 1, further comprising: Receiving a ticket transfer transaction request from any voter, wherein the ticket transfer transaction request includes a blockchain address of any other voter except the any voter; The correspondence between the blockchain address of any other voter and the valid ticket data and invalid ticket data of any other voter is stored so that any other voter can send a voting transaction request including the valid ticket data or invalid ticket data of any other voter to the smart contract.
4. The blockchain-based electronic voting method according to claim 1, further comprising: Before receiving vote-collection transaction requests from multiple voters, receiving encrypted identity information of each voter; For each voter, authenticating the encrypted identity information; When the identity authentication is passed, the blockchain address of each voter is sent to each voter, so that each voter sends a ticket collection transaction request to the smart contract according to the blockchain address.
5. The blockchain-based electronic voting method according to claim 4, wherein: Performing identity authentication on the encrypted identity information includes: A matching operation is performed on the encrypted identity information and at least one pre-stored valid encrypted identity information.
6. The blockchain-based electronic voting method according to claim 4, wherein: The encrypted identity information is obtained through the RSA algorithm.
7. The blockchain-based electronic voting method according to claim 1, wherein: Each voter's ticket transaction request includes a seed for the ticket data, which generates multiple data identifiers equal to the number of candidates and a valid identifier including: For each voter, generating the plurality of data identifiers according to a preset rule; The valid identifier is generated according to the seed.
8. The blockchain-based electronic voting method according to claim 7, wherein: The preset rule is to perform hash processing on each voter's blockchain address, the time of the ticket transaction request, and a string consisting of multiple random numbers that is the same as the number of candidates.
9. An electronic voting device based on blockchain, comprising: A first generating module is configured to, in response to receiving a ticket collection transaction request from a plurality of voters, generate, for each voter, a plurality of data identifiers and a valid identifier which are the same as the number of the plurality of candidates, each data identifier being used to identify the uniqueness of ticket data, and the valid identifier being used to identify the validity of the ticket data, and the ticket data being used by the voter to vote for the candidate; A second generating module is configured to generate, for each voter, one valid ticket data and at least one invalid ticket data according to the multiple data identifiers and the valid identifiers, wherein the valid ticket data includes a data identifier and the valid identifier, and each invalid ticket data includes a data identifier, and for each voter, the same number of ticket data as the number of candidates is generated; A return module, configured to return the one valid ticket data and at least one invalid ticket data to each voter; A receiving module is configured to receive multiple voting transaction requests sent by each voter based on the one valid ticket data and at least one invalid ticket data, each voting transaction request includes one valid ticket data or one invalid ticket data, and a blockchain address of a candidate, and each voter initiates one voting transaction request for each candidate; A calculation module is configured to calculate the number of valid ticket data for each candidate's blockchain address according to the voting transaction requests of the plurality of voters as the number of votes for each candidate; A determination module, configured to determine a voting result according to the votes of the plurality of candidates; The electronic voting device is also configured to: Receiving a ticket inquiry transaction request from any voter, wherein the ticket inquiry transaction request includes a data identifier of the voter's valid ticket data; According to the data identifier of the voter's valid ticket data, query the blockchain address of the candidate corresponding to the data identifier; Send the blockchain address of the candidate corresponding to the data identifier to the voter.
10. An electronic voting device based on blockchain, comprising: Memory; as well as A processor coupled to the memory, the processor being configured to execute the blockchain-based electronic voting method as described in any one of claims 1 to 8 based on instructions stored in the memory.
11. A computer storable medium having computer program instructions stored thereon, which, when executed by a processor, implement the blockchain-based electronic voting method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Voting method and system
CN107424283A
Voting method, device and system, server, and computer readable storage medium
CN109830029A
