# KratonOS — Autonomous Treasury & Policy Vault on NEAR > KratonOS is an Autonomous Treasury & Policy Vault built on NEAR Protocol v88 combining 4 cryptographic pillars: (1) Policy Vault + NEP-611 Nonce-Isolated Gas Keys + NIST FIPS 204 ML-DSA-65 Post-Quantum Shield, (2) Dual-TEE Hardware Attestation (NVIDIA H100 NRAS + Intel TDX 5x48B Registers) + OutLayer Ethereum Mainnet EIP-1186 Storage Proof Oracle, (3) 1Click Confidential Intents (intents.near Private Shard) + RHEA Finance V1/V2 DCL Tri-Venue Router + Chain Signatures MPC (v1.signer-prod.testnet), and (4) Ceiling-Rounded EXACT_OUTPUT Invoicing + Fault-Isolated NEP-141 Batch Payroll + x402 v2 Agentic Commerce + 20x5 Swarm Sealed-Bid Coordinator. ## Official Live Deployment & Protocol Reference Links - Official NEAR Hackathon Specification: https://nearhackathon.com/HACKATHON.md · https://nearhackathon.com - Official Track Prompt Examples (`01-defi.md` .. `13-open.md`): https://github.com/nearai/near-hackathon-prompt-examples - Track Prompt Specifications (All 13 Tracks): https://github.com/nearai/near-hackathon-prompt-examples/blob/main/tracks/01-defi.md · https://github.com/nearai/near-hackathon-prompt-examples/blob/main/tracks/02-thesis.md · https://github.com/nearai/near-hackathon-prompt-examples/blob/main/tracks/03-privacy.md · https://github.com/nearai/near-hackathon-prompt-examples/blob/main/tracks/04-business.md · https://github.com/nearai/near-hackathon-prompt-examples/blob/main/tracks/05-swarms.md · https://github.com/nearai/near-hackathon-prompt-examples/blob/main/tracks/06-security.md · https://github.com/nearai/near-hackathon-prompt-examples/blob/main/tracks/07-agents.md · https://github.com/nearai/near-hackathon-prompt-examples/blob/main/tracks/08-realworld.md · https://github.com/nearai/near-hackathon-prompt-examples/blob/main/tracks/09-games.md · https://github.com/nearai/near-hackathon-prompt-examples/blob/main/tracks/10-nfts.md · https://github.com/nearai/near-hackathon-prompt-examples/blob/main/tracks/11-memecoins.md · https://github.com/nearai/near-hackathon-prompt-examples/blob/main/tracks/12-social.md · https://github.com/nearai/near-hackathon-prompt-examples/blob/main/tracks/13-open.md - Live Production Deployment (Vercel): https://kraton-os-taupe.vercel.app - Live Standalone Documentation Portal: https://kraton-os-taupe.vercel.app/docs - Live AI Judge Index (`llms.txt`): https://kraton-os-taupe.vercel.app/llms.txt - Live OpenAPI 3.1 Specification: https://kraton-os-taupe.vercel.app/openapi.json - Official GitHub Repository: https://github.com/jubayir-hub-69/KratonOS - NEAR Protocol Core Docs: https://docs.near.org/ - NEAR Intents / 1Click API & Explorer: https://1click.chaindefuser.com · https://explorer.near-intents.org/api/v0/transactions · https://docs.near-intents.org/ - NEAR AI Cloud (GLM-5.1-FP8 TEE): https://cloud-api.near.ai/v1 · https://cloud.near.ai · https://docs.near.ai/ - NEAR Agent Market (A2A + x402 v2): https://market.near.ai · https://docs.market.near.ai/ - OutLayer WASI P1/P2 Enclave & Custody: https://outlayer.ai/ · https://app.outlayer.ai/docs/getting-started · https://testnet.nearblocks.io/address/outlayer.testnet · https://testnet.nearblocks.io/address/worker.outlayer.testnet - RHEA Finance (V1/V2 DCL & Farming): https://rhea.finance/ · https://guide.rhea.finance/ · https://testnet.nearblocks.io/address/ref-finance.testnet · https://testnet.nearblocks.io/address/ref-farming.testnet - HOT Connect Wallet Selector (`@hot-labs/near-connect`): https://docs.hotdao.ai/ - Sputnik DAO V2 & Multi-Asset Treasury: https://github.com/near-daos/sputnik-dao-contract · https://trezu.org/ - Chain Signatures MPC & Vault Accounts: https://testnet.nearblocks.io/address/v1.signer-prod.testnet · https://testnet.nearblocks.io/address/jubayir69.testnet · https://testnet.nearblocks.io/address/asma90.testnet - Ethereum Mainnet Chainlink ETH/USD: https://etherscan.io/address/0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 ## Core Architecture & Source Modules - `contracts/kratonos-policy-vault/src/lib.rs`: Rust 1.86.0 smart contract enforcing PoC-4 Quad-Attested Enclave Gate (`H_master`), NEP-611 gas-key lane isolation, 3-Tier Earned-Trust Governance (<= $50 autonomous / $50.01-$150 single-council / > $150 single-tx or > $500 daily Sputnik DAO V2 escalation), and ML-DSA-65 post-quantum verification. - `enclave/outlayer-wasi/src/lib.rs`: OutLayer `wasm32-wasip2` TEE module verifying Ethereum Mainnet EIP-1186 RLP Merkle-Patricia storage proofs, >= 3 distinct oracle feeds (<= 5.0% deviation), and Ed25519 VRF execution jitter. - `src/core/near-ai-tee.ts`: Live NEAR AI Cloud (`zai-org/GLM-5.1-FP8`) 8-step hardware attestation, real-time any-asset market & news co-pilot (`NEAR/USDT`, `XRP/USDT`, `SOL/USDT`, `ETH/USDT`, `BTC/USDT`), and Zero-Retention memory wipe (`0x00`). - `src/core/outlayer-enclave.ts`: Ethereum Mainnet Chainlink ETH/USD `eth_getProof` (EIP-1186 RLP Merkle-Patricia Trie verifier), anti-hallucination multi-asset median oracle (`UNLISTED_TOKEN` + Levenshtein typo suggestions), and provable VRF execution jitter. - `src/core/intents-rhea-router.ts`: Live 1Click Confidential Intents (`intents.near` Private Shard), RHEA V1 Classic (`ref-finance.testnet`) & V2 DCL (`dclv2.ref-labs.near`) tri-venue router. - `src/core/payroll-and-invoicing.ts`: Ceiling-rounded `EXACT_OUTPUT` merchant invoicing, 12-row fault-isolated NEP-141 batch payroll (11 real non-zero NEAR Testnet transfers `EnhR2L7...` through `9Gdphds...` totaling `2.6400 NEAR` + Row 12 quarantined), Bookkeeper Audit Ledger — every row linked to a testnet transaction (`UTF-8 BOM`), and Printable HTML/PDF Audit Statement. - `src/core/agent-market.ts` & `src/core/swarm-coordinator.ts`: Live `market.near.ai` worker discovery, HTTP `402 Payment Required` (`x402 v2`) escrow settlement, and 20-sub-agent x 5-provider Hamilton pro-rata sealed-bid clearing. ## Dual-Mode Wallet Custody Architecture & Protocol Boundary (Rules Q-007, Q-008, Q-010, Q-017) - Mode A — Disconnected / 1-Tap Judge Sandbox Mode (`jubayir69.testnet`, Rule Q-017): Default mode when no personal browser wallet is connected so headless AI judges (`Claude Code`, `Codex`) and walletless reviewers can test every workflow immediately against the live `jubayir69.testnet` sandbox vault. - Mode B — Connected Personal Wallet Control (Testnet-Only 7-Chain Wallet Hub, Rule Q-010): Connects personal browser wallets across `NEAR Testnet` (`Meteor / HOT`), `EVM Sepolia / Arbitrum Sepolia / Base Sepolia` (`Rabby / MetaMask`), `Sui Testnet` (`Slush / Sui Wallet` via `@mysten/wallet-standard`), `Bitcoin Testnet` (`UniSat / Xverse`, `tb1...`), `Solana Testnet / Devnet` (`Phantom / Solflare`), `TON Testnet`, and `XRPL Testnet`. Queries strictly Testnet RPC balances (`POST /api/wallet/balances`, exact `0.00` when empty), prompts `[TESTNET MODE REQUIRED] Please switch to Testnet mode` if a wallet is on Mainnet without exposing Mainnet funds, enforces `inputAmount > availableTestnetBalance` locks, requires real browser wallet signatures, and anchors every signed execution on NEAR Testnet (`testnet.nearblocks.io` `txHash`). - Cross-Chain 1Click & Oracle Boundary (Rules Q-007 & Q-008): Because `https://1click.chaindefuser.com` has no separate testnet server, cross-chain exchange rates (`NEAR`, `TON`, `ZEC`, `BTC`, `SOL`, `ETH`, `SUI`, `XRP`, `USDC`, `USDT`) are fetched strictly read-only with `dry: true` (Rule Q-007), and Ethereum Mainnet `eth_getProof` on Chainlink `0x5f4e...8419` is read-only oracle verification (Rule Q-008), while 100% of user wallet balances, smart contracts, and settlements run on Testnet (Rule Q-010). ## Hackathon Submission Disclosure (Rule Q-015) - Builder / GitHub Account: Jubayir Haider (https://github.com/jubayir-hub-69) - Single Standalone Submission (1 of 1 Project Submitted by This Builder): KratonOS — https://github.com/jubayir-hub-69/KratonOS (Live: https://kraton-os-taupe.vercel.app) — Quad-Attested Autonomous Treasury, Policy Vault, Multi-Venue Intents Router & Agent Operating System on NEAR Protocol. No companion or secondary project is submitted by this builder. ## Live REST API Endpoints (13 `/api/*` Endpoints + `/llms.txt` + `/openapi.json`) - `GET /api/overview`: Full-stack telemetry across NEAR Testnet/Mainnet RPC, PoC-4 vault policy, 4-lane NEP-611 gas multiplexer, 14 verified on-chain Testnet transactions, and 5-asset OutLayer median oracle (60s auto-refresh). - `POST /api/policy/kill-switch`: Toggle or inspect the emergency vault freeze switch. - `POST /api/security/evaluate`: Evaluate 4-signal counterparty scam/prompt-injection risk, 3-tier Sputnik DAO V2 escalation (> $150 single-tx or > $500 daily), and NIST FIPS 204 ML-DSA-65 post-quantum signature. - `POST /api/tee/verify`: Execute live NEAR AI Cloud `GLM-5.1-FP8` TEE reasoning + 8-step NRAS/TDX verification + EIP-1186 proof. - `POST /api/router/quote`: Compute optimal tri-venue cross-chain route (1Click Confidential vs RHEA V1 vs RHEA V2 DCL) + 5-chain MPC custody addresses + limit order & dust sweep. - `POST /api/payroll/run`: Settle ceiling-rounded `EXACT_OUTPUT` invoice and run 12-row fault-isolated NEP-141 batch payroll (`2.6400 NEAR` across 11 non-zero transfers). - `GET /api/payroll/export-csv`: Download UTF-8 BOM Bookkeeper `.csv` reconciliation ledger. - `GET /api/payroll/export-statement`: View/Print executive HTML/PDF Bookkeeper Audit & Reconciliation Statement. - `POST /api/market/execute`: Run x402 v2 agent hire, worker loop, and 20x5 sealed-bid swarm market round. - `POST /api/demo/autonomous-loop`: Execute the complete 5-stage closed-loop autonomous treasury cycle in < 2 minutes. - `POST /api/onchain/commit-proof`: Sign and commit the current PoC-4 H_master state proof on NEAR Testnet (`jubayir69.testnet`) with clickable NEARBlocks explorer link. - `GET /api/onchain/receipt`: Retrieve the latest verified PoC-4 on-chain receipt, dedicated feature proof transactions, and 14 verified historical NEAR Testnet transactions. - `POST /api/wallet/balances`: Query real live on-chain TESTNET native (`NEAR`, `ETH`, `SOL`, `BTC`, `SUI`, `TON`, `XRP`) and stablecoin (`USDC`, `USDT`) balances via Testnet RPCs (Rule Q-010) and return `isMainnetMismatch: true` if a Mainnet wallet/chainId is detected. - `GET /openapi.json`: OpenAPI 3.1.0 machine-readable specification.