Village
Te reo Māori on this page is a best-effort, machine-assisted translation, not yet reviewed by tangata whenua. We welcome corrections.
Village Gateway

Village Gateway: technical details

How a Village Gateway decision is signed, time-stamped, anchored and checked, for the people who will integrate it or audit it.

Check a record yourself About Village Gateway Read the step-by-step guide API reference: your first decision

What is in a record

Each decision is recorded as a receipt. The receipt carries an Ed25519 signature over its canonical form, and it names its signer: the decentralised identifier (DID) of the Village and the id of the key that signed it.

A decision record is exported as one envelope, gw/export/v1, holding the decision, its approvals, the receipt and the events. The export signature covers the whole export, including the time_attestation block described below, so after export, a change to any field of it fails the check.

An allowed request is given a single-use permit. The permit is signed on its own and carries a unique value, its nullifier, that stops it being used twice. The system that carries out the action redeems it exactly once. The permit sits beside the export and is checked separately.

The public keys travel in a trust bundle that the Village supplies. The checking program takes that bundle as its input and trusts a key for one reason only: you hold the bundle. A key that appears inside the export is never trusted.

The outside time stamp

Each receipt is sent to an outside European time-stamping authority for an RFC 3161 time stamp: Certum (Poland) as standard, with BOSA, CESNET, Portugal's Cartão de Cidadão and the qualified ArubaPEC (Italy) available. The daily estate root is stamped separately, by two authorities, as the section on the daily root below sets out.

The authority time-stamps a hash of the signed receipt. The imprint is sha256('gw/receipt-stamp/v1\n' + canonical signed receipt), with the receipt's signature included.

A stamp shows that the hash existed no later than the authority's stated time. It does not stamp the decision time, the events or the permit and redeem times.

If the authority does not answer, the receipt is still issued and the export shows the stamp as pending. Nothing waits for the stamp. A nightly pass asks again for any stamp that was missed. The standard stamp is not a qualified one; a qualified ArubaPEC stamp is available on request.

The checking program checks a stamp offline: it recomputes the imprint itself, checks the hash inside the token and the authority's signature, and builds the certificate chain from the certificates in the token and those fixed inside the program, ending on a key fixed inside the program. A certificate supplied in the export or in the bundle is ignored.

The offline checking program verifies a stamp from any of five European time-stamping authorities: Certum (Poland), BOSA (Belgium), CESNET (Czechia), the Portuguese state's Cartão de Cidadão authority and the qualified ArubaPEC (Italy). It needs no account and no network.

The daily root and Midnight

A Village hosted in the EU can switch daily sealing on. Each day, the decisions are sealed as one day root for that Village. That day root is signed and time-stamped. The platform is built to add that day root to the daily estate root. A hash of the estate root record (its date, root and previous root) is written to Midnight mainnet each day. A Village Gateway day root has not yet been shown inside an estate root that is written to Midnight mainnet.

The daily estate root is time-stamped by two European authorities: Certum (Poland) and the Portuguese state's Cartão de Cidadão authority. The published index of estate roots, GET /api/email-decision-record/estate-root/index, shows both stamps on every root it lists.

No request or decision content is sent out of the Village. Only a hash of the estate root record for each day is sent to Midnight. No content is sent.

The anchor proof comes from the Village's own route, GET /api/v1/gateway/decisions/:id/anchor-proof. The ledger reading is the text printed when the Village or MDSL runs midnight-anchor/verify-anchor.mjs.

The checking program can read an anchor proof and a ledger reading that you supply, with the options --anchor-proof and --anchor-check. It recomputes the receipt's leaf, the leaf's path to the Village's day root, that root's path to the estate root and the anchor key for the date, and it opens no connection to any ledger. The anchor line is supplementary: it never changes the exit code.

Check a record yourself

The checking program is one JavaScript file you can read. It needs Node.js version 20 or newer, opens no network connection and needs no product installed.

A decision record can be exported with its approvals, receipt and events, and an offline checker (Node 20, no network, no product installed) verifies the export against a bundle of public keys.

Village Gateway sends every receipt it signs to an outside time-stamping authority (Certum as standard). Where the estate switch is on, a receipt is also sent to BOSA (Belgium), CESNET (Czechia) and the Portuguese state's Cartão de Cidadão authority, and each stamp that comes back is kept. Where qualified stamps are switched on for a customer, a receipt can also take a stamp from the qualified ArubaPEC (Italy), priced per stamp. The checking program verifies every stamp offline when an export carries one. Another authority can be built in on request. The run of record: on 4 Nov 2026 a decision was held, approved with a step-up sign-in, given a one-use permit and exported, and the checking program returned verified, including the Certum stamp.

Download the checking program Sample exported record Sample bundle of public keys

SHA-256 of the checking program, as this site serves it:

8e3d5579a894f2c264c96d07190e48ab7b1bb9cf2ea6d762e00575c32210acdb

node gateway-evidence-verifier.js gateway-export-sample.json --bundle gateway-trust-bundle-sample.json

