← Protocols
Blockaid
Security / Audit·EVM · Solana · Bitcoin · Multi-chain

Blockaid

01Description

Pre-signature transaction simulation, dApp scanning, and scam detection used by major wallets (MetaMask, Coinbase Wallet, Phantom). Scans EVM/Solana/Bitcoin/Stellar transactions, raw payloads, JSON-RPC requests, dApp URLs, and tokens for malicious behavior before signing.

02Best for
  • 01pre-signature transaction simulation
  • 02wallet/dApp scam warnings
  • 03malicious URL + dApp scanning
  • 04token + address reputation checks
  • 05MPC/multisig pre-execution validation
03Install
  • pnpm add @blockaid/client
04Environment variables
VariableScopeDescription
BLOCKAID_CLIENT_API_KEYServerBlockaid API key, sent in the `X-API-KEY` header. Use the `client` environment for browser/wallet UIs and `production` for backend scanning.
05Prompt snippet
Use Blockaid before any signature. Initialize `import Blockaid from '@blockaid/client'; const client = new Blockaid({ apiKey: process.env.BLOCKAID_CLIENT_API_KEY });`. EVM transaction scan: `client.evm.transaction.scan({ chain: 'ethereum', account_address, data: { from, to, value, data }, options: ['validation', 'simulation'] })` returns `validation.result_type` (`Benign|Warning|Malicious`), `validation.reason`, and `simulation.account_summary` with asset diffs. JSON-RPC scan: `client.evm.jsonRpc.scan({ chain, data: { method, params } })` for `eth_signTypedData_v4`/`personal_sign` payloads. Solana: `client.solana.message.scan({ network, account_address, transactions: [base64] })`. URL/dApp scan: `client.site.scan({ url })`. Token scan: `client.token.scan({ chain, address })`. Block on `Malicious`, surface a confirmation modal on `Warning`, allow on `Benign`.
06Gotchas
  • Blockaid is advisory, not authoritative — `Benign` does NOT mean safe; it means no known signal. Always combine with user-shown simulation diffs for critical actions like `setApprovalForAll` or unlimited allowances.
  • Scan latency is typically 200–800ms but can spike for novel contracts requiring just-in-time simulation; show a non-blocking spinner and time-out gracefully rather than freezing the signing UI.
  • False-positive rate on brand-new legitimate dApps is non-trivial (cold-start problem) — provide a 'proceed anyway' path with explicit warning copy instead of hard-blocking.
  • The `client` environment exposes the API key to the browser; rotate aggressively and scope rate limits per app — for sensitive flows proxy through your backend with the `production` environment instead.
  • Solana scanning expects base64-encoded serialized messages, NOT base58 transaction signatures — passing the wrong encoding silently returns `Benign`.
  • Coverage of long-tail chains (Aptos, Sui, Cosmos, Move) is partial; check the supported-chain matrix per product (transaction scan vs token scan vs dApp scan) before assuming parity.
07Alternatives