vcp-explorer-api

VCP Explorer API v1.1 - API Reference

Implementation scope: the current server uses mock data. See the README implementation notes for implemented filters, response differences, and verification limitations. Proof, anchor, tier and certificate fields are demonstration metadata. The optional SDK evidence routes have a separate contract. See the versioning notes for canonical VCP status.

“Verify, Don’t Trust” - Merkle Proof Verification & VCP Module Structure

Demo API returning mock data, with proof and certificate fixtures and search. Existing response fixtures target the legacy VCP v1.0 format; conformance has not been established. The search-name allowlist also accepts the VCP v1.2 structured-schema registry (see below). Accepting a search name does not implement that event’s production, payload rules or verification.


🎯 What’s New in v1.1

Verification Features (fixtures; no server-side verification)

✅ VCP Module Structure

VCP Spec v1.0 Format Targets (conformance not established)


🚀 Quick Start

cd vcp-explorer-api
npm install
npm run dev

Server runs on http://localhost:3001


📡 API Endpoints

Base URL


1. System Status

GET /v1/system/status

Returns a fixed system-status fixture. Counts, anchors, precision and tier are sample values, not measurements of a live network or certification results.

Response:

{
  "total_events": 12160243,
  "last_anchor": {
    "network": "ethereum-mainnet",
    "block_number": 1942055,
    "tx_hash": "0x1234567890abcdef...",
    "anchored_at": "2025-11-24T14:12:00Z"
  },
  "active_nodes": 42,
  "precision": "NANOSECOND",
  "tier": "PLATINUM"
}

2. Advanced Event Search 🆕

GET /v1/events

Query Parameters

Parameter Type Required Description Example
trace_id UUID v7 No Transaction trace ID (tracks SIG→ORD→ACK→EXE chain) 01934e3a-6a1b-7c82-9d1b-0987654321dc
symbol String No Trading symbol XAUUSD, EURUSD, BTCUSDT
event_type String No Event type name (see Event Types table) ORD, EXE, REJ
start_time RFC3339 No Inclusive start boundary, nanosecond-accurate (Z or numeric UTC offset) 2025-11-24T00:00:00.123456789Z
end_time RFC3339 No Inclusive end boundary, must be >= start_time 2025-11-24T23:59:59Z
algo_id String No Match VCP-GOV algorithm ID from available detailed mock event fixtures (unknown or missing IDs do not match) neural-scalper-v1.2
venue_id String No Venue/broker/exchange identifier XNAS, BINANCE
limit Integer No Positive decimal safe integer; capped at 500, default: 50 100
offset Integer No Pagination offset (default: 0) 50

All supplied filters must be non-empty, single-valued query parameters; duplicate, array-form or nested-object forms receive 400 invalid_parameter without querying the data source. Unknown event_type receives 400 invalid_event_type. The algo_id mock search joins summary records to available VCP-GOV detail fixtures by event ID; it does not infer missing algorithm identities. event_type_code remains a response field, not a supported search parameter. total counts only events on the returned page, not the entire matching population. Mock time bounds use strict Gregorian RFC3339 timestamps with four-digit years, an explicit Z or numeric timezone offset, and optional 1–9 decimal fractional digits. Seconds are limited to 00–59 (no leap seconds); invalid calendar dates and reversed time windows return 400 invalid_parameter before data access. Bounds are inclusive, normalized with exact nanosecond integer arithmetic, and compared against the original event-summary timestamp strings. The strings are neither rounded nor rewritten. This does not establish clock accuracy, consistency with unrelated mock detail timestamp_int fields, authenticity of recorded events or VCP conformance.

Legacy fixture response codes:

Code Type Description
1 SIG Signal/Decision generated
2 ORD Order sent
3 ACK Order acknowledged
4 EXE Full execution
5 PRT Partial fill
6 REJ Order rejected
7 CXL Order cancelled
8 MOD Order modified
9 CLS Position closed
20 ALG Algorithm update
21 RSK Risk parameter change
22 AUD Audit request
98 HBT Heartbeat
99 ERR Error
100 REC Recovery
101 SNC Clock sync

