Files
aitbc/website/docs/wallet-daemon.html

215 lines
7.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wallet Daemon - AITBC Documentation</title>
<link rel="stylesheet" href="css/docs.css">
<link rel="stylesheet" href="/assets/css/site-header.css">
<link rel="preload" href="/assets/css/font-awesome.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="/assets/css/font-awesome.min.css"></noscript>
<!-- Font Awesome CDN fallback -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" crossorigin="anonymous" media="print" onload="this.media='all'; this.onload=null;">
</head>
<body>
<div data-global-header></div>
<main>
<div class="container">
<!-- Breadcrumb -->
<div class="breadcrumb">
<a href="index.html">Documentation</a>
<span></span>
<a href="components.html">Components</a>
<span></span>
<span>Wallet Daemon</span>
</div>
<!-- Back Button -->
<a href="components.html" class="back-button">
<i class="fas fa-arrow-left"></i>
Back to Components
</a>
<!-- Header -->
<div class="doc-header">
<h1><i class="fas fa-wallet"></i> Wallet Daemon</h1>
<p>Encrypted keystore with Argon2id + XChaCha20-Poly1305, REST/JSON-RPC APIs, and receipt verification capabilities</p>
<span class="status-badge">● Live</span>
</div>
<!-- Overview -->
<section class="content-section">
<h2>Overview</h2>
<p>The AITBC Wallet Daemon provides secure wallet management with enterprise-grade encryption and multiple API interfaces for seamless integration.</p>
<h3>Key Features</h3>
<ul>
<li>Encrypted keystore with Argon2id + XChaCha20-Poly1305</li>
<li>REST and JSON-RPC APIs</li>
<li>Receipt verification capabilities</li>
<li>Hardware wallet support</li>
<li>Multi-signature wallet support</li>
</ul>
</section>
<!-- Architecture -->
<section class="content-section">
<h2>Architecture</h2>
<p>The wallet daemon is built with security as the primary focus:</p>
<div class="feature-grid">
<div class="feature-card">
<h4><i class="fas fa-lock"></i> Encryption</h4>
<p>Argon2id key derivation with XChaCha20-Poly1305 AEAD encryption</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-key"></i> Key Management</h4>
<p>Hierarchical deterministic (HD) wallets with BIP44 support</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-plug"></i> API Layer</h4>
<p>REST and JSON-RPC APIs for easy integration</p>
</div>
<div class="feature-card">
<h4><i class="fas fa-shield-alt"></i> Security</h4>
<p>Sandboxed execution and memory protection</p>
</div>
</div>
</section>
<!-- API Reference -->
<section class="content-section">
<h2>API Reference</h2>
<h3>REST API</h3>
<pre><code># Create wallet
POST /api/v1/wallet/create
{
"name": "my-wallet",
"password": "strong-password"
}
# Unlock wallet
POST /api/v1/wallet/unlock
{
"name": "my-wallet",
"password": "strong-password"
}
# Get address
GET /api/v1/wallet/address
# Send transaction
POST /api/v1/wallet/send
{
"to": "0x...",
"amount": 1000,
"fee": 10
}</code></pre>
<h3>JSON-RPC API</h3>
<pre><code># Get balance
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "get_balance",
"params": [],
"id": 1
}'
# Sign transaction
curl -X POST http://localhost:8545 \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "sign_transaction",
"params": [tx_data],
"id": 1
}'</code></pre>
</section>
<!-- Configuration -->
<section class="content-section">
<h2>Configuration</h2>
<p>The wallet daemon can be configured via environment variables or config file:</p>
<pre><code># Configuration file: ~/.aitbc/wallet/config.toml
[wallet]
keystore_path = "~/.aitbc/wallet/keystore"
default_network = "mainnet"
[api]
rest_host = "127.0.0.1"
rest_port = 8545
rpc_host = "127.0.0.1"
rpc_port = 8546
[security]
argon2_time = 3
argon2_memory = 67108864 # 64MB
argon2_parallelism = 4</code></pre>
</section>
<!-- Security -->
<section class="content-section">
<h2>Security Features</h2>
<ul>
<li><strong>Memory Encryption</strong>: All sensitive data encrypted in memory</li>
<li><strong>Secure Erasure</strong>: Memory zeroized after use</li>
<li><strong>Access Control</strong>: API key authentication</li>
<li><strong>Audit Logging</strong>: All operations logged securely</li>
<li><strong>Hardware Support</strong>: Ledger and Trezor integration</li>
</ul>
</section>
<!-- Integration -->
<section class="content-section">
<h2>Integration Examples</h2>
<h3>Python Integration</h3>
<pre><code>from aitbc_wallet import WalletClient
client = WalletClient("http://localhost:8545")
# Create wallet
wallet = client.create_wallet("my-wallet", "password")
print(f"Address: {wallet.address}")
# Send transaction
tx = client.send_transaction(
to="0x123...",
amount=1000,
password="${PASSWORD}"
)
print(f"Transaction hash: {tx.hash}")</code></pre>
<h3>JavaScript Integration</h3>
<pre><code>const { WalletClient } = require('@aitbc/wallet');
const client = new WalletClient('http://localhost:8545');
// Create wallet
const wallet = await client.createWallet('my-wallet', 'password');
console.log('Address:', wallet.address);
// Get balance
const balance = await client.getBalance();
console.log('Balance:', balance);</code></pre>
</section>
</div>
</main>
<footer>
<div class="container">
<p>&copy; 2026 AITBC. All rights reserved.</p>
</div>
</footer>
<script src="js/theme.js"></script>
<script src="/assets/js/global-header.js"></script>
</body>
</html>