Federation Design Plan

(#1093) Feature Under consideration federation

Problem

Currently, there is not a public plan for how federation is supposed to work. Various elements of federation have been discussed in the Fluxer Developers server, but all of these are theoretical. Federation will take a while to create properly. It will likely be a collaborative effort by many contributors, not just the core Fluxer dev team. An open process discussing the various pros/cons of certain elements of the federation process would be, in my view, the best approach. I've taken some time to plan out, at a very high level, how various elements of federation may want to work. This is based on conversations that took place with Fluxer Developers and my own rough thoughts. I should be clear: this does not reflect at all how the Fluxer devs are currently planning to implement federation. This is just based off of my own ideas and discussions I've observed/had in the Fluxer Developers channel. This is by no means complete or comprehensive. This is a work in progress for sure and doesn't consider all elements that should be considered in the design of Federation. I would love to have a discussion about all of these aspects and perhaps work with the community and the Fluxer Dev team to come up with an official set of features and an implementation plan for how federation will work.

Proposed solution

Federation Design Plan

Objective of Federation

The objective of federation within Fluxer is:
  • To create an interconnected network of independently operated rich-media chat servers, where users across communities may interact with each other with as little friction as possible, while maintaining sovereignty over their own data.
It IS NOT to:
  • Prevent government interference with the operation of an instance;
  • Replicate data across a federated network in an effort to eliminate censorship altogether by making data impossible to delete once submitted; or
  • Maintain complete anonymity and/or secrecy of conversations, attachments, or identities tied to user accounts.

Definitions

All capitalized terms not otherwise defined herein have the following meanings:
  • “Foreign Guild” means a guild that is hosted on an Instance other than the Guild Instance.
  • “Guest Instance” means an instance that is not the Home Instance of a particular user. There may be one or many Guest Instances that a user may connect to and participate in.
  • “Guest User” means a user who is connected to and participating in, but whose account does not otherwise exist, on a particular Instance.
  • “Guild Instance” means the Instance on which a guild was created.
  • “Home Instance” means the Instance where the user’s account is created.
  • “Home User” means a user who is connected to and participating in their Home Instance.
  • “Instance” means a fully independent, self-hosted deployment of the Fluxer platform.

Authentication

  • Each user connects to and authenticates with their Home Instance. A client will need to be told what Instance to authenticate against by way of the domain name.
  • The domain of an Instance will have an SRV record that points to the API server and port of the particular Instance so that no configuration is necessary for the client.
  • The format of a username will be name#discriminator@domain.tld. The @domain.tld can be elided within a local Instance only. The Instance will assume @domain.tld for any reference to a username without it already included.

Premium Features and Limits

  • Certain profile premium features are Instance agnostic. This means that if the Home Instance has enabled these features for a user, they are visible anywhere across the federated space. The Instance agnostic premium features are:
    • Animated avatar
    • Animated banner
    • Custom discriminator
    • Custom notification sounds
    • Global expressions
    • Per-guild profiles
    • Voice entrance sounds
  • Limits, as defined within the Home Instance, apply to a Home User only.
  • Separate limits may be defined by an administrator to apply to Guest Users. A different set of limits can apply to Guest Users by applying different traits, the same as with Home Users. By default, unless configured differently, Guest Users receive the same limits as Home Users.
  • Additional limits are to be added for federation purposes:
    • Can use reactions from other instances (yes or no)
    • Maximum number of cross-instance reactions per message
    • Maximum number of cross-instance users per direct message conversation

Guilds, Messages, Attachments, Uploads, Reactions

  • Guilds are always housed on the creator’s Home Instance.
  • In the case of a transfer of guild ownership to a Guest User, the guild would continue to remain on the Home Instance.
    • Optionally, an Instance administrator may prevent transferring guilds to Guest Users altogether. This is a setting on the Instance itself.
  • All messages, attachments, and uploads are stored on the Guild Instance.
  • A guild’s limits are defined by the limit rules of the Guild Instance in combination with the guild owner’s limits on the same Instance. For example, if a Guest User becomes the owner of a guild, the limits of the Guest User as set out in the Guild Instance would now apply.
  • A Guest User’s upload limits, message lengths, embeds, reactions, etc., apply as defined in the Guild Instance for Guest Users.
  • A Guest User may use, if permitted, reactions from Foreign Guilds. These reactions are linked on the message and the Guild Instance is responsible for looking them up and making them visible to target clients.
    • The reaction image itself will be cached on the Guild Instance if it meets file size requirements. Otherwise, the reaction will be removed from the message as it will be considered invalid.

Inter-Instance Communication

  • With the exception of media and API requests, a user always communicates to other Instances through their Home Instance.
  • Each Home Instance that has users who desire to connect to Guest Instances will establish a one or more inter-Instance communications channel to the Guest Instance. These channels will aggregate all traffic between two Instances that is normally reserved for the gateway, such as presence information, state updates, new messages, etc. Each Instance will then pass on the information relevant to a particular user through their individual gateway channel.
    • This approach prevents the need for each client to potentially create dozens of gateway connections if they are, for example, members of guilds across dozens of Instances.
  • API requests (GETs/POSTs/etc.) will continue to happen with the client connecting directly to the API service of the Guest Instance and making the request.
  • API requests to Guest Instances are authenticated using a bearer token signed by the Home Instance. The Guest Instance will validate the bearer token against the well-known signing keys of the Home Instance.

Guest User Accounts

  • Each Guest User connecting to a Guest Instance, provided that federation is permitted and the Guest User may access the Guest Instance, will automatically have a local account created for them.
  • This local account will have its own user ID and other information based on claims provided by the Home Instance.
  • This local account may be deleted, disabled, or moderated like any other Home User account, by the Guest Instance administrators. A disabled account will prevent that user from connecting to the Instance.
  • All messages sent and all attachments uploaded, are tied to this local account.

Direct Messages

  • DMs are replicated on both the Guest Instance and the Home Instance. Each Instance will independently have a snapshot of the contents of each Direct Message. In the case of group DMs, the messages are replicated across all participating Instances.
  • For attachments, the uploading user’s Home Instance stores the attachment. Each participating Instance replicates only the target media URL of the Home Instance, thus directing clients to the poster’s Home Instance to retrieve the attachment.
  • A user will only send a POST request to the API service of their Home Instance to send a message. The Home Instance will use its inter-server communications channel to deliver the message to all the other Instances involved in the DM chat.

Federation Whitelist/Blacklist

  • Federation is disabled by default. This prevents users from: (1) connecting to Foreign Guilds; or (2) receiving connections from Guest Users.
  • If enabled, Federation may be turned on in one of two different ways.
    • Allow all but blacklist — Accept federating with any Instance unless that domain is on the pre-defined blacklist.
    • Deny all but whitelist — Decline federating with any Instance unless that domain is on the pre-defined whitelist.
  • If blacklisted, that Guest Instance’s users will not be able to communicate with any Home User, nor may any Home User join any Foreign Guilds housed on the Guest Instance.

Offline and Abandoned Guest Instances

  • If a Guest Instance is offline or otherwise uncontactable (e.g., either the Guest or Home Instance is on a blacklist), Home Users will see the any guilds housed on the Guest Instance as being disconnected.
  • The Home Instance will continue to make efforts to connect to the Guest Instance over a defined period of time with successive back-offs (e.g., 30 days).
  • Once the Home Instance deems the Guest Instance permanently offline, it can automatically remove membership from all guilds associated with the offline Instance and delete any of its cached data, including reactions, and references to attachments that are only housed on the Guest Instance.
  • At some further defined point in time, a Home Instance may remove the user accounts of a permanently offline Guest Instance. These removals would be treated by the platform in the same way as if a Home Account were deleted. This is considered the “Permanent Deletion Event”.
  • If the Guest Instance is revived at some point:
    • It will be discovered as revived if and when a Home User successfully adds a guild on the Guest Instance.
    • At that time, the Home Instance will inform the Guest Instance that it has considered it permanently offline. This causes the Guest Instance to remove all of the Home Instance’s data from its database in the same way as the Home Instance did when it considered the Guest Instance permanently offline.
    • Once this action occurs in the background, the Home User will be added to the guild in the Guest Instance as a new member.

Instance Authentication and Key Rotation

  • Each Instance generates a cryptographic keypair that identifies it. Upon first federating with another Instance, the public key components are exchanged.
  • Together with domain SRV record, these two elements serve to fully authenticate an instance as authoritative for any users at that particular domain.
  • The public key is used to authenticate each instance with the other when performing cross-instance communications.
  • The private key is also used to sign the bearer tokens provided to clients for sending requests to Guest Instances.
  • The keypair may be rotated. The new public key may be distributed to the other Instances using the cross-server communications channel. Upon the day and time desired by an Instance, it may invalidate old an old keypair and designate a new one as valid.
  • If an Instance attempts to communicate with an invalid keypair, its communications will be rejected.
  • Even if an Instance goes offline and is abandoned as described earlier in this document, the public key remains cached. Any revived Instance will be expected to communicate with the last known good keypair. These cached public keys will only be removed by a Permanent Deletion Event. After this, if an Instance wishes to refederate, it may use an entirely new keypair, as there would be no other links to the former Instance.
    • The admins of an Instance may at any time clear the last known-good public key and permit an Instance to reconnect with a newly generated keypair.

Push Notifications

  • Since there will be one official Fluxer mobile app, there will be a need for consolidated push notification delivery to occur from all self-hosted Instances.
  • Push notifications to the mobile app may be disabled by an Instance. If disabled, the mobile app would only retrieve the badge count and notifications upon active connection with the Home Instance.
    • Potentially, the app may be configured to, as a background task, retrieve the badge count and pending notifications from the Home Instance on a certain interval.
  • When a user first creates an account on their Home Instance, or when a Home User first joins a Foreign Guild, they will be prompted whether they would like to receive notifications from the target Instance.
  • If approved, the following occurs:
    • The app sends a request to Fluxer’s central push notifications service indicating that it is subscribing to notifications from a particular Instance.
    • Fluxer’s push service looks up the SRV record of the target Instance and retrieves the well-known configuration of the Instance.
    • If validated, Fluxer’s push service provides a token to the client, which is then passed on by the client to the target Instance.
  • The target Instance can send push requests directly to Fluxer’s central push service using the token described earlier, which would then be forwarded to the mobile app through the respective Google/Apple push services.
  • The payload of the push notification will include the domain of the Instance making the notification, thus the mobile client would know which guilds are eligible to have the notification attributed. This prevents spoofing notifications for unrelated Instances.

Merged posts

These posts were merged into this one. Their comments are now part of the conversation below, marked with where they came from.

Merged from #1204 Create an interoperability layer with Matrix homeservers

RexSystemoriginally by @Giwayume on GitHub

Report details

Problem

Matrix has been around for some time now and it is pretty much everything this project wants to be. I understand every developer has a tendency to want to create their own unique app and APIs, cause it's fun to do. But that is not what the internet needs right now. We've all moved on from one arbitrary chat app to another when each fails. What we need at this point is to agree on an open communication standard, so we can all talk to each other no matter what app we choose to use. This is what Matrix is.

Proposed solution

https://spec.matrix.org/latest/ Implement a translation layer to the Matrix "server to server" API for fluxer servers, so people on Matrix homerservers can discover and have basic communication with fluxer servers, and vice a versa. Alternately, just change the fluxer API to use the Matrix spec as its foundation so Fluxer servers are Matrix homeservers. The spec is very extensible, if you want to create your own feature (like a different voice compression algorithm) that isn't in spec, you can just add it and other servers may choose to implement it if your extension is popular enough.

Merged from #984 Self-Hosting + Join other fluxer servers + Delete Data

RexSystemoriginally by @ElevationsRPG on GitHub

Report details

Problem

Self Hosting is not available yet, Cannot join other fluxer servers, and Delete Data could be improved

Proposed solution

It would be nice if you are self hosting, theres a button in fluxer that allows you to "join another fluxer server" within the app, Also a option to right->click on a server and delete all data you have sent on that server, Also make it so that (admins of servers) can make channels that have an "option" that will inform the user upon joining the channel that messages are either "permanently stored" or "temporary only" so that data can be easily removed or not depending on what the server owner / chooses. Adding onto the idea with fluxer servers (Each fluxer server can generate its own invite code i.e fluxer.app/selfhosted/iX4093o when a user clicks the link it will open the fluxer app and join that self-hosted server via its invite code. Self-hosted servers will show up like regular (non self hosted servers) that you manually join with the invite codes. Also making so that if you need to sign up new account after joining the self-hosted server its seamless and integrated inside the app. And make option to "import existing account" into self-hosted servers for easy sign up. Perhaps keeping the local account stored in cache and only connect when actually clicking on a server or trying to "retrieve DM messages" etc. May reduce excessive load?

Merged from #1080 Choice of protocol for federation

RexSystemoriginally by @DamitusThyYeetus123 on GitHub

Report details

Problem

As federation moves closer to implementation, significant thought needs to be placed into which federation protocol(s) are used and how they are implemented.

Proposed solution

Possible protocols:
  • Activitypub:Pros:
    • Most common modern federated protocol
    • Lots of users and existing services
Cons:
  • Very focused around blogging and public posting
  • Monolithic
  • AT ProtoPros:
    • Seperation between accounts and services
    • More versatile protocol
Cons:
  • Less users and adoption
  • Dedicated fluxer protocol:Pros:
    • Specific for fluxer/built for fluxer
    Cons:
    • Another account for users to manage
    • Protocol design requires a lot of work

24 comments

Sign in with Fluxer to comment and vote.
Comment by @Haplo164
RexSystem 1 vote Merged from #1080 originally by @Haplo164 on GitHub 6 replies
Federation is a big plus in my book, I don't know much about the various protocols. The way matrix does it is less than fun for long term maintenance, I think its really important to consider long term maintenance, and balance a users control over their data and a server admins ability to keep a long running instance running well. I'd also like to throw in a users ability to transfer their account would be very nice, even if it can't move everything, being able to update friends and memberships with the new "home" server would be a very attractive to fans of federation.
Comment by @DamitusThyYeetus123
RexSystem 1 vote Merged from #1080 originally by @DamitusThyYeetus123 on GitHub
Many of the features you describe depend heavily on the choice and design of the protocol. Hopefully there's more discussion around the specifics of how federation is implemented soon, as I think it's the most important thing separating fluxer from other discord alternatives.
Comment by @Haplo164
RexSystem 1 vote Merged from #1080 originally by @Haplo164 on GitHub
It is the main reason I'm following this project, hopefully after things have calmed down a bit and self hosting is officially supported we can get some motion on this. I haven't even been able to get a good handle on the project yet so all I can do right now is think about what I want.
Comment by @Haplo164
RexSystem 1 vote Merged from #1080 originally by @Haplo164 on GitHub
How important do you think it is for there to be interoperability between Fluxer and other platforms? I've been mostly thinking in terms of Fluxer to Fluxer but that may be limiting my dreams.
Comment by @DamitusThyYeetus123
RexSystem 1 vote Merged from #1080 originally by @DamitusThyYeetus123 on GitHub
In a perfect world, there would be open discussion surrounding interoperability with other projects like spacebar and stoat, to ensure that where possible interoperability can be achieved, because when you're trying to get potentially millions of people to migrate off discord, you need all the options to be usable with each other to reduce friction and fragmentation. I'd argue that's a bigger benefit than self hosting, being able to openly communicate between multiple different projects and pieces of software.
Comment by @Haplo164
RexSystem 1 vote Merged from #1080 originally by @Haplo164 on GitHub
Identity is probably the most important part of that, being able to share contacts and have a consistent handle would be the core component. For text and voice chat I wonder if per platform bridges would be the way to go. I think trying to standardize anything else would limit any single service too much, or require everyone to agree on a constantly expanding standard. I would love to see a true single federated standard but based on how wayland protocol discussions go I don't know how well that would work out in practice.
Comment by @Haplo164
RexSystem 1 vote edited Merged from #1080 originally by @Haplo164 on GitHub
@DamitusThyYeetus123 I mentioned you in #1093 so maybe those with federation in mind can connect and build some momentum.
Comment by @Haplo164
RexSystem 1 vote originally by @Haplo164 on GitHub 8 replies
Pretty good write up, I think it's important to clearly know where chat data is stored and having it on the Guild Instance is probably best. I also think there should be a method to signal a domain change. Matrix doesn't have a way to change a servers domain so you basically have to start a new server, and that really sucks. With encryption keys you should be able to signal that a name change has taken place and update all records to reflect that. edit: it would also be nice to allow user transfers, it might be best to limit transfers to 2 online instances where the users current Home Instance initiates the transfer and the destination Instance confirms, this would move all private chats to the new Home Instance and updates the messages associated with the transferred user to point the the new Home Instance. The old Home Instance should maintain the old username as unusable for a time and respond to any requests involving the old user with a "Transferred" status and redirect to the user on their new Home Instance.
Comment by @rennr
RexSystem 1 vote originally by @rennr on GitHub OP
Yes I agree with the user transfers bit. It was something that was discussed in the Fluxer Developers server but I didn't have a chance to put in my draft above. But I do think there should be a mechanism to transfer a user's account to another instance. I agree it should be on an approval basis or there can be Instances that are whitelisted for auto-approval. Good thinking about reserving a username for a period of time - I hadn't thought of that. It may make sense to make it permanent or extremely lengthy (like 12 months) since the discriminator is involved. It's not like you're taking away a slot from someone to a unique name.
Comment by @rennr
RexSystem 1 vote originally by @rennr on GitHub OP
I also agree with the domain name change event. With the cryptographic key, as you say, the domain name change can be evidenced. As extra protection, should there be some extra verification step in place? For example:
  • Instance is transferred to a new domain but would still accept requests on the old domain. Clients are unaffected and continue to connect to the old domain during a transition period.
  • Instance sends a message to its federated Guest Instances signalling a domain update. The signed message also includes a validation code that Guest Instances can look up by pulling the old and new domain's TXT record.
  • Guest Instances pull the SRV and TXT records of the old and new domains.
  • If all is correct, the Guest Instances update all user records, messages, attachments, etc. to reference the new domain.
Comment by @Haplo164
RexSystem 1 vote edited originally by @Haplo164 on GitHub
I've been self hosting a Nextcloud instance since it was Owncloud, and I've recently redeployed a few web apps so I have really started thinking about long term maintenance. Federation is a pretty good vector to fix issues that can build up over time, especially if you need to change domains, or shut down. It can ensure that a community can live on with minimal fuss and is a direct counter to vendor lock in, which is probably why large SaaS providers don't implement it. I know @DamitusThyYeetus123 was also mentioning Federation so maybe we can really start building a discussion around Federation since it's clearly on our minds. ref #1080
Comment by @Haplo164
RexSystem 1 vote originally by @Haplo164 on GitHub
with the cryptographic layer and each instance keeping track of any other instances that they have communicated with it should be easy to contact those servers and inform them of the change. As a fall back or just an additional mechanism it would be nice to also do a redirect of some kind with the old domain, but I don't think that should be the only way to update since some people may loose access to a domain. I'm mainly thinking of someone just starting out with self hosting using one of those free subdomain services.
Comment by @a55uka
RexSystem 1 vote edited originally by @a55uka on GitHub
@rennr is it possible we could have communication on the official fluxer dev federation channel? also on the fluxer blog post roadmap it is mentioned that and no instance will store data from outside its own., i want to talk about this with the devs and you to see how literality this should be taken as your DMs are replicated on both the Guest Instance and the Home Instance, from my view, goes against it
Comment by @Haplo164
RexSystem 1 vote originally by @Haplo164 on GitHub
Yeah, those seem at odds. Some information would need to be replicated across servers, at least a reference of a chat or channel even if messages are not replicated. DM's have to be stored somewhere and I don't know how you would decide where they are stored if not replicated. Maybe whoever initiates the chat has the messages on their home server?
Comment by @LiamillionSS
RexSystem 1 vote originally by @LiamillionSS on GitHub
That would lead to cases where you are unable to access chat history when their homeserver is offline, or has important information deleted (or worse, tampered with), either accidentally or maliciously. DMs being replicated across both parties seems like the logical choice to me for this reason. If this is the decision then the wording should indeed be updated to specify the difference between private chats (DMs) and public chats
Comment by @rennr
RexSystem 1 vote edited originally by @rennr on GitHub OP
@rennr is it possible we could have communication on the official fluxer dev federation channel? also on the fluxer blog post roadmap it is mentioned that and no instance will store data from outside its own., i want to talk about this with the devs and you to see how literality this should be taken as your DMs are replicated on both the Guest Instance and the Home Instance, from my view, goes against it
This was a necessary compromise. The general view I outlined in my post is that there should not be hard, distributed replication like you get with Fediverse or with the Matrix protocol, where effectively the user(s) or instance host(s) in question lose control over the data as it gets copied potentially dozens of times depending on how many instances are participating in a "room" (Matrix) or listening to pub/sub in the Fediverse. Instead, instance hosts should maintain relative sovereignty over the data submitted to their instance. If an individual user is concerned about their personal data to the degree that they do not trust an instance host, they can host their own personal instance, thus bypassing any of the concerns they may have about others. DMs are a bit of an exception because DMs involving individuals across multiple instances necessarily cross these "data sovereignty boundaries". So the compromise would be to replicate all of the communications across all the instances involved in the DM channel. This would prevent any one instance from dropping offline for example and wiping out everyone's DMs (regardless of which instance they belong to). It would also prevent a single instance from being responsible for the data of many instances, creating a potential undue burden. There would of course need to be some sort of synchronization mechanism whereby edits or deletes from one instance's members are replicated to the other instances. But this in my view would be relatively trivial. While there may be concern that an instance could ignore deletion requests or edit requests, the likelihood in my view is low. And simply warning a user that their chats are replicated outside of their home instance would be sufficient - if this truly worries them, they could decide not to engage in DMs across instances.
Comment by @TheNathanSpace
RexSystem 1 vote Merged from #1204 originally by @TheNathanSpace on GitHub 1 reply
Was going to say "the Matrix spec doesn't even have custom emojis yet," but it looks like that was finally merged 3 weeks ago! Big things happening!!!
Comment by @Giwayume
RexSystem 1 vote Merged from #1204 originally by @Giwayume on GitHub
Even before that was merged it has been implemented "in effect" because clients like FluffyChat make their own extensions. This is what I mean if Fluxer has some custom functionality it wants, it is not limited by the Matrix spec, it can just go ahead and implement it and other clients may follow or it may be standardized. Either way having partial compatibility with other clients is desirable over none, where we are all playing this game of jumping between different apps and managing multiple accounts just to talk to all the people we want.
Comment by @rogue-agent
RexSystem 1 vote originally by @rogue-agent on GitHub
Federating with Stoat. In early development it would be simple text and emoji conversion like with bridges. When both apps catch up eachother on features, they could start being properly implemented.
Comment by @rogue-agent
RexSystem 1 vote originally by @rogue-agent on GitHub
Federated servers should be able to synchronise banned users. So if server A is federated with fluxer, and a user gets banned on fluxer, server A moderation team could synchronise the black list and so the person banned on fluxer also will be banned on server A
Comment by @Data-Hoarderr
RexSystem 1 vote edited originally by @Data-Hoarderr on GitHub

Problem

Currently, there is not a public plan for how federation is supposed to work. Various elements of federation have been discussed in the Fluxer Developers server, but all of these are theoretical. Federation will take a while to create properly. It will likely be a collaborative effort by many contributors, not just the core Fluxer dev team. An open process discussing the various pros/cons of certain elements of the federation process would be, in my view, the best approach. I've taken some time to plan out, at a very high level, how various elements of federation may want to work. This is based on conversations that took place with Fluxer Developers and my own rough thoughts. I should be clear: this does not reflect at all how the Fluxer devs are currently planning to implement federation. This is just based off of my own ideas and discussions I've observed/had in the Fluxer Developers channel. This is by no means complete or comprehensive. This is a work in progress for sure and doesn't consider all elements that should be considered in the design of Federation. I would love to have a discussion about all of these aspects and perhaps work with the community and the Fluxer Dev team to come up with an official set of features and an implementation plan for how federation will work.

Proposed solution

Federation Design Plan

Objective of Federation

The objective of federation within Fluxer is:
  • To create an interconnected network of independently operated rich-media chat servers, where users across communities may interact with each other with as little friction as possible, while maintaining sovereignty over their own data.
It IS NOT to:
  • Prevent government interference with the operation of an instance;
  • Replicate data across a federated network in an effort to eliminate censorship altogether by making data impossible to delete once submitted; or
  • Maintain complete anonymity and/or secrecy of conversations, attachments, or identities tied to user accounts.

Definitions

All capitalized terms not otherwise defined herein have the following meanings:
  • “Foreign Guild” means a guild that is hosted on an Instance other than the Guild Instance.
  • “Guest Instance” means an instance that is not the Home Instance of a particular user. There may be one or many Guest Instances that a user may connect to and participate in.
  • “Guest User” means a user who is connected to and participating in, but whose account does not otherwise exist, on a particular Instance.
  • “Guild Instance” means the Instance on which a guild was created.
  • “Home Instance” means the Instance where the user’s account is created.
  • “Home User” means a user who is connected to and participating in their Home Instance.
  • “Instance” means a fully independent, self-hosted deployment of the Fluxer platform.

Authentication

  • Each user connects to and authenticates with their Home Instance. A client will need to be told what Instance to authenticate against by way of the domain name.
  • The domain of an Instance will have an SRV record that points to the API server and port of the particular Instance so that no configuration is necessary for the client.
  • The format of a username will be name#[discriminator@domain.tld](mailto:discriminator@domain.tld). The @domain.tld can be elided within a local Instance only. The Instance will assume @domain.tld for any reference to a username without it already included.

Premium Features and Limits

  • Certain profile premium features are Instance agnostic. This means that if the Home Instance has enabled these features for a user, they are visible anywhere across the federated space. The Instance agnostic premium features are:
    • Animated avatar
    • Animated banner
    • Custom discriminator
    • Custom notification sounds
    • Global expressions
    • Per-guild profiles
    • Voice entrance sounds
  • Limits, as defined within the Home Instance, apply to a Home User only.
  • Separate limits may be defined by an administrator to apply to Guest Users. A different set of limits can apply to Guest Users by applying different traits, the same as with Home Users. By default, unless configured differently, Guest Users receive the same limits as Home Users.
  • Additional limits are to be added for federation purposes:
    • Can use reactions from other instances (yes or no)
    • Maximum number of cross-instance reactions per message
    • Maximum number of cross-instance users per direct message conversation

Guilds, Messages, Attachments, Uploads, Reactions

  • Guilds are always housed on the creator’s Home Instance.
  • In the case of a transfer of guild ownership to a Guest User, the guild would continue to remain on the Home Instance.
    • Optionally, an Instance administrator may prevent transferring guilds to Guest Users altogether. This is a setting on the Instance itself.
  • All messages, attachments, and uploads are stored on the Guild Instance.
  • A guild’s limits are defined by the limit rules of the Guild Instance in combination with the guild owner’s limits on the same Instance. For example, if a Guest User becomes the owner of a guild, the limits of the Guest User as set out in the Guild Instance would now apply.
  • A Guest User’s upload limits, message lengths, embeds, reactions, etc., apply as defined in the Guild Instance for Guest Users.
  • A Guest User may use, if permitted, reactions from Foreign Guilds. These reactions are linked on the message and the Guild Instance is responsible for looking them up and making them visible to target clients.
    • The reaction image itself will be cached on the Guild Instance if it meets file size requirements. Otherwise, the reaction will be removed from the message as it will be considered invalid.

Inter-Instance Communication

  • With the exception of media and API requests, a user always communicates to other Instances through their Home Instance.
  • Each Home Instance that has users who desire to connect to Guest Instances will establish a one or more inter-Instance communications channel to the Guest Instance. These channels will aggregate all traffic between two Instances that is normally reserved for the gateway, such as presence information, state updates, new messages, etc. Each Instance will then pass on the information relevant to a particular user through their individual gateway channel.
    • This approach prevents the need for each client to potentially create dozens of gateway connections if they are, for example, members of guilds across dozens of Instances.
  • API requests (GETs/POSTs/etc.) will continue to happen with the client connecting directly to the API service of the Guest Instance and making the request.
  • API requests to Guest Instances are authenticated using a bearer token signed by the Home Instance. The Guest Instance will validate the bearer token against the well-known signing keys of the Home Instance.

Guest User Accounts

  • Each Guest User connecting to a Guest Instance, provided that federation is permitted and the Guest User may access the Guest Instance, will automatically have a local account created for them.
  • This local account will have its own user ID and other information based on claims provided by the Home Instance.
  • This local account may be deleted, disabled, or moderated like any other Home User account, by the Guest Instance administrators. A disabled account will prevent that user from connecting to the Instance.
  • All messages sent and all attachments uploaded, are tied to this local account.

Direct Messages

  • DMs are replicated on both the Guest Instance and the Home Instance. Each Instance will independently have a snapshot of the contents of each Direct Message. In the case of group DMs, the messages are replicated across all participating Instances.
  • For attachments, the uploading user’s Home Instance stores the attachment. Each participating Instance replicates only the target media URL of the Home Instance, thus directing clients to the poster’s Home Instance to retrieve the attachment.
  • A user will only send a POST request to the API service of their Home Instance to send a message. The Home Instance will use its inter-server communications channel to deliver the message to all the other Instances involved in the DM chat.

Federation Whitelist/Blacklist

  • Federation is disabled by default. This prevents users from: (1) connecting to Foreign Guilds; or (2) receiving connections from Guest Users.
  • If enabled, Federation may be turned on in one of two different ways.
    • Allow all but blacklist — Accept federating with any Instance unless that domain is on the pre-defined blacklist.
    • Deny all but whitelist — Decline federating with any Instance unless that domain is on the pre-defined whitelist.
  • If blacklisted, that Guest Instance’s users will not be able to communicate with any Home User, nor may any Home User join any Foreign Guilds housed on the Guest Instance.

Offline and Abandoned Guest Instances

  • If a Guest Instance is offline or otherwise uncontactable (e.g., either the Guest or Home Instance is on a blacklist), Home Users will see the any guilds housed on the Guest Instance as being disconnected.
  • The Home Instance will continue to make efforts to connect to the Guest Instance over a defined period of time with successive back-offs (e.g., 30 days).
  • Once the Home Instance deems the Guest Instance permanently offline, it can automatically remove membership from all guilds associated with the offline Instance and delete any of its cached data, including reactions, and references to attachments that are only housed on the Guest Instance.
  • At some further defined point in time, a Home Instance may remove the user accounts of a permanently offline Guest Instance. These removals would be treated by the platform in the same way as if a Home Account were deleted. This is considered the “Permanent Deletion Event”.
  • If the Guest Instance is revived at some point:
    • It will be discovered as revived if and when a Home User successfully adds a guild on the Guest Instance.
    • At that time, the Home Instance will inform the Guest Instance that it has considered it permanently offline. This causes the Guest Instance to remove all of the Home Instance’s data from its database in the same way as the Home Instance did when it considered the Guest Instance permanently offline.
    • Once this action occurs in the background, the Home User will be added to the guild in the Guest Instance as a new member.

Instance Authentication and Key Rotation

  • Each Instance generates a cryptographic keypair that identifies it. Upon first federating with another Instance, the public key components are exchanged.
  • Together with domain SRV record, these two elements serve to fully authenticate an instance as authoritative for any users at that particular domain.
  • The public key is used to authenticate each instance with the other when performing cross-instance communications.
  • The private key is also used to sign the bearer tokens provided to clients for sending requests to Guest Instances.
  • The keypair may be rotated. The new public key may be distributed to the other Instances using the cross-server communications channel. Upon the day and time desired by an Instance, it may invalidate old an old keypair and designate a new one as valid.
  • If an Instance attempts to communicate with an invalid keypair, its communications will be rejected.
  • Even if an Instance goes offline and is abandoned as described earlier in this document, the public key remains cached. Any revived Instance will be expected to communicate with the last known good keypair. These cached public keys will only be removed by a Permanent Deletion Event. After this, if an Instance wishes to refederate, it may use an entirely new keypair, as there would be no other links to the former Instance.
  • The admins of an Instance may at any time clear the last known-good public key and permit an Instance to reconnect with a newly generated keypair.

Push Notifications

  • Since there will be one official Fluxer mobile app, there will be a need for consolidated push notification delivery to occur from all self-hosted Instances.
  • Push notifications to the mobile app may be disabled by an Instance. If disabled, the mobile app would only retrieve the badge count and notifications upon active connection with the Home Instance.
    • Potentially, the app may be configured to, as a background task, retrieve the badge count and pending notifications from the Home Instance on a certain interval.
  • When a user first creates an account on their Home Instance, or when a Home User first joins a Foreign Guild, they will be prompted whether they would like to receive notifications from the target Instance.
  • If approved, the following occurs:
    • The app sends a request to Fluxer’s central push notifications service indicating that it is subscribing to notifications from a particular Instance.
    • Fluxer’s push service looks up the SRV record of the target Instance and retrieves the well-known configuration of the Instance.
    • If validated, Fluxer’s push service provides a token to the client, which is then passed on by the client to the target Instance.
  • The target Instance can send push requests directly to Fluxer’s central push service using the token described earlier, which would then be forwarded to the mobile app through the respective Google/Apple push services.
  • The payload of the push notification will include the domain of the Instance making the notification, thus the mobile client would know which guilds are eligible to have the notification attributed. This prevents spoofing notifications for unrelated Instances.
Notes (optional)
No response
Checks
  • [x] I searched for existing discussions and didn't find a duplicate.
I was told to add my old post here, so I'll just link it so it can be referenced: https://feedback.fluxer.com/p/1348
Comment by @Data-Hoarderr
RexSystem 1 vote originally by @Data-Hoarderr on GitHub
Another thought I kind of had on it. In order to lower friction to join, for a private instance, it would be nice to have some kind of guest like where no account and no verification is needed for the hosts instance (and maybe add a toggle in the server settings to allow no verify join/temp/guest accounts), but then require an account to visit instances that require it. So for example, I could leave a link to my private/friends only instance in my old discord server I no longer use and specify no sign up to visit my instance. Getting people to try another platform has proven difficult. I think not having to make an account will help reduce that friction.
Comment waiting for review
Hidden by a moderator1 reply
Comment by @ElevationsRPG
RexSystem 1 vote edited Merged from #984 originally by @ElevationsRPG on GitHub
#1093 was posted on on Mar 16 2026, My post #984 was made on Februrary 20 2026, They are not duplicates, So why did you close it with the reason "Duplicate" is absolutely wrong. Anyway i really don't care anymore.