Social Media Architecture with IPFS

Following is a summary of a potential method to combine social media with IPFS, based on current state of the technology, that I posted on Gab at:

I’m exploring creation of alt-tech, in the form of an open source, resilient, easy to install, peer-to-peer chat and file management system, targeted for use in oppressive societies, and looking for a group discussion on the merits of such a project.

The current concept being explored uses an open-source browser, modified to have a chat sidebar feature. The user would install the following apps:

  • Browser with chat feature and WebRTC built-in
  • IPFS Companion extension in the browser
  • IPFS Desktop app

IPFS would be used for the following:

  • Distributed chat/file system peer server
  • Resilient infrastructure
  • Distributed file management
  • Signaling protocol for WebRTC

When the chat feature is launched in the browser, the browser would talk to the IPFS daemon to identify available peers that also support the chat feature. The user could then try to initiate chat with one or more suitable peers, where the data streaming for the chat would occur via WebRTC

The chat UI could be designed to do some of the following to aid research/collaboration:

  • Allow linkage to IPFS file resources
  • Normal web URL hyperlinks
  • Establish chat groups
  • Identify trusted chat peers

I have a Google shared doc started for project specs development

2 Likes

I am at the “thinking about it” stage for developing a WebRTC based broadcasting 1toMany application using IPFS for distribution. Although I’ve played around quite a bit with Muaz Kahn’s RTCMulticonnection code, the IPFS portion of this idea will be a challenge for me. So I’m hoping I can learn something from your development using WebRTC. Please keep me in mind.

2 Likes

@crockwave good job :+1:

1 Like

For the IPFS/WebRTC chat app, I have the chat UX requirements roughly identified.

A test of using IPFS-JS for WebRTC signaling has been previously created, but they ran into difficulties doing NAT traversal:
https://github.com/cretz/webrtc-ipfs-signaling

IPFS Issue 153 acknowledges the NAT traversal issue
https://github.com/ipfs/in-web-browsers/issues/153

For reference, here is info on WebRTC signaling protocol requirements https://www.html5rocks.com/en/tutorials/webrtc/infrastructure/

A working title for the project is IPSN (Inter-Planetary Social Network).

IPSN app would do the following:

  1. Perform normal IPFS daemon functions and data caching
  2. Identify other IPFS nodes that support IPSN (using the Identify message)
  3. Perform signaling to selected IPFS nodes in order to build an appropriate session description to be handed off to WebRTC for making and managing the datastream connection with the remote peer
  4. Perform handling of WebRTC datastream errors

An alternative to the forked browser concept would be to do the proof-of-concept in a Windows app, using IPFS-JS lib, to avoid the browser forking and to avoid install of the IPFS desktop app. The assumption is that deployment would be simplified if we can incorporate js-IPFS into the app. Issues currently include:

  1. Getting NAT traversal fully implemented into js-IPFS, so that it can pass the appropriate session description to WebRTC for P2P datastream connection
  2. Getting IPFS daemon fully operational in js-IPFS
  3. Allowing Identify message metadata such as IPSN protocol support, avatar, and user name.

In order to populate a Contacts list in the IPSN app, each IPSN app would need to include metadata with their IPFS client, passed in the Identify message, so that the other IPFS clients deployed as IPSN nodes would gracefully add that particular IPFS node into the IPSN contacts list. The UX would be much better if an IPSN app could create a user name, which appears in the remote IPSN client chat contact list.

That’s the basic concept, single app that performs both IPFS functions and P2P chat. The exact approach is yet to be determined.

On Issue 3, is the IPFS Identify message overridable, such that once an IPSN protocol capability is detected, an Identify/push variant can be used to push extra metadata to compatible IPFS client nodes, containing custom metadata, such as avatar, user name, etc.?

I’m also looking for opinions/comments on best approach for a project with regard to app structure and which libraries to use.

1 Like

Hello crockwave and all,

i discover recently this project : https://scuttlebot.io/more/protocols/secure-scuttlebutt.html and i found this approach very intresting you can test that with heavy client write into javascript and electron patchwork https://github.com/ssbc/patchwork and here you can found all docs.

If i understand correctly your approach some mechanism of that can help you on your project.

that’s depend your approach :

for exemple if you choose to store your project directly in IPFS (clientless) youd need a basic application html 5 / js (with react / js-ipfs / lib to manage cryptography ) can be sufficent

