Data
Summary: the tables the server keeps, the signed objects that clients exchange, and the local files of the CLI.
Key terms: log entry, record, wrap, envelope, public keys, project access, rotation required, profile, audit, Batch, Commit.
Related: Flows · Interfaces · Spec §14.2
The server stores three kinds of data. Signed objects (log entries and secret records) are stored as JSON text, exactly
as the client sent them, so every reader can verify the signatures. Encrypted keys (wraps and device envelopes) are
opaque bytes that only their recipient can open. Index tables (project access, latest versions, rotation marks) let the
server answer and enforce rules without reading any secret. Account tables come from auth-chad, with the prefix auth_,
in the same database.
The picture as text
erDiagram
projects ||--o{ log_entries : "seq 1..head"
projects ||--o{ wraps : "env, epoch, recipient"
projects ||--o{ records : "env, secret, version"
projects ||--o{ secrets : "latest version per secret"
projects ||--o{ project_access : "who can see it"
projects ||--o{ rotation_required : "envs waiting"
profiles ||--o{ device_envelopes : "user devices"
public_keys ||--o{ log_entries : "pinned by fingerprint"
The tables
Projects
| Table | One row is | Notes |
|---|---|---|
projects | A project | The ID and the current log head (head), which serializes appends |
log_entries | One signed log entry | Primary key (project, seq); the entry JSON with its signature |
public_keys | A public key pair | Keyed by fingerprint, so a client can verify entries of past members |
wraps | An environment key sealed to one member or machine | (project, env, epoch, kind, recipient); 80 bytes of HPKE output |
records | One signed version of one secret | (project, env, secret, version); the record JSON |
secrets | The latest version of a secret | With name_hmac, unique per environment, deleted secrets included |
project_access | A user or machine that can see a project | Derived from the log; answers 404 for everyone else |
rotation_required | An environment that waits for a rotation | Writes to it are refused until an owner rotates |
People and devices
| Table | One row is | Notes |
|---|---|---|
profiles | What this application knows about a user | Display name, identity fingerprint, admin flag |
device_envelopes | A user’s identity key sealed to one user device | 112 bytes; deleted when the device is revoked |
audit | An audit event | Time, actor, device, IP address, action, project, environment, secret, number. No names or values |
auth_* | Accounts, passkeys, sessions, tokens, devices, invites, events | auth-chad’s tables; see auth-chad’s data page |
The SQLite schema is in crates/store-sqlite/src/schema.sql. PostgreSQL has the same tables in the secrets schema.
Signed objects
A log entry changes access. Its signature covers the JCS form of the entry, and its hash links to the previous entry.
{
"project_id": "prj_…", "seq": 12, "prev_hash": "…",
"type": "member_add",
"body": { "user_id": "usr_…", "identity_fpr": "…", "role": "writer" },
"author": "usr_…", "created_at": "2026-11-23T20:14:00Z", "sig": "…"
}
| Entry type | Changes | Author |
|---|---|---|
genesis | Creates the project and binds its ID to the creator | Any user |
member_add, member_role, member_remove | Members and roles | Owner; a member may remove itself |
member_rekey | A member’s identity key | The member, signed with the old key |
env_create, env_rename, env_delete | Environments | Owner |
device_grant, device_ungrant | Machine access to one environment | Owner |
rotate | A new epoch, with the key commitment | Owner |
project_rename | The project name | Owner |
A record is one version of one secret. The name and the value are encrypted separately, so a client can list names without downloading values.
| Field | Readable by the server | Purpose |
|---|---|---|
project_id, env_id, secret_id, version, epoch | Yes | Where the record belongs and which key opens it |
name_hmac | Yes, as a hash | Finds a secret by name without revealing the name |
name_nonce, name_ciphertext | No | The encrypted name |
nonce, ciphertext | No | The encrypted value; empty for a delete |
log_seq | Yes | The log head the writer verified; fixes the writer’s role |
prev_record_hash | Yes | Chains the versions of one secret |
writer, created_at, sig | Yes | Who wrote it, when, and the signature |
Types in the server
| Type | Holds | Created by |
|---|---|---|
Principal | A user or a device, as the actor or recipient of something | The HTTP layer, from auth-chad’s proof |
Caller | auth-chad’s Authenticated proof and the client address | secrets-server-http, per request |
Actor | The principal, its device and its address, for the audit log | App, from a Caller |
Commit | One project’s change: entries, wraps, records, access changes, rotations, audit rows | A use case in App |
Batch | One transaction: project commits, auth-chad writes, a profile, device envelopes, rotation marks | A use case, or an auth-chad hook |
Wrap | An environment key sealed to one principal | Clients; checked by policy |
Profile | Display name, fingerprint, admin flag | Signup |
AuditEvent | One audit row | App |
ProjectStore::commit stores a whole Batch, or nothing. A signup, a device approval or a rotation is therefore one
transaction across auth-chad’s tables and this application’s tables.
Local state of the CLI
| File | Contents |
|---|---|
$XDG_CONFIG_HOME/secrets-chad/config.toml | Default host; per host, the issuer and the device ID |
…/state/<issuer-hash>/pins.json | Pinned fingerprints, verified log heads, highest seen versions |
…/devices/<device-id>.key | The device key, mode 0600 in a 0700 folder |
.secrets.toml in a project | Host, project ID, environment ID, required names. No secret; commit it |
The CLI keeps no copy of secret values or environment keys on disk.
Where the details are
- Records, names and values: spec §5.6 and
crates/core/src/record.rs. - Log entries: spec §6 and
crates/core/src/log.rs. - Storage requirements and both backends: spec §14.2.
- The audit log: spec §10.3.