Shortlisted at ETHOnline 2025 β Top 15 % of Project Submissions π
Project Showcase: https://ethglobal.com/showcase/travelsure-roq07
On-chain flight delay insurance powered by smart contracts and Chainlink oracles
Travelsure is a decentralized insurance platform that provides instant payouts for flight delays using blockchain technology (smart contracts). No paperwork, no waiting, no claims process. When your flight is delayed, you get paid automatically.
Travelsure revolutionizes travel insurance by leveraging Web3 technology to create a transparent, automated, and instant payout system for flight delays. The platform uses smart contracts and Chainlink oracles to verify flight status and execute payouts automatically when delays occur.
- Instant Payouts: Automatic payouts in PayPal USD when flight delays are verified
- No Claims Process: Smart contracts handle everything automatically
- Transparent Terms: All policy terms are recorded on-chain
- AI-Powered Recommendations: Intelligent agent suggests optimal coverage
- Multi-Tier Coverage: Basic, Silver, Gold, and Platinum policy tiers
- Real-time Monitoring: Chainlink Functions oracles track flight status continuously
- Decentralized Verification: Flight data verified through Chainlink's decentralized oracle network
- Buy Coverage: Choose your flight and purchase coverage with a fixed premium. Your policy is recorded on-chain.
- Oracle Monitoring: Decentralized oracles track flight status in real time and verify delays or cancellations.
- Instant Payout: If a delay triggers your policy, funds are released immediately to your wallet.
- PolicyManager: Core contract managing policies, payouts, and tier configurations (localhost)
- PolicyManagerSepolia: Sepolia testnet version with real Chainlink Functions integration
- PYUSDMock: Mock PayPal USD token for testing (localhost)
- PYUSD (Official): Official PayPal USD token on Sepolia testnet
- MockFunctionsRouter: Chainlink Functions router for oracle integration (localhost)
- Next.js 15: Modern React framework with TypeScript
- RainbowKit: Web3 wallet connection
- Wagmi: Ethereum React hooks
- Tailwind CSS: Utility-first styling
- UAgents Framework: Decentralized AI agent for insurance recommendations
- Chat Protocol: Direct communication with users
- Flight Analysis: Intelligent risk assessment and policy matching
Travelsure/
βββ contracts/ # Smart contracts (Hardhat)
β βββ contracts/ # Solidity contracts
β βββ test/ # Contract tests
β βββ scripts/ # Deployment scripts
β βββ ignition/ # Hardhat Ignition modules
βββ frontend/ # Next.js web application
β βββ app/ # App router pages
β βββ components/ # React components
β βββ lib/ # Utility functions
βββ ai-agent/ # UAgents AI system
βββ protocols/ # Agent communication protocols
βββ tests/ # Agent tests
- Solidity: Smart contract development
- Hardhat: Development environment
- Chainlink: Oracle network for flight data
- OpenZeppelin: Standard libraries
- Next.js 15: React framework
- TypeScript: Type safety
- Tailwind CSS: Styling
- RainbowKit: Wallet connection
- Wagmi: Ethereum integration
- UAgents: Decentralized AI framework
- Python: Agent development
- Chat Protocol: User interaction
- Node.js 18+ (recommended 20+)
- npm (or your preferred package manager)
- Python 3.8+ (for AI agent)
Open a terminal and run the node inside the contracts workspace. Keep this terminal running.
cd contracts
npx hardhat nodeBy default this starts an RPC server on http://127.0.0.1:8545 with chainId 31337.
In a second terminal, deploy using Hardhat Ignition while the node is running.
cd contracts
npx hardhat ignition deploy ./ignition/modules/PolicyStack.ts --network localhostThis deploys:
PYUSDMockMockFunctionsRouterPolicyManager(wired to the router and PYUSDMock)
Deployment artifacts/addresses will be written under contracts/ignition/deployments/ (e.g., localhost-*).
In a third terminal:
cd frontend
npm install
npm run devThe app will start on http://localhost:3000.
In a fourth terminal:
cd ai-agent
pip install -r requirements.txt
python insurance_agent_chat.pycd contracts
npm run node-localhost # Start local node
npm run deploy-local # Deploy to localhost
npm run simulate-fulfill # Simulate oracle fulfillmentcd frontend
npm run dev # Development server
npm run build # Production build
npm run start # Production server
npm run lint # Code lintingThe core contract that manages:
- Policy creation and management
- Tier-based pricing (Basic, Silver, Gold, Platinum)
- Automatic payout execution
- Oracle integration for flight status
- Basic: Standard coverage with basic payout
- Silver: Enhanced coverage with higher payout
- Gold: Premium coverage with maximum payout
- Platinum: Ultimate coverage with highest payout
purchasePolicy(): Create new insurance policycheckAndFulfill(): Oracle-triggered payout executiongetPolicy(): Retrieve policy detailsgetTierConfig(): Get tier-specific configuration
The Travelsure AI agent provides:
- Personalized Recommendations: Analyzes travel patterns and risk factors
- Instant Suggestions: Provides policy recommendations in seconds
- Chat Interface: Direct communication with users
cd contracts
npx hardhat testcd frontend
npm run testcd ai-agent
python -m pytest tests/Follow the "Getting Started" section above for local development.
- PolicyManagerSepolia:
0x855E81e27435F79A4145be74399DC992dB3C3ede
Blockscout: https://eth-sepolia.blockscout.com/address/0x855E81e27435F79A4145be74399DC992dB3C3ede?tab=contract
- PYUSD (Official):
0xCaC524BcA292aaade2DF8A05cC58F0a65B1B3bB9 - Chainlink Functions Router:
0xb83E47C2bC239B3bf370bc41e1459A34b41238D0 - DON ID:
0x66756e2d657468657265756d2d7365706f6c69612d3100000000000000000000
https://functions.chain.link/sepolia/5796
cd contracts
npm run deploy-sepolia # Deploy to Sepolia testnet
npm run add-consumer # Add contract as Chainlink consumer
npm run test-sepolia # Test deployment with Chainlink Functions-
Environment Setup: Copy
env.exampleto.envand configure:SEPOLIA_RPC_URL: Your Sepolia RPC endpointSEPOLIA_PRIVATE_KEY: Your wallet private keyCHAINLINK_SUBSCRIPTION_ID: Your Chainlink Functions subscriptionCHAINLINK_DON_ID: Sepolia DON IDCHAINLINK_FUNCTIONS_ROUTER: Sepolia Functions Router
-
Funding Requirements:
- Sepolia ETH for gas fees
- Chainlink Functions subscription with LINK balance
- PYUSD tokens for testing (acquire from Circle Faucet)
-
Chainlink Functions Setup:
- Create subscription on Chainlink Functions
- Add contract as authorized consumer
- Ensure sufficient LINK balance for oracle calls
- Deploy contracts to your target network
- Update frontend configuration with deployed contract addresses
- Deploy frontend to your hosting platform
- Configure AI agent for production environment
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License.
For questions and support, please open an issue in the repository.
- Ensure the Hardhat node remains running while deploying and using the app
- If you need to redeploy fresh, stop the node, restart it, and re-run the deploy step
- The AI agent requires Python dependencies to be installed
- All contract interactions require a connected Web3 wallet
