Add a custom ephemeral key storage callback to the SDK - #1357
Open
ebma wants to merge 8 commits into
Open
Conversation
Integrations wanting encrypted or vault-backed ephemeral recovery storage previously had no hook: the secrets never crossed the public SDK surface, and storeEphemeralKeys: false silently disabled the backup entirely. The callback replaces the built-in file/localStorage persistence and keeps the fail-closed registration contract.
Sync README, ARCHITECTURE, and the ephemeral-accounts security spec with the new storeEphemeralKeysCallback: built-in storage stays local-only, a configured callback shifts destination custody to the integrator, and both paths keep the fail-closed registration contract.
The skill claimed integrators could set storeEphemeralKeys: false and persist the keys themselves, but the secrets never crossed the public SDK surface, so that flag alone just disabled the recovery backup. Point custom-storage integrations at storeEphemeralKeysCallback.
✅ Deploy Preview for vortexfi canceled.
|
✅ Deploy Preview for vortex-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vrtx-dashboard canceled.
|
Additive only: StoredEphemeralKey, StoreEphemeralKeysCallback, and the optional storeEphemeralKeysCallback config field. No existing surface changed, so live integrators are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SDK integrators could opt out of the built-in ephemeral key backup (
storeEphemeralKeys: false), but could not supply their own persistence: the secrets never cross the public SDK surface, so disabling the flag simply meant no recovery material at all. Clients wanting encrypted or vault-backed storage (KMS, HSM, backend DB) had no supported path.This adds an optional
storeEphemeralKeysCallbacktoVortexSdkConfig:StoredEphemeralKey[]:{ address, rampId, secret, type }) plus the ramp ID instead of using the built-in JSON-file/localStorage storage;storeEphemeralKeysthen has no effect.registerRamp, and a rejection aborts registration before ephemeral-owned transactions are signed.Changes
packages/sdk/src/types.ts— new publicStoredEphemeralKey/StoreEphemeralKeysCallbacktypes and the config fieldpackages/sdk/src/VortexSdk.ts—storeEphemeralsdispatches to the callback when configuredpackages/sdk/test/vortexSdk.storeEphemerals.test.ts— regression tests: callback payload + built-in storage skipped, precedence overstoreEphemeralKeys: false, rejection propagation (fail-closed), disabled storage stores nothingREADME.md(usage + example),ARCHITECTURE.mdcustody section,docs/security-spec/02-signing-keys/ephemeral-accounts.md(invariant 4 distinguishes local-only built-in storage from integrator-custodied callback destination).agents/skills/vortex-integration/SKILL.md— corrects a pre-existing wrong claim thatstoreEphemeralKeys: falseallowed self-managed persistenceTesting
bun run testinpackages/sdk: 62 tests pass, plus build, NodeNext consumer typecheck, and Node + browser dist smoke-loadsbun lint(ESLint) clean