Self-custodial stablecoin wallets that plug into Grid payment flows
An Embedded Wallet is a self-custodial wallet Grid provisions for your customer that holds a stablecoin or BTC balance and participates in the standard Grid payment flows. It behaves like any other internal account for incoming funds, but every outbound transfer must be authorized by the customer — a session signing key issued for their device signs each payment.
Self-custody. Grid never has unilateral access to move funds. The customer’s device is the only party that can authorize a transaction.
Stablecoin-denominated. Balances are held as USDB. Use the standard /quotes API to convert in from fiat or out to any supported Grid bank-account rail (ACH, PIX, CLABE, UPI, IBAN, UMA, …).
Grid-native. You reuse the customer, internal-account, quote, transaction, and webhook primitives you already integrated for Payouts or P2P. The only thing that’s new is an auth + signing layer at the wallet.
Embedded Wallets ride on the same /quotes + /quotes/{id}/execute pattern as every other Grid payment. The only thing that’s different is that outbound transfers need a client signature.
Incoming funds. Funding a wallet works like any other internal account. Create a quote with the Embedded Wallet as the destination, execute it, and Grid converts the source currency into USDB and credits the wallet. No customer approval needed — incoming value is passive.
Outgoing funds. Withdrawals and transfers out require the customer to authorize them on their device. Grid returns a payloadToSign in the quote’s paymentInstructions; the client signs those bytes with its session signing key and passes the base64 signature as the Grid-Wallet-Signature header on /quotes/{id}/execute. Only then does Grid release the funds.
Sessions are short-lived (15 minutes by default) and bound to a specific device via the client key pair, so a stolen signature can’t be replayed from a different device or after the session expires. Standard transaction webhooks fire throughout the lifecycle — see Transaction lifecycle. The Quickstart below walks through an end-to-end withdrawal.
The customer’s device (browser, iOS app, or Android app). Generates the client key pair, runs WebAuthn, decrypts the session signing key, and signs outbound requests.
Integrator backend
Your server. Holds your Grid API credentials, brokers every call to Grid on behalf of the client, and issues WebAuthn challenges for initial passkey registration.
Grid
Verifies auth credentials, issues session signing keys (encrypted to the client’s public key), and enforces that every wallet action is authorized.
The client never talks to Grid directly. Every request flows client → integrator backend → Grid.
Auth credentials, client keys, and session signing keys
Three distinct pieces of crypto collaborate to authorize actions on the Embedded Wallet (withdrawals, credential changes, session revocations, and wallet exports):
Piece
Where it lives
How long it lives
What it proves
Auth credential — passkey, OIDC token, or email OTP
Registered on the wallet; the passkey itself lives on the authenticator, OIDC on your IdP, OTP in the user’s inbox
Until the customer revokes it
”I am the human who owns this wallet.” Used to authenticate the user at the start of each session.
Client key pair (P-256)
Generated on the client device for each verification request; private key stays in device-local secure storage
One verification request
Binds a given session signing key delivery to the exact device that asked for it — Grid encrypts the session to this public key, so only this device can decrypt.
Session signing key (P-256)
Issued by Grid, sealed to the client public key, decrypted and held on the device for the session’s lifetime
15 minutes (default)
“This specific wallet action was approved on an authenticated device.” Signs the payloadToSign Grid returns on quotes, credential changes, session revocations, and wallet exports.
The flow is always the same: verify an auth credential → receive a short-lived session signing key → sign payloadToSign bytes on the client → pass the signature as the Grid-Wallet-Signature header on the request that actually moves funds or changes account state. This applies to withdrawals, adding or removing credentials, revoking sessions, and exporting the wallet seed.See Client keys & signing for the full key-management and signing reference, and Authentication for the per-credential-type flows.
Customers who hold an Embedded Wallet must be KYC/KYB verified before any funds can move in or out. This quickstart picks up after KYC is complete.In sandbox, customers are automatically KYC approved on creation so you can skip straight to wallet setup.
You also need:
A platform configured with USDB in its supported currencies. In sandbox, USDB is enabled by default alongside USD and USDC.
Sandbox or production API credentials with access to the Embedded Wallet Auth and Internal Accounts endpoints.
The walkthrough below is the happy path: create a customer, find the auto-provisioned wallet, register a passkey, fund it, and withdraw to a bank account. Each step shows the HTTP request your integrator backend makes on behalf of the client.
Create the customer record. An Embedded Wallet is provisioned automatically whenever a customer is created on a platform that has USDB in its supported currencies — you don’t need to pass it on the customer.
Response:201 Created with the new Customer:... id. In sandbox, the customer is KYC-approved immediately; in production you would now run them through the KYC / KYB flow before any funds can move.
When a customer is created on a USDB-enabled platform, Grid automatically provisions an Embedded Wallet alongside their other internal accounts. Fetch it by filtering the customer’s internal accounts by type=EMBEDDED_WALLET.
curl -X GET "$GRID_BASE_URL/internal-accounts?customerId=Customer:019542f5-b3e7-1d02-0000-000000000001&type=EMBEDDED_WALLET" \ -u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET"
Embedded Wallets support three authentication credential types: passkey, OAuth (OIDC), and email OTP. A passkey is a user-friendly default: biometric, phishing-resistant, and usable across the user’s devices.Registration only binds the passkey to the wallet — it doesn’t issue a session. Sessions are created on-demand, when the customer initiates an action that needs a signature (step 7). The full flow with sequence diagram is documented in Authentication; the condensed version:
1
Your backend issues a WebAuthn challenge
Generate a random base64url challenge, store it short-lived in your session store, and return it to the client.
Grid verifies the attestation and replies 201 with the new AuthMethod:... id plus the first-authentication challenge, requestId, and expiresAt. Persist the auth method id against the customer — you’ll pass it to /challenge and /verify whenever the customer needs to sign.
The passkey is now bound to the wallet. You’ll use it to authorize the withdrawal in step 7.
Embedded Wallets behave like any other internal account on the way in — incoming funds do not need the customer’s signature. In sandbox, use the sandbox funding endpoint to skip straight to a funded state:
You will receive an INCOMING_PAYMENT webhook when the balance updates. The wallet now holds 1,000.00 USDB.
To fund from another currency (USD ACH, USDC on-chain, etc.), create a quote with destination.destinationType: "ACCOUNT" pointing at the Embedded Wallet’s InternalAccount id. The quote’s sourceCurrency can be any supported platform currency; Grid will convert into USDB on execute.
Create a quote with the Embedded Wallet as the source. Grid returns a payloadToSign in the quote’s payment instructions — this is what the client will sign to authorize the transfer.
The customer has an outstanding quote with a payloadToSign. Now we need a session signing key to sign it with — this is when the passkey actually gets used. The flow is challenge → assertion → verify → decrypt → sign.
1
Your backend requests a fresh challenge
curl -X POST "$GRID_BASE_URL/auth/credentials/AuthMethod:019542f5-b3e7-1d02-0000-000000000001/challenge" \ -u "$GRID_CLIENT_ID:$GRID_CLIENT_SECRET"
Return encryptedSessionSigningKey and expiresAt to the client.
4
Client decrypts the session signing key and signs the payload
The client decryptsencryptedSessionSigningKey with the matching client private key, then signs the quote’s payloadToSign with the resulting session signing key. Return the base64 signature to your backend.
Sign the payloadToSign bytes exactly as Grid returned them. Do not parse, re-serialize, trim, or normalize the JSON — the signature must cover the same bytes Grid’s verifier hashes.
The session signing key is now valid for 15 minutes, so subsequent wallet actions within that window (for example, a second withdrawal) can reuse it without another /challenge + /verify round-trip.