SEP30RecoveryService class
Implements SEP-0030 v0.8.1 - Account Recovery: multi-party recovery of Stellar accounts.
Provides a secure mechanism for account recovery using multiple identity providers. This service allows users to recover access to their Stellar accounts through a multi-party authentication process, eliminating single points of failure.
Recovery workflow:
- Register account with multiple identity providers (owners/signers)
- User authenticates with identity providers to prove ownership
- Recovery service verifies authentication from sufficient parties
- Service provides signatures for recovery transaction
- User rebuilds account access with recovered keys
Identity roles:
- Owner: Can sign transactions and modify account identities
- Other: Can only sign transactions (additional signers)
Authentication methods:
- Email verification
- Phone number verification
- Hardware security keys
- Biometric authentication
- Custom authentication methods
Protocol specification:
Example:
// Initialize service
SEP30RecoveryService recovery = SEP30RecoveryService(
"https://recovery.example.com"
);
// Register account with identities
SEP30AuthMethod email = SEP30AuthMethod("email", "user@example.com");
SEP30AuthMethod phone = SEP30AuthMethod("phone_number", "+1234567890");
SEP30RequestIdentity owner = SEP30RequestIdentity("owner", [email, phone]);
SEP30Request request = SEP30Request([owner]);
SEP30AccountResponse response = await recovery.registerAccount(
accountId,
request,
jwtToken
);
// Later: sign transaction for recovery
SEP30SignatureResponse signature = await recovery.signTransaction(
accountId,
signingAddress,
transactionXdr,
jwtToken
);
Security considerations:
- Use multiple independent identity providers
- Require authentication from multiple parties
- Store recovery configuration securely
- Regularly test recovery process
- Use SEP-0010 for JWT authentication
See also:
Constructors
-
SEP30RecoveryService(String _serviceAddress, {Client? httpClient, Map<
String, String> ? httpRequestHeaders}) - Creates a SEP30RecoveryService with explicit recovery server address.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- httpClient ↔ Client
-
getter/setter pair
-
httpRequestHeaders
↔ Map<
String, String> ? -
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
accountDetails(
String address, String jwt) → Future< SEP30AccountResponse> - Retrieves registered account details.
-
accounts(
String jwt, {String? after}) → Future< SEP30AccountsResponse> - Lists all accounts accessible with the JWT token.
-
deleteAccount(
String address, String jwt) → Future< SEP30AccountResponse> - Deletes account recovery registration.
-
errorFromResponseBody(
String body) → String - Parses error message from SEP-30 server response body.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerAccount(
String address, SEP30Request request, String jwt) → Future< SEP30AccountResponse> - Registers an account with the recovery service.
-
signTransaction(
String address, String signingAddress, String transaction, String jwt) → Future< SEP30SignatureResponse> - Signs a transaction using a recovery signer.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateIdentitiesForAccount(
String address, SEP30Request request, String jwt) → Future< SEP30AccountResponse> - Updates account recovery identities.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited