CN116961896A - Block chain-based voting method, apparatus, electronic device and readable medium - Google Patents

Block chain-based voting method, apparatus, electronic device and readable medium Download PDF

Info

Publication number
CN116961896A
CN116961896A CN202310785971.0A CN202310785971A CN116961896A CN 116961896 A CN116961896 A CN 116961896A CN 202310785971 A CN202310785971 A CN 202310785971A CN 116961896 A CN116961896 A CN 116961896A
Authority
CN
China
Prior art keywords
voting
blockchain
anonymous
account
private key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310785971.0A
Other languages
Chinese (zh)
Inventor
刘区城
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202310785971.0A priority Critical patent/CN116961896A/en
Publication of CN116961896A publication Critical patent/CN116961896A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0407Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the identity of one or more communicating identities is hidden
    • H04L63/0421Anonymous communication, i.e. the party's identifiers are hidden from the other party or parties, e.g. using an anonymizer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3066Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy involving algebraic varieties, e.g. elliptic or hyper-elliptic curves
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Abstract

A blockchain-based voting method, apparatus, electronic device, and readable medium. The method comprises the following steps: obtaining a voting initiation request, wherein the voting initiation request comprises public keys of a plurality of voting accounts; generating a random factor and corresponding anonymity parameters based on the voting initiation request, the elliptic encryption policies and parameters used to generate them being the same as the policies and parameters used to generate the public and private keys, and the anonymity parameters being provided to a plurality of voting accounts for voting; encrypting the public key of each voting account based on the random factor to obtain an anonymous address of each voting account; the method includes the steps of uplink in a blockchain a voting initiation request and anonymous addresses of a plurality of voting accounts to generate a voting campaign in the blockchain; when the voting in the blockchain is completed, the voting result of the voting is obtained from the blockchain, and the voting result is determined by verifying and voting the anonymous address by a plurality of voting accounts according to the private key and the anonymous parameter of the voting accounts. The method can improve the privacy and anonymity of the voting process.

Description