Additional accepted search names: INIT, ANC, ERR_CONN, ERR_AUTH, ERR_TIMEOUT, ERR_REJECT, ERR_PARSE, ERR_SYNC, ERR_RISK, ERR_SYSTEM, ERR_RECOVER, ERASURE, SYS_RECOVERY_ANNOUNCE, SYS_CHECKPOINT, SYS_AUDIT, SYS_ANCHOR_MIGRATION, and SYS_ANCHOR_FAILOVER.

The filter accepts all 27 names in the fixed VCP v1.2 structured schema, plus the retained legacy fixture names PRT, REJ, ALG, AUD, REC, and SNC. This is a 33-name search allowlist, not a replacement VCP registry. The additional names have no bundled records and return 200 with events: [] and total: 0. No new numeric codes, payloads or successful verification results are inferred. Client integrations use EventSearchType; existing fixture response types and EVENT_TYPE_CODES retain their legacy shape.

Example Requests

# Filter the available trace records (the returned page is not a completeness proof)
GET /v1/events?trace_id=01934e3a-6a1b-7c82-9d1b-0987654321dc

# Find all XAUUSD orders in time window
GET /v1/events?symbol=XAUUSD&start_time=2025-11-24T14:00:00Z&end_time=2025-11-24T15:00:00Z

# Filter by algorithm and event type
GET /v1/events?algo_id=neural-scalper-v1.2&event_type=ORD

# Pagination
GET /v1/events?symbol=EURUSD&limit=100&offset=0

Response

{
  "events": [
    {
      "event_id": "01934e3a-7b2c-7f93-8f2a-1234567890ab",
      "type": "ORD",
      "event_type_code": 2,
      "timestamp": "2025-11-24T14:02:05.123456789Z",
      "venue": "XAUUSD_PROP",
      "symbol": "XAUUSD",
      "hash_prefix": "8f2a7b",
      "status": "ANCHORED"
    }
  ],
  "query": { /* applied filters */ },
  "total": 1
}

3. Event Details (VCP Module Structure) 🔄

GET /v1/events/:id

Path Parameter:

Response Structure

{
  "header": {
    "event_id": "01934e3a-7b2c-7f93-8f2a-1234567890ab",
    "trace_id": "01934e3a-6a1b-7c82-9d1b-0987654321dc",
    "timestamp_int": "1732453325123456789",
    "timestamp_iso": "2025-11-24T14:02:05.123456789Z",
    "event_type": "ORD",
    "event_type_code": 2,
    "timestamp_precision": "NANOSECOND",
    "clock_sync_status": "PTP_LOCKED",
    "hash_algo": "SHA256",
    "venue_id": "XAUUSD_PROP",
    "symbol": "XAUUSD",
    "anchor_status": "ANCHORED"
  },
  "payload": {
    "trade_data": {
      "symbol": "XAUUSD",
      "side": "BUY",
      "order_type": "MARKET",
      "price": "2350.500",
      "order_size": "5.00"
    },
    "vcp_risk": {
      "snapshot": {
        "news_trading_restricted": "false",
        "max_drawdown_limit": "10000.00",
        "max_position_size": "50.00",
        "exposure_utilization": "0.45",
        "throttle_rate": "100",
        "circuit_breaker_status": "NORMAL"
      },
      "triggered_controls": []
    },
    "vcp_gov": {
      "algo_id": "neural-scalper-v1.2",
      "algo_version": "1.2.0",
      "algo_type": "AI_MODEL",
      "model_hash": "sha256:7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069",
      "decision_factors": {
        "features": [
          {
            "name": "rsi_14",
            "value": "72.5",
            "weight": "0.35",
            "contribution": "0.28"
          },
          {
            "name": "macd_signal",
            "value": "1.25",
            "weight": "0.25",
            "contribution": "0.18"
          }
        ],
        "confidence_score": "0.92",
        "explainability_method": "SHAP"
      },
      "governance": {
        "risk_classification": "MEDIUM",
        "last_approval_by": "op_john_doe",
        "approval_timestamp": "2025-11-20T09:00:00Z",
        "testing_record_link": "https://internal.veritaschain.org/backtest/neural-scalper-v1.2"
      }
    }
  },
  "security": {
    "event_hash": "8f2a7b9d1b0c3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f",
    "prev_hash": "00a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1",
    "signature": "MEUCIQDXyz123abc456def789ghi012jkl345mno678pqr901stu234vwx567yza890==",
    "sign_algo": "ED25519",
    "merkle_root": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
    "anchor": {
      "network": "ethereum-mainnet",
      "tx_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd",
      "block_number": 1942055,
      "anchored_at": "2025-11-24T14:10:00Z"
    }
  }
}

