mykeels.com

OEEP RFC 0002: Electoral Evidence Capture and Representation

What a piece of electoral evidence looks like in OEEP - registries, schemas, OCR, signatures, and why submissions are append-only.

OEEP RFC 0002: Electoral Evidence Capture and Representation

In RFC 0001, I introduced the idea of sending electoral evidence to many independent repositories instead of one central system.

Before anything can be sent, every app and every repository has to agree on what is being sent. That's what this post covers.

The goal is simple:

An agent should not be uploading a result to a database. They should be creating a portable, signed document that can be verified anywhere, even years after the election.

Electoral registries and polling unit identifiers

Every piece of evidence needs to point at a place everyone agrees on. OEEP uses an electoral registry: a published list of elections, contests and polling units, each with a stable identifier.

electionId:    ng-2027-general
contestId:     presidential
pollingUnitId: PU-EXAMPLE-001

The registry is versioned, signed and downloadable before election day, so apps can use it offline.

The protocol only needs a hierarchy of areas. It doesn't hardcode states, LGAs and wards, so other countries can plug in their own structure.

A standard evidence schema

If every app uses the same schema, any repository can accept evidence from any app. A simplified result submission looks like this:

{
  "protocolVersion": "1.0",
  "electionId": "ng-2027-general",
  "contestId": "presidential",
  "pollingUnitId": "PU-EXAMPLE-001",
  "reportType": "result_observation",
  "formType": "EC60E",
  "credentialId": "cred_01",
  "capturedAt": "2027-01-16T17:42:00+01:00",
  "location": {
    "latitude": 6.50,
    "longitude": 3.40,
    "accuracyMeters": 15
  },
  "attachments": [
    { "type": "result_form", "sha256": "..." }
  ],
  "ocrCounts":   { "PARTY_A": 120, "PARTY_B": 85, "PARTY_C": 42 },
  "humanCounts": { "PARTY_A": 120, "PARTY_B": 85, "PARTY_C": 47 },
  "claims": [
    { "field": "PARTY_C", "ocrValue": 42, "formValue": 47, "claim": "ocr_misread" }
  ],
  "rejectedVotes": 5,
  "accreditedVoters": 270,
  "nonce": "...",
  "signature": "..."
}

The coordinates and party names are illustrative. Notice that ocrCounts and humanCounts disagree on PARTY_C, and that claims records why. That's on purpose.

Result sheet photography and OCR

Every result submission carries three separate layers of information:

  1. Primary evidence: the original photograph of the EC8A or EC60E.
  2. Machine interpretation: the counts extracted by OCR. These can be wrong. A smudged 7 can look like a 2.
  3. Human interpretation: the counts the agent typed or corrected.

These must never overwrite one another. It doesn't matter if OCR reads 42 and the agent types 47, both are kept.

Repositories should also be able to run their own OCR against the original image, independent of whichever app produced the submission.

The app should use direct camera capture instead of gallery uploads, keep the original image, and sign its hash immediately.

Human transcription and independent vote counts

When an agent changes a number, there are two very different claims they could be making:

  • "OCR read the form wrong." That's a transcription correction.
  • "The figure written on the form is wrong." That's a dispute with the form itself.

Mixing them up would turn a typo fix into an accusation, or hide an accusation inside a typo fix.

So the app shouldn't guess. Whenever the agent's figure differs from the OCR figure, the app asks them directly:

OCR read 42 for PARTY_C. You entered 47. Which is true?

  • The scanner misread the form. The form says 47.
  • The form says 42, but I believe the correct figure is 47.

The answer is stored as an explicit, signed claim for that field:

"claims": [
  {
    "field": "PARTY_C",
    "ocrValue": 42,
    "formValue": 47,
    "claim": "ocr_misread"
  }
]

or, if the agent is disputing the form:

"claims": [
  {
    "field": "PARTY_C",
    "ocrValue": 42,
    "formValue": 42,
    "assertedValue": 47,
    "claim": "form_disputed",
    "note": "Counted 47 ballots for PARTY_C during sorting"
  }
]

This keeps one rule simple: humanCounts always means what the agent reads on the form. Anything the agent believes beyond that goes into a claim, which they chose on purpose and signed. Verifiers never have to work out intent from which fields happen to differ.

A form_disputed claim is an accusation, and it's treated as one. It can be weighed against other witnesses and independent counts (RFC 0006), and the agent is accountable for it through their credential (RFC 0003).

A photo of a result sheet only proves what was written on the form. So OEEP also supports independent vote counts: an observer who watched the ballots being counted can submit their own tally, with or without a photo. When an observer's count and the form disagree, that's exactly the kind of thing verifiers need to see.

Digital signatures and content-addressed attachments

Every submission is signed with the reporter's private key (RFC 0003 covers how keys and credentials work). The signature must cover the election, contest, polling unit, counts and attachment hashes. Change any of those and the signature fails.

Images are too large to embed in the payload, so the submission carries a SHA-256 hash of each attachment instead. The image is then stored and fetched by that hash:

PUT /v1/blobs/{sha256}

This is content addressing. The hash is the image's identity. If anyone tampers with the image, it no longer matches the hash in the signed submission.

Submissions are serialised using a canonical format, such as RFC 8785 (JSON Canonicalization Scheme), so the same content always produces the same bytes.

The app signs each submission once, at capture, and stores the signed envelope. Every retry and every relay sends those exact bytes. This matters because some signature schemes (e.g. ECDSA with random nonces) produce a different signature each time you sign. Since the submission ID is derived from the signed envelope (RFC 0005), re-signing on retry would create a "new" submission.

Immutable submissions, corrections and disputes

The protocol explicitly prohibits updating or deleting submitted evidence.

Why? Imagine someone gains control of an agent's phone after the election. If the protocol allowed edits, they could quietly change previously submitted results. With append-only records, they can't.

People still make mistakes, so instead of editing, an agent submits a correction that references the original:

{
  "reportType": "correction",
  "supersedes": "previous-submission-id",
  "reason": "Incorrect manual transcription",
  "humanCounts": { "PARTY_A": 120, "PARTY_B": 85, "PARTY_C": 47 }
}

The original stays available to auditors. Disputes work the same way: you add new evidence that references the submission you disagree with. You never remove someone else's evidence.

Corrections to a submission should only be allowed from the original reporter's key. Never from the issuing organisation or anyone else.

Incident reports and election cancellations

Not every important piece of evidence is a set of numbers. OEEP also defines report types for:

  • Incidents: violence, ballot snatching, intimidation, missing materials.
  • Cancellations: voting at a polling unit was cancelled.
  • Elections not conducted, postponements and supplementary elections.
  • Officially corrected results.

This matters for collation later. A polling unit with no result must never be counted as zero votes. "No result because the election was cancelled" and "no result received yet" are very different states.

Security considerations and trade-offs

  • More fields means more work for agents on a stressful, exhausting day. The app needs to make capture fast and simple.
  • OCR is an assistant, not an authority. It speeds up entry but never replaces the image or the human count.
  • Location data is a double-edged sword. It helps corroborate where evidence was captured, but GPS can be spoofed. RFC 0007 covers privacy.

Open questions

  • Should the schema include candidate names, or only party codes resolved through the registry?

Tomorrow, in RFC 0003, we'll look at how we know who sent a submission without a central authentication server. Let me know your thoughts in the comments below.

Related Articles

Tags