Skip to main content
This page covers what Shield validates and how: the yields it has validators for, the checks it runs on each transaction type, local decoding, runtime options, and the error messages it returns. For installation and the core API, start with the Shield overview.

Validation coverage

Shield ships two kinds of validators: dedicated validators for specific yield integrations, and a generic ERC-4626 validator backed by an embedded vault whitelist.

Dedicated validators

Generic ERC-4626 validator

The ERC-4626 validator covers a whitelist of vaults across these protocols: Angle, Curve, Euler, Fluid, Gearbox, Idle Finance, Lista, Morpho, Sky, SummerFi, Venus-Flux, Yearn, and YO Protocol. The vault registry is embedded in the Shield package, so validation needs no network calls, and it grows as new vaults are added. Vault and chain counts change as coverage grows, so this page doesn’t freeze them. Query the current coverage live:
  • shield.getSupportedYieldIds() (or the CLI’s getSupportedYieldIds operation) returns every yield ID Shield can validate.
Additional checks applied to all types:
  • Calldata tamper detection (re-encode and byte-compare)
  • Receiver/owner must equal userAddress (or a declared args.receiverAddress)
  • Chain-scoped vault whitelist (chainId:address composite key)
  • Allocator vault (OAV) address whitelisting, additive on top of the base vault registry (see Shield integration)
These protocols require dedicated validators due to non-standard transaction flows:When you use the Shield library directly, these yields return { isValid: false }: fail-safe by default. When Shield runs server-side via the Yield API, unsupported yields are currently skipped (not blocked) to avoid disrupting yields that don’t yet have validators. See Defense Mode for the implications.
Solana DeFi protocol validators, Perps API transaction coverage, and additional EVM protocol support are in development. shield.getSupportedYieldIds() always returns the canonical list for your installed version.

Risk detection and tamper protection

Shield’s structural checks catch the attack classes that matter most in a transaction pipeline:
  • Fund redirection: the decoded receiver or owner in calldata must match the user’s address (or a declared custodial receiver).
  • Approval hijacking: an approve() spender must be a whitelisted vault; arbitrary spenders are rejected.
  • Calldata tampering: Shield re-encodes decoded EVM calldata and compares it byte-for-byte against the original, catching appended bytes, modified parameters, and corrupted data.
  • Contract impersonation: tx.to must be a whitelisted address, scoped to the correct chain ID.
  • Ambiguous patterns: a legitimate transaction must match exactly one known-safe pattern; multiple matches are rejected as a potential manipulation signal.
Structural validation checks that a transaction matches an expected pattern; it doesn’t execute or simulate the transaction. For that layer, see HyperNative, a separate partner integration in the yield.xyz security stack.

Local decoding and visualization

Shield decodes every transaction locally as part of validation: ABI decoding for EVM, instruction parsing for Solana, and TronWeb decoding for Tron. Decoding happens entirely on your own systems, with no external API calls. Each decoded transaction yields a typed view of what’s on the wire: the target contract or program address, the function being called, parameter and argument values, and the auto-detected transaction type (returned as detectedType in the validation result). This matters for more than security:
  • Transparency: confirm every on-chain call before a user signs.
  • Compliance: institutions can log decoded transaction details for audit trails or regulator review.
  • Zero trust: because decoding is local, you can verify transactions built by yield.xyz or by any external system without trusting the builder.

Transaction simulation

Shield validates structure and intent; it does not execute or simulate transactions. See HyperNative for what yield.xyz’s separate simulation partner integration covers.

Runtime support

Shield is implemented in TypeScript and distributed two ways: as the @yieldxyz/shield npm library, and as standalone binaries for Linux, macOS (ARM and Intel), and Windows that require no Node.js installation. The binary speaks a JSON protocol over stdin/stdout, which makes it embeddable from Go, Python, Rust, or any language that can spawn a subprocess, including restricted, compiled, and air-gapped environments where a Node.js runtime is unavailable. See Shield integration for downloads, checksum verification, and per-language guides.

Validation errors

A deposit(), mint(), withdraw() or redeem() call whose decoded amount is zero still validates (isValid: true) and carries a ZERO_AMOUNT flag in details, so your integration can warn the user separately. A zero amount usually means the requested amount rounded down to zero.To check amounts, pass the intended amount in args.amount (underlying, as a base-unit integer string) or args.shareAmount (shares). When declared, deposit, withdraw, approval and wrap amounts must match it; declaring both, or a non-integer value, fails validation. When neither is declared, amount checks are skipped.
See Shield releases for the current changelog.

Next steps

Shield integration

Library, binaries, and language guides

Defense Mode

Server-side enforcement inside the Yield API

HyperNative

Pre-signing simulation, as a separate partner integration

Security deployment options

Choose the right deployment model