Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

mikronova/tyr

docs/PROTOCOL.md

tyr — protocol design (draft)

Canonical design for tyr, Nordisk's own compact binary eID. Vetra's heimdal-tyr is a client; keep protocol decisions here.

Design principles

  1. Binary, not text. Fixed-header + TLV framing; every field length-prefixed; versioned first byte. No XML/JSON on the wire — the ~100× CPU/space win is the whole point.
  2. no_std core. tyr-proto (the codec) builds without an allocator where possible, so the same encoder/decoder runs on an embedded secure element and on the server.
  3. Small + locked down. One modern signature suite, no negotiation zoo. Reject unknown versions/algorithms hard.
  4. Only auth + sign. No issuance/wallet/selective-disclosure sprawl — that's frida's job.

Lifecycle (maps onto heimdal's IdentityProvider)

Wire format (sketch — to be specified in spec/)

byte 0      version
byte 1      message type (StartAuth, StartSign, Challenge, Response, Result, Cancel)
bytes 2..4  length
body        TLV: {tag:u8, len:u16, value:[u8]} records

Signatures/attestations in a compact COSE-like structure (not full COSE). Suite: Ed25519 (device) / ECDSA-P256 (cards, PKCS#11), SHA-256. Hardware-bound keys; optional device attestation record.

PKCS#11 (card) path

Same shape as frida: card signs the challenge via PKCS#11, tyr verifies the card cert chain to a trusted tyr root + validity window. Key never leaves the card.

Persistence — no relational database, ever

Store trait (in edda, per the nornir-warehouse-trait pattern), never an RDBMS:

Networking (multi-server)

WireGuard node-to-node, naturally via Cilium transparent WireGuard encryption. Cilium guarantees the network (connectivity, policy, mTLS, encryption) — not application-level ACK; delivery/ACK semantics live in the event protocol (append → replicate → ACK → commit).

Open questions