Portal-Managed Backups
Portal lets you securely back up your usersβ MPC wallets so they can recover their wallets even if their device is lost or damaged. By default, Portal encrypts and stores both backup shares (βPortal-Managed Backupsβ):- The client backup share is encrypted on the userβs device, with the encryption key stored using their chosen backup method (Google Drive, Password, Passkey, or Firebase Auth). The encrypted share is then stored by Portal.
- The custodian backup share is encrypted and stored by Portal, with the encryption key stored in our KMS infrastructure.
By default, Portal manages storing both the encrypted client backup share and the custodian backup share for you. If you prefer to store and manage the backup shares in your own infrastructure instead of using Portal-Managed Backups, see our Self-Managed Backups guide.
Backup Methods
You can choose one or more backup methods for storing the encryption key for the client backup share.Passkey + Enclave
Your Portal clients can create a passkey to authenticate and manage the private encryption key within a secure enclave.Implementation Requirements
- Initialize the
Portalclass with a passkey object. - Call backup with the Passkey backup method argument.
- Portal-Managed Backups (Default)
- Self-Managed Backups
Custom Domain Passkeys
By default, Portal handles passkey operations through our hosted domain (portalhq.io). If you want passkeys to be associated with your own domain (e.g., yourapp.com), you can configure a custom relying party.
Benefits of using your own domain:
- Passkey prompts display your domain name instead of Portalβs
- Users see a consistent brand experience
- Passkeys are portable across your applications that share the same relying party
Setup Requirements
To use your own domain for passkeys, youβll need to:- Configure DNS - Point your passkey subdomain (e.g.,
passkeys.yourapp.com) to Portalβs infrastructure - Provision a TLS certificate - Create a certificate for your subdomain that Portal will store in our secure enclave
- Configure CORS - Allowlist your application origins
Getting Started: Reach out to the Portal team for instructions on setting up a custom domain, including TLS certificate provisioning for our enclave.
Configuration
Once your custom domain is set up, configure your passkey options:Step 1: Create a Passkey
Create a passkey for your user. This can be done separately from the backup flow:Step 2: Create a Backup
Once a passkey exists, you can create a backup and store the encryption key with it:- Portal-Managed Backups
- Self-Managed Backups
Password/PIN
Your Portal clients can create a password/PIN. They can either remember the password or store it in a password storage manager.Implementation Requirements
- Create a UI for password input.
- Enforce password requirements. Customer can choose between password, PIN code, passcode, or any other text-based input.
- If the user forgets their password, there are no additional recovery options.
- Portal-Managed Backups
- Self-Managed Backups
Google Drive
See the docs on how to set up Google Drive.Firebase Auth Backup
Allow customers to use their existing Firebase Authentication to authenticate into a secure enclave that holds the encryption key for the user. The Portal Web SDK uses Firebase ID tokens to store and retrieve encryption keys from Portalβs token backup service (TBS). This is ideal if your web app already uses Firebase Auth β no additional authentication method is required from your users. See the Firebase Auth Backup setup guide for prerequisites and Firebase project configuration.Implementation requirements
- Integrate Firebase Authentication in your web app (for example with the Firebase JavaScript SDK).
- Call
portal.configureFirebaseStoragewith agetTokencallback that returns a Firebase ID token for the signed-in user, ornullwhen no user is signed in. - Run backup with
BackupMethods.firebaseonly after Firebase storage is configured and the user is signed in.
Unlike React Native, the Web SDK does not use a separate
@portal-hq/firebase-storage package. Firebase backup is built into @portal-hq/web via configureFirebaseStorage. Your app supplies Firebase Auth; the Portal iframe requests ID tokens from the parent page through a secure postMessage bridge.Configure Firebase storage
CallconfigureFirebaseStorage before backupWallet or recoverWallet with BackupMethods.firebase. You typically do this immediately before the backup or recovery flow, or once after the user signs in to Firebase.
portal instance and configureFirebaseForPortal helper from the Configure Firebase storage section above.
- Portal-Managed Backups
- Self-Managed Backups
Ensure the user is signed in to Firebase, configure storage, then run backup. With Portal-Managed Backups (the default), Portal stores the encrypted client backup share for you.