A cryptographic desk clock: time reference
This post is part of a series:
- Part I: protocol for a cryptographic desk clock
- Part II: time reference (this page)
- Part III: agreement protocols
- … sometime in the future … client implementation
This part covers the Roughtime server: its architecture and security properties. The time reference itself (the time server) is this beautiful mess of wires, currently living behind a couch. It has a small cryptographic processor, a GPS module and a Raspberry Pi, and it serves House Standard Time over WiFi.

Server architecture #
Time to build! We partition the time server into two blocks:
-
trusted domain: a GPS module plus a small microcontroller running an RTOS. It parses the NMEA data from the GPS module, stores the signing key, and generates signatures.
-
untrusted domain: a Raspberry Pi running a Go binary. It talks to network peers over UDP and batches client requests into a Merkle tree, whose root it sends to the trusted domain for signing.

Why? The point of this partition is to shrink the attack surface by packing all the security-critical functionality into one small block. The trusted domain does the minimum amount of work needed, which keeps the trusted codebase small. All networking code, none of which is security-critical, runs on the Raspberry Pi. Everything security-sensitive runs in the trusted domain. No secrets live on the Pi. The worst a compromised untrusted domain can do is take the server offline.
The interface between the two blocks looks essentially like this (less important fields omitted):
typedef struct {
uint8_t merkle_root[32]; // (merkle-)hash of all client nonces
} signing_request_t;
typedef struct {
uint64_t midpoint; // time at the moment of signing
uint8_t signature[64]; // essentially, signature over merkle_root + midpoint
} signing_response_t;
The data in signing_request can be 100% attacker-controlled, and that’s fine. The Pi can be 100% popped, and the “only” consequence is reduced availability. Time is not chosen by the untrusted domain: the GPS module feeds directly into the trusted domain. The two domains talk over a simple serial line with no framing (yolo) and fixed-size packets (difficult, but not impossible, to screw up). The Pi cannot reflash the microcontroller; a human has to plug in a programmer.