mykeels.com

OEEP RFC 0005: Evidence Transmission, Replication and Preservation

How OEEP moves evidence from a phone to many repositories, survives poor connectivity, and makes tampering detectable.

OEEP RFC 0005: Evidence Transmission, Replication and Preservation

We have evidence, we know who signed it, and we know where to send it (RFC 0004). Now we actually have to send it.

Election day is hostile to technology. Networks are congested, batteries die, some areas have no signal, and internet shutdowns are always possible. This RFC is about getting evidence through anyway, and making sure it can't be quietly altered once it arrives.

Standard submission and retrieval APIs

The protocol can stay surprisingly small:

MethodEndpointPurpose
GET/.well-known/oeep.jsonRepository discovery
PUT/v1/submissions/{id}Submit immutable signed evidence
GET/v1/submissions/{id}Retrieve evidence
GET/v1/submissionsQuery by election, contest or polling unit
PUT/v1/blobs/{hash}Upload content-addressed attachment
GET/v1/blobs/{hash}Retrieve attachment
GET/v1/feedIncremental replication
GET/v1/checkpointsRetrieve signed repository checkpoints
GET/v1/receipts/{id}Retrieve signed delivery receipt

The spec needs to define canonical serialisation, signatures, response codes, upload limits, validation rules, retry semantics, pagination and replication behaviour.

Evidence storage and verification are deliberately kept separate. A verification API can come later, on top.

Idempotency and deduplication

On a bad network, a client will often send a submission, never get a response, and send it again.

OEEP makes this safe by deriving each submission's ID from its content:

submissionId = SHA256(canonicalSignedEnvelope)

This means:

  • Submitting the same evidence 100 times creates only one record per repository.
  • Every repository identifies the same submission by the same ID.
  • Changing any signed field produces a different ID.
  • Tampering with an image invalidates its expected hash.

Using PUT with a content-derived ID makes idempotency natural. A repeated PUT of the same ID is a no-op. The repository must recompute the ID from the request body and reject any mismatch, otherwise someone could upload different content under an existing ID.

For this to work, the client signs once at capture and resends the stored signed envelope on every retry (RFC 0002). Re-signing could produce a different signature, and therefore a different ID.

But two different agents photographing the same result sheet produce two separate submissions. Those are independent observations, not duplicates, and both are kept.

Offline-first evidence collection

The app should assume there is no connectivity, and treat a connection as a bonus.

  • Every submission is saved durably to a local database (e.g. SQLite) immediately after capture, in a persistent outbox.
  • Delivery status is tracked per repository: delivered to A, pending for B, failed for C.
  • A user-visible sync screen shows the agent what has and hasn't gone through.

Background retries and resumable uploads

A background retry mechanism is necessary but not sufficient. Mobile operating systems kill background jobs, phones run out of battery, and networks stay down for hours.

  • Use the OS's job scheduler (e.g. Android WorkManager) so retries survive app restarts.
  • Use exponential backoff with jitter, so millions of phones don't all retry at the same moment.
  • Use resumable uploads for images, so a dropped connection continues where it stopped instead of restarting.

One optimisation I really like: separate the signed result payload from the image. The payload is a few kilobytes. The image might be 500 KB or more. Send the payload first. The repository marks it as "awaiting attachment", and the image follows when the network allows.

Peer-assisted evidence transport

When there's no connectivity at all, evidence can be carried by another device. This is store-and-forward delivery.

Offline transfer: evidence relayed between devices

Agent A has no network. Agent B is heading somewhere that does. Agent A transfers the signed evidence to Agent B's device, and Agent B's app delivers it.

Agent B doesn't need to be trusted. The original signature stays intact. If Agent B changes anything, verification fails at every repository.

Possible transports include Bluetooth, Wi-Fi Direct, local file sharing, and QR codes for compact signed payloads without images.

This must be optional and designed around safety. Nobody should be encouraged to resist confiscation or put themselves at risk to preserve evidence.

