DeFiFlow
Where Real Assets Meet Smart DeFi.
The problem DeFiFlow solves
🌐 DeFiFlow
Where Real Assets Meet Smart DeFi.
Decentralized Finance Flow — built on BlockDAG
📌 Overview
The DeFiFlow DeFi Protocol project built to demonstrate the power of BlockDAG's EVM & SDK for DeFi innovation.
It enables users to lend, borrow, earn yield, and interact with synthetic real-world assets (RWA) in a single dApp.
Key innovations:
- ⚡ Auto-Rebalancing Credit Pools — yield strategies rebalance dynamically.
- 🌍 Synthetic RWA Tokens — on-chain representation of assets (Treasuries, Real Estate).
- 🔗 Cross-Chain Bridge Integration — BlockDAG bridge SDK for future liquidity movement.
- 🛡 Delegated Risk Control — enforce borrowing caps with BlockDAG signatures.
- 🌐 Multi-Network Support — BlockDAG, Sepolia testnet, and Ethereum mainnet
- 🖥️ Cross-Platform — Web, Desktop (Electron), Mobile (Capacitor)
- 🚀 One-Click Deployment — Vercel, Electron, and Capacitor builds
🔐 Delegated Signing Implementation
This dApp now supports Delegated Signing using EIP-712 typed messages, allowing users to keep their private keys secure in their wallets while transactions are executed by a backend relayer.
Key Features:
- ✅ No Private Keys in Codebase - Private keys remain in user wallets
- ✅ EIP-712 Typed Messages - Structured, human-readable transaction data
- ✅ Nonce-based Replay Protection - Prevents signature reuse
- ✅ Signature Expiration - Messages expire after deadline
- ✅ Backend Relayer - Secure transaction execution service
Workflow:
- User Action: User initiates action (e.g., lend dUSD) in frontend
- Message Creation: Frontend creates EIP-712 typed message with action details
- Wallet Signing: User signs the typed message with their wallet
- Backend Submission: Signed message sent to relayer service
- Signature Verification: Relayer verifies signature (optional, contract also verifies)
- Transaction Execution: Relayer submits transaction to blockchain
- Contract Validation: Smart contract verifies signature and executes action
Security Features:
- Replay Protection: Nonce tracking prevents signature reuse
- Expiration: Messages expire after configurable deadline
- Rate Limiting: API endpoints protected against abuse
- Input Validation: All inputs validated on both frontend and backend
For Developers:
- Deploy Contracts: Deploy updated LendingPool contract with EIP-712 support
- Setup Relayer: Configure and run the Node.js relayer service
- Update Frontend: Use EIP-712 signing for supported actions
- Test Integration: Verify end-to-end workflow functionality
For Users:
- Connect Wallet: Link your MetaMask or compatible wallet
- Sign Messages: Approve actions by signing typed messages
- Automatic Execution: Transactions executed securely by relayer
- Gas-free Experience: No gas costs for message signing
Security Considerations:
- Private Key Security: Private keys never leave the user's wallet
- Message Clarity: EIP-712 ensures users see exactly what they're signing
- Expiration Protection: Messages expire to prevent stale approvals
- Nonce Management: Sequential nonces prevent replay attacks
- Rate Limiting: Prevents abuse of the relayer service
- Input Validation: Comprehensive validation on all inputs
- Error Handling: Graceful failure handling with user feedback
- Audit Trail: All transactions logged for monitoring
🔒 Security Implementation Details
EIP-712 Domain Separator
const domain = {
name: 'LendingPool',
version: '1',
chainId: 1043, // BlockDAG
verifyingContract: lendingPoolAddress
}
Typed Message Structure
const types = {
DepositAction: [
{ name: 'amount', type: 'uint256' },
{ name: 'nonce', type: 'uint256' },
{ name: 'deadline', type: 'uint256' }
]
}
Contract Security Features
- Signature Verification: ECDSA recovery with domain separation
- Deadline Enforcement: Rejects expired signatures
- Nonce Validation: Prevents replay attacks
- Access Control: Only authorized users can execute actions
Backend Security
- Rate Limiting: 100 requests per 15 minutes per IP
- Input Sanitization: All inputs validated and sanitized
- Error Handling: No sensitive information leaked in errors
- HTTPS Only: All communications encrypted
- CORS Protection: Configured for allowed origins only
Production Security Features ⭐
- AWS KMS/Azure Key Vault Integration: Enterprise key management
- Automated Key Rotation: 24-hour rotation cycle with grace period
- Real-time Transaction Monitoring: Comprehensive security dashboard
- Multi-signature Support: Large transaction approval workflow
- Automated Alerting: Email and Slack integration for security events
- Relayer Balance Monitoring: Automated funding alerts
- **Securit
Challenges I ran into
i have got some bugs but i will remove them before deadline and i deployed this project only on testnet
Tracks Applied (1)
DeFi projects leveraging BlockDAG technology.
Blockdag
Technologies used
Cheer Project
Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.
