ballotlabMIDNIGHT VOTING RESEARCH

YOUR FIRST ELECTION

Four steps.
One shared result.

Try encrypted voting in your browser. You play the voters and trustees, so you can follow the whole election from the first choice to the final check.

Set up election

Give your election a name, add two to five choices and choose how many demo voters can take part.

Cast votes

Select a demo voter who has not voted yet, choose an option and cast an encrypted ballot. Save that voter’s receipt.

Reveal results

Close voting and combine any two of the three trustee shares to reveal the combined totals.

Verify election

Save the public record, check that it is internally consistent and use a receipt to find its matching encrypted ballot.

Make the election yours.

Start with a title and two to five choices. Choose between one and 1,024 synthetic voters; five is a good starting point. These credentials belong to the demonstration, not an electoral register.

Choose whether to close voting yourself or set a timer. Timed mode uses the real clock and automatically closes and reveals the results with two demo trustee shares. Keep the tab open: a closed or suspended browser cannot guarantee that a scheduled action runs on time.

Cast a vote. Keep its receipt.

Pick a demo voter who has not voted yet from the dropdown, choose an option and cast the ballot. Midnight’s native cryptography encrypts the choice, and the contract checks that the voter’s credential is eligible and has not already voted.

Save the full receipt and copy its 64-character receipt ID before switching to the next voter. The “What happens next?” panel explains when the totals will be revealed and how to check them. The QR code identifies the election and encrypted ballot without including the choice or encryption randomness. Sharing a receipt can still associate you with that ciphertext.

Two trustees reveal the total.

After voting closes, no new ballots can be added. In manual mode, click any two trustee cards and reveal the results. In timed mode, the demonstration supplies two valid shares automatically after the deadline.

The tally combines the complete accepted ballot set. It shows how many votes each choice received. All three demo trustee secrets are held in this browser session; this is a way to learn the flow, not independent trustee custody. Any two trustees who cooperate can decrypt individual ballots outside the app, even before the totals are revealed. Showing only totals in the interface does not prevent that.

Check the shared record.

Save the public election record and open the verification step. You can import and check the saved record in a fresh session, then paste a receipt ID to look up its encrypted ballot or check a saved full receipt. An ID lookup uses the record you selected; it does not prove who cast the vote. A full receipt also includes the election details to compare. The checks recompute the record’s commitments and aggregates, check the published tally equations and look for that receipt.

A consistent record is a useful check, with a specific limit. This export does not carry authenticated ballot or trustee-share proofs. Someone could construct a different, internally consistent record. Passing these checks does not prove real-world voter eligibility, an honest election or inclusion in a blockchain.

Real cryptography. A local demonstration.

The main demo runs the generated Midnight contract and native WebAssembly on your device. It does not generate a network proof or submit a blockchain transaction. The QR code is a format for the receipt; it is not the encryption itself.

You control every voter and trustee in one tab. The demonstration’s key dealer knows the complete decryption key, and two colluding trustees could decrypt individual ciphertexts outside this tally interface. It does not provide election certification, coercion resistance or a guarantee that a compromised device recorded your intended choice.

Refreshing the demo clears its in-memory election. Save public records and receipts you want to keep. Those exports do not include voter secrets, trustee secrets or ballot randomness.

Ready to connect a wallet?

The public-testnet demo has five separate screens: Connect, Set up election, Vote, Reveal results and Verify election. Use the blue stage buttons or Back / Next. Your entries, keys, receipt and uploaded result stay in this tab while you move between screens, and the election activity panel remains available. Switching screens does not send a transaction.

You can open Verify election straight away to check a downloaded network record without a wallet. To vote, connect Lace, create or join an election, and follow “Ready to vote?” for any missing steps. Save the public election-details file so you can join again later, and keep private keys separate from public records and receipts.

The testnet page proves contract calls in a browser worker, while Lace approves transactions and handles wallet and fee proving. Choose Run in this app (WASM) in Lace; its connector API cannot independently attest that setting. An isolated Lace 2.5.1 test completed all nine Preview election transactions and eight browser contract proofs. Its final record passed the app's checks, but the overall test failed because it could not observe the internal prover-WASM resource in Lace. See the current verification status ↗ (opens in a new tab) for the exact stages and limits. The tested app origin is local; hosted-origin wallet transactions and Preprod transactions remain untested, and the election client blocks mainnet.

GitHub Pages serves the application files. It does not deploy the election contract or provide a prover. The wallet and network guide explains the required services, saved files and exact testing limits.