hackquest logo

Barzakh AI

Barzakh is positioned as an AI-first tool for automating blockchain data workflows. It analyzes on-chain activity and helps users move seamlessly from insight to action.

视频

技术栈

React
Next
Web3
AI
Turbo
Typescript

描述

Barzakh AI – Autonomous Multi-Chain Blockchain Intelligence with AI-Orchestrated x402 Payments

Barzakh is a next-generation AI-powered blockchain intelligence and automation platform engineered to redefine how blockchain data is processed, understood, and acted upon via programmatic payments. By seamlessly blending real-time, verifiable on-chain data with context-aware AI agents and x402-powered settlement rails, Barzakh eliminates the manual friction between insight discovery and on-chain execution, allowing users to operate at the speed of blockchain itself.

Barzakh's architecture is designed for multi-chain dominance — aggregating intelligence from EVM-compatible networks (including Ethereum Mainnet, Cronos EVM, Cronos zkEVM, Mantle, Polygon, Arbitrum, Optimism, Base, and other Layer-2s) alongside non-EVM ecosystems like Sei Native, Aptos, Flow, Wormhole, Zeta, and more. Deep integration with the Crypto.com ecosystem — including the Crypto.com AI Agent SDK and Market Data MCP Server — positions Barzakh as a universal blockchain intelligence layer with native AI-to-commerce capabilities.


I. Vision & Mission

In a blockchain landscape where speed, accuracy, and actionable intelligence determine competitive edge, Barzakh's mission is clear:

  • Deliver instant, AI-curated intelligence across multiple blockchain networks

  • Integrate on-chain and off-chain data into a single coherent view

  • Enable AI agents to autonomously trigger x402 gasless payments based on market conditions, user intent, or automated workflows

  • Empower developers, traders, enterprises, and protocols to automate decision-making without sacrificing accuracy or context

Where other platforms stop at analytics, Barzakh executes — turning market shifts, wallet behaviors, and sentiment changes into triggered, automated actions settled on-chain via x402 protocol.


II. x402 Payment Protocol Integration (Cronos-Native)

Barzakh implements the x402 payment protocol for seamless, gasless crypto payments on Cronos EVM:

  • EIP-3009 TransferWithAuthorization for gasless USDC.e meta-transactions — users sign once, no gas required

  • EIP-712 Typed Data Signing for secure, human-readable signature requests

  • Cronos x402 Facilitator integration via official @crypto.com/facilitator-client SDK

  • Wallet verification using EIP-191 personal signatures

  • Real-time subscription management with automatic tier upgrades, expirations, and cron-based enforcement

  • Subscription billing cycles supporting monthly and yearly plans (Starter, Plus, Ultimate tiers)

  • Cancel at period end functionality allowing users to keep benefits until subscription expires

  • Immediate cancellation with instant downgrade to free tier


III. Crypto.com Ecosystem Integration

Crypto.com AI Agent SDK:

  • Natural language queries against Cronos blockchain via @crypto.com/ai-agent-client

  • Wallet analysis returning balance, transaction count, and activity patterns

  • Blockchain statistics including block heights, gas prices, and network metrics

  • Supports both Cronos EVM and zkEVM networks

  • Secured via OpenAI API key integration

Crypto.com Market Data MCP Server:

  • Real-time cryptocurrency prices from Crypto.com API

  • Support for all major cryptocurrencies including CRO, BTC, ETH, USDC, and 100+ tokens

  • 24-hour volume, high, low, and price change data

  • Cronos (CRO) specific market statistics with dedicated tool

  • Currency conversion between any crypto pairs using live exchange rates

  • CoinGecko fallback for 30-day price history and trending tokens


IV. Multi-Chain Blockchain Tools (50+ Tools Across 12+ Chains)

Cronos EVM Tools:

  • Native CRO balance queries

  • CRC-20 token holdings and metadata

  • Transaction history with pagination

  • Real-time gas price monitoring

  • Token transfer history

  • Internal transaction tracking

  • Contract event logs

  • Block information

Cronos zkEVM Tools:

  • Native zkCRO balance with RPC fallback

  • Transaction history with dynamic 10k block range

  • Transaction status by hash

  • ERC-20 token balances via /table/erc20TokenBalance endpoint

  • Token transfer history

  • Internal transaction list

  • Contract ABI retrieval (verified contracts)

  • Contract source code access

  • Token total supply queries

  • Block information

  • All using zkEVM Explorer API

