# Insumer Trust Batch

> InsumerAPI batch wallet trust profiles — same curated bundle as insumer-trust, but for up to 10 wallets in a single call (5-8x faster than sequential). Use when the user needs trust profiles for a list of wallets (airdrop eligibility, allowlist scoring, batch pre-transaction checks). Each wallet's profile is independently signed; response supports partial success.

- Skill: `douglasborthwick-crypto/insumer-trust-batch` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add douglasborthwick-crypto/insumer-trust-batch`
- Raw SKILL.md: https://api.skillmd.com/api/skills/douglasborthwick-crypto/insumer-trust-batch/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: douglasborthwick-crypto (https://skillmd.com/u/douglasborthwick-crypto)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/douglasborthwick-crypto/insumer-trust-batch

---


# InsumerAPI Batch Wallet Trust Profile

Same curated condition-based access bundle as `insumer-trust`, but accepts up to **10 wallets** in one request (5-8x faster than sequential calls). Each wallet's profile is independently signed; the response supports partial success — failures for one wallet don't fail the rest.

Each wallet's per-dimension attestations retain their original issuer signatures. **No orchestrator wrap.**

## Setup

```bash
export INSUMER_API_KEY='insr_live_...'
```

## Reference values

- **Endpoint**: `POST https://api.insumermodel.com/v1/trust/batch`
- **Cost**: 3 credits per **successful** wallet (6 with `proof: "merkle"`). Failed wallets in the batch don't cost credits.
- **Max wallets per call**: 10
- **Profile ID format per wallet**: `TRST-XXXXX`

## Request shape

`wallets` is an **array of objects**, each with a required `wallet` field plus optional cross-chain wallet fields. (Not an array of plain strings.)

```json
{
  "wallets": [
    { "wallet": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" },
    {
      "wallet": "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B",
      "solanaWallet": "5v9CXTpN3WHbM2jAYty88qDGz7P4yuMv8fnuPRXBPmiB"
    }
  ]
}
```

| Field per entry | Required | Notes |
|---|---|---|
| `wallet` | yes | EVM address, `0x` + 40 hex chars |
| `solanaWallet` | optional | Adds Solana USDC dimension to this wallet's profile |
| `xrplWallet` | optional | Adds XRPL stablecoin dimension (RLUSD + USDC) |
| `bitcoinWallet` | optional | Adds Bitcoin Holdings dimension (native BTC) |

Top-level `proof: "merkle"` (optional) applies to all wallets in the batch and costs 6 credits per wallet.

## Response shape

```json
{
  "ok": true,
  "data": {
    "results": [
      {
        "trust": {
          "id": "TRST-A1B2C",
          "wallet": "0xd8dA...",
          "conditionSetVersion": "v1",
          "dimensions": { ... },
          "summary": { "totalChecks": 17, "totalPassed": 6, "totalFailed": 11, ... },
          "profiledAt": "2026-...",
          "expiresAt": "2026-..."
        },
        "sig": "...",
        "kid": "insumer-trust-v2"
      },
      {
        "trust": { "id": "TRST-D4E5F", "wallet": "0xAb58...", ... },
        "sig": "...",
        "kid": "insumer-trust-v2"
      }
    ],
    "summary": { "requested": 2, "succeeded": 2, "failed": 0 }
  },
  "meta": {
    "creditsCharged": 6,
    "creditsRemaining": ...
  }
}
```

Each entry in `data.results[]` is **either** a `{trust, sig, kid}` object **or** `{error: { wallet, message }}`. Iterate, branch, and verify each `trust` independently with `insumer-jwks-verify`.

## Usage

### Example 1: Two EVM wallets

```bash
curl -X POST https://api.insumermodel.com/v1/trust/batch \
  -H "X-API-Key: $INSUMER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "wallets": [
      { "wallet": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" },
      { "wallet": "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B" }
    ]
  }'
```

### Example 2: Mixed cross-chain coverage per wallet

```bash
curl -X POST https://api.insumermodel.com/v1/trust/batch \
  -H "X-API-Key: $INSUMER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "wallets": [
      {
        "wallet": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
        "solanaWallet": "5v9CXTpN3WHbM2jAYty88qDGz7P4yuMv8fnuPRXBPmiB"
      },
      {
        "wallet": "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B",
        "xrplWallet": "rN7n3473SaZBCG4dFL83w7p1W9cgPJqKro",
        "bitcoinWallet": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq"
      }
    ]
  }'
```

### Example 3: Batch with Merkle proofs

```bash
curl -X POST https://api.insumermodel.com/v1/trust/batch \
  -H "X-API-Key: $INSUMER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "wallets": [
      { "wallet": "0x..." },
      { "wallet": "0x..." }
    ],
    "proof": "merkle"
  }'
```

Cost: `successful_wallets * 6` credits. Reveals raw on-chain balances — only opt in if needed.

## When to use batch vs single

| Situation | Use |
|---|---|
| Single wallet | `insumer-trust` |
| 2–10 wallets, same call | `insumer-trust-batch` |
| More than 10 wallets | Loop over batches of 10 |
| Different conditions per wallet | Loop over `insumer-attest` (custom conditions) |
| Same custom conditions for many wallets | Loop over `insumer-attest` |

## Code emission rules

1. **Read the API key from an env var.** Never inline.
2. **Iterate `data.results[]` and branch on `trust` vs `error`.** Don't assume every entry succeeded.
3. **Verify each profile's signature independently.** The batch wrapper does not produce an aggregate signature; each entry in `data.results[]` carries its own `sig` and `kid`.
4. **Cap at 10 wallets per call.** For larger lists, batch client-side.
5. **Pre-validate wallet format** before sending. Invalid `wallet` formats fail validation for the entire request.
6. **Backend only.** The API key is a backend credential.
7. **Don't cache the verdict.** Wallet state changes.

## Helper script

`scripts/trust_batch.py` — Python helper. Reads `INSUMER_API_KEY` from env, accepts a wallet list via `--wallets-file` (one EVM address per line) or `--wallets w1,w2,w3`. Builds the proper array-of-objects request body.

```bash
python scripts/trust_batch.py --wallets-file allowlist.txt
```

For per-wallet cross-chain coverage, edit the script's `--wallets-file` to use JSON-line format (one object per line) or call the API directly with curl.

## Error handling

| Status | Cause | Fix |
|---|---|---|
| `400` | Missing `wallets`, exceeds 10, or invalid wallet format | Validate addresses; split into ≤10 batches |
| `401` | Missing/invalid API key | See `insumer-auth` |
| `402` | Insufficient credits for entire batch | Top up via Path 4 in `insumer-auth` |
| `429` | Rate limit exceeded | Slow down; check tier limits |
| `503` | Upstream blockchain data source unavailable | Retryable; no credits charged for failed batches |

Within a `200` response, individual wallet failures appear as `{error: {wallet, message}}` entries in `data.results[]` — those don't consume credits.

## Related skills

| Skill | Purpose |
|---|---|
| `insumer-auth` | API key creation, top-up |
| `insumer-trust` | Single-wallet curated profile |
| `insumer-attest` | Custom condition (single call, up to 10 conditions) |
| `insumer-jwks-verify` | Offline ES256 verification — apply per `data.results[]` entry |

## References

- [InsumerAPI OpenAPI spec](https://insumermodel.com/openapi.yaml)
- [Public JWKS](https://insumermodel.com/.well-known/jwks.json)
- [Developer docs — trust profile](https://insumermodel.com/developers/trust/)