but if you wish store all localy on user space maybe a heavy client rust / go / html5 + js (electron) can be a good path.

Regards

1 Like

4 posts were split to a new topic: Off-Topic Discussion from “Social Media Architecture with IPFS”

I’ve developed a fairly feature-rich platform that I want to become “The Linux of Social Media”, meaning it’s an open-source platform anyone can use and/or build on and extend as part of the IPFS ecosystem.

I won’t try to describe it because it really takes the screencasts in the links below to do it justice. I’m looking for other Java + TypeScript developers who want to join me in working on it. I don’t have any funding. This has been a side project up until now.

https://quanta.wiki

2 Likes

I like the look and feel of the platform. That’s a lot of very good work.

However, I don’t use Mongo DB… nor most of the rest of the software stack. I noticed that your sample domain is running on Linode… of which I am a big fan :slight_smile:

My go-to DB is postgresql. However, I’ve been trying out OrbitDB which runs within IPFS as indicated throughout several other threads here.

The features I like a lot:

  • Markdown enabled
  • Intuitive editor
  • Clean layout
  • Drag and drop

The architecture aspects that prevent me from deploying the platform on my own domains:

  • Significant Non-IPFS components
  • Use of DB that I’m unfamiliar with
  • Use of embedded web server which requires me to modify my iptables and forward ports.

Quanta is Java + TypeScript, so it would only be interesting to those kinds of developers, for sure. When I researched platforms a couple of years ago I was unable to find any Java-based platforms similar to Quanta. At least now Quanta is out there and the Java world has a platform option (if I can say that humbly)

About the editor, I have Ace Editor in the codebase but I temporarily commented that out just to get the default spell-checking from the browser.

About the data store, there’s a persistence interface that could be made a pluggable API, so that other back-ends could be used, an would be a 2 to 4 week effort to complete I’d say. I wish I had funding for that. :slight_smile:

Regarding web server, it actually just ‘requires’ a Servlet Engine, so getting it out of the embedded Tomcat that Springboot uses is not really much coding, just configuration stuff.

I wish I had funding to provide … I’m a terrible UX designer and a moderately poor programmer… but fairly proficient at running everything else.

It’s really great work… Alas! In the end funding seems to actually matter.

I think, or would like to think, that within a few years the goal of a non-Corporately controlled social media platform will reach the “network” tipping point. There are several options available, but each requires a separate account and most the interlinking protocols have been disabled or are non-operative.

For awhile, I ran my own XMPP service… but then FB and Google shutdown external linkage and suddenly there’s no one on the other of the line… as per Big Tech intentions of squashing everyone else.

I think the solution is going to require blockchain and/or IPFS identities. However, the basic problem I’ve had is that most people I try to communicate with simply ignore anything not posted to Google, FB, or Twitter…

Alternative channels already exist and have existed for a very long time. However, very few people are using those alternative channels and it’s difficult to find people who are willing to navigate multiple platforms for the sole purpose of communicating with the one person who isn’t “on” a non-Corporate controlled service.

I agree with all of that @ipfsme. The world needs something like a “public general-purpose blockchain” that can “host” (but decentralized as IPFS) all social media data in the world, so that no one “posts to Twitter” or “Posts to Facebook”, but they are posting “to the internet”, so to speak, with the important thing being no central point of control or failure (no BigTech monopolies). I’m probably repeating a lot of what has already been said, but is definitely the consensus of opinion of the entire IPFS community.

So the Fediverse, ActivityPub, etc are what is needed so that the “Protocol(s)” are what all these heterogeneous platforms are using to interoperate, rather than building on any one common codebase.

In this kind of future, everyone would have 1) their own set of hashes that they’ve ever posted on any service, and 2) a way to view and browse and KNOW later on what those hashes are. Everyone needs their own personal “tree” or data structure to organize their hashes they’ve put out there, and that’s one of the goals of Quanta.

Another potential use for Quanta is that it’s just part of the infrastructure of any Pinning Service (like Pinata.cloud), because it has the ability to hold a hierarchy of anything, and be not just your way of seeing your own data, but also the actual platform over which you share it.

You can think of Quanta as a ‘melding’ of a Pinning Service and a general wiki or Social Media platform, or the piece of infrastructure that any Pinning Service can provide to unify the experience of people managing their pinned content, across all the different pinning services, so that to “run” or start your own pinning service, you don’t start from scratch, but you just use something like Quanta (even if not Quanta itself)