Module Structure Explained


4. Merkle Proof Fixture

GET /v1/events/:id/proof

Purpose: Return stored demonstration proof fields. This endpoint does not compute or verify inclusion, signatures or external anchoring.

Path Parameter:

Response Schema

{
  "event_id": "01934e3a-7b2c-7f93-8f2a-1234567890ab",
  "event_hash": "8f2a7b9d1b0c3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f",
  "merkle_proof": {
    "root_hash": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
    "leaf_index": 42,
    "audit_path": [
      "7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b",
      "9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d",
      "1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f"
    ]
  },
  "anchor_info": {
    "network": "ethereum-mainnet",
    "tx_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd",
    "block_number": 1942055,
    "anchored_at": "2025-11-24T14:10:00Z"
  },
  "hash_algo": "SHA256",
  "verification_hint": "Unverified demo fixture. Tree size and authenticated anchor evidence are not supplied; this response does not establish Merkle inclusion or external anchoring."
}

Verification limits

The optional merkle_proof.tree_size field is absent from the current fixture. Its absence prevents this response from supplying all inputs for an RFC 6962 inclusion check. Do not derive a tree size from the audit-path length. A proper verifier also needs the exact hashed bytes, a specified leaf construction, valid index and tree bounds, and index-dependent sibling ordering. JSON.stringify is not a replacement for RFC 8785 canonicalization, and repeatedly placing each sibling on the right is not a general inclusion verifier.

Even a valid inclusion path is only meaningful relative to its root. Authentication of that root, signatures, external anchoring and the recorded content are separate checks. This fixture route performs none of them. Its algorithm-name fields do not establish that SHA3-256 or BLAKE3 verification is implemented.

The optional SDK evidence demonstration uses its own pinned bundle/trust inputs, algorithms and bounded result contract; enabling it does not turn these legacy fixture routes into a conformance verifier.


5. Event Certificate 🆕📜

GET /v1/events/:id/certificate

Purpose: Assemble a demonstration JSON export from an event and its stored proof fixture. The returned tier, signature and anchor fields are not certification or regulatory-compliance findings.

Path Parameter:

Response Schema

{
  "event_id": "01934e3a-7b2c-7f93-8f2a-1234567890ab",
  "generated_at": "2025-11-24T15:00:00Z",
  "system": {
    "vcp_version": "1.0",
    "tier": "PLATINUM"
  },
  "header": {
    "event_id": "01934e3a-7b2c-7f93-8f2a-1234567890ab",
    "trace_id": "01934e3a-6a1b-7c82-9d1b-0987654321dc",
    "timestamp_int": "1732453325123456789",
    "timestamp_iso": "2025-11-24T14:02:05.123456789Z",
    "event_type": "ORD",
    "event_type_code": 2,
    "timestamp_precision": "NANOSECOND",
    "clock_sync_status": "PTP_LOCKED",
    "hash_algo": "SHA256",
    "venue_id": "XAUUSD_PROP",
    "symbol": "XAUUSD",
    "anchor_status": "ANCHORED"
  },
  "payload": {
    "trade_data": {
      "symbol": "XAUUSD",
      "side": "BUY",
      "order_type": "MARKET",
      "price": "2350.500",
      "order_size": "5.00"
    },
    "vcp_risk": {
      "snapshot": {
        "news_trading_restricted": "false",
        "max_drawdown_limit": "10000.00"
      }
    },
    "vcp_gov": {
      "algo_id": "neural-scalper-v1.2",
      "model_hash": "sha256:7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069"
    }
  },
  "security": {
    "event_hash": "8f2a7b9d1b0c3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f",
    "prev_hash": "00a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1",
    "signature": "MEUCIQDXyz123abc456def789ghi012jkl345mno678pqr901stu234vwx567yza890==",
    "sign_algo": "ED25519",
    "merkle_root": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2"
  },
  "merkle_proof": {
    "root_hash": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
    "leaf_index": 42,
    "audit_path": [
      "7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b",
      "9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d"
    ]
  },
  "anchor_info": {
    "network": "ethereum-mainnet",
    "tx_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd",
    "block_number": 1942055,
    "anchored_at": "2025-11-24T14:10:00Z"
  }
}

