When the election starts, you receive an email containing two codes: N1 and N2. N1 is a one-time authentication token that proves you are an eligible voter. N2 is your personal fingerprint that links your ballot to you for later verification — without revealing how you voted to anyone else. Casting a vote is a two-step process: verify N1 to open a session, then submit your ballot.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Crypto-Project-ENSTA/back-end/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Your email address must have been registered during the registration phase.
- The election must be in the
vote_startedstate (GET /voting/vote-status). - You must have your N1 and N2 codes from the credential email.
Verify your N1 code
Send your N1 code to If your N1 code is valid, you receive:If the code is not found (already used or incorrect), you receive:When
POST /voters/check_n1. This validates your eligibility and stores the verified N1 in your server-side session for the next step.is_N1_exist is false, do not proceed to the next step. Check that you copied the N1 code exactly as it appeared in the credential email.Submit your encrypted ballot
Send your vote to A successful submission returns:Error responses:
POST /voters/submit_vote in the same session (using the same cookie). Provide your N2 code and your vote choice.| Status | Reason |
|---|---|
403 | N1 not verified — call POST /voters/check_n1 first, or the session expired |
400 | Invalid N2 format or unrecognised vote choice |
500 | Unexpected server error during ballot processing |
Ballot fields
ThePOST /voters/submit_vote request body accepts two fields:
| Field | Type | Description |
|---|---|---|
n2 | string | Your unique N2 fingerprint from the credential email. Used to link the ballot back to you for verification. |
vote | string | Your vote choice. Must match one of the configured election choices exactly. |
How privacy is protected
The system uses an RSA blind signature scheme so that the administrator can confirm your eligibility without ever seeing which candidate you chose. When you callsubmit_vote, the server:
- Takes your vote and N2 and wraps them into a ballot object together with random bits (to prevent replay attacks).
- Blinds the ballot — multiplies it by a random masking factor using the administrator’s public key, so the ballot is unreadable.
- Sends the blinded ballot to the administrator service, which signs it without seeing the original content.
- Removes the masking factor from the signature mathematically, producing a valid signature on the original ballot — a signature the administrator unknowingly produced.
- Encrypts the signed ballot with the vote counter’s public key and forwards it to the anonymizer service.