---
title: "Integrate Privy with BlindPay"
description: "Fund BlindPay stablecoin payouts from Privy Server Wallets: sign the registration challenge and the ERC-20 approve through Privy's wallet RPC endpoint."
date: "2026-08-26"
category: "integrations"
products: ["payouts", "quotes", "webhooks"]
---

Paste this prompt into your coding agent when your product holds customer funds in Privy wallets and those wallets need to fund BlindPay payouts.

## Prompt

```text
You are integrating BlindPay payouts funded from Privy Server Wallets into my application. The Privy wallet is the sender: it registers with BlindPay, approves the payout contract, and gets recorded as the sender_wallet_address on the payout.

Before writing code, read these sources and follow them over any prior knowledge:
- https://blindpay.com/docs/llms.txt (read the blockchain wallets page and the EVM payout guide)
- The OpenAPI spec: curl https://api.blindpay.com/doc
- https://docs.privy.io/guide/server-wallets/quickstart/api
- https://docs.privy.io/guide/server-wallets/usage/ethereum
- https://docs.privy.io/api-reference/wallets/rpc-intent
Confirm the exact Server Wallets RPC request/response shape and the privy-authorization-signature requirement against these pages before coding; do not invent endpoint names or parameters.

Build the flow:
1. Fetch the registration challenge (GET /v1/instances/{instance_id}/customers/{customer_id}/blockchain-wallets/sign-message), sign it with the Privy Server Wallet through POST https://api.privy.io/v1/wallets/{wallet_id}/rpc using method personal_sign, chain_type ethereum, and the challenge as the message, then submit the returned signature to POST /v1/instances/{instance_id}/customers/{customer_id}/blockchain-wallets and persist the returned bw_ ID against the customer record. Authenticate the Privy call with HTTP Basic app_id:app_secret plus the privy-app-id header, and add privy-authorization-signature when the wallet has an owner_id.
2. Request a quote: POST /v1/instances/{instance_id}/quotes with bank_account_id, network, and token. Store the response's contract object (address, abi, functionName "approve", blindpayContractAddress, amount, network, expires_at) exactly as returned for the approve step.
3. Build the approve calldata from the stored contract object and send it through the Privy wallet: POST https://api.privy.io/v1/wallets/{wallet_id}/rpc with method eth_sendTransaction, caip2 set to the quote's network, and a transaction object with to set to the contract address and data set to the encoded approve call. Store the returned hash and poll the chain RPC until the transaction confirms, since this Privy endpoint returns once the transaction is broadcast, not once it is confirmed.
4. Execute the payout before the quote's expires_at: POST /v1/instances/{instance_id}/payouts/evm with quote_id and sender_wallet_address set to the Privy wallet's address. If expires_at passes while waiting on approve confirmation, request a fresh quote and reuse the existing on-chain allowance when it already covers the new amount.
5. Verify each Svix-signed webhook (svix-id, svix-timestamp, svix-signature against whsec_) and update stored payout state on payout.new, payout.update, and payout.complete.
6. Run the full flow end to end on a development instance with USDB on base_sepolia: one payout that completes, one that hits the $666.00 sentinel to force failed, and one that hits the $777.00 sentinel to force refunded, confirming the webhook handler reaches the correct terminal state each time.

Constraints:
- Keep BlindPay and Privy API keys server-side; the Privy Server Wallet call is the only signer, there is no browser wallet in this flow.
- Store and compare all amounts as integer minor units; never use floating point for money math.
- Call the payout execute endpoint only after the approve transaction hash confirms on-chain.

Deliverables: wallet registration module (challenge fetch, Privy personal_sign call, bw_ persistence), quote-to-approve-to-execute orchestration with the expiry and reused-allowance logic handled, webhook handlers for all three payout events, and a passing development-instance test covering the completed, failed-sentinel, and refunded-sentinel cases.
```

## How to use

1. Confirm which Privy wallets in your system are owner_id-scoped (user-controlled) versus fully server-controlled; that decides whether privy-authorization-signature is required on every call.
2. Point the agent at your existing Privy Server Wallet client so it reuses your app_id/app_secret setup instead of writing a new one.
3. Run the base_sepolia test with real sentinel amounts before pointing the flow at a production instance.

## Related docs

- [Blockchain wallets](https://blindpay.com/docs/blockchain-wallets)
- [EVM payouts](https://blindpay.com/docs/payout-evm)
- [Privy Server Wallets quickstart](https://docs.privy.io/guide/server-wallets/quickstart/api)
- [Privy wallet RPC reference](https://docs.privy.io/api-reference/wallets/rpc-intent)
