Small Grant: Dart/Flutter SDK and Photo App POC

Introduction

Project Name: Dart/Flutter SDK and Photo App proof of concept

Name of the organization or individual submitting the proposal:

Morgan McKenzie - Developer and project lead

Morgan has 15+ years full-stack development experience with a focus on mobile development. He maintains a couple of Flutter plugins and has lead development on a number of apps, the most successful being a mental health called Rootd. This is his github. He has worked in privacy tech as well as for security-oriented companies such as McAfee/Intel.

I (Morgan) am an avid (amateur) photographer and have been using Google Photos for lack of a better option, but would very much like to move away from it. I’ve long had plans to make an alternative but lacked time and wanted to avoid centralized storage. Sia is the first storage solution I’ve seen that is ownership-focused but also seems likely to be around in a few years, since there is viable monetization strategy unlike other decentralized storage networks I’ve checked out in the past.

Michelle Kung - Product Designer

Michelle is a product designer with 7 years experience across enterprise and startups. She will be approaching the design as an outsider to the decentralized ecosystem, ensuring users will be able to easily use the mobile application while also educating them about the possibilities of decentralized storage.

Describe your project.

This grant would fund three activities:

  1. Creation of a Dart wrapper for Sia’s rust SDK with a Flutter plugin allowing for easy integration into Flutter-based mobile apps.
  2. Proof of concept mobile application for a photo + video storage service akin to Google Photos, but with privacy and user-ownership built in. The initial build would focus on directly integrating with the SDKs and not on running its own indexd instance, although this would likely be part of the long-term plan.
  3. Detailing of the process of building on Sia from scratch from someone relatively unfamiliar with the ecosystem. This would take the form of blog posts and social media (bluesky, youtube)

The primary output would be the proof of concept app, and this would be the continued focus going forward, however we will commit to maintaining the dart/flutter SDKs as well.

How does the projected outcome serve the Foundation’s mission of user-owned data?

All three outputs of this project would serve the foundation’s mission. Firstly, the mobile application will continue to be developed and eventually released on the app stores. The focus will be on making it approachable and seamless for everyday people who have no knowledge of blockchain or decentralized storage.

Second, the creation of Dart/Flutter plugins will make it easy for Flutter developers to integrate with Sia.

Third, we understand that documentation/marketing is not one of the Foundation’s main focuses, but we believe in this case what we can do is valuable - you’re obviously the best source for pure documentation but we can provide a different viewpoint that will hopefully make it easier and more approachable for developers and users to adopt Sia. Anything we produce will be posted to various dart/flutter-specific developer groups as well as on a blog - we can work on whether the foundation would want to use them on their own blog or not once they’ve been written and would be happy to have them reviewed before publication.

****We cannot provide grants to residents of jurisdictions under increased FATF monitoring, those that have active OFAC sanctions, or those that fail our bank compliance tests. We also cannot provide grants if your payment bank account is located in those same locations.

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:

We are requesting 10,000 USD. This would be broken down into two parts:

Development work (8000 USD)

  • making and publishing a flutter plugin for Sia. This will include integrating the rust crate, wrapping calls, and figuring out how to map data structures to rust streams
  • development of app - upload/download of photos, making thumbnails, keeping track of edits, writing tests, etc

Design work (2000 USD)

  • figuring out onboarding flow for a user not familiar with Sia
  • communicating the foundation’s mission of education about data privacy to end-users for the photo storage use-case
  • design of mvp mobile app

We want to write about the process of building this and will do that on our own time as we understand that is not something the foundation wants to fund.

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.

There are three main code outputs from this project.

  1. a dart package exposing the sia_storage crate’s API through Dart’s FFI calls, which will mostly be a wrapper around the crate that exposes calls in ways that can be called from Dart code. If possible, code generation from the rust external interface will be used, but we are not yet sure if that is possible.
  2. a flutter plugin that wraps the dart plugin and provides the platform-specific bundling needed to actually be able to use the dart package in a flutter application. This will follow best practices for flutter plugins, and will allow integration of the sia_storage crate on iOS and Android (other platforms are considered non-mvp).
  3. the mobile app. At the proof of concept phase, we won’t have any server interaction other than with the indexd service running at sia.storage. All data will be stored locally, categorized with sqlite and using a file-system based image cache. Storage of keys will be done using the keychain on iOS and keystore on android.

Once this POC has been completed, we will look into further development and what kind of backend services we might need to run to make this into a fully-fledged service.

At this time our security posture will be as such:

  1. Use best practices on operating system for storing keys. If possible, use hardware-backed APIs (keychain/keystore) for storage of sensitive keys.
  2. Don’t hard-code keys into source code. Use CI/CD and environment variables.
  3. Don’t keep keys in memory indefinitely and wipe when possible. Be aware of copy-on-write and what that means for garbage-collected languages such as dart.

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

The grant has three main goals:

  1. Development and release of dart / flutter plugins for Sia: 2 - 4 Weeks
  2. Planning and design of app in form of wireframes, user flows, etc. + overall system design: 2 weeks
  3. Development of app POC: 4-6 Weeks

The idea is to wrap things up in about two months, with time spent on the app POC dependent on how long the development of the dart/flutter plugins take.

What are your plans for this project following the grant?

Our aim is to continue to develop the app first into a viable application available to the public that would be competitive with apps such as Google Photos. There are a lot of steps between now and then, and our tentative plan if this is approved is to request additional grant(s) once this work is complete to continue development of the app from proof of concept to a viable, released application.

This is something we very much want to see happen regardless of the grant - I (Morgan) have been thinking building something like this for years and would very much like to migrate the 20,000+ photos I have in Google Photos to somewhere that won’t be scanned by Gemini. Time is always a constraint though and the grant would allow for fully focusing on making this real.

Potential risks that will affect the outcome of the project:

Since this stage of development is for a proof of concept, the risk is fairly low. The biggest hurdle will probably be the integration between flutter/dart and the rust crate in a performant way. Flutter has some new FFI tooling that should make this easier, but likely still not easy. We’re not sure that streaming and async calls work properly yet, so some wrapper code may be necessary to expose this in a way that flutter can call.

Development Information

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

[Projects can use closed-source components, but can’t develop closed-source code. If any of your project’s code is closed-source, please describe what code and why. If utilizing code from a third-party, ensure it is appropriately licensed as open source and acknowledge which code you are planning on using here. ]

All code written as part of this grant will be open source and available publicly. We will most likely use the MIT license.

Leave a link where code will be accessible for review.

https://github.com/fution-co/photo-storage

https://github.com/rmtmckenzie/dart-sia-storage

https://github.com/rmtmckenzie/flutter-sia-storage

We’re happy to hand over the dart/flutter libraries to the Sia foundation, and can name them differently if trademark is an issue.

Do you agree to submit monthly progress reports?

[Progress reports must be submitted monthly here in the forum. ]

Yes, absolutely!

Contact info

Email: [email protected]

Any other preferred contact methods: rmtm on sia discord