setPassword
Sets the password used for the Password backup method. This method configures the password that will be used to encrypt and decrypt wallet backups using password-based key derivation.
Function Signature
Parameters
value
: The password string used to generate a key for backup encryption/decryption via password-based key derivation. This should be a secure password that the user can reliably remember or safely store.
Throws
MpcError.backupMethodNotRegistered
if the Password backup method has not been registered usingregisterBackupMethod
Notes
Must be called before using the
.Password
backup method for wallet backup or recovery operationsThe password should be securely stored or provided by the user when needed
Should be used in conjunction with registering the Password backup method
Example Usage
Security Best Practices
Use strong passwords that meet these criteria:
Minimum length of 12 characters
Mix of uppercase and lowercase letters
Include numbers and special characters
Avoid common patterns or personal information
Password Storage:
Never store the password in plain text
Consider using the iOS Keychain for secure storage
Implement appropriate password recovery mechanisms
User Experience:
Validate password strength during input
Provide clear feedback on password requirements
Consider implementing biometric authentication for accessing stored passwords
Implementation Flow
Register the Password backup method
Set the password using this method
Use the password for backup or recovery operations
Implement secure password storage and recovery
Related Documentation
For more information about password-based backup and security, see:
Last updated
Was this helpful?