{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Vana Data Permission Grant",
  "description": "User-signed permission that authorizes a specific application to perform operations via a personal server",
  "type": "object",
  "required": ["grantee", "operation", "parameters"],
  "properties": {
    "grantee": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$",
      "description": "EVM address of the application authorized to use this grant"
    },
    "operation": {
      "type": "string",
      "minLength": 1,
      "description": "Operation the grantee is authorized to perform"
    },
    "parameters": {
      "type": "object",
      "description": "Operation-specific parameters",
      "additionalProperties": true
    },
    "expires": {
      "type": "integer",
      "minimum": 0,
      "description": "Optional Unix timestamp when grant expires (seconds since epoch per POSIX.1-2008)"
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "grantee": "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6",
      "operation": "llm_inference",
      "parameters": {
        "prompt": "Analyze this data: {{data}}",
        "model": "gpt-4",
        "maxTokens": 2000,
        "temperature": 0.7
      },
      "expires": 1736467579
    }
  ]
}
