█▀▀ █░█ ▄▀█ █░░ █░░ █▀▀ █▄░█ █▀▀ █▀▀ █▀ █▀▄ █▄▀ █▄▄ █▀█ █▀█ █▄▄ █▄▄ ██▄ █░▀█ █▄█ ██▄ ▄█ █▄▀ █░█
A modern, secure, and developer-friendly Python SDK for building verifiable challenges
on Platform Network using confidential computing with end-to-end security,
using the technology from Dstack-TEE.
Getting Started · Architecture · Usage · Security · API Reference
Caution
Challenge SDK is currently in early development. Some features may be incomplete, APIs may change, and potential security vulnerabilities may exist. The team is actively testing to ensure everything is properly implemented and stable. Not ready for production use.
-
End-to-End Security: Encrypted WebSocket communication with TDX attestation (X25519/ChaCha20-Poly1305), Ed25519 signed requests, and encrypted credential management.
-
Lifecycle Management: Decorator-based handlers for startup, ready, job evaluation, and cleanup.
-
Database Migrations: Automatic versioned migrations with sealed credential decryption.
-
Custom Weights: Flexible weights calculation for mining allocation.
-
Public APIs: Built-in support for custom public endpoints.
-
Monitoring: Health checks and comprehensive logging.
Note
Challenge SDK requires Python 3.10 or higher.
Install the Challenge SDK:
pip install platform-challenge-sdkOr install from source:
git clone https://github.com/PlatformNetwork/challenge.git
cd challenge
pip install -e .Create a new challenge file my_challenge.py:
from platform_challenge_sdk import challenge, run, Context
@challenge.on_startup()
async def on_startup():
print("Challenge initializing...")
@challenge.on_ready()
async def on_ready():
print("Challenge ready to accept jobs!")
@challenge.on_job()
def evaluate(ctx: Context, payload: dict) -> dict:
return {
"score": 0.95,
"metrics": {"accuracy": 0.95},
"job_type": "inference",
}
if __name__ == "__main__":
run()See Getting Started for detailed installation and usage instructions.
For complete documentation, see:
- Getting Started - Installation, prerequisites, and quick start guide
- Architecture - System architecture, components, and Platform API/Validator roles
- Usage - Challenge lifecycle, job evaluation, weights, and public endpoints
- Security - Security architecture, TDX attestation, and encryption details
- API Reference - Complete API documentation (decorators, context, endpoints)
- Database Migrations - Migration guide and examples
- Development - Development setup, project structure, and tools
- Troubleshooting - Common errors and solutions
Copyright 2025 Cortex Foundation
Licensed under the MIT License.
See LICENSE file for details.
Made with love by the Cortex Foundation