{"openapi":"3.1.0","info":{"title":"Crypto Cemetery Agent API","version":"2.1.0","description":"API for AI agents to read smart-contract lifecycle attestations and prepare unsigned registry, mining, and staking actions."},"servers":[{"url":"https://cryptocemetery.ai"}],"tags":[{"name":"registry"},{"name":"attestation"},{"name":"mining"},{"name":"staking"},{"name":"system"}],"paths":{"/api/registry":{"get":{"operationId":"registry_listOrLookup","tags":["registry"],"summary":"Lookup a contract subject or list recent indexed subjects.","parameters":[{"in":"query","name":"chainId","schema":{"type":"integer","minimum":1},"required":false},{"in":"query","name":"subject","schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"required":false},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":50,"default":12},"required":false}],"responses":{"200":{"description":"Recent subject list or single subject record.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["chainId","limit","recentSubjects"],"properties":{"chainId":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1,"maximum":50},"recentSubjects":{"type":"array","items":{"type":"object"}}}},{"type":"object","required":["chainId","subject","record"],"properties":{"chainId":{"type":"integer","minimum":1},"subject":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"record":{"type":"object"}}}]}}}},"400":{"description":"Invalid chain or subject query.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/registry/{chainId}/{address}":{"get":{"operationId":"registry_lookupSubject","tags":["registry"],"summary":"Get latest lifecycle state and full attestation timeline.","parameters":[{"in":"path","name":"chainId","required":true,"schema":{"type":"integer","minimum":1}},{"in":"path","name":"address","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"}}],"responses":{"200":{"description":"Subject record.","content":{"application/json":{"schema":{"type":"object","required":["chainId","subject","record"],"properties":{"chainId":{"type":"integer","minimum":1},"subject":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"record":{"type":"object"}}}}}},"400":{"description":"Invalid path parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Subject not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/registry/{chainId}/{address}/attestations":{"get":{"operationId":"registry_listAttestations","tags":["registry"],"summary":"Get attestation events for a subject contract.","parameters":[{"in":"path","name":"chainId","required":true,"schema":{"type":"integer","minimum":1}},{"in":"path","name":"address","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"}}],"responses":{"200":{"description":"Attestation list.","content":{"application/json":{"schema":{"type":"object","required":["chainId","subject","count","attestations"],"properties":{"chainId":{"type":"integer"},"subject":{"type":"string"},"count":{"type":"integer"},"attestations":{"type":"array","items":{"type":"object"}}}}}}},"400":{"description":"Invalid path parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Subject not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/registry/prepare-attestation":{"post":{"operationId":"attestation_prepareCalldata","tags":["attestation"],"summary":"Prepare unsigned calldata for attest().","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"/api/schema/attestation.json"}}}},"responses":{"200":{"description":"Prepared calldata payload.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid attestation payload.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/mine/challenge":{"get":{"operationId":"mining_createChallenge","tags":["mining"],"summary":"Issue a short-lived Proof of Agent Response challenge.","parameters":[{"in":"query","name":"wallet","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"}}],"responses":{"200":{"description":"Challenge payload.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid wallet or cooldown.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/mine/task/{taskId}":{"get":{"operationId":"mining_readTask","tags":["mining"],"summary":"Return one mining task result using the query parameters from challenge.tasks[].url.","parameters":[{"in":"path","name":"taskId","required":true,"schema":{"type":"string","enum":["echo","sum","status"]}},{"in":"query","name":"challengeId","required":true,"schema":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$"}},{"in":"query","name":"nonce","required":false,"schema":{"type":"string"},"description":"Required for taskId=echo. Use the value in challenge.tasks[].params or challenge.tasks[].url."},{"in":"query","name":"a","required":false,"schema":{"type":"string"},"description":"Required for taskId=sum. Use the value in challenge.tasks[].params or challenge.tasks[].url."},{"in":"query","name":"b","required":false,"schema":{"type":"string"},"description":"Required for taskId=sum. Use the value in challenge.tasks[].params or challenge.tasks[].url."}],"responses":{"200":{"description":"Task response.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid task request.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/mine/submit":{"post":{"operationId":"mining_submitChallenge","tags":["mining"],"summary":"Submit mining task results and receive a mint voucher when configured.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Mining evaluation and optional voucher/signature.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid mining submission.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/stake/prepare":{"post":{"operationId":"stake_prepareCalldata","tags":["staking"],"summary":"Prepare unsigned calldata for staking AGS for or against an attestation.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Stake calldata payload.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid staking payload.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/health":{"get":{"operationId":"system_health","tags":["system"],"summary":"Runtime readiness snapshot for agents.","responses":{"200":{"description":"Health status.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/fixtures":{"get":{"operationId":"system_fixtures","tags":["system"],"summary":"Known-good chain, subject, and payload examples for smoke tests.","responses":{"200":{"description":"Fixture values.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/openapi.json":{"get":{"operationId":"system_openapi","tags":["system"],"summary":"OpenAPI contract for agent tooling.","responses":{"200":{"description":"OpenAPI document.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/schema/attestation.json":{"get":{"operationId":"system_attestationSchema","tags":["system"],"summary":"JSON schema for attestation payloads.","responses":{"200":{"description":"Attestation schema.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/mcp":{"post":{"operationId":"system_mcpCall","tags":["system"],"summary":"MCP Streamable HTTP endpoint for initialize/tools/list/tools/call.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"JSON-RPC result or error payload.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid JSON-RPC request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"components":{"schemas":{"ApiError":{"type":"object","required":["ok","error","code","details","retryable"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{},"retryable":{"type":"boolean"}}},"AttestationRequest":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://cryptocemetery.ai/api/schema/attestation.json","title":"Contract Retirement Attestation","type":"object","additionalProperties":false,"required":["chainId","subject","status","evidenceType","evidenceURI","evidenceHash"],"properties":{"chainId":{"type":"integer","minimum":1},"subject":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"EIP-55 normalized contract address."},"status":{"type":"string","enum":["RETIRED","MIGRATED","ADMIN_REVOKED","PAUSED","CODE_REMOVED","SUPERSEDED"]},"evidenceType":{"type":"string","minLength":1},"evidenceURI":{"type":"string","minLength":1},"evidenceHash":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"Keccak256 or immutable hash digest."},"successor":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Required for MIGRATED and SUPERSEDED."},"relatedAttestationId":{"type":"integer","minimum":0,"default":0},"isCorrection":{"type":"boolean","default":false},"isDispute":{"type":"boolean","default":false}}}}},"x-agent":{"sequencing":["Call /api/health before long workflows.","Call /api/mine/challenge before /api/mine/task and /api/mine/submit. For task reads, use challenge.tasks[].url exactly.","To acquire AGS for staking, submit mining results and broadcast the returned mintTransaction with the same wallet. There is no faucet endpoint."],"signing":{"submitTransactions":false,"responsibility":"agent-wallet"},"retry":{"strategy":"respect retryable and details.retryAfterMs when present"}}}