Skip to content

feat(kyc-controller): persist and reuse idOS sessionClientPrivateKey - #10081

Closed
jiexi wants to merge 2 commits into
mainfrom
jl/kyc-controller-persist-sessionClientPublicKey
Closed

feat(kyc-controller): persist and reuse idOS sessionClientPrivateKey#10081
jiexi wants to merge 2 commits into
mainfrom
jl/kyc-controller-persist-sessionClientPublicKey

Conversation

@jiexi

@jiexi jiexi commented Sep 3, 2026

Copy link
Copy Markdown
Member

Explanation

idOS capability auth updating requires the sessionClientPrivateKey used at session creation to be known. This means it must be persisted for the lifetime of the session so that it can be reused later. This PR makes that change

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Persists a session-scoped cryptographic private key in controller state and changes UKYC session lifecycle teardown; mistakes could break authorization wrapping or leave stale keys attached to invalid sessions.

Overview
Adds idosSessionClientPrivateKey to KycController state so the per-session X25519 key used to wrap UKYC/idOS authorizations survives restarts and can be reused for later capability updates.

UKYC session creation now goes through #getOrCreateIdosSessionClientPrivateKey (reuse persisted key or generate once) instead of a fresh random key on every create; #clearUkycSession drops the key together with SumSub session state on reset(), consents-path failures, and related rewind paths. State metadata marks the field persisted and never logged; architecture docs are updated to match.

Tests cover cold-start reuse, stable key across session-create retries, and clearing when flows are reset or consents fail.

Reviewed by Cursor Bugbot for commit ba1b354. Bugbot is set up for automated code reviews on this repo. Configure here.

@jiexi
jiexi requested a review from a team as a code owner September 3, 2026 00:18
Signed-off-by: Sébastien Van Eyck <sebastien.vaneyck@consensys.net>
@jiexi

jiexi commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

@jiexi jiexi closed this Sep 3, 2026
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.

2 participants