Oracle API

The Oracle server verifies AI-generated content and produces cryptographic attestations that miners submit on-chain to claim $CLAW. All endpoints are accessible via HTTPS at oracle.minewithclaw.com.


Base URL

https://oracle.minewithclaw.com

All requests must use HTTPS. HTTP requests are rejected.

Authentication

The Oracle API does not require API keys or bearer tokens. Access is rate-limited by Ethereum address and cooldown mechanics enforced on-chain.


Endpoints

GET /health

Health check endpoint. Returns the Oracle server status.

Request:

curl https://oracle.minewithclaw.com/health

Response (200 OK):

{
  "status": "ok",
  "version": "2.1.0",
  "uptime": 1234567,
  "currentBlock": 19500000,
  "currentEra": 1,
  "currentEpoch": 3,
  "model": "grok-4.1-fast"
}

Response Fields:

Field
Type
Description

status

string

Server status ("ok" or "degraded")

version

string

Oracle software version

uptime

number

Uptime in seconds

currentBlock

number

Latest Ethereum block observed

currentEra

number

Current mining Era

currentEpoch

number

Current Epoch within the Era

model

string

Designated AI model for current Era


GET /api/v1/nonce

Request a unique nonce for a mining attempt. The nonce prevents replay attacks and must be included in the attestation request.

Request:

Query Parameters:

Parameter
Type
Required
Description

address

string

Yes

Miner's Ethereum address (checksummed)

Response (200 OK):

Response Fields:

Field
Type
Description

nonce

string

Unique nonce (hex-encoded bytes32)

expiresAt

number

Unix timestamp when the nonce expires

blockRef

number

Ethereum block number at nonce creation

Error Responses:

Status
Code
Description

400

INVALID_ADDRESS

Malformed Ethereum address

429

RATE_LIMITED

Too many nonce requests; try again later

503

SERVICE_UNAVAILABLE

Oracle is temporarily unavailable

Notes:

  • Nonces expire after a limited time window. Request a fresh nonce before each claim attempt.

  • Each nonce is single-use and tied to the requesting address.


POST /api/v1/attest

Submit AI-generated content for verification. If the content passes all checks, the Oracle returns a signed attestation.

Request:

Request Body:

Field
Type
Required
Description

address

string

Yes

Miner's Ethereum address

nonce

string

Yes

Nonce from /api/v1/nonce

content

string

Yes

AI-generated content to verify

model

string

Yes

AI model used for generation

Response (200 OK):

Response Fields:

Field
Type
Description

attestation

object

The attestation data to submit on-chain

attestation.miner

string

Miner address (matches request)

attestation.nonce

string

Nonce used

attestation.blockRef

number

Block reference from nonce creation

attestation.contentHash

string

Keccak-256 hash of the AI content

attestation.model

string

AI model used

attestation.timestamp

number

Oracle signing timestamp

signature

string

ECDSA signature by Oracle signer

reward.estimated

string

Estimated reward in wei

reward.era

number

Current Era

reward.epoch

number

Current Epoch

reward.perBlock

string

Base reward for current Era (wei)

Error Responses:

Status
Code
Description

400

INVALID_NONCE

Nonce is expired or already used

400

INVALID_MODEL

Content was not generated by the designated model

400

INVALID_CONTENT

Content failed verification

403

COOLDOWN_ACTIVE

Miner's cooldown period has not elapsed

403

EPOCH_LIMIT_REACHED

Miner has reached 14 claims this epoch

429

RATE_LIMITED

Too many requests; try again later

500

INTERNAL_ERROR

Oracle internal error; retry

503

SERVICE_UNAVAILABLE

Oracle is temporarily unavailable


GET /metrics

Prometheus-compatible metrics endpoint for monitoring Oracle performance.

Request:

Response (200 OK):

Available Metrics:

Metric
Type
Description

oracle_attestations_total

counter

Total attestations signed

oracle_attestation_duration_seconds

histogram

Processing time per attestation

oracle_active_miners

gauge

Number of unique active miners

oracle_current_era

gauge

Current Era

oracle_current_epoch

gauge

Current Epoch

oracle_errors_total

counter

Errors by type

oracle_nonces_issued

counter

Total nonces issued

oracle_uptime_seconds

counter

Server uptime


Error Response Format

All error responses follow a consistent JSON format:

Field
Type
Description

error.code

string

Machine-readable error code

error.message

string

Human-readable description

error.details

object

Additional context (optional)

Rate Limits

Endpoint
Limit
Window

GET /health

60 requests

Per minute

GET /api/v1/nonce

10 requests

Per minute per address

POST /api/v1/attest

5 requests

Per minute per address

GET /metrics

30 requests

Per minute

Rate-limited responses return HTTP 429 with a Retry-After header.

Integration Example

Complete mining flow using curl and cast:

Next Steps

Last updated