Abstract
This proposal is developing a framework for deploying and interacting with AI models onchain using Arbitrum Stylus and Rust. This initiative will unlock innovative use cases for the Arbitrum ecosystem, such as decentralized AI computation and verifiable machine learning, while showcasing the scalability and efficiency of Stylus. By focusing heavily on development resources and open-source contributions, this project aims to establish Arbitrum as a hub for decentralized AI applications.
Motivation
The idea for this proposal emerged from a grassroots conversation within the Arbitrum communities. A Twitter thread sparked by Patrick McCorry’s observations on the EthGlobal hackathon led to a comment by Matt Hamilton (Senior DevRel at Arbitrum) suggesting embedding AI neural networks in NFTs using Stylus. Inspired by this, I conducted an experiment deploying a decision tree model using Stylus and Rust, which proved functional but highlighted challenges.
Having previously and currently contributing to the Stylus ecosystem through the @stylusdev Twitter account, where I create developer education content, I am passionate about pushing Stylus’s capabilities and onboarding developers. This proposal is the next logical step in realizing Stylus’s potential by addressing existing limitations and building tools to make onchain AI a reality.
The motivation is clear: onchain AI models represent a groundbreaking use case for blockchain technology, enabling trustless, verifiable, and decentralized computation for industries such as finance, gaming, and governance.
Rationale
This proposal aligns closely with the Arbitrum DAO’s mission and guiding values:
- Innovation: Stylus is a cutting-edge platform, and this project showcases its flexibility and scalability for high-performance computation.
- Ecosystem Growth: By introducing onchain AI capabilities, Arbitrum can attract new developers and projects to its ecosystem, expanding its use cases beyond DeFi and gaming.
- Community Engagement: The project will release open-source tools and developer education materials to empower the broader Arbitrum community.
As a Rust developer with deep experience in Stylus, I have already laid the groundwork for this initiative. The project will also leverage the expertise of two ML engineers and another Rust engineer to ensure scalability and successful delivery.
Specifications
Platform and Technologies
- Rust and Stylus: Chosen for their performance and compatibility with WebAssembly, enabling computational efficiency for onchain AI.
- Arbitrum Stylus Layer 2: Leveraging its scalability and low gas costs for deploying and interacting with AI models.
- zk-Proofs: Potential integration for verifiable and privacy-preserving AI inference.
Design Decisions
- Lightweight AI Models: Initial focus on simple models to ensure feasibility as this is a research initiative.
- Modular Architecture: Developing reusable libraries for Rust and Stylus, allowing easy adoption by other developers.
Steps to Implement
- Phase 1: Research and Feasibility (Months 1)
- Conduct a detailed study on the scalability of Stylus for AI models.
- Identify the most suitable lightweight AI models for deployment.
- Begin integrating zk-proof mechanisms.
- Phase 2: Prototype Development (Months 2-3)
- Build and deploy a prototype AI model (e.g., decision tree) on Arbitrum Stylus.
- Test performance metrics such as gas usage and inference speed.
- Publish a feasibility report.
- Phase 3: Optimization and Expansion (Months 4)
- Optimize the framework for larger datasets and more complex models.
- Incorporate community feedback and refine the tools.
- Build open-source Rust libraries for broader adoption.
- Phase 4: Community Engagement and Finalization (Months 5-6)
- Host workshops and publish developer guides/tutorials.
- Open-source the complete framework.
- Submit a final report on milestones achieved and future directions.
Timeline
- 26th November 2024: Proposal finalized and RFC submitted.
- 2nd December 2024: Snapshot proposal submitted.
- 2nd - 9th December 2024: Snapshot voting period.
- 9th - 16th December 2024: Tally voting and final confirmation.
- 20th - 23rd December 2024: Project kick-off and team onboarding.
- ** January - June 2025:** Rust and Stylus Mode (Arbitrum Hat On)
Overall Cost
Allocation and Justification
1. Cloud Computing and Storage ($80,000)
Justification: Training AI models, even lightweight ones, can be computationally intensive and require significant resources to achieve reasonable training times and performance.
2. Data Acquisition and Preparation ($30,000)
Justification: High-quality data is crucial for training effective AI models. Costs cover acquisition and preparation to ensure models are trained on reliable data.
3. Software Licenses and Tools ($10,000)
Justification: Specialized tools can significantly enhance development efficiency, model performance, and security, justifying their cost.
4. Security Audits and Code Reviews ($20,000)
Justification: Security is paramount, especially when deploying onchain. Audits help prevent costly exploits and build trust with users and the community.
5. Research and Development Expenses ($30,000)
Justification: Ongoing research is essential to push the boundaries of what’s possible and to incorporate the latest advancements into the project.
6. Testing and Deployment ($10,000)
Justification: Robust testing and deployment processes ensure reliability and facilitate smooth integration and updates.
7. Community Tools and Documentation ($10,000)
Justification: Comprehensive documentation and support tools are vital for community adoption and to lower the barrier to entry for new developers.
8. Intellectual Property and Legal ($5,000)
Justification: Proper legal groundwork prevents future disputes and ensures the project adheres to all regulations and best practices.
9. Contingency Funds ($5,000)
Justification: A contingency fund ensures the project can handle unexpected challenges without compromising its goals.
TOTAL: 200, 000 USD
What Success Looks Like
- Deployment of a working onchain AI model prototype on Stylus.
- Release of open-source tools and libraries for the community.
- Increased developer interest in Stylus and Rust within the Arbitrum ecosystem.
- A roadmap for future expansion into more complex models and decentralized AI applications.
Conclusion
This proposal is an opportunity to push the boundaries of what blockchain technology can achieve by enabling decentralized AI computation on Arbitrum Stylus. By combining a solid technical foundation, community engagement, and a passion for innovation, we aim to make Arbitrum the go-to ecosystem for onchain AI applications.