A decentralized usage-based insurance platform leveraging DIMO's vehicle telemetry data and Cartesi's off-chain computation capabilities to provide dynamic insurance premiums based on driving behavior.
The platform consists of three main components:
- Smart Contracts: Solidity contracts for policy management and premium calculations
- Cartesi Coprocessor: Off-chain computation engine for risk assessment
- Frontend: React-based web interface for policy management
graph TD
A[Frontend] --> B[Smart Contracts]
B --> C[Cartesi Coprocessor]
C --> D[Risk Model]
D --> C
C --> B
E[DIMO API] --> A
ubi-dapp/
├── contracts/ # Smart contract implementation
│ ├── contracts/ # Core contracts
│ ├── interfaces/ # Contract interfaces
│ ├── libraries/ # Shared libraries
│ └── types/ # Custom types
│
├── coprocessor/ # Cartesi coprocessor implementation
│ └── ubi-risk/ # Risk assessment engine
│ ├── src/ # Source code
│ ├── models/ # Risk models
│ └── services/ # External services
│
└── frontend/ # Web interface
├── components/ # React components
├── hooks/ # Custom hooks
├── services/ # API services
└── utils/ # Utilities
- Node.js v20.11+
- Docker Desktop
- Foundry
- Git
# Install Cartesi Coprocessor CLI
# Download from https://github.com/Mugen-Builders/co-processor-cli/releases
tar -xzf cartesi-coprocessor-aarch64-apple-darwin.tar.gz
sudo mv cartesi-coprocessor /usr/local/bin/
sudo chmod +x /usr/local/bin/cartesi-coprocessor
# Install Cartesi CLI
npm i -g @cartesi/cli
# Enable RISC-V support in Docker
docker run --privileged --rm tonistiigi/binfmt --install all
# Clone repository
git clone https://github.com/your-org/ubi-dapp.git
cd ubi-dapp
# Install dependencies
npm install
# Start Cartesi devnet
cartesi-coprocessor start-devnet
# Deploy coprocessor
cd coprocessor/ubi-risk
cartesi-coprocessor publish --network devnet
# Deploy contracts
cd ../../contracts
cartesi-coprocessor deploy --contract-name InsurancePolicy --network devnet --constructor-args <Coprocessor_Address> <Machine_Hash>
# Start frontend
cd ../frontend
npm run dev
# Smart contract tests
cd contracts
forge test
# Coprocessor tests
cd ../coprocessor/ubi-risk
npm test
# Frontend tests
cd ../frontend
npm test
See Deployment Guide for detailed instructions on deploying to testnet and mainnet.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
For security concerns, please email security@your-org.com.
This project is licensed under the MIT License - see the LICENSE file for details.