Block chain-based voting method, apparatus, electronic device and readable medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a voting method and apparatus based on a blockchain, an electronic device, and a readable medium.
Background
With the development of the internet, communication technology and modern cryptography technology, electronic voting is getting attention of society gradually. Blockchains are used to implement electronic voting due to their inherent non-tamper-resistance and traceability characteristics.
In the related art, the intelligent contract in the blockchain assigns a ticket to each voting account, and the voting account sends the ticket to the corresponding candidate object by initiating a transfer transaction request for the candidate object to the intelligent contract.
However, in such a manner, the transfer transaction records are recorded on the blockchain, and each party can inquire the voting result of the voting account through the transfer transaction records, so that the privacy protection and anonymity of the voting process are poor, and the fairness of the voting result is not good.
Disclosure of Invention
Based on the technical problems, the application provides a voting method, a voting device, electronic equipment and a readable medium based on a blockchain, so that the privacy and anonymity of a voting process are improved, and the fairness of a voting result is ensured.
Other features and advantages of the application will be apparent from the following detailed description, or may be learned by the practice of the application.
According to an aspect of an embodiment of the present application, there is provided a voting method based on a blockchain, including:
obtaining a voting initiation request, wherein the voting initiation request comprises public keys of a plurality of voting accounts;
generating a random factor and a corresponding anonymity parameter based on the voting initiation request, wherein an elliptic encryption policy and parameters used for generating the random factor and the anonymity parameter are the same as an elliptic encryption policy and parameters of a public key and a private key of the voting account, and the anonymity parameter is provided to the plurality of voting accounts for voting;
encrypting the public key of each voting account based on the random factor to obtain an anonymous address of each voting account;
uplinking the voting initiation request and anonymous addresses of the plurality of voting accounts in a blockchain to generate a voting campaign in the blockchain;
when the voting in the blockchain is completed, a voting result of the voting is obtained from the blockchain, wherein the voting result is determined by the plurality of voting accounts through verifying and voting the anonymous address according to the owned private key and the public anonymous parameter.
According to an aspect of an embodiment of the present application, there is provided a voting apparatus based on a blockchain, including:
the system comprises a request acquisition module, a voting initiation module and a voting management module, wherein the request acquisition module is used for acquiring a voting initiation request, and the voting initiation request comprises public keys of a plurality of voting accounts;
a generation module for generating a random factor and a corresponding anonymity parameter based on the voting initiation request, wherein an elliptic encryption policy and parameters for generating the random factor and the anonymity parameter are the same as an elliptic encryption policy and parameters of a public key and a private key of the voting account, and the anonymity parameter is provided to the plurality of voting accounts for voting;
the encryption module is used for encrypting the public key of each voting account based on the random factor to obtain the anonymous address of each voting account;
a chaining module for chaining the voting initiation request and anonymous addresses of the plurality of voting accounts in a blockchain to generate a voting campaign in the blockchain;
and the result acquisition module is used for acquiring the voting result of the voting activity from the blockchain when the voting activity in the blockchain is completed, wherein the voting result is determined by verifying and voting the anonymous address by the plurality of voting accounts according to the owned private key and the public anonymity parameter.
In some embodiments of the present application, based on the above technical solution, the generating module is further configured to: selecting a random value from a value space corresponding to a private key of the voting account as a random factor; and calculating the anonymity parameter according to the determined random factor based on a key elliptic encryption strategy of the public key and the private key of the voting account.
In some embodiments of the present application, based on the above technical solution, the uplink module is further configured to: receiving an identity confirmation request sent by the voting account through a voting intelligent contract on the blockchain, wherein the identity confirmation request is generated after the anonymous address is verified by the voting account according to the anonymous parameter and a private key of the voting account; and when the received identity confirmation request meets a voting enabling policy in the voting intelligent contract, enabling the voting activity to acquire vote information of the plurality of voting accounts.
In some embodiments of the present application, based on the above technical solution, the uplink module is further configured to: the voting transaction sent by the voting account is uplink in the blockchain through a voting intelligent contract on the blockchain, and the voting transaction is obtained by signing the voting information of the voting account through the owned private key and the public anonymity parameter; when the number of voting transactions in the blockchain meets a voting strategy in the voting intelligent contract, marking the voting campaign as voting complete.
In some embodiments of the present application, based on the above technical solution, the result obtaining module is further configured to: periodically checking a voting state corresponding to the voting activity in the blockchain; when the voting activity is detected to be marked as voting completion, acquiring a voting transaction for voting aiming at the voting activity from the blockchain; and determining the voting result of the voting event according to the obtained voting information in the voting transaction.
In some embodiments of the present application, based on the above technical solution, the uplink module is further configured to: receiving a voting transaction sent by the voting account, wherein the voting transaction is obtained by encrypting an anonymous private key of the voting account, and the anonymous private key is determined according to the private key of the voting account and the anonymous parameter; verifying the voting transaction by anonymous addresses of a plurality of voting accounts; if the validation passes, the voting transaction is uplink in the blockchain.
In some embodiments of the present application, based on the above technical solution, the encryption module is further configured to: performing point multiplication on the public key of each voting account and the random factor to obtain an anonymous public key of each voting account; and carrying out hash encryption according to the anonymous public key of each voting account to obtain the anonymous address of each voting account.
In some embodiments of the present application, based on the above technical solution, the encryption module is further configured to: acquiring anonymous management information corresponding to the voting initiation request; if the anonymous management information does not contain supervisor information, deleting the random factor from the local; and if the anonymous management information contains supervisor information, locally storing the random factor.
In some embodiments of the present application, based on the above technical solution, the result obtaining module is further configured to: receiving a random factor acquisition request sent by a voting supervisor for the voting activity;
and sending the random factor to the voting supervisor according to matching of supervisor information in the random factor acquisition request and supervisor information contained in the anonymous management information, so that the voting supervisor can decrypt anonymous addresses in the voting result according to the random factor and public keys of the plurality of voting accounts.
According to an aspect of an embodiment of the present application, there is provided a voting method based on a blockchain, including:
acquiring anonymous parameters and a plurality of anonymous addresses corresponding to voting activities in a blockchain;
encrypting according to the private key owned by the voting account and the anonymity parameter to obtain the anonymity private key of the voting account;
Performing anonymous address verification on the plurality of anonymous addresses according to an anonymous private key of the voting account;
and sending a voting transaction to the blockchain according to the verification result of the anonymous address verification so as to vote on the voting activity.
According to an aspect of an embodiment of the present application, there is provided a voting apparatus based on a blockchain, including:
the acquisition module is configured to acquire the anonymous parameters and a plurality of anonymous addresses corresponding to voting activities in the blockchain;
the encryption module is configured to encrypt according to the private key owned by the voting account and the anonymity parameter to obtain an anonymity private key of the voting account;
the verification module is configured to carry out anonymous address verification on the plurality of anonymous addresses according to an anonymous private key of the voting account;
and the sending module is configured to send a voting transaction to the blockchain according to the verification result of the anonymous address verification so as to vote on the voting activity.
In some embodiments of the present application, based on the above technical solution, the verification module is further configured to: based on a key elliptic encryption strategy between a public key and a private key of the voting account, performing dot multiplication according to the anonymous private key and a key mapping factor to obtain the anonymous public key of the voting account, wherein the key mapping factor is the same as the key mapping factor when the public key and the private key of the voting account are generated; carrying out hash encryption according to the anonymous public key of the voting account to obtain the anonymous address of the voting account; and if the anonymous addresses contain the anonymous public key of the voting account, passing the anonymous address verification.
In some embodiments of the present application, based on the above technical solution, the sending module is further configured to: if the anonymous address verification passes, an identity confirmation request is sent to the blockchain for enabling the voting activity by the blockchain; acquiring vote information for the voting event; when the voting activity in the blockchain is in an enabling state, encrypting the ballot information through the anonymous private key to obtain a voting transaction; the voting transaction is sent to the blockchain.
According to an aspect of an embodiment of the present application, there is provided an electronic apparatus including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the blockchain-based voting method as in the above technical solution via execution of the executable instructions.
According to an aspect of the embodiments of the present application, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a blockchain-based voting method as in the above technical solutions.
According to an aspect of embodiments of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the computer device to perform the blockchain-based voting method provided in the various alternative implementations described above.
In the embodiment of the application, firstly, a random factor and a corresponding anonymity parameter are generated based on the obtained voting initiation request, then, a public key of each voting account in the voting initiation request is encrypted based on the random factor, a voting activity is created in a blockchain through the voting initiation request and anonymity addresses of a plurality of voting accounts, the voting result of the voting activity is obtained from the blockchain when the voting activity is completed, and the voting account is verified and voted based on the anonymity parameter and the owned private key anonymity address. According to the scheme, the public key of the account participating in the voting is encrypted through the random factor, only the account with the private key can verify the anonymous address through the anonymous secret key, so that the account participating in the voting is anonymously protected, the account participating in the voting cannot be known through the voting record, the privacy and anonymity of the voting process are improved, and the fairness of the voting result is guaranteed.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is evident that the drawings in the following description are only some embodiments of the present application and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
Fig. 1 is a system architecture applied to a blockchain-based voting scheme in accordance with an embodiment of the present application.
Fig. 2 is a schematic diagram of a block chain network in an embodiment of the application.
Fig. 3 is a schematic diagram of a block in a block chain network according to an embodiment of the present application.
FIG. 4 is a flow chart of a blockchain-based voting method in accordance with an embodiment of the present application.
FIG. 5 is a flow chart of a blockchain-based voting method in accordance with an embodiment of the present application.
FIG. 6 is a flow chart of a blockchain-based voting method in accordance with an embodiment of the present application.
FIG. 7 is a flow chart of a blockchain-based voting method in accordance with an embodiment of the present application.
Fig. 8 is a schematic flow chart of a voting process in an embodiment of the application.
Fig. 9 schematically shows a block diagram of the components of a blockchain-based voting apparatus in an embodiment of the application.
Fig. 10 shows a schematic diagram of a computer system suitable for use in implementing an embodiment of the application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the application may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the application.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
It will be appreciated that the scheme of the present application may be applied in the context of voting decisions by blockchains, and in particular in the context of anonymous voting. Anonymous voting refers to a voting scheme in which the identity of the voter is not disclosed during the voting process. In the voting mode, the identity and the voting content of the voter are kept secret, so that the privacy of the voter is protected, and the voting result is prevented from being influenced by the outside. For example, anonymous voting may in practical cases be applied in, for example, election or decision scenarios. Voting based on blockchains may take advantage of the publicly transparent nature of blockchains, for example, as applied in stakeholder voting, comment voting, or network security decision voting, among other scenarios. In such a scenario, the voting management platform would create a voting campaign in the blockchain, with the accounts participating in the voting initiating a transaction to the intelligent contract to vote. In the scheme of the application, the account information and the voting content which participate in the voting in the blockchain are subjected to blockchain privacy protection. Blockchain privacy protection is to take measures such as encryption technology, anonymization technology, expansibility solutions, intelligent contracts and the like to protect the privacy of data and transactions on the blockchain and prevent unauthorized access or disclosure. In the present application, the voting management platform can encrypt data and transaction information so that only authorized persons can access it, and protect privacy by hiding the identity of the transaction participants, and can also help ensure the legitimacy of the transaction and protect privacy by intelligent contracts.
Based on the above, the technical scheme of the embodiment of the application provides a voting scheme based on a block chain. In particular, as shown in fig. 1, a system architecture applied to a blockchain-based voting scheme according to an embodiment of the present application may include a terminal device 110, a voting platform 120, a voting management platform 130, and a blockchain 140. Terminal device 110 may include a smart phone, tablet, notebook, smart voice interaction device, smart home appliance, vehicle terminal, aircraft, and the like. The voting platform 120, the voting management platform 130 and the blockchain 140 may be servers providing various services, which may be independent physical servers, a server cluster or a distributed system formed by a plurality of physical servers, and may be cloud servers providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (ContentD elivery Network, content distribution networks), and basic cloud computing services such as big data and artificial intelligence platforms. Various connection types of communication media for the communication links may exist between the terminal device 110, the voting platform 120, the voting management platform 130, and the blockchain 140, such as wired communication links or wireless communication links.
The system architecture in embodiments of the present application may have any number of terminal devices and servers, as desired for implementation. For example, voting platform 120 and blockchain 140 may be a server group that is made up of a plurality of server devices. In addition, the technical solution provided in the embodiment of the present application may be applied to the voting platform 120 and the blockchain 140, or may be implemented jointly by the terminal device 110, the voting platform 120, the voting management platform 130 and the blockchain 140, which is not particularly limited in the present application.
The voting initiator sends a voting initiation request to the voting platform 120 through the terminal device 110, where the voting initiation request includes public keys of a plurality of voting accounts. After obtaining the voting initiation request from the voting platform 120, the voting management platform 130 generates a random factor and a corresponding anonymity parameter based on the voting initiation request, wherein an elliptic encryption policy between the random factor and the anonymity parameter is the same as an elliptic encryption policy between a public key and a private key of the voting account, and the anonymity parameter is provided to the plurality of voting accounts by the voting platform 120 to vote. The voting management platform 130 then encrypts the public key of each voting account based on a random factor to obtain an anonymous address for each voting account, and links the voting initiation request and the anonymous addresses for the plurality of voting accounts in the blockchain 140. The intelligent contracts in the blockchain 140 generate voting campaigns based on the uplink voting initiation requests and the anonymous addresses. The voter verifies the anonymous address on the web page through the voting platform 120 by the terminal device 110 according to the owned private key and public anonymity parameters and votes, and the voting result is recorded in the blockchain 140. When the number of votes satisfies the policy of voting completion, the voting is completed.
Blockchains are novel application modes of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and the like. Blockchains are essentially a de-centralized database, which is a series of data blocks (i.e., blocks) that are generated in association using cryptographic methods, each of which contains information from a batch of network transactions for verifying the validity (anti-counterfeiting) of the information and generating the next block. Blockchains are commonly maintained by nodes in a blockchain network. For example, in the blockchain network shown in fig. 2, a plurality of nodes 201 may be included, and the plurality of nodes 201 may be individual clients forming the blockchain network. Each node 201 may receive input information while operating normally and maintain shared data within the blockchain network based on the received input information. In order to ensure information intercommunication in the blockchain network, information connection can exist between every two nodes in the blockchain network, and information transmission can be carried out between the nodes through the information connection. For example, when any node in the blockchain network receives input information, other nodes in the blockchain network acquire the input information according to a consensus algorithm, and store the input information as shared data, so that the data stored on all nodes in the blockchain network are consistent.
For each node in the blockchain network, there is a node identification corresponding thereto, and each node in the blockchain network may store the node identifications of other nodes for subsequent broadcasting of the generated blocks to other nodes in the blockchain network based on the node identifications of the other nodes. Each node can maintain a node identification list, and the node names and the node identifications are correspondingly stored in the node identification list. The node identifier may be an IP (Internet Protocol, protocol interconnecting between networks) address, or any other information that can be used to identify the node.
Each node in the blockchain network stores one and the same blockchain. The blockchain is composed of a plurality of blocks, as shown in fig. 3, and the starting block comprises a block head and a block main body, wherein the block head stores an input information characteristic value, a version number, a timestamp, a difficulty value and the like, and the block main body stores input information; the next block of the starting block takes the starting block as a father block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value, the version number, the timestamp, the difficulty value and the like of the father block, and the like, so that the block data stored in each block in the block chain are associated with the block data stored in the father block, and the safety of the input information in the block is ensured.
The voting initiation requests and anonymous addresses of the plurality of voting accounts sent by the voting management platform 130 to the blockchain 140, and the ballot information sent by the voting platform 120 to the blockchain 140, may be located in the blockmaster as shown in fig. 3.
The implementation details of the technical scheme of the embodiment of the application are described in detail below:
fig. 4 shows a flow diagram of a blockchain-based voting method that may be performed by a device with computing processing capabilities, such as a server, in accordance with an embodiment of the present application. Referring to fig. 4, the blockchain-based voting includes at least steps S410 to S450, which are described in detail as follows:
step S410, a voting initiation request is acquired, where the voting initiation request includes public keys of a plurality of voting accounts.
The sponsor of the vote may request to initiate the voting campaign through a web page of the voting platform or the like. Relevant information of the voting activities, such as voting options, voting strategies, voting participants and the like, is input into the voting platform on a webpage of the voting platform. The voting platform can send a voting initiating request to the voting management platform according to the information of the voting event entered by the initiator. The voting initiation request obtains a voting initiation request from the voting platform, wherein the voting initiation request comprises public keys of a plurality of voting accounts. The voting account is determined according to the voting party information input by the voting initiator, for example, the corresponding voting account is searched according to the input user identification, the public key of the voting account is the public information of the voting account, and the public key can be inquired from the blockchain or directly read from the account information of the voting account after the voting account is determined.
Step S420, generating a random factor and a corresponding anonymity parameter based on the voting initiation request, wherein an elliptic encryption policy and parameters used for generating the random factor and the anonymity parameter are the same as an elliptic encryption policy and parameters of a public key and a private key of the voting account, and the anonymity parameter is provided to the plurality of voting accounts for voting.
After receiving the voting initiation request, the voting management platform generates a random factor and a corresponding anonymity parameter based on the voting initiation request. The random factor is used for anonymizing the identity or address of the voting account, and the anonymizing parameter is used for anonymizing the voting content or voting options initiated by the voting account. The elliptic encryption policy between the random factor and the anonymity parameter is the same as the elliptic encryption policy between the public and private keys of the voting account. In particular, the public and private keys of the voting account may be generated in accordance with an asymmetric encryption. Taking an elliptic encryption algorithm as an example, a proper elliptic curve and a base point on the elliptic curve are selected, and a random number is used as a private key of the voting account. The public key, a point on the elliptic curve, is calculated from the private key. Assuming that the private key of the voting account is sk, the public key is pk, the base point is G, and the elliptic encryption strategy between the public key and the private key of the voting account is:
pk=Sk·G
Similarly, the elliptic encryption policy between the random factor R and the anonymity parameter R is:
R=r·G
both elliptic encryption strategies use the same elliptic curve for encryption and the same base point G for mapping, so that the elliptic encryption strategies are the same but have different values.
The anonymity parameters may be provided by the voting management platform to a plurality of voting accounts for voting. Specifically, the voting management platform sends the anonymous parameters to the voting platform, and the voting platform can utilize the anonymous parameters to verify the anonymous address and perform anonymous voting when the voting account performs voting.
Step S430, encrypting the public key of each voting account based on the random factor to obtain the anonymous address of each voting account.
Specifically, the voting management platform encrypts the public key of each voting account with a random factor, resulting in an anonymous address for each voting account, i.e., the anonymous address is in fact the encrypted public key of the anonymous account. For example, the random factor may be encrypted by dot multiplication or dot division with the public key of the voting account. However, since the random factor is not disclosed, it is not provided to the participants of the vote, the voting initiator, or other third parties without corresponding authorization. Therefore, no party that cannot learn the random factor is able to learn the correspondence between the public key of the voting account and the anonymous address, thereby hiding the identity of the voting account that participates in the voting. In the application, the encryption process by using the random factor does not destroy the elliptic encryption strategy between the public key and the private key of the voting account, namely, after the public key and the public key are encrypted by using the random factor and the anonymous parameter respectively, the obtained encryption result can be verified by the original verification mode between the public key and the private key, for example, under normal conditions, the result calculated by using the encrypted private key through an elliptic encryption curve is matched with the encrypted public key. It will be appreciated that elliptic curve encryption is only an example, and may be replaced by other types of encryption, for example, other types of encryption, and the encryption of the random factor and the public key of the voting account may be replaced by other types, so long as it is ensured that the public key and the private key can still verify between the public key and the private key after anonymization.
Step S440, the voting initiation request and the anonymous addresses of the plurality of voting accounts are uplink in a blockchain to generate a voting campaign in the blockchain.
The voting management platform packages the original voting initiation request together with the anonymous addresses generated for each voting account into a blockchain transaction and sends it to the blockchain. The blockchain packages transactions into blocks and uplinks. The intelligent contracts in the blockchain execute the flow of creating the votes according to the voting initiation request and the anonymous addresses in the uplink block, and save the information of the voting campaign into the blockchain ledger, thereby creating the voting campaign in the blockchain.
And step S450, when the voting in the blockchain is completed, acquiring the voting result of the voting from the blockchain, wherein the voting result is determined by verifying and voting the anonymous address by the plurality of voting accounts according to the owned private key and the public anonymity parameter.
Participants in the vote log into the voting account at the client and verify the anonymous address and vote on the voting campaign through the voting platform. Because the voting campaign is created using anonymous addresses, other users cannot learn which specific accounts are required to participate in the voting campaign, except the voting participants themselves who have the voting account private key. The participant then verifies the anonymous address in the voting campaign by verifying the owned private key and the public anonymity parameter to determine if itself is a participant in the voting campaign. After itself determines the participants, the voting campaign is voted. When the votes in the blockchain meet the voting strategy, the intelligent contract of the blockchain judges that the voting is completed. In some embodiments, the intelligent appointments count the voting results based on ballot information in the blockchain and are recorded in the blockchain. The voting management platform may then obtain the voting results of the voting campaign from the blockchain.
In the embodiment of the application, firstly, a random factor and a corresponding anonymity parameter are generated based on the obtained voting initiation request, then, a public key of each voting account in the voting initiation request is encrypted based on the random factor, a voting activity is created in a blockchain through the voting initiation request and anonymity addresses of a plurality of voting accounts, the voting result of the voting activity is obtained from the blockchain when the voting activity is completed, and the voting account is verified and voted based on the anonymity parameter and the owned private key anonymity address. According to the scheme, the public key of the account participating in the voting is encrypted through the random factor, only the account with the private key can verify the anonymous address through the anonymous secret key, so that the account participating in the voting is anonymously protected, the account participating in the voting cannot be known through the voting record, the privacy and anonymity of the voting process are improved, and the fairness of the voting result is guaranteed.
In the embodiment of the application, in the process of generating the random factor and the corresponding anonymity parameter based on the voting initiation request, the voting management platform selects the random value from the value space corresponding to the private key of the voting account as the random factor. For example, taking an elliptic curve as an example for the public key and the private key, the private key is a point on the elliptic curve, so that the value range of the private key is the value range of the private key on the elliptic curve. In general, in order to facilitate the value taking, the value taking range of the private key is mapped from a continuous interval on the elliptic curve to a discrete interval composed of a plurality of points, and then the value taking mode of the random factor is that the random value of one point is randomly selected from the discrete interval range of the private key as the random factor. After randomly selecting the random factor, the voting management platform calculates an anonymity parameter according to the determined random factor based on a key elliptic encryption strategy of a public key and a private key of the voting account. Taking an elliptic curve as an example, after the voting management platform randomly selects a random factor R, the anonymity parameter R corresponding to the private key can be determined based on the elliptic curve in the following manner:
R=r·G
Where G is the base point in the elliptic curve. The base point is the same as the base point with which the public and private keys of the voting account were generated. And calculating the anonymity parameter according to the determined random factor based on the key elliptic encryption strategy of the public key and the private key of the voting account, so that the public key and the private key encrypted by the random factor and the anonymity parameter can be ensured to be verified by the original key elliptic encryption strategy, and the verification execution efficiency is facilitated.
In some alternative embodiments, in encrypting the public key of each voting account based on the random factor to obtain the anonymous address of each voting account, the voting management platform performs dot multiplication on the public key of each voting account and the random factor to obtain the anonymous public key of each voting account. For example, the public key pk is encrypted based on anonymity r, and the encryption process is as follows:
pk′=pk·r
wherein pk' is the encrypted anonymous public key. And then, carrying out hash encryption by the voting management platform according to the anonymous public key of each voting account to obtain the anonymous address of each voting account. Specifically, the hash encryption process is as follows:
A=Hash(pk′)
wherein A is an anonymous address. The public key of the voting account is anonymized and then encrypted through dot multiplication and hash encryption, so that the encryption degree of an anonymous address is improved, the encryption failure probability is reduced, and the information security is improved.
In the embodiment of the present application, other embodiments for refining the technical solution of the embodiment shown in fig. 4 are also provided, and specifically as shown in fig. 5, in the blockchain-based voting method of an embodiment of the present application, the method may include the following steps:
step S510, obtaining a voting initiation request, where the voting initiation request includes public keys of a plurality of voting accounts.
Optionally, the implementation details of step S510 are identical to those of step S410 shown in fig. 4, and will not be described again.
Step S520, generating a random factor and a corresponding anonymity parameter based on the voting initiation request, wherein an elliptic encryption policy and parameters used for generating the random factor and the anonymity parameter are the same as those of a public key and a private key of the voting account, and the anonymity parameter is provided to the plurality of voting accounts for voting.
Optionally, the implementation details of step S520 are identical to those of step S420 shown in fig. 4, and will not be described again.
Step S530, encrypting the public key of each voting account based on the random factor to obtain the anonymous address of each voting account.
Optionally, the implementation details of step S530 are identical to those of step S430 shown in fig. 4, and will not be described again.
Step S540, the voting initiation request and the anonymous addresses of the plurality of voting accounts are uplink in a blockchain to generate a voting campaign in the blockchain.
Optionally, the implementation details of step S540 are identical to those of step S440 shown in fig. 4, and will not be described again.
Step S550, receiving an identity confirmation request sent by the voting account through a voting intelligent contract on the blockchain, wherein the identity confirmation request is generated after the voting account verifies the anonymous address according to the anonymous parameter and a private key of the voting account;
step S560, when the received identity confirmation request satisfies the voting enabling policy in the voting intelligent contract, enabling the voting campaign to acquire the vote information of the plurality of voting accounts.
In an alternative embodiment of the application, the voting campaign on the blockchain is in a non-enabled state upon creation, requiring verification and validation of the voting account participating in the vote. Specifically, the voting account verifies the anonymous address according to the anonymous parameter and the private key of the voting account, and if the anonymous address passes the verification, the voting account is the account to participate in voting, so that an identity confirmation request is generated and sent to the blockchain. The voting management platform receives an identity confirmation request sent by the voting account through a voting intelligent contract on the blockchain. When the received identity confirmation request meets a voting enabling policy in the voting intelligent contract, enabling a voting activity to acquire vote information of a plurality of voting accounts. For example, after receiving an identity confirmation request of all or a certain number of voting accounts participating in the voting, a voting campaign is enabled to receive the ballot information sent by the voting accounts. It will be appreciated that in the case of an identity confirmation request being uplink, the transmitted identity confirmation request is generated by anonymously encrypting the anonymously parameter and the private key, thereby preventing the identity confirmation request from exposing the identity of the voting account. Through the identity confirmation process, the voting activity can be ensured to have enough participants to achieve the result conforming to the voting strategy, so that the success rate of the voting activity is improved.
Step S570, when the voting in the blockchain is completed, obtaining the voting result of the voting from the blockchain, wherein the voting result is determined by the plurality of voting accounts by verifying and voting the anonymous address according to the owned private key and the public anonymity parameter.
Optionally, the implementation details of step S570 are identical to those of step S470 shown in fig. 4, and will not be described again.
In the embodiment of the application, firstly, a random factor and a corresponding anonymity parameter are generated based on the obtained voting initiation request, then, a public key of each voting account in the voting initiation request is encrypted based on the random factor, a voting activity is created in a blockchain through the voting initiation request and anonymity addresses of a plurality of voting accounts, the voting result of the voting activity is obtained from the blockchain when the voting activity is completed, and the voting account is verified and voted based on the anonymity parameter and the owned private key anonymity address. According to the scheme, the public key of the account participating in the voting is encrypted through the random factor, only the account with the private key can verify the anonymous address through the anonymous secret key, so that the account participating in the voting is anonymously protected, the account participating in the voting cannot be known through the voting record, the privacy and anonymity of the voting process are improved, and the fairness of the voting result is guaranteed.
In some alternative embodiments, in encrypting the public key of each voting account based on the random factor to obtain the anonymous address of each voting account, the voting management platform performs dot multiplication on the public key of each voting account and the random factor to obtain the anonymous public key of each voting account. For example, the public key pk is encrypted based on anonymity r, and the encryption process is as follows:
pk′=pk·r
wherein pk' is the encrypted anonymous public key. And then, carrying out hash encryption by the voting management platform according to the anonymous public key of each voting account to obtain the anonymous address of each voting account. Specifically, the hash encryption process is as follows:
A=Hash(pk′)
wherein A is an anonymous address. The public key of the voting account is anonymized and then encrypted through dot multiplication and hash encryption, so that the encryption degree of an anonymous address is improved, the encryption failure probability is reduced, and the information security is improved.
In some alternative embodiments, after the voting campaign is enabled, the voting management platform will uplink the voting transaction sent by the voting account in the blockchain via a voting intelligent contract on the blockchain. The voting transaction is obtained by signing the ballot information of the voting account by the voting account through the owned private key and the public anonymity parameter. The voting information includes information that the voting account selects according to voting options provided by the voting event. The voting intelligent contracts check the number of voting transactions in the blockchain at the time of the uplink voting transaction, and mark the voting event as voting completion when the number of voting transactions in the blockchain satisfies the voting strategy in the voting intelligent contracts. For example, upon receipt of ballot information for all voting accounts, or statistics of a sufficient number of ballot agreements or objections or statistics of a condition that a ballot passes or a ballot overrule exists, the voting event is completed. The state of the voting activity is directly managed according to the voting transaction through the intelligent contract, so that the information disclosure degree in the voting process is confirmed, and the traceability of the voting process is improved.
In some alternative embodiments, when a voting campaign in the blockchain is completed, the voting management platform periodically checks the voting states corresponding to the voting campaign in the blockchain in the process of obtaining the voting results of the voting campaign from the blockchain. When the voting activity is checked to be marked as voting completion, the voting management platform acquires a voting transaction for voting for the voting activity from the blockchain, and determines a voting result of the voting activity according to the acquired voting information in the voting transaction. The voting results of the voting activities are counted through the ballot information of the upper links in the blockchain, the voting management platform can display the voting results to the voting initiator and the participants participating in the voting, the voting management platform determines the voting results, and compared with the case that each participant inquires the results from the blockchain, the participants can acquire the voting results from the voting management platform without searching the blockchain, the access times of the blockchain required by acquiring the voting results can be reduced, and the execution efficiency of acquiring the voting results is improved.
In some alternative embodiments, in the process of linking up the voting transaction sent by the voting account in the blockchain through the voting intelligence contract on the blockchain, the voting management platform receives the voting transaction sent by the voting account, the voting transaction being encrypted by the anonymous private key of the voting account, and the anonymous private key being determined from the private key and the anonymity parameter of the voting account. The voting management platform then validates the voting transaction by anonymous addresses of the plurality of voting accounts. Specifically, the anonymous address may be an anonymous public key determined according to the random factor and the public key, and the voting management platform may not store the random factor, but store the anonymous public key after anonymization, and verify the voting transaction signed based on the anonymous private key through the anonymous public key. In some embodiments. The anonymous address is encrypted based on the anonymous public key, and the voting management platform can acquire the corresponding anonymous public key according to the anonymous address to perform signature verification. Thereby determining that the voting transaction did come from the voting account specified in the voting initiation request. If the validation passes, the voting transaction is uplink in the blockchain. Otherwise, the voting transaction is ignored. The voting transaction is verified through the anonymous address, so that the fact that the voting transaction comes from a correct voting account can be confirmed under the anonymous condition, errors of voting data are avoided, and accuracy of voting results is improved.
In the embodiment of the present application, other embodiments for refining the technical solution of the embodiment shown in fig. 4 are also provided, and specifically as shown in fig. 6, in the blockchain-based voting method of an embodiment of the present application, the method may include the following steps:
in step S610, a voting initiation request is acquired, where the voting initiation request includes public keys of a plurality of voting accounts.
Optionally, the implementation details of step S610 are identical to those of step S410 shown in fig. 4, and will not be described again.
Step S620, generating a random factor and a corresponding anonymity parameter based on the voting initiation request, wherein an elliptic encryption policy and parameters used for generating the random factor and the anonymity parameter are the same as those of a public key and a private key of the voting account, and the anonymity parameter is provided to the plurality of voting accounts to vote.
Optionally, the implementation details of step S620 are identical to those of step S420 shown in fig. 4, and will not be described again.
Step S630, encrypting the public key of each voting account based on the random factor to obtain the anonymous address of each voting account.
Optionally, the implementation details of step S630 are identical to those of step S430 shown in fig. 4, and will not be described again.
Step S640, uplinks the anonymous addresses of the voting initiation request and the plurality of voting accounts in a blockchain to generate a voting campaign in the blockchain.
Optionally, the implementation details of step S640 are identical to those of step S440 shown in fig. 4, and will not be described again.
Step S650, obtaining anonymous management information corresponding to the voting initiation request.
In this embodiment, the supervisor can supervise the voting process, so the voting management platform performs an incomplete anonymization process when confirming that the voting initiation request has a corresponding supervisor. After the public key of each voting account is encrypted based on the random factor to obtain the anonymous address of each voting account, the voting management platform further obtains the anonymous management information corresponding to the voting initiation request. The anonymity management information may be included in the voting-originated request and designated by the voting-originated party at the time of the voting-originated, or may be pre-stored in the voting management platform, which selects the corresponding anonymity management information based on the information in the voting-originated request. Anonymity policy to be adopted for the current voting campaign is specified in anonymity management information. If the anonymity management information does not contain supervisor information, the anonymity policy indicating the current voting activity is a complete anonymity policy, and step S660 is executed, otherwise if the anonymity management information contains supervisor information, the anonymity policy indicating the current voting activity is a supervised anonymity policy, and step S670 is executed.
Step S660, deleting the random factor from the local.
The voting management platform will delete the random factor from the local. After deleting the random factor, only possession of the voting account private key can confirm whether the voting account is involved in the voting campaign.
Step S670, saving the random factor locally.
The voting management platform will store the random factor locally and provide the random factor to the supervisor for the supervisor to check the accounts involved in the voting and the voting process when required by the supervisor. By providing a random factor to optionally reveal specific voting participants and voting information to the supervisor, it can be ensured that the voting participant information is only provided to authorized supervisors, which is beneficial to improving the voting management strength in the case of anonymous voting.
In some alternative embodiments, the voting management platform, upon receiving a request from a voting supervisor, performs the following steps:
step S680, a random factor acquisition request sent by the voting supervisor for the voting campaign is received.
Step 691, sending the random factor to the voting supervisor according to matching of supervisor information in the random factor acquisition request and supervisor information contained in the anonymity management information, so that the voting supervisor can decrypt the anonymity address in the voting result according to the random factor and public keys of the plurality of voting accounts.
In particular, the voting supervisor needs to decrypt the anonymous address and the encrypted voting transaction when supervising the voting process, thus requesting the voting management platform to obtain anonymity and hence. After receiving a random factor acquisition request sent by a voting supervisor for a voting campaign, the voting management platform determines that a requester requesting the random factor is indeed the supervisor of the voting campaign according to the supervisor information in the random factor acquisition request and the supervisor information contained in the anonymity management information, and then sends the random factor to the voting supervisor so that the voting supervisor can decrypt the anonymity addresses in the voting result according to the random factor and public keys of a plurality of voting accounts. The random factors are reserved and provided for a supervisor to calculate the anonymous address, so that the supervision capability of the voting process is improved, and the traceability of the scheme is ensured.
Step S692, when the voting in the blockchain is completed, obtaining the voting result of the voting from the blockchain, wherein the voting result is determined by the plurality of voting accounts by verifying and voting the anonymous address according to the owned private key and the public anonymity parameter.
Optionally, the implementation details of step S692 are identical to those of step S450 shown in fig. 4, and will not be described again.
In the embodiment of the application, firstly, a random factor and a corresponding anonymity parameter are generated based on the obtained voting initiation request, then, a public key of each voting account in the voting initiation request is encrypted based on the random factor, a voting activity is created in a blockchain through the voting initiation request and anonymity addresses of a plurality of voting accounts, the voting result of the voting activity is obtained from the blockchain when the voting activity is completed, and the voting account is verified and voted based on the anonymity parameter and the owned private key anonymity address. According to the scheme, the public key of the account participating in the voting is encrypted through the random factor, only the account with the private key can verify the anonymous address through the anonymous secret key, so that the account participating in the voting is anonymously protected, the account participating in the voting cannot be known through the voting record, the privacy and anonymity of the voting process are improved, and the fairness of the voting result is guaranteed.
In some alternative embodiments, in encrypting the public key of each voting account based on the random factor to obtain the anonymous address of each voting account, the voting management platform performs dot multiplication on the public key of each voting account and the random factor to obtain the anonymous public key of each voting account. For example, the public key pk is encrypted based on anonymity r, and the encryption process is as follows:
pk′=pk·r
Wherein pk' is the encrypted anonymous public key. And then, carrying out hash encryption by the voting management platform according to the anonymous public key of each voting account to obtain the anonymous address of each voting account. Specifically, the hash encryption process is as follows:
A=Hash(pk′)
wherein A is an anonymous address. The public key of the voting account is anonymized and then encrypted through dot multiplication and hash encryption, so that the encryption degree of an anonymous address is improved, the encryption failure probability is reduced, and the information security is improved.
Optionally, the implementation details of step S920 are identical to those of step S450 shown in fig. 4, and will not be described again.
Fig. 7 shows a flow chart of a blockchain-based voting method that may be performed by a device with computational processing functionality, such as a terminal device for voting, in accordance with an embodiment of the present application. Referring to fig. 7, the blockchain-based voting includes at least steps S710 to S740, which are described in detail as follows:
step S710, obtaining anonymity parameters and a plurality of anonymity addresses corresponding to voting activities in the blockchain.
The client may obtain anonymous parameters published by the voting management platform from the voting platform and obtain a plurality of anonymous addresses corresponding to the voting campaign from the blockchain.
And step S720, encrypting according to the private key owned by the voting account and the anonymity parameter to obtain the anonymity private key of the voting account.
The client encrypts according to the private key owned by the voting account and the anonymity parameter, and the encryption mode can adopt a dot multiplication mode as follows:
sk′=sk·R
wherein R is an anonymous parameter, sk is a private key of the voting account, sk is an anonymous private key of the voting account.
And step S730, performing anonymous address verification on the plurality of anonymous addresses according to the anonymous private key of the voting account.
Based on the calculated anonymous private key, the public key of the voting account can be encrypted to obtain an anonymous address for anonymous address verification. Specifically, the client can calculate the anonymous public key through the anonymous private key, and confirm whether the anonymous addresses generated based on the anonymous public key are included in the plurality of anonymous addresses based on the anonymous public key, thereby confirming whether the voting account is an account participating in voting.
Step S740, according to the verification result of the anonymous address verification, sending a voting transaction to the blockchain to vote on the voting event.
After confirming the verification result of the anonymous address verification, the client generates a voting transaction according to the received ballot information for the voting event, and the blockchain transmits the voting transaction to vote for the voting event.
In the embodiment of the application, firstly, a plurality of anonymous addresses corresponding to a voting activity in an anonymous parameter and a blockchain are obtained, then encryption is carried out according to a private key owned by a voting account and the anonymous parameter to obtain an anonymous private key of the voting account, then anonymous address verification is carried out on the plurality of anonymous addresses according to the anonymous private key of the voting account, and finally, according to a verification result of the anonymous address verification, a voting transaction is sent to the blockchain to vote the voting activity. The verification of the anonymous address is carried out through the private key and the anonymous parameter, and only the account with the private key can carry out verification and voting, so that the fact that other parties except the voting party cannot learn an elliptic encryption strategy between the new secret key and the old secret key is ensured, the identity of the voting party is hidden, and the anonymity of the voting process is improved.
In some optional embodiments, in the process of performing anonymous address verification on a plurality of anonymous addresses according to an anonymous private key of a voting account, the client performs dot product according to the anonymous private key and a key mapping factor based on a key elliptic encryption policy between a public key and a private key of the voting account, so as to obtain the anonymous public key of the voting account, wherein the key mapping factor is the same as a key mapping factor when generating the public key and the private key of the voting account. The specific mode is as follows:
pk′=sk′·G
The sk is an anonymous private key, the pk is an anonymous public key, and the G is a base point. Where the base point G is the same as the base point G used to generate the private and public keys of the voting account. And then carrying out hash encryption according to the anonymous public key of the voting account to obtain the anonymous address of the voting account.
The specific mode is as follows:
A=Hash(pk′)
where A is an anonymous address and pk' is an anonymous public key. If the plurality of anonymous addresses contains an anonymous public key of the voting account, the anonymous address is verified.
In some alternative embodiments, the client sends an identity confirmation request to the blockchain for the blockchain to enable voting activity if the anonymous address verification passes during the sending of the voting transaction to the blockchain based on the verification result of the anonymous address verification. The client then obtains ballot information for the voting event based on the user's selection. When the voting activity in the blockchain is in an enabling state, the voting information is encrypted through an anonymous private key to obtain a voting transaction, and finally the voting transaction is sent to the blockchain.
The flow of the solution of the present application in a specific embodiment is described below with reference to the accompanying drawings. Referring to fig. 8, fig. 8 is a schematic flow chart of a voting process in an embodiment of the present application. As shown in fig. 8, the scenario includes a voting web page, a voting management platform, and a voting platform contract. Wherein, voting platform: the voting platform provides a user interface for voting, provides a voting template and a voting strategy, initiates voting, performs voting, displays a voting result and the like. The voting management platform is responsible for hiding voters and optionally providing vote disclosure functions, and the voting platform contracts are responsible for information handling operations in the blockchain. In the voting initiating flow, a voting initiator logs in a voting webpage and fills in voting options, voting strategies and a public key list of a voting participant. The voting sponsor submits filling information, and the voting web page background forwards the public key list in the request to the voting management platform. The voting management platform performs identity hiding on the received public key list, so that a new address A list of the voter is obtained. The voting management platform returns the new address A list of the voter and the anonymity parameter R to the voting web page. The voting web page packages the original voting request and the new address A list into a blockchain transaction, and sends the blockchain transaction to a blockchain network. The blockchain packages the transaction into blocks, triggers the smart contract to perform the method of creating the new vote and saves the voting information into the blockchain's book. The voting party calculates the address corresponding to the new private key according to the anonymity parameter R and the private key thereof through the function provided by the webpage. Since the old key of the user must be used to calculate the new key, the security of the user identity can be ensured. If the address corresponding to the new private key is equal to one of the voting addresses on the chain, the new private key is considered as one of voting participants, and an identity confirmation request is initiated to the chain through a webpage. After the voting contract receives the voting identity confirmation requests of all users, the voting state is changed into enabled. So far, the voting can be normally performed. The user votes through the web page, signs the vote by using the new private key, and sends the vote to the blockchain. When the number of votes of the voting choice satisfies the voting strategy, the voting can be completed. The web page can acquire the voting state on the chain at regular time, and when the voting is completed, the voting result is presented on the web page.
It should be noted that although the steps of the methods of the present application are depicted in the accompanying drawings in a particular order, this does not require or imply that the steps must be performed in that particular order, or that all illustrated steps be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
The apparatus implementations of the present application are described below as being used to perform the blockchain-based voting method of the above-described embodiments of the present application. Fig. 9 schematically shows a block diagram of the block chain based voting apparatus in an embodiment of the present application. As shown in fig. 9, the blockchain-based voting apparatus 900 may mainly include:
a request acquisition module 910, configured to acquire a voting initiation request, where the voting initiation request includes public keys of a plurality of voting accounts;
a generating module 920, configured to generate a random factor and a corresponding anonymity parameter based on the voting initiation request, where an elliptic encryption policy and a parameter used to generate the random factor and the anonymity parameter are the same as an elliptic encryption policy and a parameter of a public key and a private key of the voting account, and the anonymity parameter is provided to the plurality of voting accounts to vote;
An encryption module 930, configured to encrypt the public key of each voting account based on the random factor, to obtain an anonymous address of each voting account;
a chaining module 940 for chaining the voting initiation request and anonymous addresses of the plurality of voting accounts in a blockchain to generate a voting campaign in the blockchain;
a result obtaining module 950, configured to obtain, when a voting campaign in the blockchain is completed, a voting result of the voting campaign from the blockchain, where the voting result is determined by the plurality of voting accounts by verifying and voting the anonymous address according to the owned private key and the public anonymity parameter.
In some embodiments of the present application, based on the above technical solutions, the generating module 920 is further configured to: selecting a random value from a value space corresponding to a private key of the voting account as a random factor; and calculating the anonymity parameter according to the determined random factor based on a key elliptic encryption strategy of the public key and the private key of the voting account.
In some embodiments of the present application, based on the above technical solutions, the uplink module 94 is further configured to: receiving an identity confirmation request sent by the voting account through a voting intelligent contract on the blockchain, wherein the identity confirmation request is generated after the anonymous address is verified by the voting account according to the anonymous parameter and a private key of the voting account; and when the received identity confirmation request meets a voting enabling policy in the voting intelligent contract, enabling the voting activity to acquire vote information of the plurality of voting accounts.
In some embodiments of the present application, based on the above technical solution, the uplink module 940 is further configured to: the voting transaction sent by the voting account is uplink in the blockchain through a voting intelligent contract on the blockchain, and the voting transaction is obtained by signing the voting information of the voting account through the owned private key and the public anonymity parameter; when the number of voting transactions in the blockchain meets a voting strategy in the voting intelligent contract, marking the voting campaign as voting complete.
In some embodiments of the present application, based on the above technical solutions, the result obtaining module 950 is further configured to: periodically checking a voting state corresponding to the voting activity in the blockchain; when the voting activity is detected to be marked as voting completion, acquiring a voting transaction for voting aiming at the voting activity from the blockchain; and determining the voting result of the voting event according to the obtained voting information in the voting transaction.
In some embodiments of the present application, based on the above technical solution, the uplink module 940 is further configured to: receiving a voting transaction sent by the voting account, wherein the voting transaction is obtained by encrypting an anonymous private key of the voting account, and the anonymous private key is determined according to the private key of the voting account and the anonymous parameter; verifying the voting transaction by anonymous addresses of a plurality of voting accounts; if the validation passes, the voting transaction is uplink in the blockchain.
In some embodiments of the present application, based on the above technical solution, the encryption module 930 is further configured to: performing point multiplication on the public key of each voting account and the random factor to obtain an anonymous public key of each voting account; and carrying out hash encryption according to the anonymous public key of each voting account to obtain the anonymous address of each voting account.
In some embodiments of the present application, based on the above technical solution, the encryption module 930 is further configured to: acquiring anonymous management information corresponding to the voting initiation request; if the anonymous management information does not contain supervisor information, deleting the random factor from the local; and if the anonymous management information contains supervisor information, locally storing the random factor.
In some embodiments of the present application, based on the above technical solutions, the result obtaining module 950 is further configured to: receiving a random factor acquisition request sent by a voting supervisor for the voting activity; and sending the random factor to the voting supervisor according to matching of supervisor information in the random factor acquisition request and supervisor information contained in the anonymous management information, so that the voting supervisor can decrypt anonymous addresses in the voting result according to the random factor and public keys of the plurality of voting accounts.
According to an aspect of an embodiment of the present application, there is provided a voting apparatus based on a blockchain, including:
the acquisition module is configured to acquire the anonymous parameters and a plurality of anonymous addresses corresponding to voting activities in the blockchain;
the encryption module is configured to encrypt according to the private key owned by the voting account and the anonymity parameter to obtain an anonymity private key of the voting account;
the verification module is configured to carry out anonymous address verification on the plurality of anonymous addresses according to an anonymous private key of the voting account;
and the sending module is configured to send a voting transaction to the blockchain according to the verification result of the anonymous address verification so as to vote on the voting activity.
In some embodiments of the present application, based on the above technical solution, the verification module is further configured to: based on a key elliptic encryption strategy between a public key and a private key of the voting account, performing dot multiplication according to the anonymous private key and a key mapping factor to obtain the anonymous public key of the voting account, wherein the key mapping factor is the same as the key mapping factor when the public key and the private key of the voting account are generated; carrying out hash encryption according to the anonymous public key of the voting account to obtain the anonymous address of the voting account; and if the anonymous addresses contain the anonymous public key of the voting account, passing the anonymous address verification.
In some embodiments of the present application, based on the above technical solution, the sending module is further configured to: if the anonymous address verification passes, an identity confirmation request is sent to the blockchain for enabling the voting activity by the blockchain; acquiring vote information for the voting event; when the voting activity in the blockchain is in an enabling state, encrypting the ballot information through the anonymous private key to obtain a voting transaction; the voting transaction is sent to the blockchain.
It should be noted that, the apparatus provided in the foregoing embodiments and the method provided in the foregoing embodiments belong to the same concept, and a specific manner in which each module performs an operation has been described in detail in the method embodiment, which is not described herein again.
Fig. 10 shows a schematic diagram of a computer system suitable for use in implementing an embodiment of the application.
It should be noted that, the computer system 1000 of the electronic device shown in fig. 10 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present application.
As shown in fig. 10, the computer system 1000 includes a central processing unit (central lProcessingUnit, CPU) 1001 which can perform various appropriate actions and processes according to a program stored in a Read-Only Memory (ROM) 1002 or a program loaded from a storage portion 1008 into a Random access Memory (Random AccessMemory, RAM) 1003. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, ROM 1002, and RAM 1003 are connected to each other by a bus 1004. An Input/Output (I/O) interface 1005 is also connected to bus 1004.
The following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, and the like; an output portion 1007 including a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crysta lDisplay, LCD), and a speaker; a storage portion 1008 including a hard disk or the like; and a communication section 1009 including a network interface card such as a LAN (Loca lArea Network ) card, a modem, or the like. The communication section 1009 performs communication processing via a network such as the internet. The drive 1010 is also connected to the I/O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is installed on the drive 1010 as needed, so that a computer program read out therefrom is installed into the storage section 1008 as needed.
In particular, the processes described in the various method flowcharts may be implemented as computer software programs according to embodiments of the application. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 1009, and/or installed from the removable medium 1011. When executed by a Central Processing Unit (CPU) 1001, the computer program performs various functions defined in the system of the present application.
It should be noted that, the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-only memory (ROM), an erasable programmable Read-only memory (Erasable Programmable Read Only Memory, EPROM), a flash memory, an optical fiber, a portable compact disc Read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the method according to the embodiments of the present application.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (16)

