Introduction
Recovery lets a designated guardian replace one role’s lost signer while preserving its permissions.- Use when: you want a backup authorization path before a user loses access to a key.
- For: apps offering guardian-based recovery on a compatible Swig deployment.
How it works
- While an administrator is available, give an independent guardian
ReplaceAuthorityfor the target role. - Record the guardian role ID and the protected role ID separately.
- If the target key is lost, have the guardian approve its replacement public key.
- Confirm the replacement and verify that the role retains its original permissions.
Recovery scope
ProgramExec authorities cannot be replacement targets. The guardian chooses the key that inherits the target’s access. If the target’s only key is lost while it has an active hold, recovery may need to wait for expiry.
SDK example
Assign the guardian
Use an Ed25519 administrator withAll or ManageAuthority to prepare this grant. Then sign and submit with the administrator and payer.
Replace an Ed25519 key
The replacement instruction is available in Rust’sswig-interface. Classic exposes the permission builder above but does not expose the replacement instruction builder.
- Confirm the wallet, target role ID, and new public key before the guardian signs.
- Refetch the wallet after confirmation and verify the replacement authority.
- A Secp256r1 target needs a new compressed P-256 key; a Secp256k1 target needs a matching Secp256k1 key.
- Reopen a session after replacing a session authority. Recovery adds no separate delay policy beyond the active-lock restriction.

