chore: update genesis timestamp, fix import paths, clean compiled JS files, and adjust mock path - Update devnet genesis timestamp to 1766400877 - Add Receipt model for zk-proof generation with receiptId, miner, coordinator fields - Fix import paths from settings to config across service modules (access_control, audit_logging, encryption, hsm_key_manager, key_management, zk_proofs) - Remove compiled JavaScript files from explorer-web components and lib directories - Update mock data base path
614 lines
21 KiB
HTML
614 lines
21 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Documentation - AITBC</title>
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
:root {
|
|
--primary-color: #2563eb;
|
|
--secondary-color: #1e40af;
|
|
--accent-color: #3b82f6;
|
|
--text-dark: #1f2937;
|
|
--text-light: #6b7280;
|
|
--bg-light: #f9fafb;
|
|
--bg-white: #ffffff;
|
|
--border-color: #e5e7eb;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
line-height: 1.6;
|
|
color: var(--text-dark);
|
|
}
|
|
|
|
.container {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
padding: 0 20px;
|
|
}
|
|
|
|
/* Header */
|
|
header {
|
|
background: var(--bg-white);
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
position: fixed;
|
|
width: 100%;
|
|
top: 0;
|
|
z-index: 1000;
|
|
}
|
|
|
|
nav {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 1rem 0;
|
|
}
|
|
|
|
.logo {
|
|
font-size: 1.5rem;
|
|
font-weight: bold;
|
|
color: var(--primary-color);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.nav-links {
|
|
display: flex;
|
|
gap: 2rem;
|
|
list-style: none;
|
|
}
|
|
|
|
.nav-links a {
|
|
color: var(--text-dark);
|
|
text-decoration: none;
|
|
transition: color 0.3s;
|
|
}
|
|
|
|
.nav-links a:hover {
|
|
color: var(--primary-color);
|
|
}
|
|
|
|
/* Main Content */
|
|
main {
|
|
margin-top: 80px;
|
|
padding: 40px 0;
|
|
}
|
|
|
|
.doc-header {
|
|
text-align: center;
|
|
margin-bottom: 3rem;
|
|
}
|
|
|
|
.doc-header h1 {
|
|
font-size: 2.5rem;
|
|
color: var(--text-dark);
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.doc-header p {
|
|
font-size: 1.1rem;
|
|
color: var(--text-light);
|
|
}
|
|
|
|
/* Documentation Grid */
|
|
.doc-grid {
|
|
display: grid;
|
|
grid-template-columns: 250px 1fr;
|
|
gap: 2rem;
|
|
}
|
|
|
|
/* Sidebar */
|
|
.sidebar {
|
|
background: var(--bg-light);
|
|
border-radius: 10px;
|
|
padding: 1.5rem;
|
|
height: fit-content;
|
|
position: sticky;
|
|
top: 100px;
|
|
}
|
|
|
|
.sidebar h3 {
|
|
font-size: 1.2rem;
|
|
margin-bottom: 1rem;
|
|
color: var(--text-dark);
|
|
}
|
|
|
|
.sidebar ul {
|
|
list-style: none;
|
|
}
|
|
|
|
.sidebar li {
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.sidebar a {
|
|
color: var(--text-light);
|
|
text-decoration: none;
|
|
display: block;
|
|
padding: 0.5rem;
|
|
border-radius: 5px;
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.sidebar a:hover,
|
|
.sidebar a.active {
|
|
background: var(--bg-white);
|
|
color: var(--primary-color);
|
|
}
|
|
|
|
/* Content */
|
|
.content {
|
|
background: var(--bg-white);
|
|
border-radius: 10px;
|
|
padding: 2rem;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
|
|
}
|
|
|
|
.content h2 {
|
|
font-size: 2rem;
|
|
margin-bottom: 1rem;
|
|
color: var(--text-dark);
|
|
border-bottom: 2px solid var(--border-color);
|
|
padding-bottom: 0.5rem;
|
|
}
|
|
|
|
.content h3 {
|
|
font-size: 1.5rem;
|
|
margin: 2rem 0 1rem;
|
|
color: var(--text-dark);
|
|
}
|
|
|
|
.content h4 {
|
|
font-size: 1.2rem;
|
|
margin: 1.5rem 0 0.5rem;
|
|
color: var(--primary-color);
|
|
}
|
|
|
|
.content p {
|
|
margin-bottom: 1rem;
|
|
color: var(--text-light);
|
|
}
|
|
|
|
.content ul,
|
|
.content ol {
|
|
margin-bottom: 1rem;
|
|
padding-left: 2rem;
|
|
}
|
|
|
|
.content li {
|
|
margin-bottom: 0.5rem;
|
|
color: var(--text-light);
|
|
}
|
|
|
|
.content code {
|
|
background: var(--bg-light);
|
|
padding: 0.2rem 0.4rem;
|
|
border-radius: 3px;
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.content pre {
|
|
background: var(--bg-light);
|
|
padding: 1rem;
|
|
border-radius: 5px;
|
|
overflow-x: auto;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.content pre code {
|
|
background: none;
|
|
padding: 0;
|
|
}
|
|
|
|
.content blockquote {
|
|
border-left: 4px solid var(--primary-color);
|
|
padding-left: 1rem;
|
|
margin: 1rem 0;
|
|
color: var(--text-light);
|
|
font-style: italic;
|
|
}
|
|
|
|
.content table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin: 1rem 0;
|
|
}
|
|
|
|
.content th,
|
|
.content td {
|
|
padding: 0.75rem;
|
|
text-align: left;
|
|
border-bottom: 1px solid var(--border-color);
|
|
}
|
|
|
|
.content th {
|
|
background: var(--bg-light);
|
|
font-weight: 600;
|
|
color: var(--text-dark);
|
|
}
|
|
|
|
/* Alert Boxes */
|
|
.alert {
|
|
padding: 1rem;
|
|
border-radius: 5px;
|
|
margin: 1rem 0;
|
|
}
|
|
|
|
.alert-info {
|
|
background: #dbeafe;
|
|
border-left: 4px solid #3b82f6;
|
|
color: #1e40af;
|
|
}
|
|
|
|
.alert-warning {
|
|
background: #fef3c7;
|
|
border-left: 4px solid #f59e0b;
|
|
color: #92400e;
|
|
}
|
|
|
|
.alert-success {
|
|
background: #d1fae5;
|
|
border-left: 4px solid #10b981;
|
|
color: #065f46;
|
|
}
|
|
|
|
/* Footer */
|
|
footer {
|
|
background: var(--text-dark);
|
|
color: white;
|
|
padding: 40px 0;
|
|
text-align: center;
|
|
margin-top: 40px;
|
|
}
|
|
|
|
/* Responsive */
|
|
@media (max-width: 768px) {
|
|
.doc-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.sidebar {
|
|
position: static;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<!-- Header -->
|
|
<header>
|
|
<nav class="container">
|
|
<a href="index.html" class="logo">AITBC</a>
|
|
<ul class="nav-links">
|
|
<li><a href="index.html">Home</a></li>
|
|
<li><a href="documentation.html" class="active">Documentation</a></li>
|
|
<li><a href="#roadmap">Roadmap</a></li>
|
|
<li><a href="#contact">Contact</a></li>
|
|
</ul>
|
|
</nav>
|
|
</header>
|
|
|
|
<!-- Main Content -->
|
|
<main>
|
|
<div class="container">
|
|
<div class="doc-header">
|
|
<h1>AITBC Documentation</h1>
|
|
<p>Comprehensive guides and technical documentation for the AITBC platform</p>
|
|
</div>
|
|
|
|
<div class="doc-grid">
|
|
<!-- Sidebar -->
|
|
<aside class="sidebar">
|
|
<h3>Quick Links</h3>
|
|
<ul>
|
|
<li><a href="#getting-started">Getting Started</a></li>
|
|
<li><a href="#architecture">Architecture</a></li>
|
|
<li><a href="#api-reference">API Reference</a></li>
|
|
<li><a href="#developer-guide">Developer Guide</a></li>
|
|
<li><a href="#deployment">Deployment</a></li>
|
|
<li><a href="#security">Security</a></li>
|
|
<li><a href="#faq">FAQ</a></li>
|
|
</ul>
|
|
</aside>
|
|
|
|
<!-- Content -->
|
|
<div class="content">
|
|
<section id="getting-started">
|
|
<h2>Getting Started</h2>
|
|
<p>Welcome to AITBC! This guide will help you get started with the AI Training & Blockchain Computing platform.</p>
|
|
|
|
<h3>Prerequisites</h3>
|
|
<ul>
|
|
<li>Linux or macOS operating system</li>
|
|
<li>Docker installed (version 20.10+)</li>
|
|
<li>Git</li>
|
|
<li>Node.js (version 16+) for frontend development</li>
|
|
<li>Python (version 3.8+) for backend development</li>
|
|
</ul>
|
|
|
|
<h3>Quick Installation</h3>
|
|
<div class="alert alert-info">
|
|
<strong>Note:</strong> For production deployments, please refer to the <a href="#deployment">Deployment Guide</a>.
|
|
</div>
|
|
|
|
<pre><code># Clone the repository
|
|
git clone https://github.com/aitbc/aitbc.git
|
|
cd aitbc
|
|
|
|
# Run the setup script
|
|
./scripts/setup.sh
|
|
|
|
# Start the development environment
|
|
docker-compose up -d</code></pre>
|
|
|
|
<h3>Verify Installation</h3>
|
|
<p>Once the services are running, you can verify the installation by checking:</p>
|
|
<ul>
|
|
<li>Blockchain Node: <code>http://localhost:8545</code></li>
|
|
<li>Coordinator API: <code>http://localhost:8080</code></li>
|
|
<li>Marketplace UI: <code>http://localhost:3000</code></li>
|
|
</ul>
|
|
</section>
|
|
|
|
<section id="architecture">
|
|
<h2>Architecture</h2>
|
|
<p>AITBC is built with a modular architecture consisting of several key components:</p>
|
|
|
|
<h3>Core Components</h3>
|
|
<h4>1. Blockchain Node</h4>
|
|
<p>The blockchain node implements a hybrid Proof of Authority/Proof of Stake consensus mechanism with dynamic mode switching:</p>
|
|
<ul>
|
|
<li><strong>FAST Mode:</strong> 100-200ms finality, up to 50,000 TPS</li>
|
|
<li><strong>BALANCED Mode:</strong> 500ms-1s finality, up to 20,000 TPS</li>
|
|
<li><strong>SECURE Mode:</strong> 2-5s finality, up to 10,000 TPS</li>
|
|
</ul>
|
|
|
|
<h4>2. Coordinator API</h4>
|
|
<p>The coordinator acts as the central hub for marketplace operations:</p>
|
|
<ul>
|
|
<li>Job management and scheduling</li>
|
|
<li>Receipt verification and storage</li>
|
|
<li>Provider registration and reputation</li>
|
|
<li>Multi-tenant support</li>
|
|
</ul>
|
|
|
|
<h4>3. GPU Service Provider</h4>
|
|
<p>Decentralized compute providers offer AI/ML services:</p>
|
|
<ul>
|
|
<li>Model inference</li>
|
|
<li>Training and fine-tuning</li>
|
|
<li>Result verification</li>
|
|
<li>Cross-chain compatibility</li>
|
|
</ul>
|
|
|
|
<h3>Data Flow</h3>
|
|
<ol>
|
|
<li>Client submits job request to Coordinator</li>
|
|
<li>Coordinator matches with suitable provider</li>
|
|
<li>Provider executes computation</li>
|
|
<li>Results submitted with cryptographic proof</li>
|
|
<li>Verification and settlement on blockchain</li>
|
|
</ol>
|
|
</section>
|
|
|
|
<section id="api-reference">
|
|
<h2>API Reference</h2>
|
|
<p>AITBC provides REST APIs for interacting with the platform:</p>
|
|
|
|
<h3>Coordinator API</h3>
|
|
<h4>Authentication</h4>
|
|
<p>All API requests require authentication using JWT tokens:</p>
|
|
<pre><code>Authorization: Bearer <your-jwt-token></code></pre>
|
|
|
|
<h4>Endpoints</h4>
|
|
<table>
|
|
<tr>
|
|
<th>Method</th>
|
|
<th>Endpoint</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
<tr>
|
|
<td>POST</td>
|
|
<td>/api/v1/jobs</td>
|
|
<td>Create a new job</td>
|
|
</tr>
|
|
<tr>
|
|
<td>GET</td>
|
|
<td>/api/v1/jobs/{id}</td>
|
|
<td>Get job details</td>
|
|
</tr>
|
|
<tr>
|
|
<td>GET</td>
|
|
<td>/api/v1/jobs</td>
|
|
<td>List jobs</td>
|
|
</tr>
|
|
<tr>
|
|
<td>POST</td>
|
|
<td>/api/v1/receipts/verify</td>
|
|
<td>Verify a receipt</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h3>Example: Create a Job</h3>
|
|
<pre><code>curl -X POST http://localhost:8080/api/v1/jobs \
|
|
-H "Authorization: Bearer <token>" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"type": "inference",
|
|
"model_id": "gpt-4",
|
|
"input_data": "Hello, world!",
|
|
"requirements": {
|
|
"max_tokens": 100,
|
|
"temperature": 0.7
|
|
}
|
|
}'</code></pre>
|
|
</section>
|
|
|
|
<section id="developer-guide">
|
|
<h2>Developer Guide</h2>
|
|
<p>This section provides detailed information for developers building on AITBC.</p>
|
|
|
|
<h3>SDKs</h3>
|
|
<p>AITBC provides SDKs for multiple languages:</p>
|
|
<ul>
|
|
<li><strong>Python SDK:</strong> <code>pip install aitbc</code></li>
|
|
<li><strong>JavaScript SDK:</strong> <code>npm install @aitbc/client</code></li>
|
|
<li><strong>Go SDK:</strong> <code>go get github.com/aitbc/go-sdk</code></li>
|
|
</ul>
|
|
|
|
<h3>Building Extensions</h3>
|
|
<p>Developers can extend AITBC functionality through:</p>
|
|
<ol>
|
|
<li>Custom marketplace extensions</li>
|
|
<li>New compute provider implementations</li>
|
|
<li>Alternative consensus mechanisms</li>
|
|
<li>Cross-chain bridges</li>
|
|
</ol>
|
|
|
|
<h3>Contributing</h3>
|
|
<p>We welcome contributions! Please see our <a href="https://gitea.bubuit.net/aitbc/blob/main/CONTRIBUTING.md">contributing guide</a> for details.</p>
|
|
</section>
|
|
|
|
<section id="deployment">
|
|
<h2>Deployment Guide</h2>
|
|
<p>This guide covers deploying AITBC in production environments.</p>
|
|
|
|
<h3>System Requirements</h3>
|
|
<div class="alert alert-warning">
|
|
<strong>Minimum Requirements:</strong>
|
|
<ul>
|
|
<li>4 CPU cores</li>
|
|
<li>8GB RAM</li>
|
|
<li>100GB storage</li>
|
|
<li>Stable internet connection</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<h3>Production Deployment</h3>
|
|
<pre><code># Clone the repository
|
|
git clone https://github.com/aitbc/aitbc.git
|
|
cd aitbc
|
|
|
|
# Configure environment
|
|
cp .env.example .env
|
|
# Edit .env with your settings
|
|
|
|
# Deploy with Docker Compose
|
|
docker-compose -f docker-compose.prod.yml up -d</code></pre>
|
|
|
|
<h3>Monitoring</h3>
|
|
<p>AITBC includes built-in monitoring capabilities:</p>
|
|
<ul>
|
|
<li>Prometheus metrics endpoint</li>
|
|
<li>Grafana dashboards</li>
|
|
<li>Health check endpoints</li>
|
|
<li>Log aggregation</li>
|
|
</ul>
|
|
</section>
|
|
|
|
<section id="security">
|
|
<h2>Security</h2>
|
|
<p>Security is a top priority for AITBC. Here are the key security features:</p>
|
|
|
|
<h3>Cryptography</h3>
|
|
<ul>
|
|
<li>Zero-knowledge proofs for privacy</li>
|
|
<li>Threshold signatures for security</li>
|
|
<li>End-to-end encryption</li>
|
|
<li>Secure multi-party computation</li>
|
|
</ul>
|
|
|
|
<h3>Audit Reports</h3>
|
|
<p>Our smart contracts have been audited by:</p>
|
|
<ul>
|
|
<li>Trail of Bits (2024)</li>
|
|
<li>CertiK (2024)</li>
|
|
<li>OpenZeppelin (2023)</li>
|
|
</ul>
|
|
|
|
<h3>Bug Bounty</h3>
|
|
<p>We offer a bug bounty program with rewards up to $100,000. Report vulnerabilities at <a href="mailto:aitbc@bubuit.net">security@aitbc.io</a>.</p>
|
|
</section>
|
|
|
|
<section id="faq">
|
|
<h2>Frequently Asked Questions</h2>
|
|
|
|
<h3>General</h3>
|
|
<h4>What is AITBC?</h4>
|
|
<p>AITBC is a decentralized platform for AI/ML workloads that combines blockchain technology with artificial intelligence to create a trustless marketplace for computational resources.</p>
|
|
|
|
<h4>How does AITBC ensure privacy?</h4>
|
|
<p>We use zero-knowledge proofs and secure enclaves to protect sensitive data while enabling verification of computation.</p>
|
|
|
|
<h4>What blockchains does AITBC support?</h4>
|
|
<p>AITBC currently supports Ethereum, Polygon, and Binance Smart Chain, with more chains being added.</p>
|
|
|
|
<h3>Technical</h3>
|
|
<h4>What is the maximum TPS?</h4>
|
|
<p>AITBC can achieve up to 100,000 TPS through sharding and rollup architectures.</p>
|
|
|
|
<h4>How long does finality take?</h4>
|
|
<p>Finality time depends on the consensus mode: 100ms (FAST), 1s (BALANCED), or 5s (SECURE).</p>
|
|
|
|
<h3>Economic</h3>
|
|
<h4>How are providers rewarded?</h4>
|
|
<p>Providers earn AITBC tokens for completing computations, with rewards based on performance and reputation.</p>
|
|
|
|
<h4>What are the fees?</h4>
|
|
<p>Transaction fees are dynamic and depend on network load, typically ranging from 0.1% to 1% of the transaction value.</p>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<!-- Footer -->
|
|
<footer>
|
|
<div class="container">
|
|
<p>© 2025 AITBC. All rights reserved.</p>
|
|
</div>
|
|
</footer>
|
|
|
|
<script>
|
|
// Smooth scrolling for sidebar links
|
|
document.querySelectorAll('.sidebar a').forEach(anchor => {
|
|
anchor.addEventListener('click', function (e) {
|
|
e.preventDefault();
|
|
document.querySelector(this.getAttribute('href')).scrollIntoView({
|
|
behavior: 'smooth'
|
|
});
|
|
});
|
|
});
|
|
|
|
// Update active sidebar link on scroll
|
|
const sections = document.querySelectorAll('section[id]');
|
|
const sidebarLinks = document.querySelectorAll('.sidebar a');
|
|
|
|
window.addEventListener('scroll', () => {
|
|
let current = '';
|
|
sections.forEach(section => {
|
|
const sectionTop = section.offsetTop;
|
|
const sectionHeight = section.clientHeight;
|
|
if (scrollY >= (sectionTop - 100)) {
|
|
current = section.getAttribute('id');
|
|
}
|
|
});
|
|
|
|
sidebarLinks.forEach(link => {
|
|
link.classList.remove('active');
|
|
if (link.getAttribute('href') === '#' + current) {
|
|
link.classList.add('active');
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|