A sophisticated proof-of-concept demonstrating how AI agents can simplify complex blockchain operations while maintaining security and transparency through Hedera's enterprise-grade infrastructure.
This full-stack Next.js dApp combines natural language AI interactions with blockchain event management, featuring on-chain event creation, NFT ticket minting on Hedera, off-chain HBAR payment verification, and automated check-in with Hedera Consensus Service (HCS) audit logs.
HashBot AI Agent - Interact with the Hedera blockchain using natural language commands. Create events, mint tickets, and manage blockchain operations through conversational AI powered by Groq LLM and the Hedera Agent Kit.
- π€ AI-Powered Blockchain Operations - Natural language interface for complex Hedera transactions
- π¨ Clean, Modern UI with Tailwind CSS and responsive design
- π Transparent HashScan Integration for all on-chain activities
- π Mirror Node Verification for payments and ownership validation
- π’ Vendor Dashboard - Create events, deploy on-chain, mint NFT tickets
- πͺ Public Events Marketplace - Browse and discover events
- π³ Secure Ticket Purchase API with Mirror Node payment verification
- β Smart Check-In System with HCS logging and ownership validation
- β‘ Hedera SDK Integration - Enterprise-grade blockchain infrastructure
- Frontend: Next.js 15 (App Router), TypeScript, Tailwind CSS
- Blockchain: Hedera JS SDK (@hashgraph/sdk), HCS Topics, NFT Collections
- AI: LangChain, Groq LLM (llama-3.1-8b-instant), Hedera Agent Kit
- Data: Hedera Mirror Node REST API, File-based storage (demo)
- State Management: React Query, Zod validation
npm install
# or
yarn installCopy .env.example to .env and configure your Hedera credentials:
# Backend (server-only) - Never expose these!
HEDERA_NETWORK=testnet
HEDERA_ACCOUNT_ID=0.0.xxxxx
HEDERA_PRIVATE_KEY=302e02...
HEDERA_MIRROR_URL=https://testnet.mirrornode.hedera.com
# Frontend (client-available)
NEXT_PUBLIC_WALLET_CONNECT_ID=
NEXT_PUBLIC_RPC_URL=
NEXT_PUBLIC_HEDERA_NETWORK=testnet
NEXT_PUBLIC_BASE_URL=http://localhost:3000
# AI Integration
GROQ_API_KEY=npm run dev
# or
yarn devOpen http://localhost:3000 and start creating events with AI assistance!
src/
βββ app/
β βββ api/
β β βββ chat/route.ts # AI agent endpoint
β β βββ events/
β β βββ route.ts # Event CRUD operations
β β βββ purchase/route.ts # Payment verification + ticket minting
β β βββ checkin/route.ts # Ownership validation + HCS logging
β β βββ deploy/route.ts # Deploy event to HCS topic
β β βββ tickets/route.ts # Create NFT ticket collections
β β βββ extract/route.ts # AI-powered event detail extraction
β βββ events/
β β βββ page.tsx # Events marketplace
β β βββ [id]/page.tsx # Event details + purchase flow
β βββ checkin/page.tsx # Ticket validation interface
β βββ vendor/page.tsx # Event creation dashboard
β βββ page.tsx # Landing page with AI chat
βββ components/
β βββ chat-interface.tsx # HashBot AI chat component
βββ server/
β βββ initialize-agent.ts # AI agent configuration
β βββ event-service-tools.ts # Custom Hedera tools for AI
βββ lib/
βββ hedera-event-service.ts # Core Hedera operations wrapper
User: "Create a tech conference on December 15th in San Francisco, $50 tickets, max 200 people"
HashBot: β
Created event with HCS topic 0.0.12345 and deployed NFT collection!
User: "Create 100 tickets for my event"
HashBot: β
Minted NFT collection with 100 tickets, ready for purchase!
User: "Check in ticket #42 for event 0.0.12345"
HashBot: β
Verified ownership and logged check-in to HCS audit trail!
Server-only (never exposed to client)
HEDERA_ACCOUNT_ID- Your operator accountHEDERA_PRIVATE_KEY- Private key for blockchain operationsHEDERA_MIRROR_URL- Mirror node endpointGROQ_API_KEY- AI model access
Client-available (prefixed with NEXT_PUBLIC_)
NEXT_PUBLIC_HEDERA_NETWORK- Network identifierNEXT_PUBLIC_BASE_URL- Application base URL
- Open HashBot chat or visit
/vendor - Describe your event in natural language
- AI extracts structured data and creates blockchain resources
- Get HCS Topic ID and HashScan links automatically
- AI agent creates HCS Topic for event audit trail
- Stores event metadata on-chain
- Returns Topic ID with HashScan verification link
- AI agent mints NFT collection for tickets
- Configures supply, metadata, and pricing
- Returns Token ID with HashScan verification
- Buyer sends HBAR to vendor (off-chain)
- Submits payment transaction ID through UI
- Backend verifies payment via Mirror Node
- AI agent mints and transfers NFT ticket to buyer
- Logs purchase to event's HCS topic
- Scan QR code or enter ticket details
- AI agent validates current ownership via Mirror Node
- Logs check-in event to HCS audit trail
- Returns verification with HashScan links
POST /api/chat
{
"userAccountId": "0.0.buyer",
"input": "Create a music festival next month",
"history": [...] // Chat context
}POST /api/events/purchase
{
"eventId": "0.0.topicId",
"buyerAccountId": "0.0.buyer",
"paymentTxId": "0.0.from@timestamp",
"ticketTokenId": "0.0.tokenId"
}POST /api/events/checkin
{
"eventId": "0.0.topicId",
"tokenId": "0.0.tokenId",
"serialNumber": 1,
"ownerAccountId": "0.0.owner" // Optional strict validation
}All blockchain operations include transparent HashScan links:
- Topics:
https://hashscan.io/{network}/topic/{topicId} - Tokens:
https://hashscan.io/{network}/token/{tokenId} - Transactions:
https://hashscan.io/{network}/transaction/{txId}
# Production build
npm run build
# Start production server
npm start
# Lint code
npm run lint- Verify
GROQ_API_KEYis set correctly - Check Hedera network alignment in environment variables
- Restart development server after
.envchanges
- Ensure sufficient HBAR balance in operator account
- Verify payment transaction IDs are valid and confirmed
- Check Mirror Node connectivity for payment verification
HEDERA_NETWORKandNEXT_PUBLIC_HEDERA_NETWORKmust match- Use correct Mirror Node URL for your network (testnet/mainnet)
- β Never expose private keys to client-side code
- β All privileged operations happen server-side
- β Payment verification through Mirror Node
- β Ownership validation before check-ins
- Replace file-based storage with enterprise database
- Implement role-based access control (RBAC)
- Add comprehensive rate limiting and monitoring
- Set up proper audit logging and alerting
- Use hardware security modules (HSM) for key management
- Enhanced Wallet Integration - Seamless association and signing UX
- QR Code Check-ins - Mobile-first ticket validation
- Database Migration - PostgreSQL/MongoDB backend
- Advanced RBAC - Multi-tenant vendor management
- Ticket Marketplace - Secondary sales with royalties
- Mobile App - React Native companion app
- Analytics Dashboard - Event performance metrics
- Multi-language Support - Global accessibility
This proof-of-concept demonstrates the potential of AI-blockchain integration. Contributions welcome for:
- Enhanced AI agent capabilities
- Additional Hedera service integrations
- UI/UX improvements
- Security enhancements
Built with β€οΈ using Hedera's enterprise blockchain infrastructure and cutting-edge AI technology.