返回博客 发布

VCP Sidecar Guide现已包含生产就绪的实现代码

发布符合VCP v1.0规范的生产就绪MQL5和Python实现,用于审计追踪。

2025年12月27日 阅读时间8分钟 VeritasChain Standards Organization

我们很高兴宣布vcp-sidecar-guide仓库的重大更新。本次发布包含MQL5和Python的生产就绪实现代码,使开发者能够立即将符合VCP v1.0规范的审计追踪集成到其交易系统中。


新功能

生产就绪的源代码

仓库现包含完整功能的实现:

src/
├── mql5/
│   ├── vcp_mql_bridge_v1_0.mqh    # 约850行
│   └── README.md
└── python/
    ├── vcp_sidecar_adapter_v1_0.py # 约700行
    ├── requirements.txt
    └── README.md

可运行示例

展示实际用法的完整可运行示例:

examples/
├── mql5/
│   └── ExampleEA.mq5              # 包含MA交叉策略的完整EA
└── python/
    └── example_usage.py           # 7个综合示例

VCP v1.0规范合规

两种实现均完全符合VCP v1.0:

功能 状态
UUID v7(RFC 9562)
双时间戳格式(纳秒字符串 + ISO 8601)
3层事件结构(header/payload/security)
SHA-256哈希链
全部事件类型代码(SIG、ORD、ACK、EXE等)
数值字符串表示
GDPR合规的账户假名化

这些实现已准备好进行VC-Certified(Silver)合规性测试。


快速开始

Python

from vcp_sidecar_adapter_v1_0 import VCPEventFactory, VCPEventSerializer, Tier

factory = VCPEventFactory(venue_id="MY_VENUE", tier=Tier.SILVER)

signal = factory.create_signal_event(
    symbol="XAUUSD",
    account_id="12345",
    algo_id="MY_ALGO",
    algo_version="1.0.0",
    confidence="0.85"
)

print(VCPEventSerializer.to_json(signal, indent=2))

MQL5

#include <VCP/vcp_mql_bridge_v1_0.mqh>

int OnInit()
{
    VCP_CONFIG config;
    config.api_key = InpVCPApiKey;
    config.endpoint = "https://api.veritaschain.org";
    config.venue_id = "MY_VENUE";
    config.tier = VCP_TIER_SILVER;
    config.async_mode = true;
    
    VCP_Initialize(config);
    return INIT_SUCCEEDED;
}

主要功能

MQL5桥接

CVCPLogger类、10K缓冲异步队列、批处理、自动哈希链

Python适配器

VCPEventFactory、JSON/JSONL序列化、VCC客户端、Manager API轮询

哈希链

用于防篡改审计追踪的自动SHA-256哈希链

TraceID

通过EventCorrelator验证的订单生命周期关联


适用对象


输出示例

这些实现生成的事件输出符合VCP v1.0的JSON:

{
  "header": {
    "event_id": "019b591b-ea7e-7507-a1cc-bb555e81345f",
    "trace_id": "019b591b-ea7e-7f6f-b130-ede86931b9d4",
    "timestamp_int": "1766726560382246912",
    "timestamp_iso": "2025-12-26T05:22:40.382Z",
    "event_type": "SIG",
    "event_type_code": 1,
    "timestamp_precision": "MILLISECOND",
    "clock_sync_status": "BEST_EFFORT",
    "hash_algo": "SHA256",
    "venue_id": "MY_PROP_FIRM",
    "symbol": "XAUUSD",
    "account_id": "acc_ca1ee1d09effaa36"
  },
  "payload": {
    "vcp_gov": {
      "algo_id": "ALGO_001",
      "algo_version": "2.1.0",
      "confidence": "0.85"
    }
  },
  "security": {
    "event_hash": "1caae2edff5207de8dbc05ac88a7353c...",
    "prev_hash": "0000000000000000000000000000000000..."
  }
}

开始使用

1. 克隆仓库

git clone https://github.com/veritaschain/vcp-sidecar-guide.git

2. 查阅集成指南

3. 运行示例

cd vcp-sidecar-guide
pip install -r src/python/requirements.txt
python examples/python/example_usage.py

4. 集成到您的系统

使用src/目录中的源代码


后续计划

我们正在持续扩展VCP工具:


资源


VeritasChain Standards Organization(VSO)为AI驱动和算法市场开发开放的加密审计标准。VSO认证仅确认技术合规性,不代表财务、商业或监管认可。

"验证,而非信任"

分享本文:

开始使用VCP构建

克隆仓库,立即将VCP审计追踪集成到您的交易系统中。

查看仓库 返回博客