[vault] Identity: restore from the 24 words, revocation signing for revoked keys only, the backup secret (docs/IDENTITY.md; v0.10.0)
This commit is contained in:
+34
-5
@@ -2,7 +2,7 @@
|
||||
|
||||
Every Domi app gets its own subkey, certified by **one root Ed25519 key per person**. The root key lives in
|
||||
the vault and never leaves it: no function of this crate returns it, and the vault signs nothing with it but
|
||||
subkey certificates. The certificate format, the match code and verification are in Fundamentum
|
||||
subkey certificates and revocations of keys the person revoked. The certificate format, the match code and verification are in Fundamentum
|
||||
(`crates/tessera`, `docs/TESSERA.md`); this page is the vault side.
|
||||
|
||||
## Creating it: the order is mandatory
|
||||
@@ -31,6 +31,12 @@ is `Clone` or `Serialize`; each prints `[redacted]`.
|
||||
Test vector: entropy `00` × 32 → `abandon` × 23 + `art` → root public key
|
||||
`vCrwX9p44un1ftQLgJtuaVQ0qPWbFfzNjgrlDkL4TKs` (base64url). Fundamentum pins the same value.
|
||||
|
||||
### Restoring it from the 24 words (core 0.10.0)
|
||||
`Enrollment::restore(phrase)` takes the whole phrase, typed back, and gives a `Confirmed`: the person typed
|
||||
all 24 words, which proves more than three. The words are checked against the BIP39 English list and its
|
||||
checksum (any case, any spacing between them); anything else is `Error::NotAMnemonic`, which names no word.
|
||||
The same words give the same root, so every app and every group trusts it again.
|
||||
|
||||
## In the vault file
|
||||
|
||||
A body member next to `items` (docs/FORMAT.md, "Body"); old vaults without it open as before:
|
||||
@@ -42,13 +48,19 @@ A body member next to `items` (docs/FORMAT.md, "Body"); old vaults without it op
|
||||
"created": 1793000000000,
|
||||
"issued": [
|
||||
{ "kind": "app", "app_id": "fiscus", "purpose": "sync", "subkey": "<base64url>", "label": "fiscus.exe",
|
||||
"not_before": 1793000000, "not_after": 1824536000, "issued": 1793000000000 }
|
||||
"not_before": 1793000000, "not_after": 1824536000, "issued": 1793000000000,
|
||||
"revoked_at": 1795000000, "revocation": ["<base64url TRV1>"] }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
- `issued` records each cert the vault signed, for *Domi identity → apps and devices*. It is a record, not
|
||||
a trust list: revocation is v1.1.
|
||||
a trust list.
|
||||
- `revoked_at` (Unix seconds, core 0.10.0) is set when the person revokes the key; `revocation` holds the
|
||||
signed statements once they exist. Both are left out until then. A renewed key has several certs: all of
|
||||
them are marked.
|
||||
- **A Custos older than core 0.10.0 drops `revoked_at` and `revocation` when it saves the vault**, so a
|
||||
revocation in progress would have to be started again.
|
||||
- **An older Custos drops the member when it saves the vault** (it ignores members it does not know). Every
|
||||
Custos that saves this vault must run core 0.7.0 or later. The mnemonic recovers the root either way.
|
||||
|
||||
@@ -59,9 +71,26 @@ A body member next to `items` (docs/FORMAT.md, "Body"); old vaults without it op
|
||||
| `Vault::domi_root_public()` | the root public key, if there is an identity |
|
||||
| `Vault::domi_sign_cert(tbs)` | Ed25519 over `"tessera cert v1\0" ‖ tbs`. Refuses a `tbs` that does not start with `TSC1` followed by this root's public key |
|
||||
| `Vault::domi_issued()`, `domi_record(issued)` | the record of issued certs |
|
||||
| `Vault::domi_mark_revoked(subkey, at)` | the person revoked this key: marks every cert of it, returns the time in effect (the first one, if it was marked before) |
|
||||
| `Vault::domi_sign_revocation(tbs)` | Ed25519 over `"tessera revoke v1\0" ‖ tbs`. Refuses a `tbs` that does not start with `TRV1`, this root's public key, a key marked revoked and that key's `revoked_at` |
|
||||
| `Vault::domi_record_revocation(subkey, statements)` | keeps the signed statements with the key's certs |
|
||||
| `Vault::domi_backup_secret(app_id)` | the app's backup secret (below) |
|
||||
|
||||
The prefix check means the vault is not a general signing oracle: whatever the app hands it, the result
|
||||
can only ever verify as a certificate naming this root.
|
||||
The prefix checks mean the vault is not a general signing oracle: whatever the app hands it, the result
|
||||
can only ever verify as a certificate naming this root, or as a revocation of a key the person revoked, at
|
||||
the time they did. The two domains differ, so neither can pass for the other. Statement format: Fundamentum
|
||||
docs/TESSERA.md §12.
|
||||
|
||||
### The backup secret (core 0.10.0)
|
||||
```
|
||||
backup secret = HKDF-SHA256(salt = "tessera backup v1", ikm = the root secret, info = app id)
|
||||
```
|
||||
Custos hands an app its own (Domi pipe `backup_key`, behind the app's namespace grant); the app seals its
|
||||
backup with it and names its backup mailbox from it (Fundamentum docs/TESSERA.md §12). It comes back from
|
||||
the 24 words alone. The caller passes a valid app id (a-z, 0-9, `-`). Test vector, shared with Fundamentum:
|
||||
the zero-entropy root, app `fiscus` → `HKDF-Expand(secret, "mailbox")` =
|
||||
`IygCOrh-ibO6-KY5AXQ9Prl2SyPWQIyZZ-anffcbMCU`, and XChaCha20-Poly1305 with
|
||||
`HKDF-Expand(secret, "seal")`, a zero nonce and empty input = `ci_JRbtsx5prR83KT9Y7LA` (the tag).
|
||||
|
||||
## What it does not protect
|
||||
|
||||
|
||||
Reference in New Issue
Block a user