Decentralised Graph Database Infrastructure for Enhanced S5.js (Large Grant Proposal)
Project name: FabGraph
Date: October 29, 2025
Applicant: Jules Lai
Organisation: Fabstir
Related Previous Grant: Enhanced S5.js (Technical implementation complete)
1. Executive Summary
I propose building FabGraph, a decentralised graph database library that runs natively on Enhanced S5.js, providing the missing relational data layer for the Sia ecosystem. Building on my successful Enhanced S5.js grant and production vector database experience, FabGraph enables developers to store, query, and traverse complex relationship data whilst maintaining complete data sovereignty through client-side encryption.
This grant delivers open-source database softwareβnot hosted infrastructureβthat developers can integrate into their applications to build privacy-preserving knowledge management, social graphs, or relational data systems on Sia storage. FabGraph fills the critical missing piece in Siaβs open-source data infrastructure, providing graph database capabilities to complement file storage (S5) and existing vector search solutions.
Key Deliverables:
- Open-source JavaScript/TypeScript library (MIT licence)
- Cypher query language support (80% OpenCypher specification)
- Graph algorithms (PageRank, shortest path, clustering)
- Migration tools from Neo4j/GraphML
- Comprehensive documentation and examples
Jurisdiction Compliance
- Are you a resident of any prohibited jurisdiction? No
- Will your payment bank account be in a prohibited jurisdiction? No
2. Problem Statement
The Missing Data Layer
Whilst Sia/S5 excels at file storage, developers lack a crucial component: a library to store and query relationships between data. Current options fail:
Centralised Graph Databases (Neo4j, Amazon Neptune, ArangoDB)
- Require hosted infrastructure or complex self-hosting
- $70,000-$200,000/year licensing
- Proprietary software with vendor lock-in
- Data sovereignty compromised
Existing Decentralised Storage (IPFS, Arweave, Filecoin)
- No native graph database libraries
- Developers must build from scratch
- No relationship query capabilities
- Cannot traverse connections efficiently
Blockchain-Based Graphs (The Graph, Ceramic)
- Public data only
- Limited query capabilities
- High latency (seconds per query)
- No complex traversal algorithms
Why Developers Need Decentralised Graph Libraries
Modern applications require relationship data:
- Knowledge Management: Document relationships, citations, dependencies
- Social Networks: Friend graphs, interaction networks
- Organisational Data: Hierarchies, permissions, workflows
- Research Systems: Citation networks, knowledge graphs
- Compliance Tracking: Data lineage, audit trails
Without a proper graph database library for S5, developers resort to inefficient workarounds or abandon decentralisation entirely.
3. Solution
FabGraph: Native Graph Database Library for S5
I propose building an open-source graph database library that:
- Integrates with S5: Uses Enhanced S5.js for all persistence
- Provides Standard API: Cypher compatibility
- Handles Encryption: Client-side encryption with user-controlled keys
- Scales Horizontally: HAMT sharding for millions of nodes/edges
- Works Standalone: Drop-in library for any JavaScript/TypeScript application
- Team Collaboration: Sub-graph permissions for controlled sharing
Technical Architecture
βββββββββββββββββββββββββββββββββββββββββββββββ
β Developer's Application Code β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β FabGraph Library API β
β ββββββββββββββββββββββββββββββββββββββββ β
β β β’ Graph.create() β β
β β β’ Graph.query(cypher) β β
β β β’ Graph.traverse(pattern) β β
β β β’ Graph.import(neo4j) β β
β β β’ Graph.grantSubGraphAccess() β β
β ββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Query Processing Module β
β Graph Engine Core β
β Storage Abstraction β
βββββββββββββββββββββββββββββββββββββββββββββββ€
β Enhanced S5.js (Dependency) β
βββββββββββββββββββββββββββββββββββββββββββββββ
Performance Considerations
FabGraph performance is fundamentally constrained by S5 network latency
(~800ms per operation). Mitigation strategies include:
- Aggressive client-side caching of frequently accessed nodes
- Batch fetching for predictable traversal patterns
- Query result caching with TTL
- Optional read-ahead for common relationship patterns
Developers should expect:
- First-query latency proportional to data fetched
- Subsequent queries on cached data: <100ms
- Cache-miss operations: ~800ms per S5 fetch
Library Features
Simple Integration:
import { FabGraph } from "@fabstir/fabgraph";
// Initialise with S5 connection
const graph = new FabGraph({
s5Client: myS5Client,
encryption: true,
});
// Create nodes and relationships
await graph.create(`
CREATE (a:Person {name: 'Alice'})
CREATE (b:Person {name: 'Bob'})
CREATE (a)-[:KNOWS]->(b)
`);
Advanced Querying:
// Find patterns in the graph
const results = await graph.query(`
MATCH (p:Person)-[:KNOWS*1..3]-(friend)
WHERE p.name = 'Alice'
RETURN friend.name, length(path) as distance
`);
Sub-graph Access Control:
// User A creates a graph with team data
await graph.create(`
CREATE (team:Team {name: 'Engineering'})
CREATE (alice:Person {name: 'Alice', role: 'Lead'})
CREATE (bob:Person {name: 'Bob', role: 'Developer'})
CREATE (project:Project {name: 'FabGraph'})
CREATE (alice)-[:MANAGES]->(team)
CREATE (bob)-[:MEMBER_OF]->(team)
CREATE (team)-[:WORKS_ON]->(project)
`);
// User A grants User B access to project sub-graph only
await graph.grantSubGraphAccess({
userId: "userB_publicKey",
rootNode: "project",
traversalDepth: 2, // Can see project and immediate connections
permissions: ["READ", "UPDATE"], // Can read and update, not delete
includePattern: "(:Project)-[:*]-()", // Cypher pattern defining boundary
});
// User B can now query only their permitted sub-graph
const results = await graph.query(`
MATCH (p:Project)-[r]-(connected)
RETURN p, r, connected
`); // Automatically filtered to permitted nodes
4. Team
Jules Lai (Project Lead)
- Founder/CTO of Fabstir
- Relevant Proven Delivery: Enhanced S5.js (25% early)
- Production Experience: 4+ years building decentralised infrastructure
- Technical Expertise: Graph databases, distributed systems, cryptography
- Domain Knowledge: Former blue chip financial derivatives developer
Relevant Track Record with Sia Foundation
- Enhanced S5.js delivered ahead of schedule
- Exceeded technical requirements
- Open-sourced all deliverables with comprehensive documentation
- Active community participation and support
5. Development Roadmap
Month 1: Architecture Design & Foundation
Focus: Design decisions, architecture documentation, development environment setup
Deliverables:
- Complete technical specification document
- Graph storage format design (CBOR-based)
- API design documentation
- Development environment setup
- NPM package structure
- Basic S5 integration tests
Metrics:
- Architecture review complete
- Design documentation (20+ pages)
- Development environment operational
Month 2: Core Storage Implementation
Focus: Node/edge storage, HAMT sharding, basic CRUD operations
Deliverables:
- Node and edge storage classes with ownership metadata
- HAMT-based sharding implementation
- Property management system
- Basic CRUD operations API
- S5 storage adapter with timeout resilience
- Sub-graph boundary definition (node groups, traversal limits)
Metrics:
- Handle 100,000 nodes/edges in tests
- Sub-second retrieval with caching
- 95% code coverage for core modules
Month 3: Query Parser Development
Focus: Cypher parser implementation and query planning
Deliverables:
- Cypher query parser module
- Query planner implementation
- AST generation and validation
- Basic query execution engine
- Error handling for malformed queries
Metrics:
- Parse 50+ Cypher query patterns
- Query parsing <10ms (AST generation only, not execution)
- Comprehensive parser test suite
Month 4: Query Execution & Optimisation
Focus: Complete query system, indices, transactions, permissions
Deliverables:
- Query execution engine completion
- Query optimiser
- Index management system
- Transaction support with rollback
- Sub-graph permission system (CRUD per sub-graph)
- Permission-aware query filtering
- TypeScript type generation
Metrics:
- Support 80% of OpenCypher specification
- Query execution with intelligent caching:
- Cache hits: <50ms
- Cache misses: ~800ms per S5 operation
- Multi-hop queries: proportional to depth
- Transaction rollback verified
- Permission filtering validated
Month 5: Algorithms & Migration Tools
Focus: Graph algorithms, import/export, integration features
Deliverables:
- Graph algorithms module (PageRank, shortest path, clustering)
- Migration tools (Neo4j, GraphML import)
- Batch import/export utilities
- Vector database integration hooks
- CSV import functionality
- Sub-graph sharing utilities (permission grants/revokes)
Metrics:
- Algorithms validated against reference implementations
- Support graphs with 1M+ nodes in tests
- Migration from Neo4j tested
- Sub-graph sharing tested across users
Month 6: Production Release & Documentation
Focus: Polish, documentation, examples
Deliverables:
- Performance profiling tools
- Comprehensive error handling
- Full API documentation
- 5+ example applications (including access control demo)
- Performance benchmarks document
- Developer tutorials
- Access control best practices guide
Metrics:
- Zero critical bugs in release candidate
-
90% test coverage across all modules
- Query performance (100K+ node graphs):
- Cached traversals: <100ms
- Single S5 fetch: ~800ms
- Complex queries: 2-5 seconds (depending on hops)
- 100+ pages of documentation
- All examples fully functional
- Sub-graph access control fully documented
Note: I initially proposed an 8-month timeline, but based on my Enhanced S5.js track record demonstrating consistent early delivery whilst exceeding technical requirements, I believe 6 months is a more accurate and realistic timeframe.
6. Budget
Total Budget: $57,600 USD
Monthly Breakdown:
- Library Development: $9,600/month
- Duration: 6 months
- Total: $57,600
This budget reflects:
- Proven delivery record (Enhanced S5.js completed 25% ahead of schedule)
- London-based development costs
- Senior-level expertise in distributed systems and graph databases
Cost Efficiency
The grant enables development of enterprise-grade graph database capabilities
as permanently free, open-source software for the Sia ecosystem.
Resource Allocation
- Development (85%): Core library implementation, testing, optimisation
- Documentation (10%): API docs, tutorials, migration guides
- Community Support (5%): Developer assistance, bug fixes, feedback integration
Payment Schedule
Monthly milestone-based payments:
- Month 1: $9,600 (Architecture & Foundation)
- Month 2: $9,600 (Core Storage)
- Month 3: $9,600 (Query Parser)
- Month 4: $9,600 (Query Execution)
- Month 5: $9,600 (Algorithms & Migration)
- Month 6: $9,600 (Production Release)
7. Impact on Sia Ecosystem
Completing the Decentralised Data Stack
FabGraph provides the missing library for complete data infrastructure on Sia:
| Data Type | Solution | Status |
|---|---|---|
| Files | S5/Enhanced S5.js | |
| Vectors | Various solutions | |
| Graphs | FabGraph | |
| Result | Full data toolkit | Enabled |
Developer Ecosystem Benefits
Easier Development
- Drop-in JavaScript/TypeScript library
- Familiar query language (Cypher)
- Comprehensive documentation and examples
- Migration paths from existing databases
New Application Possibilities
- Decentralised knowledge bases
- Privacy-preserving social networks
- Sovereign organisational tools
- Relationship-aware applications
- Collaborative AI Development: Teams sharing model relationships with controlled access
- Granular Knowledge Management: Subject-matter experts owning graph sections
- Multi-tenant Applications: Isolated sub-graphs within shared infrastructure
Technical Leadership
- First graph database library for blockchain storage
- Complete data infrastructure toolkit
- Reference implementation for other platforms
Post-Grant Sustainability
Following grant completion, I will:
- Maintain FabGraph as part of Platformless AIβs infrastructure
- Address critical bugs and security issues
- Accept community contributions via GitHub
- Provide basic documentation and examples
Note: Without ongoing funding, feature development and active promotion
will be limited to what I can sustain alongside my primary projects.
8. Risk Assessment
Technical Risks
| Risk | Mitigation | Impact | Probability |
|---|---|---|---|
| Complex implementation | Leverage existing graph theory libraries | High | Low |
| Performance optimisation | Learn from vector DB caching patterns | Medium | Medium |
| S5 timeout handling | Proven solutions from prior work | Low | Low |
| API design complexity | Follow OpenCypher standards | Medium | Low |
Adoption Risks
| Risk | Mitigation | Impact | Probability |
|---|---|---|---|
| Developer learning curve | Extensive documentation and examples | Medium | Low |
| Library integration issues | Clean API, minimal dependencies | Low | Low |
| Performance expectations | Clear benchmarks and guidelines | Medium | Medium |
9. Success Metrics
Technical Metrics (Month 6)
- β NPM package published and functional
- β 80% OpenCypher specification coverage
- β Performance within S5 network constraints (cached <100ms, uncached ~800ms)
- β >90% test coverage
- β Zero critical bugs
- β Bundle size <1MB
Ecosystem Metrics
- Integration with Platformless AI (guaranteed)
- Open-source repository maintained on GitHub
- Documentation and examples available
- MIT licence enabling unrestricted use
10. Conclusion
FabGraph fills a critical gap in the Sia ecosystem: a graph database library that enables developers to build applications with complex relationship data whilst maintaining data sovereignty. As free, open-source software, FabGraph democratises access to graph database capabilities without licensing fees or vendor lock-in.
My proven track record delivering Enhanced S5.js and production-grade vector database infrastructure demonstrates my ability to build sophisticated data libraries for S5. With growing demand for decentralised data systems and no existing graph database solution for blockchain storage, FabGraph positions Sia as the complete platform for privacy-preserving application development.
This grant investment yields essential open-source infrastructure that unlocks new application categories, accelerates developer adoption, and establishes Sia as the leader in decentralised data librariesβnot just file storage, but complete data systems.
Appendices
A. Technical Specifications
- OpenCypher subset implementation plan
- Storage format specifications
- API design documentation
- Performance benchmark methodology
B. Prior Software Deliverables
- Enhanced S5.js: 10.6x under size requirement, 280+ tests
- Media ecosystem on S5/Sia validated by 19 top US film distributors
- Production systems running on S5
C. Development Commitments
-
Will all of your projectβs code be open-source? Yes, MIT licence
-
Monthly progress reports: Yes, I agree to submit monthly reports
-
Demo participation: Yes, I agree to participate in demos
-
Point of contact: Jules Lai - jlai [at] fabstir [dot com]
-
Code repository: https://github.com/Fabstir/fabgraph (to be created)
-
Previous work:
-
Have you developed a proof of concept for this idea already?
Yes:
D. Contact Information
- Email: jlai [at] fabstir [dot com]
- Discord: @jules_lai
βBuilding the graph database library for decentralised data sovereigntyβ
Submitted by Jules Lai, Fabstir
October 2025