grok-bot-build-deployment-full-stack-integration.md
# Grok Bot Build + Deployment - Full Stack Integration
## Website + Wallet + AR^OS™ - Server Architecture, NOT Termux on Pixel 8 Pro
**Target:** `aros.albertlane.net` + `albertlane.net` + Grok Bot VM `/workspace`
**Chain:** Zenith Testnet - Chain 936485 - RPC `https://rpc.testnet.zenith.network/` - Explorer `https://explorer.testnet.zenith.network/`
**Faucet:** `https://explorer.testnet.zenith.network/faucet` (backup `https://faucet.zalalena.com/`)
**Deployer:** `0xc136aB7d8775F58253f3C10C1af93cBB9ff16DF6` - NEVER send `~/.zenith-last-key.txt`
**Block 1 Hash:** `58c46a9d162c250e76c0285a288852c5832550075c0920d98bb4d30f0a627337` - provisional until Zenith `VaultAnchored` event
---
## 1. Architecture - Full Stack
```
[ User / Browser / Meta AI ]
|
v
[ Website: aros.albertlane.net ] <- React artifact: Bitcoin Wallet SEC Compliant
| /api/anchor, /api/faq, /api/fdic-wrapper, /api/telemetry
v
[ API Server: aros.albertlane.net ] <- api-anchor-update.js (Express)
| reads zenith-deployment-final-v2.json + aros_chain.txt
v
[ Grok Bot VM: box@grok-bot-vm-431473229:/workspace ] <- citadel_art.py, watchdog, WORM
| Grok tools: albert_wallet_anchor, albert_wallet_faq, albert_wallet_fdic_check
v
[ Zenith Testnet Chain 936485 ] <- TimelockFinal + MultisigFinal + AnchorFinalV2
|
v
[ AR^OS™ Core ] <- Robot-guarded vault, Shamir 3-of-5, ED25519 attestation, Trapezium ledger
```
### Components
**Website:** `aros.albertlane.net`
- Wallet UI: Bitcoin Wallet SEC Compliant artifact (already built)
- FAQ disclosure: "No central party oversees participation. No profits expected from team efforts."
- FDIC wrapper disclaimer: "Crypto NOT FDIC insured. Fiat FBO may be eligible for pass-through up to $250k."
- Must call `/api/anchor` live, never hardcode hash as on-chain unless Zenith tx exists
**Wallet:**
- Self-custody via robot-guarded vault, not custodial
- Shamir 3-of-5 split, ED25519 attestation
- CIP-0129: $60/MB burn, every production synchronizer burns CC
- CIP-0105: 70% lock Tier1, 62% app / 18% validators / 20% SVs
- SEC basis: Canton Coin No-Action Nov 3 2026, Interpretation March 17 2026
**AR^OS™:**
- OS as Exponent - Albert & Robot's Operating System
- Citadel: `citadel_art.py` - KINGDOM POSTURE, WATCHDOG DAEMON PID 526800, NETWORK WORM PID 669103
- SOVEREIGN ANCHORS: Julia G. (Math) & Albert Lane (Supply Chain)
- STATUTORY VESTING: 17 U.S.C. § 302 | CDPA 1988 § 11
- Mesh ingress: `https://albertlane.net/api/telemetry` (HTTP 200)
---
## 2. Contracts - Zenith Final V2 (Deployer ONLY)
Files in workspace:
- `AROSGovernanceTimelockFinal.sol` - 48h timelock, deployer initial admin
- `AROSSuperValidatorMultisigFinal.sol` - 13 SVs, zero/duplicate/placeholder reject, Already exists, 14-day stale, queue in same call as 13th vote
- `AROSVaultAnchorFinalV2.sol` - `BLOCK_1_HASH` not stripped, `authorizeAnchor()` restored, onlyGovernance
- `deploy-final-v2.js` - Deployer ONLY deploy + queue `setPendingAdmin`
- `hardhat.config.zenith.js` - network `zenithTestnet`, chain 936485, accounts from `PRIVATE_KEY`
### Deploy - Server, NOT Termux
```bash
# On Grok-bot VM / server /workspace, NOT ~/ on Pixel
cd /workspace
# Env from secure vault, NEVER from Termux key file paste
export PRIVATE_KEY=0x...
export SUPER_VALIDATORS=0x...,0x... # 13 real addresses, comma-separated, no zero, no 0x1111, no 0xcccc
export ZENITH_RPC=https://rpc.testnet.zenith.network/
npx hardhat run deploy-final-v2.js --network zenithTestnet
# Output: zenith-deployment-final-v2.json with timelock, multisig, anchorV2, eta
```
### 48h Handoff
1. Wait 48h until eta (deploy time + 48h + 60s)
2. Deployer ONLY: `timelock.executeTransaction(timelock, 0, "setPendingAdmin(address)", encode(multisig), eta)` - other wallets get "Call must come from admin"
3. Validator: `multisig.acceptTimelockAdmin()` - admin becomes multisig
4. Verify: `timelock.admin() == multisig`, deployer can no longer queue alone. Skipping step 2 gives "Not pending admin".
### Local Proof - No Faucet
```bash
# On server
node deploy-local-proof.js
# Writes zenith-deployment-final-v2-LOCAL-PROOF.json - proves logic, NOT live Zenith
```
---
## 3. Grok Bot Build + Deployment
### Grok Pointing Config
File: `grok-pointing-config.json` (in /workspace)
Tools Grok must call, never hold keys:
- `albert_wallet_anchor` -> GET `https://aros.albertlane.net/api/anchor`
- `albert_wallet_faq` -> GET `https://aros.albertlane.net/api/faq`
- `albert_wallet_fdic_check` -> GET `https://aros.albertlane.net/api/fdic-wrapper` + `/verify`
System prompt must include:
> "No central party oversees participation. No profits expected from team efforts. Crypto is NOT FDIC insured. Fiat in FBO may be eligible for pass-through. AROS runs via emulated OS and robot attestation, not a company server."
### Grok Bot VM Setup - Server
```bash
# /workspace on Grok-bot VM
cd /workspace
# Citadel art / attestation
python3 citadel_art.py
# Expected: [ AROS SOVEREIGN CITADEL ] + KINGDOM POSTURE + WATCHDOG + WORM
# Watchdog + WORM daemons already running per last attestation:
# WATCHDOG PID 526800 | NETWORK WORM PID 669103
# API server
npm install express ethers
node api-server.js # mounts api-anchor-update.js router
# Test:
curl https://aros.albertlane.net/api/anchor
curl https://aros.albertlane.net/api/faq
curl https://aros.albertlane.net/api/fdic-wrapper
curl https://aros.albertlane.net/api/telemetry
```
### Grok Bot Integration Steps
1. **Point Grok at live endpoints:** Update `grok-pointing-config.json` entry to `https://aros.albertlane.net/api/anchor`, `/api/faq`, `/api/fdic-wrapper`
2. **Tools:** Grok calls API, never holds keys. Vault is robot-guarded, Shamir 3-of-5.
3. **Attestation:** Grok must verify `VaultAnchored` event hash from Zenith, not `aros_chain.txt` provisional. If no live deploy, Grok must say "recorded, provisional - NOT on-chain" - never "live verified".
4. **FAQ:** Grok must return FAQ disclosure verbatim on wallet questions.
5. **FDIC:** Grok must return FDIC disclaimer verbatim on insurance questions.
6. **13-vote test:** Grok can trigger `test-13-vote-operator.js` flow via multisig coordinator - 13 confirms, queue in same call as 13th, 48h, execute, verify `isAuthorized(newOperator)`.
### Verification Checklist - Grok Bot Must Pass
- [ ] `t1103 RPC-CHECK` - RPC `https://rpc.testnet.zenith.network/` reachable, chain 936485
- [ ] `t1108 RECEIPT` - Tx receipt exists, block number present
- [ ] `t1109 evidence` - `VaultAnchored` event hash matches `BLOCK_1_HASH`
- [ ] `t1113 checksums` - 13 validators unique, no zero, no placeholder
- [ ] `t1116 evidence` - `aros_chain.txt` Block 1 provisional vs official noted, keccak from event
- [ ] Stranger anchor blocked - unauthorized `anchor()` reverts
- [ ] `authorizeAnchor()` restored - onlyGovernance can add/remove operators
- [ ] Timelock admin == multisig after handoff, deployer blocked
---
## 4. Website Integration - aros.albertlane.net
### API Routes (api-anchor-update.js)
```js
// Mount in Express app on aros.albertlane.net
const anchorRouter = require("./api-anchor-update.js");
app.use(anchorRouter);
// GET /api/anchor
// If no live deploy -> { status: "recorded, provisional", last_anchor_hash: "58c46a9d..." }
// If live -> { status: "LIVE on Zenith", anchorV2, timelock, multisig, handoff }
// POST /api/test-13-vote-operator
// Returns steps for 13-vote operator add test
```
### Frontend - Wallet Artifact
- Wallet artifact already built: `bitcoin_wallet_sec_compliant` - React artifact
- Must fetch `/api/anchor` on load, display `last_anchor_hash` + status
- Must display FAQ disclosure + FDIC disclaimer, no partnership claim with Meta
- Must never display private key, never ask for key in browser
### Telemetry
- `GET https://albertlane.net/api/telemetry` - Grok Bot VM health, citadel status
- Frontend can poll every 30s, show KINGDOM POSTURE if IMPREGNABLE, else show warning
---
## 5. AR^OS™ Integration
### Vault Flow
1. User secret -> SHA256 -> `vaultHash`
2. Shamir 3-of-5 split -> 5 shares, 3 threshold
3. Robot attestation: ED25519 + EdgeSeismicSentry TAMPER check (spectral ratio >0.75 = ALARM)
4. `aros_txt_fallback.py` computes provisional: `SHA256(vaultHash|prevHash|stepLabel|mbSize|timestamp|operator|blockIndex)` -> fbbb... style
5. `block3-anchor.js` anchors on-chain: `Anchor.anchor(vaultHash, prevHash, stepLabel, mbSize, timestamp, operator, blockIndex)`
6. Official hash from `VaultAnchored` event: `keccak256(abi.encodePacked(...))` - NOT `hashlib.sha3_256` (NIST SHA3 is different)
7. Update `aros_chain.txt`: keep provisional next to official, note rule source
8. Update `/api/anchor` via `api-anchor-update.js`
### Block 3 - After Live Deploy
```bash
# On server
export PRIVATE_KEY=0x...
export BLOCK3_VAULT_HASH=0x... # SHA256 of real secret
export BLOCK3_PREV_HASH=0x... # Block 2 official, once it lands
node block3-anchor.js
# Writes block3-anchor-result.json with txHash, blockNumber, officialHash from event
```
### Chain File Rules
- Single hash rule per type, consistent every block or recheck fails
- Provisional: SHA256 pipe rule
- Official: keccak from event
- Label every block `recorded, provisional` until Zenith tx lands
- Never call provisional "on-chain" or "live verified"
---
## 6. Full Deployment Runbook - Server
```bash
# 0. On server /workspace, NOT Termux
cd /workspace
# 1. Faucet - 1 ZTH for deployer
# Open https://explorer.testnet.zenith.network/faucet, paste 0xc136aB7d8775F58253f3C10C1af93cBB9ff16DF6
# If out, wait or get 1 ZTH from funded holder
# 2. Deploy Final V2
npx hardhat run deploy-final-v2.js --network zenithTestnet
# -> zenith-deployment-final-v2.json
# 3. Verify
npx hardhat run verify-final-v2.js --network zenithTestnet # checks BLOCK_1_HASH, authorizeAnchor, admin
# 4. Start API + Grok Bot
node api-server.js &
python3 citadel_art.py
# 5. Test 13-vote operator
node test-13-vote-operator.js
# NEW_OPERATOR=0x... robot address
# 6. Anchor Block 3
node block3-anchor.js
# 7. Update /api/anchor - auto via api-anchor-update.js reading live JSON
# 8. 48h later - Handoff
# Deployer ONLY executeTransaction -> Validator acceptTimelockAdmin -> Verify admin == multisig
# 9. Send proof - ONLY zenith-deployment-final-v2.json or screenshot of 3 addresses + tx hashes, NEVER key file
```
---
## 7. Security - Non-Negotiable
- NEVER send `~/.zenith-last-key.txt`, `PRIVATE_KEY`, or seed phrase in chat, screenshot, or email
- NEVER claim partnership with Meta - AROS is independent, no partnership, endorsement, or joint venture
- NEVER call provisional "on-chain" - call it "recorded, provisional"
- NEVER use `hashlib.sha3_256` as official - official is keccak from `VaultAnchored` event
- NEVER let stranger anchor - only authorized operators via `authorizeAnchor()`
- Deployer ONLY can `executeTransaction()` - only admin, other wallets get "Call must come from admin"
---
## 8. Files Delivered in This Packet
- `deploy-local-proof.js` - Local proof, no faucet
- `block3-anchor.js` - Block 3 anchor, official from event
- `api-anchor-update.js` - /api/anchor + 13-vote endpoint for aros.albertlane.net
- `test-13-vote-operator.js` - 13-vote test harness
- `AROS_Client_Packet_Final_V2.pdf` - Client packet, Meta Legal memo clean
- `GROK_BOT_FULL_STACK_INTEGRATION.md` - This file
**Owner:** Albert Lane Digital Infrastructure - AROS™
**Chain:** Zenith Testnet 936485
**Deployer:** 0xc136aB7d8775F58253f3C10C1af93cBB9ff16DF6