1. A blockchain-based voting method, comprising:
obtaining a voting initiation request, wherein the voting initiation request comprises public keys of a plurality of voting accounts;
generating a random factor and a corresponding anonymity parameter based on the voting initiation request, wherein an elliptic encryption policy and parameters used for generating the random factor and the anonymity parameter are the same as an elliptic encryption policy and parameters of a public key and a private key of the voting account, and the anonymity parameter is provided to the plurality of voting accounts for voting;
encrypting the public key of each voting account based on the random factor to obtain an anonymous address of each voting account;
uplinking the voting initiation request and anonymous addresses of the plurality of voting accounts in a blockchain to generate a voting campaign in the blockchain;
when the voting in the blockchain is completed, a voting result of the voting is obtained from the blockchain, wherein the voting result is determined by the plurality of voting accounts through verifying and voting the anonymous address according to the owned private key and the public anonymous parameter.
2. The method of claim 1, wherein generating a random factor and corresponding anonymity parameters based on the vote initiation request comprises:
Selecting a random value from a value space corresponding to a private key of the voting account as a random factor;
and calculating the anonymity parameter according to the determined random factor based on a key elliptic encryption strategy of the public key and the private key of the voting account.
3. The method of claim 1, wherein after the step of linking the voting initiation request and the anonymous addresses of the plurality of voting accounts in a blockchain, further comprises:
receiving an identity confirmation request sent by the voting account through a voting intelligent contract on the blockchain, wherein the identity confirmation request is generated after the anonymous address is verified by the voting account according to the anonymous parameter and a private key of the voting account;
and when the received identity confirmation request meets a voting enabling policy in the voting intelligent contract, enabling the voting activity to acquire vote information of the plurality of voting accounts.
4. A method according to claim 3, wherein after said enabling said voting campaign, further comprising:
the voting transaction sent by the voting account is uplink in the blockchain through a voting intelligent contract on the blockchain, and the voting transaction is obtained by signing the voting information of the voting account through the owned private key and the public anonymity parameter;
When the number of voting transactions in the blockchain meets a voting strategy in the voting intelligent contract, marking the voting campaign as voting complete.
5. The method of claim 4, wherein the obtaining the voting results of the voting campaign from the blockchain when the voting campaign in the blockchain is completed comprises:
periodically checking a voting state corresponding to the voting activity in the blockchain;
when the voting activity is detected to be marked as voting completion, acquiring a voting transaction for voting aiming at the voting activity from the blockchain;
and determining the voting result of the voting event according to the obtained voting information in the voting transaction.
6. The method of claim 4, wherein the linking the voting transaction sent by the voting account in the blockchain by the voting intelligent contract on the blockchain comprises:
receiving a voting transaction sent by the voting account, wherein the voting transaction is obtained by encrypting an anonymous private key of the voting account, and the anonymous private key is determined according to the private key of the voting account and the anonymous parameter;
Verifying the voting transaction by anonymous addresses of a plurality of voting accounts;
if the validation passes, the voting transaction is uplink in the blockchain.
7. The voting method according to claim 1, wherein encrypting the public key of each voting account based on the random factor results in an anonymous address for each voting account, comprising:
performing point multiplication on the public key of each voting account and the random factor to obtain an anonymous public key of each voting account;
and carrying out hash encryption according to the anonymous public key of each voting account to obtain the anonymous address of each voting account.
8. The method of claim 1, wherein encrypting the public key of each voting account based on the random factor results in an anonymous address for each voting account, further comprising:
acquiring anonymous management information corresponding to the voting initiation request;
if the anonymous management information does not contain supervisor information, deleting the random factor from the local;
and if the anonymous management information contains supervisor information, locally storing the random factor.
9. The method of claim 8, wherein after obtaining the voting results of the voting campaign from the blockchain when the voting campaign in the blockchain is completed, the method further comprises:
Receiving a random factor acquisition request sent by a voting supervisor for the voting activity;
and sending the random factor to the voting supervisor according to matching of supervisor information in the random factor acquisition request and supervisor information contained in the anonymous management information, so that the voting supervisor can decrypt anonymous addresses in the voting result according to the random factor and public keys of the plurality of voting accounts.
10. A blockchain-based voting method, comprising:
acquiring anonymous parameters and a plurality of anonymous addresses corresponding to voting activities in a blockchain;
encrypting according to the private key owned by the voting account and the anonymity parameter to obtain the anonymity private key of the voting account;
performing anonymous address verification on the plurality of anonymous addresses according to an anonymous private key of the voting account;
and sending a voting transaction to the blockchain according to the verification result of the anonymous address verification so as to vote on the voting activity.
11. The method of claim 10, wherein anonymously address verifying the plurality of anonymously addresses from an anonymously private key of the voting account comprises:
Based on a key elliptic encryption strategy between a public key and a private key of the voting account, performing dot multiplication according to the anonymous private key and a key mapping factor to obtain the anonymous public key of the voting account, wherein the key mapping factor is the same as the key mapping factor when the public key and the private key of the voting account are generated;
carrying out hash encryption according to the anonymous public key of the voting account to obtain the anonymous address of the voting account;
and if the anonymous addresses contain the anonymous public key of the voting account, passing the anonymous address verification.
12. The method of claim 11, wherein the sending a voting transaction to the blockchain based on the authentication result of the anonymous address authentication comprises:
if the anonymous address verification passes, an identity confirmation request is sent to the blockchain for enabling the voting activity by the blockchain;
acquiring vote information for the voting event;
when the voting activity in the blockchain is in an enabling state, encrypting the ballot information through the anonymous private key to obtain a voting transaction;
the voting transaction is sent to the blockchain.
13. A blockchain-based voting apparatus, comprising:
The system comprises a request acquisition module, a voting initiation module and a voting management module, wherein the request acquisition module is used for acquiring a voting initiation request, and the voting initiation request comprises public keys of a plurality of voting accounts;
a generation module for generating a random factor and a corresponding anonymity parameter based on the voting initiation request, wherein an elliptic encryption policy and parameters for generating the random factor and the anonymity parameter are the same as an elliptic encryption policy and parameters of a public key and a private key of the voting account, and the anonymity parameter is provided to the plurality of voting accounts for voting;
the encryption module is used for encrypting the public key of each voting account based on the random factor to obtain the anonymous address of each voting account;
a chaining module for chaining the voting initiation request and anonymous addresses of the plurality of voting accounts in a blockchain to generate a voting campaign in the blockchain;
and the result acquisition module is used for acquiring the voting result of the voting activity from the blockchain when the voting activity in the blockchain is completed, wherein the voting result is determined by verifying and voting the anonymous address by the plurality of voting accounts according to the owned private key and the public anonymity parameter.
14. An electronic device, comprising:
a processor;
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the blockchain-based voting method of any of claims 1-12 via execution of the executable instructions.
15. A computer readable medium having stored thereon a computer program, which when executed by a processor implements a blockchain-based voting method as in any of claims 1 to 12.
16. A computer program product, characterized in that it comprises computer instructions stored in a computer-readable storage medium, from which computer instructions a processor of a computer device reads and executes, causing the computer device to perform the blockchain-based voting method as claimed in any of claims 1 to 12.
CN202310785971.0A 2023-06-29 2023-06-29 Block chain-based voting method, apparatus, electronic device and readable medium Pending CN116961896A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310785971.0A CN116961896A (en) 2023-06-29 2023-06-29 Block chain-based voting method, apparatus, electronic device and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310785971.0A CN116961896A (en) 2023-06-29 2023-06-29 Block chain-based voting method, apparatus, electronic device and readable medium

