Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.b402.ai/llms.txt

Use this file to discover all available pages before exploring further.

POST /wallet/incognito/verify builds an unsigned ERC-4337 UserOperation for an incognito (privacy) operation using the b402 privacy pool. Shield operations deposit tokens into the privacy pool. Unshield operations withdraw tokens from the privacy pool back to a visible address.
POST /wallet/incognito/verify

Request Body

FieldTypeRequiredDescription
walletAddressstringYesNexus smart wallet address
incognitoDataobjectYesPrivacy pool operation parameters
incognitoData.typestringYes"shield" (deposit into privacy pool) or "unshield" (withdraw from privacy pool)
incognitoData.*variousYesAdditional privacy-pool-specific parameters for the operation
paymentRequirementsobjectYesPayment configuration
paymentRequirements.networkstringYesTarget network ("bsc" or "base")
Shield moves tokens from your visible wallet into the b402 privacy pool, making them untraceable. Unshield withdraws tokens from the privacy pool back to a visible address.

Response

200 - Unsigned UserOp

FieldTypeDescription
isValidbooleanWhether the incognito operation can proceed
userOpobjectUnsigned ERC-4337 UserOperation ready for client signing
userOpHashstringHash of the UserOp that the client must sign
feeAmountstringFacilitator fee in token wei

Error Responses

StatusCodeDescription
400validation_errorMissing or invalid fields, unsupported incognito type
400validation_errorWallet not deployed or insufficient balance
500blockchain_errorFailed to read on-chain state or estimate gas

What Happens Server-Side

  1. Validates wallet - Confirms a deployed contract exists at walletAddress
  2. Parses incognito data - Reads privacy pool parameters and determines shield/unshield flow
  3. Builds UserOp - Encodes the privacy pool interaction into callData with fee injection
  4. Estimates gas - Calls the ERC-4337 bundler to estimate gas limits
  5. Signs paymaster data - The paymaster authorizes gas sponsorship
  6. Returns unsigned UserOp - Client signs userOpHash and submits via /wallet/incognito/settle

Examples

cURL

curl -X POST https://facilitatorv3.b402.ai/wallet/incognito/verify \
  -H "Content-Type: application/json" \
  -d '{
    "walletAddress": "0x...nexus_smart_wallet",
    "incognitoData": {
      "type": "shield",
      "token": "0x55d398326f99059fF775485246999027B3197955",
      "amount": "10000000000000000"
    },
    "paymentRequirements": {
      "network": "bsc"
    }
  }'

TypeScript

const response = await fetch('https://facilitatorv3.b402.ai/wallet/incognito/verify', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    walletAddress: '0x...nexus_smart_wallet',
    incognitoData: {
      type: 'shield',
      token: '0x55d398326f99059fF775485246999027B3197955',
      amount: '10000000000000000',
    },
    paymentRequirements: {
      network: 'bsc', // or 'base'
    },
  }),
});

const data = await response.json();

if (data.isValid) {
  console.log('Incognito UserOp built successfully');
  console.log('UserOp hash to sign:', data.userOpHash);
  console.log('Fee:', data.feeAmount);
  // Sign userOpHash and submit to /wallet/incognito/settle
} else {
  console.error('Verification failed');
}

Next Step

After receiving the response, sign the userOpHash with the wallet owner’s private key and submit the signed UserOp to POST /wallet/incognito/settle.