Decentralised Graph Database Infrastructure for Enhanced S5.js (Large Grant Proposal)

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:

  1. Integrates with S5: Uses Enhanced S5.js for all persistence
  2. Provides Standard API: Cypher compatibility
  3. Handles Encryption: Client-side encryption with user-controlled keys
  4. Scales Horizontally: HAMT sharding for millions of nodes/edges
  5. Works Standalone: Drop-in library for any JavaScript/TypeScript application
  6. 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 :white_check_mark: Complete
Vectors Various solutions :white_check_mark: Available
Graphs FabGraph :dart: Proposed
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

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

Hi @juleslai - thank you for this proposal. Given you currently have a grant you’re working on, can you confirm when your proposed start date is for this grant?

Hi @mecsbecs, thank you for taking the time to look at the FabGraph proposal.

Assuming the current Enhanced S5.js grant formally ends on 02 December 2025 and its last milestone report submitted by October 25th passes, I would be ready to begin funded work on FabGraph as early as 03 December 2025, pending the outcome of your upcoming review cycle.

In the meantime, I’m available to start any non‑funded preparatory activities (e.g., design reviews, planning) from 26 November if that would be helpful while the review is underway.

I’m prepared to commence work promptly once approval is confirmed and will hit the ground running as soon as given the green light.

1 Like

Thanks for your proposal to The Sia Foundation Grants Program.

After review, the Committee has decided to reject your proposal citing the following reasons:

  • There are concerns regarding the technical feasibility of building a relational database on top of object storage and the appropriateness of this use case on Sia.
  • The Committee would prefer to review a new grant proposal once the current grant project has been finished and reviewed.

We’ll be moving this to the Rejected section of the Forum. Thanks again for your proposal, and you’re always welcome to submit new requests if you feel you can address the Committee’s concerns.

Dear @mecsbecs and the Sia Foundation Grants Committee,
Thank you for reviewing my FabGraph proposal and providing feedback. I appreciate your consideration and would like to clarify some technical aspects that I failed to communicate clearly.

Graph vs Relational Database
FabGraph is a graph database (nodes and edges), not a relational database (tables and rows). This distinction is crucial - graph structures map naturally to object storage, with each node or edge stored as a CBOR-serialized blob. My production vector database already works successfully this way on Enhanced s5.js, proving the approach’s viability.

Addressing the Developer Gap
While Enhanced S5.js provides an excellent path-based API, it remains essentially a key-value store. Most developers expect database functionality - queries, indexing, relationships - and currently must build this entire layer themselves before starting their applications. FabGraph removes this significant adoption barrier.

Cypher Query Language
FabGraph uses Cypher (Neo4j’s graph query language), not SQL. This is strategic: LLMs already understand Cypher in their training data, enabling AI agents to interact with Sia-stored data immediately. This positions Sia uniquely for the AI infrastructure market - it’s infrastructure essential for Platformless AI.

Enhanced S5.js Status
Regarding your preference to complete current grants first: my Enhanced S5.js technical work is complete, with all deliverables met. I’m currently working with Redsolver on the upstream merge. I understand if you prefer to wait for formal closure before considering new proposals.

Moving Forward
Would the committee consider a smaller proof-of-concept grant once Enhanced S5.js is merged? Perhaps focusing solely on core graph storage to demonstrate feasibility before expanding to full Cypher implementation? I’m flexible on scope and timeline to address any concerns.

I remain committed to building on Sia. Thank you for your time and consideration.

Best regards,
Jules Lai

Hello @juleslai - thank you for this note. I will bring this up at this week’s Committee meeting (tomorrow) and let you know the Committee’s response.

Hi @juleslai the Committee would be open to seeing a proof-of-concept Small grant. Please keep in mind the upcoming Foundation holiday for your timeline, which means there will be no reviews conducted around December 25.

1 Like