Small Grant: expo-sia-storage

Introduction

Project Name: expo-sia-storage

Name of the organization or individual submitting the proposal: @manojsrinivasa (discord)

Github - jonumhills (Manoj Srinivasa) · GitHub

Describe your project.

expo-sia-storage is an Expo native module that makes the Sia Rust SDK usable in React Native and Expo applications on iOS and Android.

The existing @siafoundation/sia-storage npm package is compiled from the Sia Rust SDK to WebAssembly via wasm-pack. WebAssembly works in browsers and Node.js. It does not work in React Native because the Hermes JavaScript engine does not implement the WebAssembly API. This is not a configuration issue or a workaround problem. It is a architectural incompatibility between the WASM compilation target and the Hermes runtime.

expo-sia-storage resolves this by compiling the same Rust source to native binaries for iOS and Android instead of WASM, then exposing the SDK through React Native’s JSI bridge via UniFFI. The published package presents an identical TypeScript API to the existing web SDK, allowing a developer to replace one import line and have the same upload and download logic work on a mobile device.

The SiaFoundation/sia-sdk-rs repository already contains a sia_storage_ffi crate with UniFFI interface definitions. The scope of this grant is to build the Expo Module wrapper around that crate, handle the cross-compilation and packaging for all three mobile targets, write the TypeScript API layer, and publish the package to npm under an MIT license.

How does the projected outcome serve the Foundation’s mission of user-owned data? What problem does your project solve?

Consumer facing mobile apps are the most direct path to putting user owned data in the hands of non-technical users. iOS and Android together represent the overwhelming majority of personal computing for most people. A grant recipient who wants to ship a privacy-focused contacts manager, calendar, or file storage app today cannot use the official Sia SDK in their Expo project. The only current options are abandoning Expo for a fully native build, writing a bespoke Rust-to-JSI bridge without UniFFI support, or making raw HTTP calls to indexd and reimplementing key derivation and upload logic from scratch. None of these are viable for a focused two-month grant project.

The consequence of this gap is that mobile app development on Sia is effectively blocked for the React Native ecosystem, which is the most widely used cross-platform mobile framework. expo-sia-storage removes that blocker. Once published to npm, any Expo developer can add a single dependency and access the full Sia SDK functionality on mobile. The package is reusable infrastructure: it benefits every current and future Sia mobile grant rather than serving one project alone.

Are you a resident of any jurisdiction on that list? No
Will your payment bank account be located in any jurisdiction on that list? No

Grant Specifics

Amount of money requested and justification with a reasonable breakdown of expenses:

Total $6000 - 2 months of developer fees for @manojsrinivasa

What is the high-level architecture overview for the grant? What security best practices are you following? Please review our Development Guide for further details.

High-level architecture: Expo app UI + TypeScript API layer + React Native JSI bridge to a native Expo Module (Swift on iOS, Kotlin on Android) + the sia_storage_ffi crate from SiaFoundation/sia-sdk-rs compiled to native binaries (libsia.a for iOS, libsia.so for Android) via Cargo and UniFFI + indexd Application API over HTTPS. The sia_storage_ffi crate already contains UniFFI annotations; uniffi-bindgen-react-native reads those annotations and generates the Swift, Kotlin, and TypeScript glue code automatically. The iOS binaries are packaged as an XCFramework consumed via CocoaPods. The Android binaries are placed in jniLibs/ and picked up by Gradle.

Security best practices: The package does not manage or store credentials. The AppKey is passed in by the calling application and flows directly into the Rust layer, identical to the behaviour of the existing browser SDK. The cryptographic code is compiled unmodified from the Foundation’s own sia-sdk-rs source. All network calls target the caller’s own indexd instance over HTTPS with certificate validation handled inside the Rust HTTP client.

What are the goals of this small grant? Please provide a general timeline for completion.

Month 1 - Rust cross-compilation working for all three targets, XCFramework packaged for iOS, Android .so files placed in jniLibs/, FFI surface audit complete, proof-of-concept upload and download working in emulator.

Month 2 - TypeScript API layer complete, full API parity with @siafoundation/sia-storage, published to npm as expo-sia-storage v0.1.0, README with integration guide, example app.

