Inspiration

When I was building a DIDComm-based mobile app, I wondered how to share images over the DIDComm protocol. At the same time, I thought it would be nice to have a more decentralized way of publishing and sharing photos. Something like Instagram, but without the surveillance and where users still have control over their photos. That brought me to the idea of Decentgram.

What it does

Decentgram allows you to upload photos to the Decentralized Web Node and share them with other users via DIDs.

How we built it

We built a simple web app with Next.js and Web5 SDK, which we connected to our own instance of DWN.

Challenges we ran into

  • There was a bug in Web5 SDK that disallowed access to blob record data from other DWN. We created a patch based on the PR https://github.com/TBD54566975/web5-js/pull/345/files.
  • We were getting 502 Bad Gateway in some cases when accessing the TBD-hosted DWN instance. We solved it by deploying our own DWN instance.
  • It seems it's not possible to update a record when you want to add a recipient. We solved it by creating a new record and removing the old one. Similarly, it's not possible to add more recipients. We're perhaps missing something, and both of those cases should be solved with a different approach.

Accomplishments that we're proud of

  • We were able to make the photo sharing work by restricting access to the sender's DWN for specific DIDs and without sending the image to the recipient's DWN, which was the main goal of our project.
  • We deployed our own instance of DWN.

What we learned

  • Basics of how Web5 and DWN work.
  • How the data larger than 50 kb are loaded into the app.
  • How the did:ion DID and its DID Document is constructed.

What's next for Decentgram

  • Share photos with multiple users at once.
  • Add other social aspects, likes, comments, and zaps with Bitcoin Lightning.
  • Use the code to send images via DIDComm in the mobile app.
  • It might also be possible to integrate it in some Nostr client.
  • Offline mode.

Built With

Share this project:

Updates