BTW…

I could provide some funding via a monthly BAT contribution, if you signup your github as a Brave Creator:

It won’t be much… about 5 BAT a month, which currently is worth about $1.25 USD … but at least you’d have the ability to attract a nearly passive income source. If you could get a few monthly contributors, it starts to add up fast.

This is kind of off topic but related, I am working on a system to help with the IPFS/IPNS naming system. This might help your project since people will have easy to remember “IPFS domain names” and they can then share them out to create webrings, or social networks. I need help thinking through a few items though. Let me know if you are interested and we can discuss.

Cheers

-nb

Hello.

Just want to mention that in galacteek i use decentralized identities with IPID (DID documents stored in IPFS and resolvable with IPNS). Your DID has the form did:ipid:QmhGfhc… (the last part being an IPNS key ID). Peers exchange DIDs over pubsub and authentify each other through a DIDauth service (using p2p streams). When the DID document changes it’s republished to IPNS. One downside is that if a user goes offline for a while and the IPID is not republished, others would most likely not be able to resolve the DID that’s why i use a backup resolve cache only for IPIDs.

Although DID specs are still evolving, i think any decentralized social media application based on IPFS should consider using IPID (or DIDs stored on a blockchain) for verifiable identities backed by crypto.

@wclayf

That’s an interesting topic. I feel like trying to replicate a centralized database model, what @reload mentioned re blockchains, is sort of outdated and proven not to scale. That’s why we have NIST P-521 EC social public keys that we share in a quorum based approach with peers in our example app qDesk.org - For verification purposes I feel like it’s best to provide a layer for every major external network, but unless it’s done by posting a signed message and scraping that, I doubt it really aligns with the values of decentralized computing.

I think a true blockchain as a way of ‘decentralizing’ Social Media may be too impractical, because of scalability and other reasons, but the Federation model of ActivityPub seems to be working (Pleroma, Mastodon, etc), although it’s a bit complicated to implement and test since Mastodon and other’s don’t really follow the spec.

What IPFS can potentially bring to ActivityPub is the ability to send only the CIDs from peer to peer, rather than sending actual streams of actual data the way ActivityPub currently works. It would be a fairly straight-forward proposal to the AP Stream spec body that maybe they allow responses to contain just a CID that points to the data.

So for example if I get an AP request for a user’s outbox, I can just send back the CID of where that data is stored. This ‘seems’ like it would be a good design path, but I it’s hard to predict if that’s truly better than plain ordinary AP. I mean, since the server might want to customize the stream on a per-call basis, based on dynamic parameters, so in that kind of case a single CID may not work because IPFS is ultimately links to static pre-generated data.

I know IPFS can publish entire directories but I’m not up to speed on how you could publish a small update to a directory without streaming up the entire content of the new directory. (assuming we were to represent a user’s outbox as a directory of files for example) Maybe IPFS chunking does make this practical (similar to how RSYNC sends updates only), but the Social Media scenario is challenging because the user is constantly pushing up new content one sentence at a time essentially, and this constantly changing feed may just be impractical for IPFS? I’m not sure.

Like I said, I think that whole model is flawed, then you don’t really end up with a decentralized social network. You’ll have a centralized social network on decentralized architecture.

On qDesk we’re using encrypted channels and sharing social profiles and posts that people can search like they do with the embedded search algorithm on Twitter. We don’t store any files to IPFS, unless the user attaches a file/image. We’re using IPFS PubSub and people in the network of a certain peer listen to the updates that peer has, one word at a time or when peers are syncing the history also a few words at a time :wink:

Of course it would be cool to have longer messages in a file on IPFS you can just reference by the CID but I think that’s not very well suited for a social network. Especially when EU citizens have a right to mutability. We’re banning users from channels, flagging and blocking users and posts from the timeline search, etc. That’s pretty smooth when your social network works based on a quorum based approach, where there’s no central directory but just owners and representatives of owners for different bits of data.

1 Like

@StatinedInTheField I’m really glad you posted that, because I didn’t know about IPFS PubSub until I read your post, and was really excited to find out about that! I wasn’t quite sure yet how I was going to Federate or Decentralize “Quanta.wiki” project, other than to use ActivityPub, but if I wanted to connect only instances of Quanta to each other then IPFS PubSub looks really interesting.