Demonstration uses:

The fixture export does not establish a legitimate execution, accepted evidence, regulatory compliance or the outcome of a dispute.


6. Certified Entities

GET /v1/certified/entities

Returns a list of mock/demo organisations from src/data/entities.ts. These are not certified entities: VSO does not issue certifications itself, and no certification registry backs this endpoint.

Response:

{
  "entities": [
    {
      "name": "Alpha Quant Exchange",
      "type": "EXCHANGE",
      "tier": "PLATINUM",
      "status": "COMPLIANT",
      "verification_url": "https://explorer.veritaschain.org/entities/alpha-quant",
      "audit_report": "2025-Q3"
    }
  ]
}

7. Health Check

GET /health

Response:

{
  "status": "ok",
  "timestamp": "2025-11-24T14:30:00.000Z",
  "version": "1.0.0",
  "service": "VCP Explorer API"
}

📋 HTTP Status Codes & Error Model

Success Codes

Code Description
200 OK - Request successful

Client Error Codes

Code Error Description Example
400 invalid_parameter Invalid query parameter limit must be one positive decimal safe integer
400 invalid_event_id Event ID format invalid Must be UUID v7
400 invalid_event_type Unknown event type Valid: SIG, ORD, ACK, EXE, …
400 invalid_parameter Invalid or reversed RFC3339 time range Use a valid calendar date and explicit offset
404 not_found Resource not found Event does not exist
404 not_found No bundled proof/certificate fixture No availability is inferred from anchor metadata

Server Error Codes

Code Error Description  
429 rate_limit_exceeded Too many requests 60 requests/min limit
500 internal_error Internal server error Unexpected failure

Error Response Format

{
  "error": "invalid_parameter",
  "message": "Limit must be a single unsigned decimal safe integer greater than zero"
}

Example Error Scenarios

Invalid Event Type:

GET /v1/events?event_type=INVALID
{
  "error": "invalid_event_type",
  "message": "Unsupported event_type value"
}

Event Not Found:

GET /v1/events/01934e3a-0000-7000-8000-000000000000
{
  "error": "not_found",
  "message": "Event not found"
}

No Bundled Proof Fixture (HTTP 404):

GET /v1/events/01934e3a-0000-7000-8000-000000000000/proof
{
  "error": "not_found",
  "message": "Merkle proof not found for this event"
}

🔒 Security & Rate Limiting

CORS Configuration

Rate Limits

Security Headers (Helmet.js)


🧪 Testing Examples

# System status
curl http://localhost:3001/v1/system/status

# Search events
curl "http://localhost:3001/v1/events?symbol=XAUUSD&limit=5"

# TraceID search
curl "http://localhost:3001/v1/events?trace_id=01934e3a-6a1b-7c82-9d1b-0987654321dc"

# Event details
curl http://localhost:3001/v1/events/01934e3a-7b2c-7f93-8f2a-1234567890ab

# Merkle proof
curl http://localhost:3001/v1/events/01934e3a-7b2c-7f93-8f2a-1234567890ab/proof

# Certificate
curl http://localhost:3001/v1/events/01934e3a-7b2c-7f93-8f2a-1234567890ab/certificate

# Health check
curl http://localhost:3001/health

📝 Development Scripts

npm run dev      # Development with hot-reload
npm run build    # TypeScript compilation
npm start        # Run the compiled reference server
npm run lint     # ESLint check
npm run format   # Prettier formatting

📄 Additional Resources


📄 License

Apache-2.0 — see the repository LICENSE, the source of truth for this API. The separately maintained VCP specification has its own license.


📞 Support


Version: 1.1.0
VCP Spec: v1.0 (superseded by v1.2)
Status: Demo (mock data)

“Verify, Don’t Trust” - Built by VSO with ❤️