Mantle Network Tools:

  • getMantleBalance — Native MNT balance queries

  • getMantleBlockInfo — Block details and finality status

  • getMantleTransaction — Transaction status and receipt by hash

  • getMantleTokenBalance — ERC-20 token balance for specific tokens

  • getMantleGasPrice — Real-time gas price on Mantle L2

  • getMantleTransactionHistory — Address transaction history with pagination

  • getMantleTokenTransfers — ERC-20 transfer events for an address

  • getMantleTokenList — All tokens held by an address

  • getMantlePortfolio — Comprehensive portfolio (native MNT + all tokens)

  • getMantleContractABI — Verified contract ABI retrieval

  • getMantleContractSource — Contract source code access

  • getMantleRollupInfo — L2 rollup status, batch info, and EigenDA data availability metrics

  • Using Mantlescan API

EVM Generic Tools:

  • Etherscan V2 API integration supporting 68+ chains including all testnets

  • Zerion portfolio aggregation with NFT collections

  • ENS name resolution (forward and reverse)

  • Multi-chain wallet analysis

  • Transaction translation to human-readable format

Aptos Tools:

  • APT coin balance queries

  • Account resources inspection

  • Move module exploration

  • ANS (Aptos Name Service) resolution

  • Transaction history and details

  • Using @aptos-labs/ts-sdk

Flow Tools:

  • Cadence script execution

  • NFT collection queries

  • Account resource inspection

  • Using @onflow/fcl (Flow Client Library)

SEI Tools:

  • Cosmos SDK queries

  • IBC transfer tracking

  • Native SEI balance

  • Using @sei-js/core on Pacific-1 network

Zeta Tools:

  • ZetaVM testnet queries

  • Cross-chain messaging verification

  • Native ZETA balance

Wormhole Tools:

  • Cross-chain bridge verification

  • Guardian signature validation

  • VAA (Verified Action Approval) parsing

Utility Tools:

  • DeFi Llama TVL and protocol data

  • Tavily web search for real-time information

  • News search API for crypto headlines

  • X/Twitter search for social sentiment

  • Image generation via Gemini 2.5 Flash + Imagen 3

  • Transaction explanation/translation


V. Relay Protocol Cross-Chain Swap Integration

  • Relay Protocol SDK for optimized cross-chain token swaps

  • 85+ supported chains including Ethereum, Base, Optimism, Arbitrum, Polygon, Cronos, and more

  • getRelaySwapQuote tool for fetching optimal swap routes

  • executeRelaySwap tool for transaction execution

  • getRelaySupportedTokens tool for chain-specific token lists

  • Dynamic token decimal fetching from Relay Currencies API to prevent amount interpretation errors

  • Swap completion tracking with server-side persistence to prevent duplicate transactions

  • MEV protection via Relay solver network infrastructure

  • Cross-chain routing for swaps between different networks (e.g., Base ETH → Optimism ETH)


VI. Multi-Model AI Orchestration

Supported Language Models:

  • GPT-4o (OpenAI) — Fast, lightweight general tasks

  • GPT-4.1 (OpenAI) — Complex, multi-step reasoning

  • GPT-5.1 (CometAPI) — Default model, next-generation capabilities

  • GPT-5.2 (CometAPI) — Advanced experimental model

  • Claude Opus 4.5 Thinking (Anthropic via CometAPI) — Deep analysis with thinking mode

  • GLM-4.7 (Zhipu via CometAPI) — Multilingual support

Image Generation:

  • Gemini 2.5 Flash Image (Google via CometAPI) — High-fidelity image generation

AI Infrastructure:

  • Vercel AI SDK 4.1.17 for streaming responses

  • Token-by-token SSE output with transfer encoding

  • Intent classification with chain-aware routing

  • Pattern matching for Cronos, EVM, Aptos, Solana, SEI, and general queries

  • Chain context preservation across conversation turns

  • LLM fallback for ambiguous queries

  • 58KB+ system prompts with comprehensive blockchain knowledge


VII. Security & Authentication

Authentication Methods:

  • Email + Password with bcrypt (12 rounds)

  • Google OAuth 2.0 integration

  • Wallet Connect with EIP-4361 SIWE (Sign-In With Ethereum)

  • EIP-191 wallet signature verification

Two-Factor Authentication:

  • TOTP 2FA (RFC 6238) with 30-second window

  • Email OTP (6-digit codes, 10-minute TTL)

  • QR code generation for authenticator apps

Session Management:

  • JWT tokens (HS256) with httpOnly cookies

  • SameSite=Lax cookie policy

  • Sliding window session refresh

  • Re-authentication required for sensitive operations (account deletion, wallet binding, email/password changes)

AI Security Defense Layers:

  • Layer 1: Input Sanitization — Homoglyph detection, invisible character stripping, RTL/LTR override removal, Unicode normalization (NFC/NFKC)

  • Layer 2: Prompt Injection Defense — Direct/indirect injection detection, jailbreak pattern matching, role manipulation prevention

  • Layer 3: Media Protection — Polyglot file detection, EXIF metadata stripping, steganography detection, magic byte validation

  • Layer 4: Model Protection — Sponge attack prevention, model extraction defense, output filtering for PII/secrets

  • Layer 5: Runtime Monitoring — Tier-based rate limiting, anomaly detection, x402 expiry checks, audit logging


