Ground Agent Context in Bitcoin State
proof.groundPURPOSE: Creates a signed epistemic anchor receipt for agent context grounded in the current Bitcoin tip. USAGE: Use to ground agent context and obtain a verifiable receipt. Do NOT use for raw ZK proof verification; use proof.verify instead. PARAMETERS: Accepts contextHash as a 64-character case-insensitive hexadecimal SHA-256 digest, agentId as a trimmed 1-256 character string, and an optional metadata object. BEHAVIOR: Validates context and checks Bitcoin tip and signing readiness before requesting payment; after 250-sat L402 settlement, returns a signed receipt without a second HTTP payment. Rate limit: 60 req/min per IP shared across /mcp. RETURNS: Object containing receipt with signed payload, Merkle proof, NIP-78 signature, normalized contextHash and agentId, blockHeight, blockHash, and timestamp; verify it through /api/v1/zk/verify. ERRORS: -32602 (Invalid Parameters) for malformed context, HTTP 402 (Payment Required) with a 250-sat invoice when unpaid, 429 (Rate Limit), or 503 when Bitcoin tip or signing is unavailable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agentId | Yes | Trimmed client or agent identifier string from 1 to 256 characters. | research-agent-7 |
| metadata | No | Key-value JSON object containing arbitrary metadata. | |
| contextHash | Yes | 64-character case-insensitive hexadecimal SHA-256 digest string; normalized to lowercase. | 4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f4f |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| receipt | Yes | Full signed receipt; send unchanged to POST /api/v1/zk/verify as attestation. |