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 lets any voter independently confirm that their ballot was included in the published results and that its cryptographic integrity is intact. Voters supply their N2 verification code — issued after casting a ballot — and the system checks whether a matching entry exists in the published tally, then reports the cryptographic validity of that entry. This endpoint is available after voting ends.
POST /results/verify-vote

Request body

n2
string
required
The voter’s N2 verification code, received after submitting a ballot.

Response fields

found
boolean
true if a ballot with this N2 code was found in the published results; false otherwise.
status
"valid" | "invalid_signature" | "invalid_n2" | null
The cryptographic verification outcome. null when found is false.
vote
string | null
The candidate this ballot was cast for. null when found is false.
message
string
A human-readable description of the verification result.

Status values

  • valid — The ballot was found and cryptographically verified. The vote was counted correctly and has not been tampered with.
  • invalid_signature — The ballot was found but the administrator’s digital signature failed verification. This may indicate tampering with the published results.
  • invalid_n2 — The ballot was found but the N2 hash does not match the stored value. The ballot entry may be forged.
  • found: false — No ballot with this N2 code exists in the published results. The vote may not have been recorded.

Example request

curl -X POST "$API_URL/results/verify-vote" \
  -H "Content-Type: application/json" \
  -d '{"n2": "your-n2-code-here"}'

Example responses

{
  "found": true,
  "status": "valid",
  "vote": "Alice",
  "message": "Ballot is cryptographically valid and was counted."
}

Build docs developers (and LLMs) love