VIII. Technology Stack

Core Framework:

  • Node.js 18+ runtime

  • pnpm 8.6.12 package manager

  • Turborepo 2.7.2 monorepo orchestration

  • Next.js 16.1.0 full-stack framework

  • React 19.2.0 with React Server Components

  • TypeScript 5.6.3 type safety

Frontend Stack:

  • TailwindCSS 3.4 for styling

  • Radix UI primitives for accessible components

  • Lucide React icons

  • Framer Motion 11.3 for animations

  • Lottie React for complex animations

  • Prosemirror and CodeMirror 6 for rich text editing

  • Zod 3.25 for validation

  • TanStack Query 5.90 for data fetching

  • useSWR for real-time data

Backend Stack:

  • Next.js API Routes (Edge + Node runtimes)

  • Vercel Functions (serverless)

  • Vercel AI SDK 4.1.17

  • PostgreSQL 15 database

  • Drizzle ORM 0.34.1 (type-safe, migrations)

  • NextAuth.js 5.0.0-beta.30

  • Stripe 18.5 for traditional payments

  • x402 Protocol for crypto payments

  • Nodemailer 6.10 for email

Web3 Stack:

  • Wagmi 2.19 for React hooks

  • RainbowKit 2.2.9 for wallet UI

  • Viem 2.41 for EVM interactions

  • ethers.js v6 for Ethereum utilities

  • EIP-3009 (TransferWithAuthorization)

  • EIP-712 (Typed Data Signing)

  • EIP-191 (Personal Signatures)

Infrastructure:

  • Vercel for frontend hosting and serverless

  • Cloudflare for edge security (WAF, DDoS protection)

  • Cloudflare R2 for S3-compatible object storage

  • Neon PostgreSQL (serverless database)

  • Sentry 9.11 for error monitoring

  • Vercel Analytics for performance metrics


IX. Codebase Architecture

Turborepo Monorepo Structure:

  • apps/frontend — Next.js 16.1 application with 200+ components

  • apps/backend — Supplementary backend services

  • packages/shared — Shared utilities (@barzakh/shared) including all AI tools, prompts, and payment logic

API Routes:

  • /api/chat — Protected AI chat with tool execution

  • /api/auth — NextAuth handlers

  • /api/billing/x402 — Crypto payment endpoints (subscribe, settle, verify, verify-wallet)

  • /api/billing/stripe — Traditional payment webhooks

  • /api/2fa — TOTP setup and verification

  • /api/settings — User preferences

  • /api/cron/check-subscriptions — Automated subscription expiry handling (every 6 hours)

Database Schema:

  • User management with tier levels (free, starter, plus, ultimate)

  • Chat history persistence

  • Subscription tracking (Stripe [Coming Soon] + x402)

  • Wallet binding for Web3 auth

  • 2FA secrets storage

  • Session management


X. Key Features Summary

Agentic Capabilities:

  • 50+ blockchain tools executable via natural language

  • Multi-chain intelligence aggregation

  • Autonomous monitoring and alerting

  • Context memory across conversation sessions

  • Intent classification with automatic tool routing

Payment Infrastructure:

  • x402 gasless payments on Cronos (zero gas for users)

  • Stripe integration for credit card payments

  • Subscription tiers with feature gating

  • Automatic expiration enforcement

  • Dual payment rail support

Developer Experience:

  • API-first design for integration

  • OpenAPI 3.0 specification

  • Type-safe database with Drizzle ORM

  • Comprehensive error handling

  • Production deployment on Vercel

User Experience:

  • Real-time streaming responses

  • Web search for current information

  • News and social media integration

  • Image generation capabilities

  • Cross-chain portfolio analysis

  • Mobile-responsive PWA


In essence, Barzakh is not just a blockchain analytics platform — it is a multi-chain, AI-driven command center with native x402 payment capabilities. It empowers organizations to observe, interpret, and monetize actions across the blockchain spectrum with unprecedented speed and precision, combining the analytical power of machine learning, the adaptability of autonomous agents, and the commercial viability of gasless crypto payments.

By converging on-chain clarity with AI-driven foresight and x402-powered settlement infrastructure, Barzakh sets the stage for a future where blockchain intelligence is instant, autonomous, monetizable, and universally accessible — powering the next wave of AI-native commerce on Cronos and beyond.

本次黑客松进展

Production
队长
KKafir Dclxvi
项目链接
赛道
AI