Skip to content

feat(stack-kms-vendor): keyset records, derived data keys and the static key backend (CIP-5306) - #1647

Draft
freshtonic wants to merge 1 commit into
james/cip-5304-stack-kms-key-vendor-errorsfrom
james/cip-5306-keyset-records-and-derived-data-keys
Draft

freshtonic wants to merge 1 commit into
james/cip-5304-stack-kms-key-vendor-errorsfrom
james/cip-5306-keyset-records-and-derived-data-keys

Conversation

@freshtonic

@freshtonic freshtonic commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Layer 3 of the CIP-5203 stack. Implements CIP-5306 (ADR-0014).

  • New crate stack-kms-vendor, with the KeyVendorBackend trait (wrap, unwrap, sleep). Each vendor crate implements only this trait.
  • KeysetRecord is a versioned record, written as stack-keyset: + base64url, with create and rewrap.
  • Derived data keys: HKDF-SHA256 from the root key. The info binds the keyset id, the vendor and the key mode. The root key is cached for a TTL (default 5 minutes).
  • KeyRouter holds ZeroKMS and at most one vendor, and routes by keyset.
  • The static key backend.
  • Also: retry (backoff on throttling), the VendorTransport trait, and a shared contract suite.
  • The crate docs hold the capability matrix of every key backend.

stack-encrypt does not change. Decisions are in docs/plans/2026-11-05-key-vendor-backends-decisions.md (CIP-5306 section).

Replaces #1625, which was closed.

…tic key backend (CIP-5306)

The vendor seam (wrap, unwrap), keyset records, the derived data key mode
with the root key TTL in the key source, the key router (ZeroKMS and at
most one vendor, by keyset id), the static key backend, the transport seam,
the shared credential cache, the contract suite and the fixture harness.
The vendor and mode bytes are bound into every derived key.
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

@changeset-bot

changeset-bot Bot commented Nov 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a2cee6b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Mutation testing (cargo-mutants, --in-diff, stack-auth + stack-encrypt)

No mutants were generated for the changed lines.

This branch has not been deployed

No deployments
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