A decentralized marketplace built on Starknet that enables users to lend and rent temporary account access through session keys. This innovative platform allows account owners to monetize their accounts while providing renters with secure, time-limited access to specific functionalities.
- Session Key Marketplace: Create, list, and rent session keys with customizable permissions
- Secure Account Lending: Temporary account access without sharing private keys
- Flexible Pricing: Set custom rental rates and durations
- Multi-Wallet Support: Compatible with Argent and Braavos wallets
- Real-time Updates: Live marketplace data with automatic synchronization
- Batch Operations: Efficient bulk session key management
- Transaction History: Complete audit trail of all marketplace activities
- Network Switching: Seamless switching between Starknet networks
- Emergency Controls: Instant session key revocation and marketplace pausing
- Comprehensive Testing: Full end-to-end test coverage with security audits
Production App: https://accountlend.vercel.app/
Try the live marketplace to experience session key lending and renting on Starknet testnet.
- SessionKeyMarketplace: Core marketplace logic for listing and renting
- SessionKeyManager: Advanced session key lifecycle management
- Security Features: Built-in access controls and emergency mechanisms
- React Components: Modular, reusable UI components
- Starknet Integration: Native wallet connectivity and contract interactions
- Responsive Design: Mobile-first approach with Tailwind CSS
- State Management: Efficient caching and background synchronization
- Node.js 18+ and Yarn
- Starknet wallet (Argent or Braavos)
- Git
# Clone the repository
git clone https://github.com/max65536/accountlend.git
cd accountlend
# Install dependencies
yarn install
# Start development server
yarn devVisit http://localhost:3000 to access the application.
Create a .env.local file:
NEXT_PUBLIC_STARKNET_NETWORK=testnet
NEXT_PUBLIC_MARKETPLACE_CONTRACT=0x...
NEXT_PUBLIC_SESSION_MANAGER_CONTRACT=0x...- Connect Wallet: Use Argent or Braavos wallet
- Create Session Key: Set permissions, expiration time, and action limits
- List on Marketplace: Set rental price and duration
- Manage Rentals: Monitor active rentals and earnings
- Emergency Control: Cancel session keys at any time for security
- Browse Marketplace: View available session keys with different permissions
- Rent Access: Pay rental fee to gain temporary limited control
- Use Permissions: Execute allowed operations within time and action limits
- Automatic Expiry: Access automatically revokes after rental period
- Limited Actions: Sellers can exclude specific actions (e.g., transfers)
- Time Limits: All session keys have configurable expiration times
- Instant Cancellation: Sellers can revoke access immediately if needed
- Permission Control: Fine-grained control over what renters can do
# Unit tests
yarn test
# End-to-end tests
yarn test:e2e
# Security audit
yarn test:security
# Complete workflow test
yarn test:workflow- β Wallet connection and network switching
- β Session key creation and management
- β Marketplace listing and rental
- β Payment processing and escrow
- β Security controls and emergency procedures
- β Cross-browser compatibility
accountlend/
βββ contract/ # Cairo smart contracts
β βββ lendaccount/
β βββ src/
β β βββ lib.cairo # Main contract
β β βββ marketplace.cairo # Marketplace logic
β β βββ session_key_manager.cairo
β βββ tests/
βββ src/
β βββ components/ # React components
β β βββ accountMarket.tsx # Main marketplace UI
β β βββ SessionKeyManager.tsx # Session key management
β β βββ WalletBar.tsx # Wallet connection
β βββ services/ # Business logic services
β βββ utils/ # Utility functions
β βββ pages/ # Next.js pages
βββ tests/ # Test files
βββ docs/ # Documentation
- Frontend: Next.js 14, React 18, TypeScript, Tailwind CSS
- Blockchain: Starknet, Cairo 2.0, Starknet.js
- Testing: Jest, Playwright, Custom security audits
- Development: ESLint, Prettier, Husky pre-commit hooks
- Check
development_progress.mdfor current status - Create feature branch from
main - Implement changes with tests
- Update progress tracking
- Submit pull request with documentation
# Deploy contracts to Starknet testnet
cd contract/lendaccount
scarb build
starkli deploy target/dev/lendaccount_SessionKeyMarketplace.contract_class.json
# Deploy frontend to Vercel
vercel --prod- Smart contracts audited and deployed to mainnet
- Frontend deployed with production contract addresses
- All tests passing
- Security review completed
- Performance optimization verified
- Monitoring and alerting configured
- Core marketplace functionality
- Session key management system
- Multi-wallet integration (Argent & Braavos)
- Comprehensive testing suite
- Security audit framework
- Production deployment pipeline
- Live demo application
- Advanced session key policies
- Mobile app optimization
- Gas optimization improvements
- Enhanced user analytics
- Cross-chain compatibility
- Advanced permission templates
- Automated rental renewals
- Reputation system for lenders
- Session Key Isolation: Each session key has limited, specific permissions
- Time-based Expiration: Automatic access revocation
- Action Limitations: Exclude specific operations (transfers, approvals, etc.)
- Emergency Controls: Instant marketplace pause and session revocation
- Audit Trail: Complete transaction history and logging
- Smart Contract Security: Comprehensive access controls and validation
- No Private Key Sharing: Renters never access the actual private keys
- Granular Control: Precise permission management for each session
- Immediate Revocation: Sellers maintain full control and can cancel anytime
- Limited Exposure: Time and action limits minimize potential risks
- Fork the repository
- Create a feature branch
- Follow the development guidelines in
.clinerules - Submit a pull request with comprehensive tests
- Use TypeScript for all new code
- Add tests for new functionality
- Update documentation
- Follow Cairo best practices for smart contracts
- Maintain security standards
- ESLint and Prettier for code formatting
- Comprehensive test coverage required
- Security review for all smart contract changes
- Performance testing for UI components
- Deployment Guide - Complete deployment instructions
- Wallet Testing Guide - Wallet integration testing
- Session Key Testing Guide - Session key functionality testing
- Contract Testing Guide - Smart contract testing
- Development Progress - Current project status
Wallet Connection Issues
# Clear browser cache and reconnect wallet
# Ensure correct network is selected
# Check wallet extension is updatedContract Interaction Failures
# Verify contract addresses in config
# Check network connectivity
# Ensure sufficient gas feesDevelopment Server Issues
# Clear Next.js cache
rm -rf .next
yarn devThis project is licensed under the MIT License - see the LICENSE file for details.
- Starknet team for the robust blockchain infrastructure
- Argent and Braavos for wallet integration support
- Open source community for various tools and libraries
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Project Wiki
Built with β€οΈ on Starknet
AccountLend is pioneering the future of decentralized account access management. Join us in building a more flexible and secure blockchain ecosystem.