Introduction
Project Name: chain47 - AI agents for SIA
Name of the organization or individual submitting the proposal: Mert Köklü
Describe your project
chain47-sia is a TypeScript framework that enables AI agents to interact seamlessly with the Sia network. Built on modern AI technologies like LangChain and integrating deeply with Sia’s infrastructure, chain47-sia provides a powerful toolkit for creating intelligent agents that can autonomously manage decentralized storage operations on the Sia network.
The framework provides complete coverage of renterd, hostd, and walletd APIs, enabling everything from file uploads and host configuration to wallet management through natural language interaction. Whether you’re a storage user, host, or developer, chain47-sia simplifies interaction with the Sia network without compromising on functionality or security.
Who benefits from your project?
1.Storage Users (Renters)
- Simplified interaction with Sia through natural language
- Automated optimization of storage costs and redundancy
- Intelligent contract management and renewal
- Easy monitoring of storage health and status
2.Storage Providers (Hosts)
- Automated host setup and configuration
- Dynamic pricing optimization
- Performance monitoring and alerting
- Simplified contract and collateral management
3.Developers
- Comprehensive framework for building AI-powered Sia applications
- Extensive documentation and examples
- Plugin architecture for extending functionality
- Testing framework for reliable development
4.Sia Ecosystem
- Increased accessibility through AI-powered interfaces
- Higher adoption potential through simplified UX
- More robust network through intelligent automation
How does the project serve the Foundation’s mission of user-owned data?
chain47-sia strengthens Sia’s mission of user-owned data by making decentralized storage more approachable through natural language interaction while maintaining the network’s core principles of user control and privacy. The framework enables users to manage their data through intuitive AI-powered interfaces without compromising Sia’s trustless model or requiring intermediaries.
The project preserves Sia’s privacy-first approach by processing AI interactions locally when possible and avoiding central data collection. All storage operations remain fully controlled by users, with the AI serving only to simplify interaction and optimize decisions around storage contracts, redundancy, and cost management.
Are you a resident of any jurisdiction on following list? No
Will your payment bank account be located in any jurisdiction on following list? No
Grant Specifics
Core Features
Sia Network Operations
-
Complete Integration: Full support for all Sia network operations from renterd, hostd, and walletd APIs.
- Full support for renterd API (file management, contract handling)
- hostd API integration (host setup, configuration, pricing)
- walletd API implementation (transaction management, balance tracking)
- Cross-component synchronization and state management
-
Intelligent Contract Management: Advanced system for automating storage contract creation, renewal, and monitoring. Handles contract formation fees, collateral management, and proof submission.
-
Storage Optimization: Smart algorithms for optimizing storage redundancy, cost efficiency, and host selection based on scoring metrics.
-
Host Interaction System: Comprehensive toolkit for host operations including volume management, host announcements, and pricing optimization.
LangChain Integration
-
Tools: Purpose-built LangChain tools for all Sia operations:
- Storage management (upload, download, redundancy)
- Wallet operations (transfers, balance checks)
- Contract handling (formation, renewal, proof submission)
- Host management (setup, configuration, pricing)
-
Memory Management: Specialized storage patterns for maintaining context about:
- Active storage contracts
- File health and redundancy status
- Host performance metrics
-
LangGraph Workflows: Complex operation orchestration for:
- Multi-step file uploads with encryption
- Host setup and configuration
- Contract negotiation and formation
- Health checks and repair processes
Multi-Component Integration
- Unified API Layer: Seamless integration with Sia’s core components: renterd, hostd, and walletd.
- Response Streaming: Real-time streaming of model responses to provide immediate feedback. Supports both text completion and chat completion models.
Safety System
-
Operation Validation: Comprehensive checks for:
- Contract parameters and collateral
- Storage redundancy requirements
- Host reliability metrics
-
Resource Management: Configurable limits for:
- Storage allocation
- Contract formation
- Collateral commitments
- Bandwidth usage
Web Integration
- REST API: HTTP API for integrating agent capabilities into web applications. Includes authentication, rate limiting, and request validation.
Local GUI Interface
- Chat Interface: Local web-based chat interface for interacting with the agent. Includes message history, response formatting, and action previews.
Technical Architecture
Core Components
These are example interfaces for the core components of the chain47-sia framework to demonstrate the high-level structure and usage patterns.
SiaProvider
interface SiaProvider extends Provider {
connect(): Promise<void>;
getConsensus(): Promise<ConsensusInfo>;
// Actions...
formContract(params: ContractParams): Promise<ContractID>;
}
ActionRegistry
interface Action {
name: string;
description: string;
parameters: Schema;
execute(args: any): Promise<any>;
}
class ActionRegistry {
registerAction(action: Action): void;
getAction(name: string): Action;
listActions(): Action[];
}
AgentKit
class AgentKit {
constructor(config: AgentConfig);
addProvider(provider: Provider): void;
registerTools(tools: Tool[]): void;
execute(action: string, params: any): Promise<Result>;
}
Integration Methods
1. Direct SDK Usage
import { SiaAgent } from 'chain47';
const agent = new SiaAgent({
provider: new SiaProvider({
renterURL: 'localhost:9980',
hostURL: 'localhost:9982'
}),
wallet: new SiaWalletManager(seed)
});
2. LangChain Integration
import { createSiaTools } from 'chain47/langchain';
const tools = createSiaTools(agent);
const chain = new LangChain({
tools,
model: "gpt-4"
});
3. REST API
// Start REST server
const server = new SiaAgentServer({
port: 3000,
agent: siaAgent
});
// API endpoints
POST /api/contracts // Contract management
GET /api/status // System status
Usage Modes
1. Chat Mode
Interactive conversation with the AI agent.
Features:
- Natural language interaction
- Context awareness
- Memory of previous interactions
- Error explanation
- Suggested actions
Example:
const agent = new SiaAgent({
mode: "chat",
memory: true
});
// User interactions
"What's my current storage usage?"
"Upload my documents folder with 3x redundancy"
"How healthy are my storage contracts?"
2. Library Mode
Direct programmatic interaction through TypeScript/JavaScript.
Features:
- Full TypeScript support
- Promise-based API
- Error handling
- Type safety
- Event system
Example:
const agent = new SiaAgent({
mode: "library",
provider: new SiaProvider()
});
// Direct method calls
await agent.getStorageUsage();
await agent.uploadFolder({
path: "./documents",
redundancy: 3
});
await agent.checkContractHealth();
3. Autonomous Mode
Will be implemented in future. Not included in this scope.
Agent operates independently based on predefined strategies.
Features:
- Strategy-based execution
- Safety limits
- Monitoring
- Automated reporting
- Alert system
Example:
const agent = new SiaAgent({
mode: "autonomous",
strategy: {
type: "host",
params: {
minStoragePrice: "50 SC/TB/month",
maxCollateral: "5000 SC",
targetUtilization: 0.8,
rebalanceInterval: "24h"
}
}
});
// Start autonomous operation
await agent.start();
4. Watch Mode
Will be implemented in future. Not included in this scope.
Monitor blockchain state and execute predefined actions.
Features:
- Event watching
- Address monitoring
- Price alerts
- Transaction tracking
- Custom triggers
Example:
const agent = new SiaAgent({
mode: "watch",
triggers: [
{
type: "storage",
condition: "redundancy < 2.5",
action: "repair",
params: {
targetRedundancy: 3
}
}
]
});
// Start watching
await agent.startWatching();
Tech Stack
Core Framework
- Language: TypeScript
- Runtime: Node.js >= v18
- Package Manager: pnpm
- Build System: Turborepo
- Testing: Jest + Testing Library
- Documentation: TypeDoc
- CI/CD: GitHub Actions
AI Integration
- Framework: LangChain + LangGraph
- Model Support:
- OpenAI (GPT-4, GPT-3.5)
- Anthropic (Claude)
- Memory Management: LangChain Memory
- Tool System: Custom LangChain Tools
Frontend
- Framework: Next.js 14
- UI Components: shadcn/ui
- Styling: Tailwind CSS
- State Management: React Query
- Animations: Framer Motion
- Data Visualization: Recharts
- Code Highlighting: Prism.js
Backend
- API Framework: NestJS
- Validation: Zod
- Error Handling: Winston
- API Documentation: Swagger/OpenAPI
Sia Integration
- Core APIs:
- renterd API
- hostd API
- walletd API
- Real-time Updates: WebSocket subscriptions
- Data Processing: Stream-based file handling
chain47-sia GUI Interface
A web interface for natural language interaction with Sia network operations.
- Message history with agent responses
- Real-time streaming responses
- Code block formatting for transactions
- Syntax highlighting for code/transaction data
- Message reactions for quick feedback
Example Interaction
User: "Configure my host for optimal earnings"
Agent: Let's optimize your host configuration
Current network averages:
- Storage price: 45 SC/TB/month
- Collateral: 2x storage price
- Contract length: 3 months
Recommended settings:
[View Details] [Apply] [Cancel]
User Stories
For Storage Users (Renters)
As a renter, I want to:
- Upload files by describing them in natural language (“upload my tax documents with 3x redundancy”)
- Check my storage status (“how much storage am I using and what’s the cost?”)
- Monitor file health (“are my files healthy and properly backed up?”)
- Get cost estimates (“how much will it cost to store 100GB for a year?”)
For Storage Providers (Hosts)
As a host, I want to:
- Set up my host through conversation (“help me configure my host for optimal earnings”)
- Optimize pricing (“analyze network prices and suggest competitive rates”)
- Monitor performance (“show me my host stats and earnings”)
For Developers
As a developer, I want to:
- Build AI-powered Sia apps using the TypeScript SDK
- Add Sia storage features to my LangChain applications
- Create custom storage automation tools
- Integrate Sia operations into my web applications
These interactions can happen through web chat interface (UI) or programmatically through the SDK.
Project Final Deliverables
- Complete chain47 adaptor implementation for Sia network in TypeScript with full type definitions
- Comprehensive test suite including unit and integration tests
- LangChain-compatible tools for all renterd, hostd, and walletd operations
- Pre-configured prompts for renterd, hostd, and walletd operations
- All renterd actions implementation of complete renterd API
- All hostd operations implementation of complete hostd API
- walletd operations implementation of complete walletd API
- Web chat interface for interacting with the AI agent to perform Sia operations
- REST API for remote service integration
- Interactive chat mode for natural language interaction
- Direct library mode for programmatic integration
- CLI tool that wakes up the API and chat interface
- Integration guides and API reference documentation
- Comprehevensive documentation for building AI agents with chain47-sia
Milestones
Milestone 1: Core Framework and Base Integration
- Estimated duration: 6 weeks
- FTE: 1
- Budget: $11,111 USD
- Justification of Budget: 30 workdays x 6 hours x $61.73 = $11,111
- Deliverables:
- Complete TypeScript framework setup with core architecture
- Full renterd API integration implementation
- Initial LangChain tool development for renterd operations
- Basic chat interface implementation
- Development environment setup and testing framework
- CLI tool implementation with basic commands
- Initial documentation structure
Milestone 2: Wallet Integration and Enhanced Features
- Estimated duration: 7 weeks
- FTE: 1
- Budget: $12,963 USD
- Justification of Budget: 35 workdays x 6 hours x $61.73 = $12,963
- Deliverables:
- Complete walletd API integration
- LangChain tools for wallet operations
- Memory management system implementation
- Validation and safety systems
- Chat mode enhancements
- Initial REST API implementation for core features
- Expanded test coverage for wallet operations
Milestone 3: Host Integration and Advanced Features
- Estimated duration: 7 weeks
- FTE: 1
- Budget: $12,963 USD
- Justification of Budget: 35 workdays x 6 hours x $61.73 = $12,963
- Deliverables:
- Complete hostd API integration
- LangChain tools for host operations
- Web-based chat interface implementation
- Complete REST API implementation
- Integration tests for host operations
Milestone 4: System Completion and Documentation
- Estimated duration: 7 weeks
- FTE: 1
- Budget: $12,963 USD
- Justification of Budget: 35 workdays x 6 hours x $61.73 = $12,963
- Deliverables:
- Complete system integration testing
- Performance optimization for all components
- Final CLI tool refinements and testing
- Comprehensive documentation
- Example applications and use cases
- API reference documentation
- Final testing and bug fixes
- Production release
Total requested amount: $50,000
Similar Implementations
AI agents are currently very high in demand in the blockchain ecosystem. There are many projects that are working on AI agents that interact with blockchain networks. Some of them are:
- Solana: GitHub - sendaifun/solana-agent-kit: connect any ai agents to solana protocols
- Starknet: GitHub - KasarLabs/starknet-agent-kit: A toolkit for creating AI agents that can interact with the Starknet blockchain
- Coinbase: GitHub - coinbase/agentkit: Every AI Agent deserves a wallet.
- elizaOS/eliza: GitHub - elizaOS/eliza: Autonomous agents for everyone
Or current running hackathons:
- Sui: Sui AI Agent Hackathon
- ethGlobal: Agentic Ethereum
As a long time developer of Sia ecosystem, I didn’t want Sia network to be left behind in this trend. I believe that chain47-sia will be a great addition to Sia ecosystem and will attract more developers to Sia network.
Future Plans
My previous project SiaQL was developing a GraphQL API for Sia network.
Now, chain47-sia will be using this GraphQL API to interact with Sia network. With chain47-sia, users will be able to interact with Sia network through natural language easily.
Usage modes such as autonomous mode and watch mode will be implemented in future versions of chain47-sia to provide more advanced automation and monitoring capabilities. I wanted to keep the scope of this proposal focused on the core features to ensure a successful initial release.
I am committed to maintaining and improving chain47-sia over the long term (1 year), with regular updates, bug fixes, and new features based on community feedback and evolving Sia network requirements.
Long-term Sustainability
- Monthly feature updates based on community feedback
- Open-source community contribution model
- Comprehensive documentation for contributors
- Regular sync with Sia core team for API updates
- Public roadmap for future development
- Bug fixes for issues
Potential risks that will affect the outcome of the project
1.API Changes
- Risk: Sia’s APIs (renterd/hostd/walletd) could undergo significant changes
- Mitigation: Build flexible adapters, maintain close communication with Sia team
2.AI Model Limitations
- Risk: AI models may not always correctly interpret storage/hosting commands
- Mitigation: Implement robust validation checks, clear error messages, confirmation steps
3.Framework Compatibility
- Risk: LangChain or other dependencies could have breaking changes
- Mitigation: Lock stable versions, maintain thorough test coverage
Development Information
Will all of your project’s code be open-source?
Yes, all code developed for this project will be open-source and available for community review and contribution.
Leave a link where code will be accessible for review
The project repository will be hosted on GitHub at: https://github.com/justmert/chain47
Do you agree to submit monthly progress reports?
Yes, I agree to submit detailed monthly progress reports.
Contact info
Contact Name: Mert Köklü
I worked as Intelligent Video Analytics Team Leader in a NVIDIA distributer company that develops video analytics solutions for 2 years. After diving into Web3 ecosystem, I have become a grantee for well-known protocols such as Sia, Aave, Compound, Filecoin, Web3 Foundation, and Solana demonstrating my extensive experience and expertise across multiple blockchain ecosystems.
I am also a grantee of Sia Foundation with projects:
My other grantee projects can be found on my GitHub profile: https://github.com/justmert
Email: [email protected]
Any other preferred contact methods:
- LinkedIn: https://www.linkedin.com/in/mertkoklu/
- Discord: mertkkl
- Telegram: mertkklu