4

In my use case, deposit address is same for all users and the app specific account is identified the memo. In that case the federation server will be retuning the same account all the time.

Can I omit the actual federation server and host the federation.toml as a file in the specified location and provide and endpoint for others to query (like a federation query)?

  • Is there any internal mechanism foe federation server to communicate to each other?

PS: I want to have the myself*myapp.com address.

2

What I did just this week is implement two simple endpoints for federation and compliance in our API. Very straightforward once you figure out that these are very simple APIs. This is not very obvious from the documentation.

Basically with federation, you return a small json blob in response to a name query with the full stellar address (uid*yourdomain.com) with the memo and stellar account key of your deposit account. I don't see why you would need the stellar federation server for that.

Similarly if you want to support the compliance protocol you need a single end point that answers the question whether it is OK for a third party to send a particular transaction. What we do is very simple:

  • we check the signature using the sender's key from their toml
  • we pick apart the transaction to dig out the memo so we know who on our side it is intended for
  • we check whether that user has done KYC; if not we deny the request.
  • we deny info requests for aml info. We may change this in the future if we find that this is actually needed. But with GDPR we need to be careful what information we leak via APIs like this.

IMHO the stellar documentation is super confusing on this. They present all these different servers and moving parts with complex configuration without actually pointing out that these are example implementations of very simple REST APIs that in all likelihood don't match your architecture at all. It's much easier to simply implement the API directly.

Similarly the bridge server is a bit of a question-mark as well. It seems to do some unspecified magic that boils down to simple interactions with horizon, and federation/compliance servers on both sides. I don't see any big reason why I could not do that manually. IMHO it only makes sense when you are doing federated to federated type transactions and you could probably do this manually as well.

  • 1
    You're completely right about the various SDF servers. I was assuming OP meant a generic federation server at first, but reading through everything again, I think the question is "Do I have to use the SDF federation service for federation", and of course, then answer is "No". It's just an API, and a rather simple one at that. – Johan Stén Sep 1 '18 at 12:58
  • Even corresponding static files accessible through .well-known/* – niksmac Sep 9 '18 at 5:27
2

You never need a federation server for anything.

It might be a service you want to provide to your users however, so they don't have to deal with copy-pasting memos all the time.

If you decide to, just as you say, your federation lookup would return the same account always, but with a different memo (per user, or per lookup)

Without a federation server, you won't get federated address lookups. And I think you mean the stellar.toml file.

  • Thanks for the reply. What if I can implement the lookups manually? That will work right? – niksmac Aug 30 '18 at 9:09
  • Federated address lookups aren't initiated by you, they are initiated by a user, and they might be initiated outside of your app. How are you going to do a manual lookup if a user if using my app? *drumroll*.. By having a federation server that my app calls when I encounter a federated address pointing to your domain. – Johan Stén Aug 30 '18 at 9:51
  • I am little lost here, even if the look up are initiated outside my app, if my app/server responds to the lookup calls it will work right? Say I put the stellar.toml and federation.tolm correctly, yes? – niksmac Aug 30 '18 at 9:55
  • Then you've just made a federation server. – Johan Stén Aug 30 '18 at 9:59
  • Exactly, so a federation server is just an api endpoint where the mapping to address to string is saved, right? Hence there is no more functionality in the federation server internally, like talking to other federation server etc. – niksmac Aug 30 '18 at 10:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.