Skip to main content
The solData criterion provides advanced validation of Solana transaction instruction data using Interface Definition Language (IDL) specifications. It decodes and validates instruction parameters against specific rules before signing, and applies to API key authentication wallets only. For general policy setup, see the Policy Engine Overview. For common Solana policy patterns, see Solana Policies.

How solData works

A solData criterion specifies which Solana programs to validate via the idls field, then defines instruction-level validation rules via the conditions field. The idls field accepts either:

IDL specifications

Anchor IDL format

IDL specifications must follow Anchor’s IDL format v0.30+. To convert older formats:

Supported argument types

Primitive types supported: bool, string, pubkey, u8u256, i8i256, f32, f64. Complex types (user-defined types, arrays, vectors, optionals) are not currently supported. Reach out on CDP Discord if you need them.

Instruction discriminators

Discriminators are unique byte sequences that identify instructions within a program:

IDL configuration

Known program shortcuts

Use predefined names for common programs instead of providing full IDL objects:
  • "SystemProgram" — Native Solana system program
  • "TokenProgram" — SPL Token program
  • "AssociatedTokenProgram" — Associated Token Account program

Custom IDL objects

For custom programs, provide IDL objects with:
  • address — The program’s public key
  • instructions — Array of instruction definitions, each with name, discriminator, and args

Conditions

Evaluation logic

  • Multiple conditions in a solData criterion are evaluated with OR logic — any matching condition passes
  • Parameters within a condition are evaluated with AND logic — all must match

Condition structure

Each condition includes:
  • instruction — Name matching an instruction in one of the provided IDLs
  • params (optional) — Array of parameter validations, each with name, operator (==, <=, >=, <, >, !=, in, not in), and value or values

Examples

Using known program shortcuts

Using custom IDL objects

For TypeScript projects using custom Anchor programs, the @coral-xyz/anchor SDK provides type-safe instruction builders and IDL utilities that simplify constructing properly formatted transactions.

Ecosystem program examples

The solData criterion works with any Solana program. Common use cases by category:

Key considerations

  • Always use Anchor IDL format v0.30+
  • Discriminator bytes must exactly match the program’s instruction identifiers
  • Convert older IDL formats with anchor idl convert before use