-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwallet-architecture.html
More file actions
210 lines (181 loc) · 11.9 KB
/
Copy pathwallet-architecture.html
File metadata and controls
210 lines (181 loc) · 11.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI2Work Native Wallet Architecture</title>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'JetBrains Mono', monospace; background: #020617; min-height: 100vh; padding: 2rem; color: white; }
.container { max-width: 1200px; margin: 0 auto; }
.header { margin-bottom: 2rem; }
.header-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.pulse-dot { width: 12px; height: 12px; background: #22d3ee; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }
.subtitle { color: #94a3b8; font-size: 0.875rem; margin-left: 1.75rem; }
.diagram-container { background: rgba(15, 23, 42, 0.5); border-radius: 1rem; border: 1px solid #1e293b; padding: 1.5rem; overflow-x: auto; }
svg { width: 100%; min-width: 900px; display: block; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 2rem; }
.card { background: rgba(15, 23, 42, 0.5); border-radius: 0.75rem; border: 1px solid #1e293b; padding: 1.25rem; }
.card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.card-dot { width: 8px; height: 8px; border-radius: 50%; }
.card-dot.cyan { background: #22d3ee; }
.card-dot.emerald { background: #34d399; }
.card-dot.violet { background: #a78bfa; }
.card-dot.rose { background: #fb7185; }
.card h3 { font-size: 0.875rem; font-weight: 600; }
.card ul { list-style: none; color: #94a3b8; font-size: 0.75rem; }
.card li { margin-bottom: 0.375rem; }
.footer { text-align: center; margin-top: 1.5rem; color: #475569; font-size: 0.75rem; }
</style>
<link rel="canonical" href="https://atlasnexus.tech/wallet-architecture">
</head>
<body>
<div class="container">
<div class="header">
<div class="header-row">
<div class="pulse-dot"></div>
<h1>AI2Work Native Ethereum Wallet</h1>
</div>
<p class="subtitle">Android Keystore · Capacitor WebView Bridge · EIP-1559 Signing</p>
</div>
<div class="diagram-container">
<svg viewBox="0 0 1000 720">
<defs>
<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#64748b" />
</marker>
<pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse">
<path d="M 40 0 L 0 0 0 40" fill="none" stroke="#1e293b" stroke-width="0.5"/>
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#grid)" />
<!-- Android Device Boundary -->
<rect x="30" y="30" width="480" height="500" rx="12" fill="rgba(34, 211, 238, 0.03)" stroke="#22d3ee" stroke-width="1.5" stroke-dasharray="8,4"/>
<text x="42" y="48" fill="#22d3ee" font-size="10" font-weight="600">Android Device</text>
<!-- AI2Work App Boundary -->
<rect x="50" y="60" width="440" height="455" rx="8" fill="rgba(34, 211, 238, 0.02)" stroke="#22d3ee" stroke-width="0.8" stroke-dasharray="4,4"/>
<text x="62" y="76" fill="#22d3ee" font-size="8">AI2Work APK (Capacitor)</text>
<!-- WebView -->
<rect x="300" y="95" width="175" height="100" rx="6" fill="rgba(8, 51, 68, 0.4)" stroke="#22d3ee" stroke-width="1.5"/>
<text x="387" y="118" fill="white" font-size="11" font-weight="600" text-anchor="middle">WebView</text>
<text x="387" y="136" fill="#94a3b8" font-size="8" text-anchor="middle">ai2work.onrender.com</text>
<text x="387" y="152" fill="#94a3b8" font-size="8" text-anchor="middle">React + wagmi</text>
<text x="387" y="168" fill="#94a3b8" font-size="7" text-anchor="middle">window.ethereum</text>
<!-- ConnectWallet in WebView -->
<rect x="320" y="210" width="130" height="30" rx="4" fill="rgba(6, 78, 59, 0.3)" stroke="#34d399" stroke-width="1"/>
<text x="385" y="229" fill="#34d399" font-size="8" text-anchor="middle">ConnectWallet → wagmi</text>
<!-- JavascriptInterface Bridge -->
<rect x="80" y="95" width="190" height="85" rx="6" fill="rgba(136, 19, 55, 0.4)" stroke="#fb7185" stroke-width="1.5"/>
<text x="175" y="115" fill="white" font-size="11" font-weight="600" text-anchor="middle">_ai2workWallet</text>
<text x="175" y="132" fill="#94a3b8" font-size="8" text-anchor="middle">@JavascriptInterface Bridge</text>
<text x="175" y="148" fill="#94a3b8" font-size="8" text-anchor="middle">Injecte window.ethereum</text>
<text x="175" y="164" fill="#fb7185" font-size="7" text-anchor="middle">compatible wagmi / connectkit</text>
<!-- NativeEthWalletPlugin -->
<rect x="80" y="210" width="190" height="60" rx="6" fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" stroke-width="1.5"/>
<text x="175" y="234" fill="white" font-size="11" font-weight="600" text-anchor="middle">NativeEthWalletPlugin</text>
<text x="175" y="252" fill="#94a3b8" font-size="8" text-anchor="middle">@CapacitorPlugin</text>
<!-- EthWalletHelper -->
<rect x="80" y="300" width="190" height="90" rx="6" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1.5"/>
<text x="175" y="322" fill="white" font-size="11" font-weight="600" text-anchor="middle">EthWalletHelper</text>
<text x="175" y="340" fill="#94a3b8" font-size="8" text-anchor="middle">secp256k1 ECDSA</text>
<text x="175" y="356" fill="#94a3b8" font-size="8" text-anchor="middle">EIP-191 · EIP-1559</text>
<text x="175" y="374" fill="#a78bfa" font-size="7" text-anchor="middle">Keccak256 + RLP (pure Kotlin)</text>
<!-- Keystore -->
<rect x="80" y="420" width="190" height="55" rx="6" fill="rgba(120, 53, 15, 0.3)" stroke="#fbbf24" stroke-width="1.5"/>
<text x="175" y="442" fill="white" font-size="11" font-weight="600" text-anchor="middle">Android Keystore</text>
<text x="175" y="460" fill="#94a3b8" font-size="8" text-anchor="middle">AES-256/GCM · Hardware-backed</text>
<!-- Remote Web App -->
<rect x="550" y="95" width="200" height="100" rx="8" fill="rgba(30, 41, 59, 0.5)" stroke="#94a3b8" stroke-width="1.5"/>
<text x="650" y="120" fill="white" font-size="11" font-weight="600" text-anchor="middle">Remote Web App</text>
<text x="650" y="140" fill="#94a3b8" font-size="8" text-anchor="middle">ai2work.onrender.com</text>
<text x="650" y="160" fill="#94a3b8" font-size="8" text-anchor="middle">Next.js · Tailwind · wagmi</text>
<text x="650" y="180" fill="#94a3b8" font-size="7" text-anchor="middle">Server-side rendering</text>
<!-- Celo Network -->
<rect x="780" y="95" width="180" height="60" rx="6" fill="rgba(120, 53, 15, 0.3)" stroke="#fbbf24" stroke-width="1.5"/>
<text x="870" y="118" fill="white" font-size="11" font-weight="600" text-anchor="middle">Celo Mainnet</text>
<text x="870" y="136" fill="#94a3b8" font-size="8" text-anchor="middle">Chain ID: 42220</text>
<!-- Arrows -->
<!-- Bridge → WebView -->
<line x1="270" y1="135" x2="298" y2="135" stroke="#fb7185" stroke-width="1.5" marker-end="url(#arrowhead)"/>
<text x="284" y="128" fill="#fb7185" font-size="7" text-anchor="middle">injects</text>
<!-- Plugin → Bridge -->
<line x1="175" y1="210" x2="175" y2="182" stroke="#34d399" stroke-width="1.5" marker-end="url(#arrowhead)"/>
<!-- Helper → Plugin -->
<line x1="175" y1="300" x2="175" y2="272" stroke="#a78bfa" stroke-width="1.5" marker-end="url(#arrowhead)"/>
<!-- Keystore → Helper -->
<line x1="175" y1="420" x2="175" y2="392" stroke="#fbbf24" stroke-width="1.5" marker-end="url(#arrowhead)"/>
<!-- WebView → Remote App (HTTPS) -->
<line x1="475" y1="145" x2="548" y2="145" stroke="#22d3ee" stroke-width="1.5" marker-end="url(#arrowhead)"/>
<text x="512" y="138" fill="#22d3ee" font-size="7" text-anchor="middle">HTTPS</text>
<!-- Remote App → Celo (RPC) -->
<line x1="750" y1="125" x2="778" y2="125" stroke="#fbbf24" stroke-width="1.5" stroke-dasharray="4,3" marker-end="url(#arrowhead)"/>
<text x="764" y="118" fill="#fbbf24" font-size="7" text-anchor="middle">RPC</text>
<!-- EIP-191 Personal Sign flow -->
<text x="175" y="498" fill="#94a3b8" font-size="7" text-anchor="middle">→ EIP-191: "\x19Ethereum Signed Message:\n"</text>
<!-- Legend -->
<text x="780" y="210" fill="white" font-size="10" font-weight="600">Legend</text>
<rect x="780" y="222" width="16" height="10" rx="2" fill="rgba(8, 51, 68, 0.4)" stroke="#22d3ee" stroke-width="1"/>
<text x="802" y="230" fill="#94a3b8" font-size="8">WebView / Frontend</text>
<rect x="780" y="238" width="16" height="10" rx="2" fill="rgba(6, 78, 59, 0.4)" stroke="#34d399" stroke-width="1"/>
<text x="802" y="246" fill="#94a3b8" font-size="8">Capacitor Plugin</text>
<rect x="780" y="254" width="16" height="10" rx="2" fill="rgba(76, 29, 149, 0.4)" stroke="#a78bfa" stroke-width="1"/>
<text x="802" y="262" fill="#94a3b8" font-size="8">Crypto Layer</text>
<rect x="780" y="270" width="16" height="10" rx="2" fill="rgba(136, 19, 55, 0.4)" stroke="#fb7185" stroke-width="1"/>
<text x="802" y="278" fill="#94a3b8" font-size="8">JS Bridge</text>
<rect x="780" y="286" width="16" height="10" rx="2" fill="rgba(120, 53, 15, 0.3)" stroke="#fbbf24" stroke-width="1"/>
<text x="802" y="294" fill="#94a3b8" font-size="8">Keystore / Network</text>
<line x1="780" y1="308" x2="796" y2="308" stroke="#fb7185" stroke-width="1" stroke-dasharray="3,3"/>
<text x="802" y="311" fill="#94a3b8" font-size="8">Auth / RPC Flow</text>
</svg>
</div>
<div class="cards">
<div class="card">
<div class="card-header">
<div class="card-dot rose"></div>
<h3>Zero-Trust Key Storage</h3>
</div>
<ul>
<li>• Private key never leaves Android Keystore</li>
<li>• AES-256/GCM encryption with hardware backing</li>
<li>• No BIP39 mnemonic exposure in memory</li>
<li>• Delete wallet = delete Keystore entry</li>
</ul>
</div>
<div class="card">
<div class="card-header">
<div class="card-dot emerald"></div>
<h3>Web3 Compatible</h3>
</div>
<ul>
<li>• Full window.ethereum shim</li>
<li>• wagmi / connectkit auto-detection</li>
<li>• EIP-191: personal_sign</li>
<li>• EIP-1559: fee-market transactions</li>
</ul>
</div>
<div class="card">
<div class="card-header">
<div class="card-dot violet"></div>
<h3>No External Dependencies</h3>
</div>
<ul>
<li>• Keccak256: 200 lines of pure Kotlin</li>
<li>• RLP encoder: minimal, Ethereum-specific</li>
<li>• ECDSA: BouncyCastle (Android built-in)</li>
<li>• No Web3j, no ethers.js on-device</li>
</ul>
</div>
</div>
<p class="footer">
AI2Work · atlasnexus.tech · Open Source (MIT)
</p>
</div>
<a href="/#contact" class="fixed bottom-4 left-4 right-4 z-50 sm:hidden inline-flex items-center justify-center rounded-full bg-primary px-5 py-3 text-sm font-bold text-white shadow-2xl shadow-blue-900/20" aria-label="Demander un devis Atlas Nexus">Demander un devis →</a>
</body>
</html>