Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Crypto-Project-ENSTA/front-end/llms.txt

Use this file to discover all available pages before exploring further.

This endpoint submits a voter’s encrypted ballot to the server. By the time this call is made, the ballot has already been blind-signed and encrypted client-side — the vote field carries the ciphertext, not the plaintext candidate selection. The voter’s N2 code is required to authenticate the submission and prevent double-voting.
POST /voters/submit_vote

Request body

n2
string
required
The voter’s N2 verification code issued during registration. Used to authenticate the ballot submission.
vote
string
required
The encrypted, blind-signed ballot content. This must be the ciphertext produced by the client-side encryption step — not the plaintext candidate name.

Response fields

status
string
"success" on a valid submission, or an error status string if the submission was rejected.
message
string
Human-readable description of the result.

Example request

curl -X POST "$API_URL/voters/submit_vote" \
  -H "Content-Type: application/json" \
  -d '{"n2": "your-n2-code-here", "vote": "<encrypted-ballot>"}'

Example response

{
  "status": "success",
  "message": "Vote submitted successfully"
}
The vote field must contain the encrypted, blind-signed ballot produced client-side — NOT the plaintext candidate name. Encryption and blind signing happen before this call is made.
This endpoint is only available when voting_status === "vote_started". Submissions outside the active voting phase will be rejected.
Each N2 code can only be used once. Attempting to submit a second vote with the same N2 code will fail.

Build docs developers (and LLMs) love