Skip to main content

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.

Use this endpoint to confirm that your vote was received by the system and counted correctly. You submit your N2 fingerprint — the second credential you received by email — and the API returns whether a matching vote was found, what status it carries, and (if the vote is valid) the choice that was recorded. This endpoint is read-only: calling it does not affect your vote, its status, or the election tally in any way.

Request

POST /results/verify-vote

Body

n2
string
required
Your N2 fingerprint — the second credential you received by email after registering. This is used to look up your vote record. Do not use your N1 credential here; only N2 is accepted.

Response

found
boolean
required
true if a vote with the provided N2 fingerprint exists in the system; false otherwise.
status
string | null
required
The status of your vote. One of "valid", "invalid_signature", or "invalid_n2". null when no vote was found (found is false).
vote
string | null
required
The candidate choice recorded for your vote. Only present when status is "valid". null in all other cases to avoid disclosing data when tampering or eligibility issues are detected.
message
string
required
A human-readable explanation of the result, describing what the status means for your vote.

HTTP status codes

CodeMeaning
200Lookup completed. Check the found and status fields to interpret the result.
500Internal server error while verifying the vote.

Response scenarios

{
  "found": false,
  "status": null,
  "vote": null,
  "message": "No vote found with this N2 fingerprint"
}
This endpoint is read-only. Calling it does not change your vote, its status, or the election tally.
What each invalid status means:
  • invalid_signature — Your vote was received but the digital signature could not be verified against your registered public key. This can happen if the vote data was tampered with after signing, the wrong private key was used, or the signature was corrupted in transit. Your vote was not counted, and the recorded choice is not disclosed because potential tampering was detected.
  • invalid_n2 — Your vote was received but the N2 fingerprint validation failed. This means the N2 value in the vote did not match your registered credentials. Your vote was not counted. Check that your voter registration was completed correctly and that your N2 fingerprint was computed and submitted accurately.

Example

curl -X POST https://your-api/results/verify-vote \
  -H "Content-Type: application/json" \
  -d '{"n2": "your-n2-fingerprint-here"}'
{
  "found": true,
  "status": "valid",
  "vote": "Candidate A",
  "message": "Your vote was counted successfully"
}

Build docs developers (and LLMs) love