Who is the target user for your project?

The primary audience is Expo and React Native developers building applications on Sia, including current and future grant recipients who want to ship mobile apps without writing native bridge code themselves.

The secondary audience is the broader React Native ecosystem. Publishing this as an open npm package means any developer evaluating Sia for a mobile project can integrate it in minutes. This lowers the barrier for ecosystem growth independent of the grants program.

What are your plans for this project following the grant?

The package will be maintained as open source after the grant concludes. Version compatibility with new Expo SDK releases will be tested and updated on a best-effort basis. If the Foundation releases breaking changes to sia-sdk-rs that alter the FFI surface, a corresponding update to expo-sia-storage will be published.

The immediate follow-on project planned after this grant is a mobile application that uses expo-sia-storage to store a user’s personal contacts in their own Sia bucket. That application would serve as a production-level integration test for the package as well as a consumer-facing demonstration of user-owned data on mobile. A separate grant proposal for that project will be submitted after expo-sia-storage v0.1.0 ships.

Potential risks that will affect the outcome of the project:

XCFramework packaging complexity. Combining arm64 device and arm64 simulator slices into a single XCFramework that CocoaPods can consume requires specific lipo and xcodebuild invocations and is sensitive to the Xcode toolchain version. This is the most technically uncertain step in the project. Existing open source reference implementations, including expo-rust-demo by Daniel Cortes and the rust-react-native repository by mariusud, will be used as a starting point. Additional time has been reserved in the month 1 schedule specifically for this step.

FFI surface coverage. The sia_storage_ffi crate exposes the subset of the Rust SDK that the Foundation targeted for Swift, Kotlin, and Python consumers. If specific operations required by a real Expo app are absent from the FFI crate, the options are to submit a pull request to sia-sdk-rs, implement a thin workaround at the TypeScript layer using direct HTTP calls to indexd, or request that the Foundation extend the interface. A full audit of the FFI surface against the web SDK will be completed in the first week of month 1 before any module code is written.

Hermes runtime constraints. UniFFI for React Native is documented by Mozilla as an early release. The documentation notes that Rust crates need to make alternative arrangements if they depend on features the JavaScript virtual machine does not provide. The Sia SDK performs all HTTP communication inside the Rust layer through its own HTTP client rather than delegating to JavaScript, which limits exposure to this risk. If Hermes-specific constraints do surface they will be documented in the monthly progress report for the community’s benefit.

Development Information

Will all of your project’s code be open-source?

Yes. The package will be published under the MIT License, consistent with SiaFoundation/sia-sdk-rs and all other Sia Foundation repositories. A LICENSE file will be present in the repository root from the first commit.

Third-party dependencies and their licenses:

SiaFoundation/sia-sdk-rs (MIT) provides the sia_storage_ffi crate and all underlying Rust cryptographic logic. No modifications will be made to the cryptographic code. uniffi-bindgen-react-native (MIT, Mozilla) provides the binding generation toolchain. expo-modules-core (MIT, Expo) provides the native module scaffold.

No closed-source components are used at any layer of the package.

Leave a link where code will be accessible for review.

The expo-sia-storage module code will be at https://github.com/jonumhills/expo-sia-storage
The package builds directly on https://github.com/SiaFoundation/sia-sdk-rs specifically the sia_storage_ffi crate.

Do you agree to submit monthly progress reports?

Yes. Progress reports will be submitted on the 25th of each month to the Sia forum grants category. Each report will cover milestones completed, technical issues encountered, and the plan for the following month.

Contact info

Email: [email protected]
Any other preferred contact methods: @manojsrinivasa on Discord

npm install react-native-sia

https://github.com/siaFoundation/react-native-sia

Hi @Nate,
Thank you for pointing me to the react-native package. I didn’t come across it during my research while building SiaContacts app in react-native expo. I am withdrawing this grant since this already solves the problem I was proposing to build.

I will be submitting a separate proposal for SiaContacts (a mobile contacts app built on Sia using react-native-sia as the storage layer).

  • Manoj Srinivasa

Hi @manojsrinivasa - at your request, this proposal has been moved to the ‘Inactive’ category.

1 Like