Project Info
Inspiration
💡🏠 Coming from Southern California, I'm very aware of the immense risks posed by wildfires, like the ones in LA last month. In fact, there was a brush fire just a few miles from my house. Unfortunately, increasing wildfire risks means that most home insurers are leaving the state, leaving millions without insurance. And, the remaining insurers have increased prices significantly. I've never done any crypto/web3 stuff before but wanted to explore for the hackathon. After reading about decentralized projects like Filecoin and Helium, I wondered: could we do the same for insurance? Instead of one profit-oriented corporation, services could be rendered transparently, quickly, and fairly on the blockchain, assisted by AI agents. I realized that insurance companies basically have three jobs: Risk assessment: determining how much insurance costs based on risk models Claims processing: reviewing claims and disbursing/denying funds Treasury investing: insurance companies make profit by investing collected money Having humans do this is very expensive. ~27% of annual premiums collected ($560B) is spent on operating expenses like salaries, sales commissions, management fees, etc. I realized that all three of these components could be replaced by AI and web3 technology, driving down costs exponentially—meaning that insurance can become cheaper, faster, and more fair. All this is enabled by the** Eigenlayer AVS system**, which enables us to get zkTLS verified off-chain LLM responses through Opacity and Cloudflare. Eigenlayer provides a way for independent operators to provide services like LLM inference, and they are incentivized to be truthful because they get slashed (lose their stake) if they are caught lying. Also, by being on the blockchain, we can ensure transparent pricing and payout conditions via smart contracts. What I made 🔗 While I wasn't able to finish the entire thing due to the complexity of the project and working solo, I was able to develop various working + open sourced key components including an AI agent and various smart contracts. a landing page + detailed technical whitepaper on a local testnet based on Eigenlayer Hello World AVS, a smart contract setup where users can purchase insurance policies, process claims, and simulate disaster events for testing. Operators would provide verified LLM inference, which powers the agents. Github repo local demo that uses Opacity and Perplexity API to review claims and verify the disaster events via Perplexity API, and returns a zkTLS-verified verdict. I hard-coded in satellite, weather, and other data for the time being but the Opacity GPT4o zkTLS stuff is real and so is the Perplexity API! Github repo more complex insurance policy smart contract with features like voting, various levels of insurance, expiry, etc. smart contract for wildfire prediction market **To invest collected premiums to make profit to reward restakers/operators and pay policyholders: Financial AI agent (uses five tools) that invests premiums using real data + calculator + submits simulated trade orders. Live demo Advanced version with simulated trades, and Github How I built it 🛠️ First of all, it was only possible thanks to a lot of explanations and help from the Eigenlayer and Opacity teams since this is my first time building a web3 project. To build things, I relied on the sample repos, Eigenlayer Hello World AVS and the Eigenlayer AI quickstart. The main languages were Solidity, TypeScript, and some HTML/CSS for the frontends. I also used Remix which is kind of like Replit for web3, which helped me test my smart contracts. I also used Google Colab to code and test the stock trading agent and then Replit to deploy the live demo. Challenges I ran into Learning the intricacies of smart contracts, on‑chain/off‑chain interactions, and integrating AVS Getting set up with a MetaMask wallet Remembering how much gwei, wei, and eth are Accomplishments that I'm proud of Building working smart contracts Learning about web3 and Eigenlayer What I learned How restaking, zkTLS, smart contracts, and AVS work
What's next
for Eigensurance I would like to work on deploying this live!
Eigensurance AVS
Eigensurance is a decentralized disaster insurance protocol built on EigenLayer that leverages multiple operator validation for disaster event verification and claims processing.
Architecture
The protocol consists of several key components:
DisasterInsuranceServiceManager: Main contract handling policy creation, disaster validation, and claimsMockDisasterOracle: Simulates disaster data feedsMockStakeRegistry: Handles operator registration and validationMockAVSDirectory: Manages AVS operator registration
Setup Instructions
Prerequisites
Installation
- Clone the repository:
git clone https://github.com/andrewgcodes/eigen.git
cd eigen
- Install dependencies:
npm install
- Copy environment files:
cp .env.example .env
cp contracts/.env.example contracts/.env
Local Development
- Start local Anvil chain:
npm run start:anvil
- In a new terminal, deploy the contracts:
# Deploy EigenLayer core contracts
npm run deploy:core
# Deploy Disaster Insurance contracts
npm run deploy:insurance
Usage
Create a Policy
Create a new insurance policy:
npm run insurance:create-policy
This creates a policy with:
- Coverage amount: 1 ETH
- Location: San Francisco
- Disaster Type: EARTHQUAKE
- Premium: 5% of coverage amount
Simulate a Disaster
Simulate a disaster event:
npm run insurance:simulate-disaster
This simulates an earthquake in San Francisco with:
- Severity: 7.0 on Richter scale
- Multiple operator validations
- Event verification
Process Claims
Process an insurance claim:
npm run insurance:process-claim
This processes the claim for:
- The most recently created policy
- The most recent disaster event
- Transfers coverage amount to policyholder if valid
Testing
Run the test suite:
cd contracts
forge test -vv
The tests cover:
- Policy creation
- Disaster event simulation
- Multi-operator validation
- Claim processing
- Edge cases and error conditions
Contract Addresses (Local Testnet)
After deployment, contract addresses can be found in:
- EigenLayer Core:
deployments/core/31337.json - Disaster Insurance:
deployments/disaster-insurance/31337.json
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License.
Security
This is a prototype and has not been audited. Do not use in production.
Analysis
View
Metric
- 6
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- GoIn code
- HTMLIn code
- JavaScriptIn code
- PythonIn code
- ReactIn code
- RustIn code
- SolidityIn code
- TypeScriptIn code
- OpenAIClaimed
- VercelClaimed
9 of 11 appear in the indexed code. 2 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
21 MB
Source files
3,432
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
andrewgcodes/eigen
3,937 files · 43.4 MB · @ 2f24fcb
Structure
Interface
3 files · 0%Screens, components and styles rendered to the user.
Application logic
2,189 files · 56%Domain rules, services and shared utilities.
+7 moreData & schema
4 files · 0%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Solidity53%
- JavaScript22%
- Go16%
- Markdown4%
- Rust3%
- YAML0%
- Other (5)1%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable-v4.9.0/package.json
npm · 3939 development-only dependencies.
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-v4.9.0/package.json
npm · 3939 development-only dependencies.
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable/package.json
npm · 3232 development-only dependencies.
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts/package.json
npm · 3232 development-only dependencies.
contracts/lib/eigenlayer-middleware/lib/openzeppelin-contracts-upgradeable/package.json
npm · 3232 development-only dependencies.
contracts/lib/eigenlayer-middleware/lib/openzeppelin-contracts/package.json
npm · 3232 development-only dependencies.
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/go.mod
go · 27- github.com/ethereum/go-ethereum
- +26 more
operator/rust/crates/operator/Cargo.toml
cargo · 22- alloy
- chrono
- dotenv
- eigen-client-elcontracts
- eigen-logging
- eigen-testing-utils
- eigen-types
- eigen-utils
- eyre
- futures
- futures-util
- hello-world-utils
- hex
- num-bigint
- once_cell
- rand
- reqwest
- serde
- +4 more
frontend/package.json
npm · 17- @chakra-ui/react
- @emotion/react
- @emotion/styled
- ethers
- framer-motion
- react
- react-dom
- +10 more
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/package.json
npm · 14- solidity-docgen
- +13 more
package.json
npm · 9- dotenv
- ethers
- +7 more
contracts/lib/eigenlayer-middleware/go.mod
go · 66 development-only dependencies.
operator/rust/crates/utils/Cargo.toml
cargo · 4- alloy
- eyre
- serde
- serde_json
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/testHelpers/package.json
npm · 3- keccak256
- merkletreejs
- web3
contracts/lib/eigenlayer-middleware/package.json
npm · 33 development-only dependencies.
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-upgradeable-v4.9.0/requirements.txt
pypi · 1- certora-cli
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/lib/openzeppelin-contracts-v4.9.0/requirements.txt
pypi · 1- certora-cli
contracts/lib/eigenlayer-middleware/lib/eigenlayer-contracts/requirements.txt
pypi · 1- certora-cli
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.