Repository-to-repository replication

In a naive design, the phone has to deliver evidence to every repository itself. That costs agents a lot of data and multiplies the chances of failure.

So OEEP adds server-to-server replication. Once any repository receives a valid signed submission, it makes it available on its /v1/feed endpoint. Other repositories poll that feed and pull anything they're missing. A repository can also push directly to peers with PUT /v1/submissions/{id}, the same endpoint clients use.

Replication between repositories

The phone reached Repository A but failed to reach B and C. Repository A replicates to B and C. Direct delivery attempts from the phone can still continue independently.

This gives us:

  • Less mobile data per agent. With 3 contests (three 500 KB images) and 5 repositories, that's ~7.5 MB per agent for direct delivery to all, versus ~1.5 MB for one upload plus replication.
  • Repositories that were temporarily down can catch up.
  • Once evidence has propagated, no single repository can suppress it.
  • Organisations that join after the election can reconstruct the full dataset.
  • A destroyed phone matters much less, as long as it reached one repository.

Since every submission carries its original signature, Repository B doesn't need to trust Repository A. It verifies the evidence itself.

Replication must preserve the original submission. It must not create a new witness report.

Evidence only needs to reach one honest, connected repository for wider distribution to begin.

Signed receipts and proof of custody

When a repository has durably stored and validated a submission, it returns a signed receipt:

{
  "repositoryId": "observer-repository-a",
  "submissionId": "sha256:...",
  "receivedAt": "...",
  "status": "stored",
  "signature": "..."
}

This is proof of custody. If a repository later claims it never received a submission, the agent or another repository can present the receipt, signed by the repository's own key.

Merkle trees and append-only transparency logs

Receipts cover individual submissions. But how do we know a repository hasn't deleted or altered evidence across its whole dataset?

Here I'm borrowing from Certificate Transparency rather than reaching for blockchain.

Each repository keeps an append-only log of accepted submissions, and periodically publishes a signed Merkle tree root as a checkpoint.

A signed Merkle tree root

Each submission is hashed. Pairs of hashes are hashed together, up to a single root. Changing any historical submission changes its hash, which changes every hash above it, which breaks consistency with the previously published checkpoint.

Other organisations archive and exchange these checkpoints. Auditors can then request:

  • Inclusion proofs: proof that a specific submission is in the log.
  • Consistency proofs: proof that the log has only been extended, not rewritten.

Repositories won't have identical roots, because they receive submissions in different orders. Instead, they verify each other's log consistency and reconcile missing submission IDs.

Signed receipts plus witnessed checkpoints make it substantially harder for a repository to quietly rewrite its history.

Do we need blockchain?

Not for the initial system.

RequirementSimpler solution
Evidence authenticityDigital signatures
Image integritySHA-256 hashes
Distributed storageRepository replication
Tamper-evident historyMerkle transparency logs
AccountabilitySigned receipts
Cross-organisation verificationOpen verification rules

A blockchain can't establish whether a photographed result sheet was genuine. It adds complexity without solving the hardest problem.

Security considerations and trade-offs

  • Replication spreads bad evidence too. That's fine. Replication is about preservation, not acceptance. Verification happens in RFC 0006.
  • Mobile OSes are aggressive about background work. The app has to be careful about battery and keep the agent informed.
  • Storage is manageable. Using 176,846 polling units, 3 agents per unit, 3 contests and 500 KB images, that's about 1.6 million submissions and roughly 800 GB of images per repository. Commodity object storage, a queue and PostgreSQL can handle that.
  • Peer relay has privacy costs. The relaying device learns what it's carrying. Payloads may need encryption to the destination repositories.

Open questions

  • Should a client stop direct delivery once it sees a receipt from a replicating repository? Yes, it should.
  • How often should repositories publish checkpoints on election day?
  • What's the most useful subset of a submission that fits in a QR code?

In RFC 0006, we'll look at verifying evidence and collating results. Let me know your thoughts in the comments below.

Related Articles

Tags