{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://eep.dev/schemas/v0.1/conformance.credential.json",
    "title": "EEP Conformance Credential",
    "description": "W3C Verifiable Credential 2.0-compatible schema for the EEP Conformance Credential issued by eep.dev to publishers that pass the EEP conformance test suite. See SPECIFICATION.md §10.2 and Whitepaper §10.2. Publishers include this credential in their /.well-known/eep.json manifest under the `conformance_credential` field. Agents verify the credential on first contact without querying any registry.",
    "type": "object",
    "required": [
        "@context",
        "type",
        "issuer",
        "validFrom",
        "validUntil",
        "credentialSubject",
        "proof"
    ],
    "additionalProperties": true,
    "properties": {
        "@context": {
            "type": "array",
            "description": "JSON-LD context. Must include W3C VC 2.0 and EEP contexts.",
            "items": {
                "type": "string"
            },
            "contains": {
                "const": "https://www.w3.org/ns/credentials/v2"
            },
            "examples": [
                [
                    "https://www.w3.org/ns/credentials/v2",
                    "https://eep.dev/contexts/v0.1"
                ]
            ]
        },
        "type": {
            "type": "array",
            "description": "VC type. Must include 'VerifiableCredential' and one of the EEP conformance tier types.",
            "items": {
                "type": "string"
            },
            "allOf": [
                {
                    "contains": {
                        "const": "VerifiableCredential"
                    }
                },
                {
                    "contains": {
                        "enum": [
                            "EEPConformanceCredential_Core",
                            "EEPConformanceCredential_Standard",
                            "EEPConformanceCredential_Full"
                        ]
                    }
                }
            ],
            "examples": [
                [
                    "VerifiableCredential",
                    "EEPConformanceCredential_Full"
                ]
            ]
        },
        "id": {
            "type": "string",
            "description": "Unique identifier for this credential instance.",
            "format": "uri",
            "examples": [
                "https://eep.dev/credentials/conformance/01HN3QK7GX"
            ]
        },
        "issuer": {
            "description": "The DID of the issuer. Must be eep.dev's authoritative DID for the credential to be trusted.",
            "oneOf": [
                {
                    "type": "string",
                    "pattern": "^did:[a-z0-9]+:.+$"
                },
                {
                    "type": "object",
                    "required": [
                        "id"
                    ],
                    "properties": {
                        "id": {
                            "type": "string",
                            "pattern": "^did:[a-z0-9]+:.+$"
                        },
                        "name": {
                            "type": "string"
                        }
                    }
                }
            ],
            "examples": [
                "did:web:eep.dev"
            ]
        },
        "validFrom": {
            "type": "string",
            "description": "ISO 8601 UTC timestamp when this credential becomes valid (date of conformance test passing).",
            "format": "date-time",
            "examples": [
                "2026-03-05T12:00:00Z"
            ]
        },
        "validUntil": {
            "type": "string",
            "description": "ISO 8601 UTC timestamp when this credential expires. Per Whitepaper §10.2, conformance credentials expire annually and must be renewed. Agents MUST reject expired conformance credentials.",
            "format": "date-time",
            "examples": [
                "2027-03-05T12:00:00Z"
            ]
        },
        "credentialSubject": {
            "type": "object",
            "required": [
                "id",
                "conformanceTier",
                "testedAt",
                "passedChecks"
            ],
            "additionalProperties": true,
            "description": "The publisher that passed the conformance test suite.",
            "properties": {
                "id": {
                    "type": "string",
                    "description": "The DID of the publisher that passed conformance testing.",
                    "pattern": "^did:[a-z0-9]+:.+$",
                    "examples": [
                        "did:web:api.publisher.example"
                    ]
                },
                "conformanceTier": {
                    "type": "string",
                    "description": "The EEP conformance tier the publisher achieved. Per Whitepaper §10.2 Table 2: Core (Layer 1 + L2 SSE), Standard (Core + Webhooks + credential/payment gates + version negotiation), Full (Standard + L3 WebSockets + commerce + agreement + data_request + session persistence + W3C DPV).",
                    "enum": [
                        "Core",
                        "Standard",
                        "Full"
                    ],
                    "examples": [
                        "Full"
                    ]
                },
                "eepVersion": {
                    "type": "string",
                    "description": "The EEP specification version against which conformance was tested.",
                    "examples": [
                        "0.1"
                    ]
                },
                "testedAt": {
                    "type": "string",
                    "description": "ISO 8601 UTC timestamp when the conformance test suite was run.",
                    "format": "date-time",
                    "examples": [
                        "2026-03-05T10:30:00Z"
                    ]
                },
                "passedChecks": {
                    "type": "integer",
                    "description": "Number of conformance checks passed. Informational.",
                    "minimum": 1,
                    "examples": [
                        47
                    ]
                },
                "totalChecks": {
                    "type": "integer",
                    "description": "Total number of conformance checks run. Informational.",
                    "minimum": 1,
                    "examples": [
                        47
                    ]
                },
                "manifestUrl": {
                    "type": "string",
                    "description": "URL of the publisher's /.well-known/eep.json manifest that was tested.",
                    "format": "uri",
                    "examples": [
                        "https://api.publisher.example/.well-known/eep.json"
                    ]
                },
                "sectorExtensions": {
                    "type": "array",
                    "description": "Sector-specific conformance extensions (e.g., EEP-FinServ-1.0) that were also tested and passed. See Whitepaper §11.4 and GOVERNANCE.md.",
                    "items": {
                        "type": "string",
                        "pattern": "^EEP-[A-Za-z]+(-[A-Za-z]+)?-\\d+\\.\\d+$"
                    },
                    "examples": [
                        [
                            "EEP-FinServ-1.0"
                        ]
                    ]
                }
            }
        },
        "proof": {
            "type": "object",
            "required": [
                "type",
                "created",
                "verificationMethod",
                "proofPurpose",
                "proofValue"
            ],
            "description": "Cryptographic proof over the credential, signed by eep.dev's DID private key. Agents MUST verify this proof before trusting the credential.",
            "properties": {
                "type": {
                    "type": "string",
                    "description": "Proof type. EEP uses Ed25519Signature2020 or DataIntegrityProof.",
                    "enum": [
                        "Ed25519Signature2020",
                        "DataIntegrityProof"
                    ],
                    "examples": [
                        "Ed25519Signature2020"
                    ]
                },
                "created": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO 8601 UTC timestamp when the proof was created.",
                    "examples": [
                        "2026-03-05T12:00:00Z"
                    ]
                },
                "verificationMethod": {
                    "type": "string",
                    "description": "DID URL of the key used to sign this credential. Must resolve to a key in eep.dev's DID Document.",
                    "examples": [
                        "did:web:eep.dev#key-1"
                    ]
                },
                "proofPurpose": {
                    "type": "string",
                    "description": "Purpose of the proof. Must be 'assertionMethod' for conformance credentials.",
                    "const": "assertionMethod"
                },
                "proofValue": {
                    "type": "string",
                    "description": "Base64url-encoded cryptographic proof value.",
                    "minLength": 16,
                    "examples": [
                        "z58DAdFfa9SkqZMVPxAQpic7ndSayn1PzZs6ZjWp1CktyGesjuTSwRdoWhAfGFCF5bppETSTojQCrfFPP2oumHKtz"
                    ]
                },
                "cryptosuite": {
                    "type": "string",
                    "description": "Cryptosuite identifier when type is DataIntegrityProof.",
                    "examples": [
                        "eddsa-rdfc-2022",
                        "ecdsa-rdfc-2019"
                    ]
                }
            }
        }
    },
    "examples": [
        {
            "@context": [
                "https://www.w3.org/ns/credentials/v2",
                "https://eep.dev/contexts/v0.1"
            ],
            "type": [
                "VerifiableCredential",
                "EEPConformanceCredential_Full"
            ],
            "id": "https://eep.dev/credentials/conformance/01HN3QK7GX",
            "issuer": "did:web:eep.dev",
            "validFrom": "2026-03-05T12:00:00Z",
            "validUntil": "2027-03-05T12:00:00Z",
            "credentialSubject": {
                "id": "did:web:api.publisher.example",
                "conformanceTier": "Full",
                "eepVersion": "0.1",
                "testedAt": "2026-03-05T10:30:00Z",
                "passedChecks": 47,
                "totalChecks": 47,
                "manifestUrl": "https://api.publisher.example/.well-known/eep.json"
            },
            "proof": {
                "type": "Ed25519Signature2020",
                "created": "2026-03-05T12:00:00Z",
                "verificationMethod": "did:web:eep.dev#key-1",
                "proofPurpose": "assertionMethod",
                "proofValue": "z58DAdFfa9SkqZMVPxAQpic7ndSayn1PzZs6ZjWp1CktyGesjuTSwRdoWhAfGFCF5bppETSTojQCrfFPP2oumHKtz"
            }
        }
    ]
}