Skip to main content
Wallets created with createWalletPreGen() require the stored userShare and an MPC ceremony every time you sign. After migration, signing only needs a wallet ID and your API key.

SDK pregen vs REST API wallets

Both wallet types use the same database and MPC infrastructure. The difference is where the user’s key share lives.

What happens during migration

  1. The SDK encrypts your userShare with the enclave’s P-256 public key (ECIES). The plaintext never leaves your server.
  2. The encrypted payload is sent to Para’s backend, which forwards it to the hardware-isolated enclave for decryption and storage.
  3. The wallet becomes eligible for REST API signing and appears in GET /v1/wallets?status=ready queries.
Migration is additive — you’re adding REST API access, not replacing SDK signing. After verifying migration, you can optionally delete the stored userShare values from your database if you no longer need SDK-based signing.
Only unclaimed pregen wallets can be migrated. Once a user signs up with the wallet’s pregen identifier, migration returns 403.
The server SDK handles encryption for you.
This method fetches the enclave’s public key, encrypts the share with ECIES-P256-AES256-SHA256, and sends the encrypted payload to POST /v1/wallets/{walletId}/migrate-share. EVM and Cosmos wallets use the DKLS scheme (the default). Pass 'ED25519' for Solana or Stellar wallets.

Migrate with the REST API directly

If you’re not using the SDK, you’ll need to encrypt the share yourself before calling the endpoint.

Fetch the enclave public key

Response:

Encrypt the share

Implement ECIES encryption with the P-256 curve:
  1. Generate an ephemeral P-256 key pair
  2. Run ECDH with the enclave’s public key to derive a shared secret
  3. SHA-256 hash the shared secret to produce the AES key
  4. Encrypt the share data with AES-256-GCM using a random 12-byte IV
  5. Prepend the IV to the ciphertext (which includes the GCM auth tag), then base64-encode the result into encryptedData
The plaintext you encrypt is a JSON string:
The signer field is the raw signer secret extracted from the userShare string. The userShare is a series of base64-encoded JSON segments joined by -. Parse each segment, find the one whose id matches your wallet ID, and use its signer field. Set userId to the wallet ID. Pregen wallets don’t have a user ID, but the enclave schema requires a non-empty value — the wallet ID is used as a placeholder and is ignored during signing.
Getting ECIES-P256 right is tricky. Use the SDK method unless you have a specific reason not to.

Send the encrypted payload

The encryptedPayload value is a JSON string, not a nested object. Stringify your ECIES envelope before embedding it in the request body.
Maximum payload size is 64KB. Returns the updated wallet object on success.

Step-by-step migration

1

Stop creating SDK pregen wallets

For new wallets, switch to the REST SDK or REST API. Replace createWalletPreGen() calls with para.createWallet() from @getpara/rest-sdk, or call POST /v1/wallets directly. Wallets created via REST are already ready for signing — no migration needed.
2

Export existing user shares

Gather the userShare values you stored when you created each SDK pregen wallet. You need the walletId and its corresponding userShare for every wallet you want to migrate.
3

Migrate existing wallets

4

Verify migration

Migrated wallets appear in ?status=ready results:
5

Sign via REST API

No userShare or MPC ceremony needed:

SDK method to REST endpoint mapping

FAQ

Yes. The wallet works with both the SDK and the REST API after migration.
No. Once the share is persisted to the enclave, it can’t be removed. The wallet remains usable through both the SDK and REST API.
No. The endpoint returns 409 Conflict. The migration loop above handles this by catching 409s and skipping.
No. Migration only works on unclaimed pregen wallets — it returns 403 once a user has claimed the wallet.
Standard rate limits apply. See Setup - Rate limits for details.
Only if you’re not using the SDK. para.migrateWalletShare() handles ECIES encryption for you.

Next steps