The two samples are synthetic: a key made only for these samples, and invented values. Run on the sample, the checking program exits with 1, by design. The sample export was made before any outside time stamp had been obtained for its signed receipt, so the checking program reports the time-stamp check as incomplete, and a mandatory check that cannot be made is counted as not passed, so the program exits with 1. When an export carries a stamp, the checking program checks it offline. Exit codes: 0 every mandatory check passed; 1 a check failed or could not be made; 2 a usage error or an unreadable file; 3 a version this copy does not know.

  • That the signed receipt and the exported record carry valid signatures from a key in the bundle of public keys you hold, and, where the bundle states a validity period, that the key was valid when the decision was made.
  • That the approvals and the events agree with the decision's final state, and that a decision does not show a state its events do not reach.
  • That the checking program is the file described here: compare its SHA-256 with the value above.

Publishing the checking program is for reading and checking. It is not a licence to anything.

What the checking program verifies

  • The export is a well-formed record with a closed schema: a field it does not know fails the check.
  • Both signatures, on the receipt and on the export, are checked with the key the trust bundle lists under that key id, at the decision time the record states; where the bundle gives the key's validity period, the program checks it.
  • The decision block repeats exactly what the signed receipt says.
  • The action commitment recomputes from the exported action.
  • The approvals and the events agree with the finding and with each other: their count, their times and their order.
  • When a permit is supplied: its signature, its claims and its nullifier.
  • The RFC 3161 time stamp: it is read with strict DER, the program recomputes the imprint itself, and the certificate chain must end on a key fixed inside the program.
  • The approver ids named in the record are distinct.
  • For a version 2 receipt, the mandate block; and, where the decision carries one, the category fields: each closed, well formed and the same on the receipt and the decision block.
  • In an export that names its approvers, each passkey approval carries the approver's own signature over the action and the approver's user id. The approver signs on their own device over a challenge, a one-time request the server computes from the exact action, and the approval page shows the action as the server lists it. A passkey can approve a given decision once, so one passkey cannot stand as two approvers of that decision. This does not stop one passkey registered to two accounts from approving two different decisions, and two passkeys held by one person are not detected. The program recomputes what was signed from the Village, the decision and the commitment in the signed receipt and the approver named beside the signature, requires that the device verified the approver, and checks the signature with the key carried beside it; with --approver-keys, only the keys you list pass, and an approval signed before the approver was named in the challenge passes only with --allow-approver-v1. The key an approver pins is the key the server returned (trust on first use), so a key obtained from the approver's own device is the stronger pin. The signature carries no time. An approval made with a two-step code or a password carries no signature, and the check reads not_checked.
  • From the next nightly seal where a Village has anchoring switched on, each event of a decision and each approval is sealed into the Village's day root (exports from 19 November 2026), and the server refuses to export a record that no longer matches its seal. The program recomputes every event from an export that names its approvers, checks that the events chain one to the next, and folds each into the day root the export names, so a change to an approver, an approval time or an event since that seal fails the check; the check holds even against an export signed again, provided the anchor proof for that night (--anchor-proof) is one you already held or whose estate root you have confirmed on the ledger (--anchor-check); a proof taken from the same server after a change proves nothing. A server that leaves out a decision's latest events and presents the earlier state still passes the offline check; the latest state is covered only by the export signature. The day root itself is checked only through the anchor proof, which covers the day root of the night the receipt was sealed. An approval or event changed before its first nightly seal is sealed as found. Approvals that existed before 19 November 2026 are sealed from the next nightly seal after that date, and the program says how many days after the approval that was. The nightly seal is new and its first reading in production is not yet in, and older decisions export as not yet sealed until a Village's nightly seal catches up. The checking program published before 19 November 2026 answers 'unknown version' on a new export, so use the current one.

Revocation of keys and certificates is not checked beyond what the trust bundle records: the program opens no network connection, so a key or certificate revoked after the bundle was made is not known to it.

When every mandatory check has passed, that shows the record is as Village Gateway signed it at export and that its parts agree, and nothing more. It does not show that the action was sensible or that it was carried out.

Connecting a system that carries out actions

Putting Village Gateway in the path of an action takes four steps.

  1. The agent describes what it wants to do, and Village Gateway answers: go ahead, wait for approval, or no.
  2. A cleared action receives a permit made for exactly that action.
  3. The system that carries out the action checks the permit with Village Gateway before it acts, and each permit works once.
  4. The outcome is reported back and joins the record.

A reference resource shows how a protected system redeems a Gateway permit over HTTP: an allowed request executes exactly once, an approval-gated request waits and executes once after approval, and the resource reports the outcome back to the record.

The reference program is built and tested, and it is available on request.

The post-quantum signature

Gateway receipts and exports can carry a second, post-quantum signature (ML-DSA-65, FIPS 204), turned on per Village and checked offline by the checking program. Five named European authorities are available to stamp receipts: Certum (Poland), BOSA (Belgium), CESNET (Czechia), Portugal's Cartão de Cidadão and, as a qualified stamp on request, ArubaPEC (Italy). More can be built in on request. The post-quantum implementation is our own and has not been independently audited.

Contact us About Village Gateway