MIDNIGHT / PUBLIC PREVIEW
Try voting on
the public testnet.
Connect Lace to Midnight Preview, create a test election and submit encrypted votes. The shared network services are already selected. Use test DUST and select on-device WASM proving in Lace. This page proves contract calls in your browser, and your wallet approves each transaction.
Distinct evidence at every stage
Running a contract, creating a proof, submitting a transaction and receiving confirmation are different events. An indexer observation is not independent chain verification.01 / CONNECT
Wallet connectionConnect to the public testnet.
Preview is a shared test network. You do not need to run your own node or indexer.
- Install Lace ↗ (opens in a new tab), enable Midnight and choose Preview.
- Get free test NIGHT from the Preview faucet ↗ (opens in a new tab), then use Generate tDUST in Lace and wait for usable DUST.
- In Lace, choose Settings → Midnight → On this device → Run in this app (WASM), then save the configuration. Ballot Lab creates contract proofs in a browser worker; Lace creates the wallet and fee proofs.
Use test tokens only. No Docker or local proof server is needed for this mode. The first proof downloads public proving files; proving can take a few minutes and needs enough memory. Keep this tab open.
How to set up Lace
- Select Midnight Preview. Open Lace and choose Settings → Network → Testnet, select Preview under Midnight, then confirm. Cardano has its own network setting.
- Choose on-device proving. In Settings → Midnight → On this device, choose Run in this app (WASM) and save the configuration. This makes Lace generate wallet and DUST fee proofs on your device. Do not select a remote or delegated prover.
- Get free test NIGHT. Open your Midnight account in Lace, choose Receive → Unshielded, and copy the address starting with
mn_addr_preview. Use it at the Preview faucet linked above, complete the CAPTCHA and request tokens. Wait for the test NIGHT balance to appear in Lace. - Generate tDUST. Return to your Midnight account and choose Generate tDUST. Lace fills in your DUST address. Choose Review transaction, then Confirm to register your test NIGHT for DUST generation.
- Wait for usable DUST. Registration starts tDUST accruing. Wait for a usable DUST balance before creating an election or submitting a vote. Receiving test NIGHT alone does not start DUST generation.
- Connect to Ballot Lab. Open this app in the same browser as Lace, reload the page and choose Refresh wallet list. Select Lace, enter a separate password for this app and click Connect selected wallet.
If Midnight is missing from Lace, follow the Lace setup steps ↗ (opens in a new tab).
Use Preview test tokens only. You can check public services without a wallet and connect Lace before funding it. Connecting does not submit a transaction.
Check the proving setting in Lace. Its connector API cannot tell this page whether “Run in this app (WASM)” or a delegated prover is selected. An absent server address is not proof of on-device processing. This app rejects reported external prover URLs and has no remote fallback for its own contract proofs.
Continue when you’re ready. You can return to any step.
02 / SET UP ELECTION
Test electionSet up or join an election.
Create a new test election with your own choices and voting schedule.
Choose an election-details file to fill in its address and fingerprint, or enter them below.
Get the contract address and fingerprint from a source you trust. The app checks that the contract’s keys and settings match, but cannot prove that its initial setup or history was honest.
For a new election, click Generate administrator key, then download it. To reuse a saved key, choose Use an existing key or load its file.
No administrator key generated or loaded yet.
Only the election administrator needs this key. Keep the same key to register voters. Downloaded key files are private, unencrypted text; they are never included in public receipts or election records.
Leave enough time to register trustee keys and voters before voting opens. Browser proofs and wallet approvals can take several minutes; the voting window must allow each vote to be proved and accepted before it closes. After creating the contract, register the trustee keys below before leaving this page.
Required: set up trustee keys
Generate the shares, then register the trustee keys before voting. Generation happens only in this tab; registration requires your wallet and a network transaction.
This test setup creates all three key shares in one place. They are not held by independent people. Two people with these shares could also decrypt individual ballots outside the app.
Save the trustee keys
After registration, download one private file for each trustee. Each contains that trustee’s key share and the election details. These files are unencrypted: give each trustee only their own file and keep them separate from public election details and receipts.
Generate and register the trustee shares before downloading them. Save all three before leaving this setup session.
Save this election for later
Keep a public join file with the network, contract address and election fingerprint. When you return, choose Join an election and load this file. Save private voter, administrator and trustee keys separately.
Create the election and register its trustee keys first. Registration gives the election its fingerprint.
03 / VOTE
Encrypted ballotRegister a voter, then vote.
Ready to vote?
Connect your wallet, then create or join an election.
The scheduled time alone does not open voting. Register voters beforehand, then submit Open voting during the voting window. If someone else opened the election, refresh its status here.
Generate a key for a new voter, or load the key that was registered for this voter.
Register each voter before voting opens, using the administrator key. Download the voter key and load that same file when voting. The file is private, unencrypted text and contains no vote or receipt. Loading it does not register a voter or allow a second vote. If you joined an existing election, confirm what each numbered choice means before casting.
Each voter key gets a file number. Its receipt uses the same number, and downloading that key again in this session keeps its number. Load the original key file to restore its number when you return. File numbers are local labels, not public voter IDs.
If a submission does not get a clear response, check the pending vote before trying again. Further votes stay disabled while its status is uncertain, so you do not accidentally submit it twice.
Receipt found in the network record
Receipt ID
Full QR receipt text
This receipt identifies your ballot and election. It matches the record returned by your indexer; that alone does not independently verify the blockchain. The QR code does not include a transaction ID.
04 / REVEAL RESULTS
2 of 3Reveal the combined results.
Voting can close only after the time set in the contract. Then two trustees each use their secret share to help reveal the total. Each contribution is checked against all accepted votes.
The contract enforces the voting deadline. Closing the election, adding trustee contributions and publishing totals still need transactions and wallet approvals. This page cannot keep running after you close it. See the scheduled-test guide (opens in a new tab) for unattended development tests.
Join the election first, then load your private trustee file. The app checks the key and selects the matching trustee. You still choose when to submit the contribution.
05 / VERIFY ELECTION
Network recordCheck the public election record.
Upload a saved election record
Choose the public JSON file you previously downloaded. This checks the saved ballots, receipts, aggregate and any finalized totals locally, without a wallet. It does not join the election or replace the live network record.
No saved record checked yet.
Saved record is internally consistent
These results come from the uploaded file. They do not prove that the record is authentic, complete or current. This file contains no proof package establishing voter eligibility, genuine trustee contributions or blockchain acceptance. Compare its fingerprint and your receipt through a source you trust.
Check your own receipt
Looks up an encrypted ballot in the election you joined. An ID alone does not prove who cast it or independently verify the blockchain. Save the full receipt too: it includes the election details.
The download includes encrypted ballots and public trustee contributions, without private choices or keys. It is a copy of your indexer’s record, not a complete proof of the election. Keep the page open until each transaction finishes, and check an uncertain transaction before retrying.
SUPPORT DEVELOPMENT
Buy me a coffee.
Enjoying Midnight Ballot Lab? You can support its development with a NIGHT or ADA tip on Cardano. Scan the QR code or copy the address below. Thank you for helping me keep building.
Tips are optional. The demo is free to use.