{
  "$ref": "#/definitions/identity-profile-v1",
  "definitions": {
    "identity-profile-v1": {
      "type": "object",
      "properties": {
        "mint": {
          "type": "string"
        },
        "network": {
          "type": "string",
          "enum": [
            "solana-devnet",
            "solana-mainnet"
          ]
        },
        "handle": {
          "type": [
            "string",
            "null"
          ]
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "image_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "treasury": {
          "type": "string"
        },
        "services": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "endpoint": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "endpoint"
            ],
            "additionalProperties": false
          }
        },
        "verified_domains": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "capability_cards": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "type": "string",
                "enum": [
                  "seller_api",
                  "buyer_tool",
                  "data_source",
                  "control_channel",
                  "automation",
                  "marketplace",
                  "pay_skills",
                  "custom"
                ]
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "description": {
                "type": "string",
                "maxLength": 500
              },
              "source": {
                "type": "string",
                "enum": [
                  "leash",
                  "pay-skills",
                  "manual",
                  "connection",
                  "automation"
                ]
              },
              "slug": {
                "type": "string",
                "maxLength": 200
              },
              "endpoint": {
                "type": "string",
                "format": "uri",
                "maxLength": 800
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 40
                },
                "default": []
              },
              "protocols": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "x402",
                    "mpp"
                  ]
                },
                "default": []
              },
              "visibility": {
                "type": "string",
                "enum": [
                  "public",
                  "private"
                ],
                "default": "public"
              }
            },
            "required": [
              "id",
              "kind",
              "title"
            ],
            "additionalProperties": false
          }
        },
        "claims": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "issuer": {
                "type": "string"
              },
              "subject_mint": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "value": {
                "type": "string"
              },
              "evidence_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "signature": {
                "type": "string"
              },
              "visibility": {
                "type": "string",
                "enum": [
                  "public",
                  "private"
                ]
              },
              "expires_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "revoked_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "created_at": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "issuer",
              "subject_mint",
              "type",
              "value",
              "evidence_url",
              "signature",
              "visibility",
              "expires_at",
              "revoked_at",
              "created_at"
            ],
            "additionalProperties": false
          }
        },
        "operator_history": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "event_id": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "executive_register",
                  "executive_delegate",
                  "delegation_set",
                  "delegation_revoke"
                ]
              },
              "phase": {
                "type": "string",
                "enum": [
                  "prepared",
                  "submitted",
                  "confirmed",
                  "failed"
                ]
              },
              "actor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "delegate": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "executive": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "token_mint": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "source_token_account": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "delegated_amount": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "signature": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "event_source": {
                "type": "string"
              },
              "created_at": {
                "type": "string"
              },
              "confirmed_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "failed_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "event_id",
              "kind",
              "phase",
              "actor",
              "delegate",
              "executive",
              "token_mint",
              "source_token_account",
              "delegated_amount",
              "signature",
              "event_source",
              "created_at",
              "confirmed_at",
              "failed_at"
            ],
            "additionalProperties": false
          }
        },
        "reputation": {
          "type": "object",
          "properties": {
            "settled_calls": {
              "type": "integer"
            },
            "denied_calls": {
              "type": "integer"
            },
            "rating": {
              "type": "number"
            }
          },
          "required": [
            "settled_calls",
            "denied_calls",
            "rating"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "mint",
        "network",
        "handle",
        "name",
        "description",
        "image_url",
        "treasury",
        "services",
        "verified_domains",
        "capability_cards",
        "claims",
        "operator_history",
        "reputation"
      ],
      "additionalProperties": false
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#"
}