POST returns a payloadToSign, and the signed retry returns the encrypted seed.
Generate a fresh P-256 client key pair specifically for the export. Send its clientPublicKey on both export requests, then decrypt encryptedWalletCredentials with the matching private key after the signed retry succeeds.
1
First call — receive the challenge
2
Client stamps the payload
Build a Grid wallet signature over
payloadToSign with an active session signing key on the account. Keep the export private key on the client; Grid will use the matching clientPublicKey from step 1 to seal the wallet credentials.3
Signed retry — receive the encrypted seed
200 here is only the encrypted seed if the body isn’t { "status": "PROCESSING" }. See handling a still-processing response — if you get PROCESSING, re-send the identical signed retry (same clientPublicKey, Grid-Wallet-Signature, and Request-Id) until you get the credentials. Because Grid never stores them, the re-send is the only way to receive them; subscribe to wallet_operation.completed to know when it will succeed. The Request-Id challenge is consumed only by the attempt that actually returns credentials, so a PROCESSING response leaves it usable.4
Decrypt on the client
encryptedWalletCredentials is a signed wallet export envelope, not the base58check session-bundle format used by encryptedSessionSigningKey. Parse the envelope, verify dataSignature against enclaveQuorumPublic, decode the hex data JSON to get encappedPublic and ciphertext, then decrypt with the export private key that matches the clientPublicKey you sent on both export requests.The plaintext is a BIP-39 mnemonic (the wallet’s master seed).