Skip to content

feat(guest-agent): select key epochs in v0 GetKey - #1630

Merged
kvinwang merged 3 commits into
nextfrom
feat/v0-getkey-epochs
Nov 20, 2026
Merged

kvinwang merged 3 commits into
nextfrom
feat/v0-getkey-epochs

Conversation

@kvinwang

@kvinwang kvinwang commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

v0 GetKey always derives from the CVM's current app root key. After a KMS root key rotation or an app epoch advance, every v0 key (including the Sign key at path vms) silently changes, and there is no way to reach the old one: v0 has no epoch selector, and v1's GetKey epochs derive under a different KDF, so they never return the old v0 key. v0 apps holding assets under a key have no migration path.

Fix

  • GetKeyArgs gains optional uint32 root_epoch = 4 / app_epoch = 5. Unset keeps today's behaviour (current epochs). Older epochs are fetched from the KMS through the same app_root path v1 uses.
  • GetKeyResponse reports root_epoch = 3 / app_epoch = 4, so clients can detect an older agent that ignored the selectors.
  • This is a sanctioned exception to the v0 freeze. The proto comment, docs/guest-api-v0.md and the pinned frozen_surface digests are updated. Tappd.DeriveK256Key shares GetKeyArgs and honours the selectors too.
  • The Rust, Go, Python and JS v0 clients expose the selectors and fail when a requested epoch is missing from or differs in the response.

Backport: #1631

Signed-off-by: Kevin Wang <wy721@qq.com>
Signed-off-by: Kevin Wang <wy721@qq.com>
@kvinwang
kvinwang merged commit dceb1c8 into next Nov 20, 2026
18 checks passed
@kvinwang
kvinwang deleted the feat/v0-getkey-epochs branch November 20, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant