Skip to content

feat: add a KRS backup-provider option to safe creation - #10318

Draft
davidkaplanbitgo wants to merge 1 commit into
masterfrom
davidkaplan/wcn-3884-backup-key-provider-option
Draft

davidkaplanbitgo wants to merge 1 commit into
masterfrom
davidkaplan/wcn-3884-backup-key-provider-option

Conversation

@davidkaplanbitgo

Copy link
Copy Markdown
Contributor

Ticket: WCN-3884

Lets a safe be created with its multisig backup roots held by a KRS provider instead of generated locally (today) or supplied by the caller (BYOK).

What

  • CreateSafeOptions.backupKeyProvider: { provider: 'coincover'; slots?: MultisigRootKeyType[] }, mutually exclusive with multisigRoots.
    • slots defaults to both multisig slots: the wire contract needs a non-empty externalBackupSlots alongside backupKeyProvider, and the enabled slots are only known after initialize, so the server's echo stays authoritative.
  • initializeSafe sends externalBackupSlots + backupKeyProvider.
  • createSafeKeys generates no local backup for a provider-held slot and registers the provider root in the existing register-last phase via keychains.createBackup({ provider, safeId }), with bounded 5xx retries (provider roots are scoped to provider + safe, so a retry cannot mint a second root) before the archive-on-failure path.
  • Express POST …/safes/generate and …/safes/{safeId}/keys/generate accept and forward the option.

Review notes

  • Self-generated and BYOK paths are unchanged; the existing tests for them are untouched and the new cases assert the option validation, slot defaulting, retry and archive behaviour.
  • Nothing was built or run locally; first signal is CI.

@linear-code

linear-code Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

WCN-3884

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Compatibility checks are failing on Node.js 27-nightly (experimental, non-blocking). This does not block merge, but it signals an incompatibility to fix before this release becomes supported.

View run

@davidkaplanbitgo
davidkaplanbitgo force-pushed the davidkaplan/wcn-3884-backup-key-provider-option branch from de68b97 to 8c251d1 Compare December 4, 2026 17:45
A safe's multisig backup roots can be held by a KRS provider instead of being
generated locally or supplied by the caller.

- CreateSafeOptions.backupKeyProvider ({ provider, slots }) is mutually
  exclusive with multisigRoots. Slots default to both multisig slots and the
  server rejects one the safe does not enable.
- initializeSafe sends externalBackupSlots plus backupKeyProvider.
- createSafeKeys generates no local backup for a provider-held slot and
  registers the provider root last through keychains.createBackup, with bounded
  5xx retries before the archive-on-failure path.
- Express generate and keys/generate accept and forward the option.

Ticket: WCN-3884
@davidkaplanbitgo
davidkaplanbitgo force-pushed the davidkaplan/wcn-3884-backup-key-provider-option branch from 8c251d1 to b1dce83 Compare December 4, 2026 17:53

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