Electrum cash server discovery

Electrum Cash indexing servers, like Fulcrum, are spread out over the wider Internet. There is no simple way for a client to start using them, what you’ll often see is that an library or app hardcodes the URL of one or more of them.

This may work great, but it does have downsides that I decided needed attention.
The downside is especially there for setups that do not store the end-user application (i.e. code) on a webserver for the customer to use in a browser. The greater the disconnect is between what the user actually runs and what the developer controls, the bigger the cost to reacting to changes in the world.
Additionally, including a direct URL in a popular product puts a target on the back of that specific server.

Using DNS seeds

Stealing the idea from full node discovery, I started a DNS seed for electrum indexing servers.

To use this I suggest the following procedure:

  • do a DNS lookup on ec-seed.flowee.cash you’ll get a bunch IP addresses of known fulcrum servers.
  • connect to one or more of them over the non-ssl port (50001) and use the standard API to fetch from it all its known peers.
  • use the downloaded list of known peers to pick your server, probably you want to prefer an SSL encrypted connection.
  • do your normal things.

The advantage is not having any hardcoded URLs in your app and a more flexible way of updating access to those servers in case some of them get shut down for one reason or other. Again, this is more relevant for projects that ship code on something like google playstore because the cost of updating is much higher than just a DNS update and actually includes the end-user getting the update on their device.

If others think this is a good idea, you are free to use the above DNS seed. If others want to run their own seed, please share that and I’ll gladly use it in my application.

Cheers!

3 Likes

I like the idea.

Alternatively, is there a way to use some kind of DHT for automatic peer discovery?

Maybe utilizing existing efficient DHTs that are not going anywhere, like Bittorrent’s or IPFS’?