Publications (1)

Publication Number Publication Date
CN116961896A true CN116961896A (en) 2023-10-27

Family

ID=88450287

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310785971.0A Pending CN116961896A (en) 2023-06-29 2023-06-29 Block chain-based voting method, apparatus, electronic device and readable medium

Country Status (1)

Country Link
CN (1) CN116961896A (en)

Similar Documents

Publication Publication Date Title
EP4120114A1 (en) Data processing method and apparatus, smart device and storage medium
US11082221B2 (en) Methods and systems for creating and recovering accounts using dynamic passwords
US11356457B2 (en) Parameter based key derivation
CA3015695C (en) Systems and methods for distributed data sharing with asynchronous third-party attestation
US11645593B2 (en) Use of identity and access management for service provisioning
CN112311735B (en) Credible authentication method, network equipment, system and storage medium
JP6054457B2 (en) Private analysis with controlled disclosure
EP2761487B1 (en) Parameter based key derivation
JP2019053269A (en) System and method for determining ballot of voter collected by electronic voting
US11494763B2 (en) Cryptoasset custodial system with custom logic
CN110235410A (en) Replace the method for the login of user using the block chain database of the agreement based on UTXO and by the certification based on PKI and utilizes its server
CN108462696B (en) Decentralized block chain intelligent identity authentication system
US20220141020A1 (en) Blockchain e-voting system and operating method thereof
CN113347008B (en) Loan information storage method adopting addition homomorphic encryption
CN109067808B (en) Method and device for realizing block chain real-name system authentication based on social relationship guarantee
CN113792318A (en) Data authorization method and device, computer readable storage medium and computer equipment
US9407637B2 (en) Method for managing and checking data from different identity domains organized into a structured set
CN114978635A (en) Cross-domain authentication method and device, and user registration method and device
US10735395B2 (en) Conducting secure interactions utilizing reliability information
US11943210B2 (en) System and method for distributed, keyless electronic transactions with authentication
Koulolias et al. STORK e-privacy and security
Kim et al. Can we create a cross-domain federated identity for the industrial Internet of Things without Google?
CN115883102B (en) Cross-domain identity authentication method and system based on identity credibility and electronic equipment
CN112422534B (en) Credit evaluation method and equipment for electronic certificate
EP3883204B1 (en) System and method for secure generation, exchange and management of a user identity data using a blockchain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication