> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enso.build/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate an unsigned transaction against a prior simulation

> Validates that an unsigned transaction matches a previously simulated transaction. Compares each field (chainId, data, to, from, value) and returns per-field validation results. The `data` field is compared by hash to detect any calldata tampering.



## OpenAPI

````yaml /public/shield-openapi.json post /api/v1/validate
openapi: 3.1.0
info:
  title: Enso Shield API
  description: >-
    Transaction simulation and validation API. Simulate any EVM transaction to
    predict outputs and gas, then validate before signing to ensure integrity.
  contact:
    name: Enso Build
    url: https://enso.build
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://shield.api.enso.build
security:
  - bearerAuth: []
  - apiKeyQuery: []
tags:
  - name: shield
    description: Transaction simulation and validation endpoints
paths:
  /api/v1/validate:
    post:
      tags:
        - shield
      summary: Validate an unsigned transaction against a prior simulation
      description: >-
        Validates that an unsigned transaction matches a previously simulated
        transaction. Compares each field (chainId, data, to, from, value) and
        returns per-field validation results. The `data` field is compared by
        hash to detect any calldata tampering.
      operationId: validate_transaction
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateRequest'
        required: true
      responses:
        '200':
          description: Validation completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateResponse'
        '400':
          description: Bad request — invalid parameters or missing required fields
        '401':
          description: Unauthorized — missing or invalid API key
        '404':
          description: >-
            Simulation not found or expired (simulations are cached for 5
            minutes)
        '429':
          description: Rate limited — too many requests
        '500':
          description: Internal server error
components:
  schemas:
    ValidateRequest:
      type: object
      description: Request to validate an unsigned transaction against a prior simulation
      required:
        - simulationId
        - transaction
      properties:
        simulationId:
          type: string
          format: uuid
          description: Simulation ID from a prior /simulate call
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        transaction:
          $ref: '#/components/schemas/UnsignedTransactionDto'
          description: The unsigned transaction to validate
    ValidateResponse:
      type: object
      description: Response from the validate endpoint
      required:
        - valid
        - simulationId
        - checks
      properties:
        valid:
          type: boolean
          description: >-
            Whether all validation checks passed. Only true when every
            individual check is true.
          example: true
        simulationId:
          type: string
          format: uuid
          description: The simulation ID that was validated against
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        checks:
          $ref: '#/components/schemas/ValidationChecks'
          description: Per-field validation results showing which fields matched
    UnsignedTransactionDto:
      type: object
      description: Unsigned transaction to validate against a prior simulation
      required:
        - data
        - to
        - from
        - value
        - chainId
      properties:
        data:
          type: string
          description: Hex-encoded calldata
          example: >-
            0x3593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000066c5a817
        to:
          type: string
          description: Target contract address
          example: '0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E'
        from:
          type: string
          description: Sender address
          example: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
        value:
          type: string
          description: Value in wei (decimal string)
          example: '1000000000000000000'
        chainId:
          type: integer
          format: int64
          description: Chain ID
          example: 1
    ValidationChecks:
      type: object
      description: Per-field validation results
      required:
        - chainId
        - data
        - to
        - value
        - from
      properties:
        chainId:
          type: boolean
          description: Whether the chain ID matches the simulation
        data:
          type: boolean
          description: Whether the calldata hash matches the simulation (detects tampering)
        to:
          type: boolean
          description: Whether the target contract address matches
        value:
          type: boolean
          description: Whether the native token value matches
        from:
          type: boolean
          description: Whether the sender address matches
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Enso API key passed as Bearer token in Authorization header
    apiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: Enso API key passed as query parameter

````