However, I’m a believer in “Protocols over Platforms”, which means I don’t want to create a platform and then expect that I can get everyone to use it. I want a platform that can interoperate with a larger network of other platforms, that use a common protocol to communicate as a Social Media network.

RSS is the simple standard for just publishing a simple feed of course (and we can all already publish and consume RSS), but Social Media takes it further where you ‘follow’ people, and consolidate a bunch of feeds from all your friends into a single feed where you can also post to their feeds (i.e. replies)

I mean perhaps even a “Writable RSS” spec could even (mostly) solve some of this. If I can publish a feed but others can post ONTO that feed… that alone would be a game changer… but it doesn’t exist. There’s no ‘standardized’ way to ‘update’ an RSS feed afaik.

Obviously there’s a huge network-effect already with the Fediverse (ActivityPub) and I’d love to have Quanta connected to the Fediverse and those millions of users (if I had a full year to implement that!!) but you’re right that Federated definitely is not identical to Decentralized. People do want to own their own data, and if they do then it’s on them to store it, and doesn’t need a blockchain however.

Right now there’s not even a standard file format for how someone would own all their Social Media data, afaik.


Product Plug: Actually in Quanta there is an ability to export all of the data into a ZIP or TAR that can be both browsed offline and imported back in later, so I have that, but what I mean is there’s no “Industry Standard” for what it would even look like for someone to “download” all their Social Media data, into a format which could theoretically be ported over to some different platform, etc.

However, I’m a believer in “Protocols over Platforms”, which means I don’t want to create a platform and then expect that I can get everyone to use it. I want a platform that can interoperate with a larger network of other platforms, that use a common protocol to communicate as a Social Media network

Wouldn’t we all? When it’s supposed to be decentralized it’s on us to build such a protocol.

You’re right that Federated definitely is not identical to Decentralized

Yeah and I believe the social network of the future works browser to browser, democratic between the users, without any centralized parties involved. AP doesn’t allow that, even requires a user directory.

With our protocol we make sure you don’t need that since identities generated for our protocol are inherently unique. It’s things like this that make the cornerstones of decentralized social networks.

Right now there’s not even a standard file format for how someone would own all their Social Media data, afaik.

I’m thinking probably makes more sense to encourage maintainers of social networks to import from other social networks. Like how we are planning to import from Matrix and Discord. Progress will always be faster than we can find standards in this field IMO.

Whenever you find the time look deeper into our Quest Network project questnetwork.github.io/docs - I think we have a lot of the same goals and found solutions to a lot of your questions, we haven’t needed any major funding for the past several years, I personally am still working on it at least 6 hours every day (most days a lot more) and we’re just a few weeks from offering any feature that you would expect from say Discord (we even support bots and we also already have a few things Discord doesn’t have like QR invites) or Twitter (I’m just now testing the timeline feature). I’ve been helping reload to use this in a Python desktop app but with your stack it would be much easier!

You can also use our underlying NodeJS library quest-os for your TypeScript app and use encrypted channels on IPFS and our social functionality like the timelines (0.9.4+) from a super easy API interface. With our bee module, you also have the ability to export your data and “browse” offline. If you lose the internet connection while talking to someone on chat on your local network, even the web demo will continue to work.

Our primary goal is to offer developers the ability to experiment with protocols and users the ability to enjoy a safe, private, democratic and decentralized social network experience.

What exactly is it that you want to solve with Quanta?

Sounds like you have a lot of cool stuff in qDesk. I still need to look at it better, I only glanced at it, so far.

About browser-to-browser decentralized: I think that level of pure peer to peer is good, but at some point somewhere there needs to be some kind of ‘commodity server’ instances (kind of like how Docker commoditized deployments) that can do powerful search and timelines like Quanta does. We don’t want any single point of failure, but I think having 100s or 1000s of commodity servers run by volunteers or orginizations (perhaps getting Filecoin miners to run them) is a good plan.

One of the super easy product pivots or spin-offs I could do with Quanta is to make it a Search Engine for IPFS. Practically the only thing I’d have to write would be a crawler, becasue the rest can be done by the power of MongoDB and it’s full-text search.

To answer your question of what even is Quanta:
If you scroll down on the main landing page you can find sections of info, and also here are the screencasts of it in action:


And if you want to see the tiny bit of docs I’ve written so far go here:

https://quanta.wiki/f/user-guide