MonmouthMonmouth Docs

Validation Framework

Overview

The validation framework provides request-response capability verification at the protocol level. Before an agent is trusted to perform an action, it must prove it has the capability to do so.

This is not just permission checking — it's a structured protocol where validators can challenge agents to demonstrate competence.

How It Works

1. Agent requests capability (e.g., "I can execute swaps")
2. Validator issues a challenge
3. Agent responds with proof
4. Protocol records the validation result

Validation Types

Capability Validation

Verify that an agent can perform a specific operation:

// Request validation for swap capability
const validation = await agent.requestValidation({
  capability: 'swap',
  parameters: {
    maxValue: '10 ETH',
    supportedTokens: ['ETH', 'USDC', 'WETH'],
  },
})
 
console.log(validation.status) // 'validated' | 'pending' | 'rejected'

Identity Validation

Verify that an agent's identity claims are legitimate:

const validation = await agent.requestValidation({
  capability: 'identity',
  claims: {
    owner: '0x...',
    linkedAddresses: ['0x...'],
  },
})

Behavioral Validation

Verify that an agent behaves according to its stated policies:

const validation = await agent.requestValidation({
  capability: 'policy-compliance',
  policies: ['no-frontrunning', 'slippage-tolerance'],
})

Challenge-Response Protocol

Validators can issue challenges that agents must respond to:

// Validator side
const challenge = await validator.issueChallenge({
  agent: 'did:monmouth:agent:0x...',
  type: 'swap-execution',
  parameters: {
    token: 'ETH',
    amount: '0.01',
    expectedSlippage: '0.5%',
  },
})
 
// Agent side
const response = await agent.respondToChallenge({
  challengeId: challenge.id,
  proof: {
    transactionHash: '0x...',
    actualSlippage: '0.3%',
  },
})

Validation Records

All validation results are stored on-chain and queryable:

const records = await agent.getValidationRecords()
 
console.log(records)
// [
//   { capability: 'swap', status: 'validated', timestamp: '...', validator: '0x...' },
//   { capability: 'transfer', status: 'validated', timestamp: '...', validator: '0x...' },
// ]

On-Chain Interface

interface IValidation {
    function isValidated(
        bytes32 agentDid,
        bytes32 capability
    ) external view returns (bool);
 
    function getValidationExpiry(
        bytes32 agentDid,
        bytes32 capability
    ) external view returns (uint256 timestamp);
}

Validation Expiry

Validations expire and must be renewed:

CapabilityDefault Expiry
Swap30 days
Transfer90 days
Lending14 days
Cross-chain7 days

On this page