Bitcoin Forum
May 17, 2024, 10:42:05 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: I would like to connect to the Electrum SPV network with a 3rd party client  (Read 58 times)
NotATether (OP)
Legendary
*
Offline Offline

Activity: 1610
Merit: 6746


bitcoincleanup.com / bitmixlist.org


View Profile WWW
June 02, 2023, 05:51:59 AM
 #1

How would I go about doing that exactly? Which parts of the source code should I be looking at in particular? And perhaps most importantly, where will I get a list of initial servers just like how Bitcoin Core has lists of "seed nodes" that clients can use to discover other peers?

To be clear, I am building the client from scratch.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
DireWolfM14
Copper Member
Legendary
*
Offline Offline

Activity: 2184
Merit: 4238


Join the world-leading crypto sportsbook NOW!


View Profile WWW
June 02, 2023, 02:12:59 PM
 #2

This question is really above my pay grade, but maybe I can make a suggestion that will help you down the right track.  I've run a couple of different SPV servers over the last few years including ElectrumX, Romanz' Electrs, and (my favorite,) blockstream's Electrs.  Blockstream's Electrs has been the most stable and practical one that I've used, and it tends to be the one recommended by most client-side developers.

As for communicating with the server, could it be as simple as creating API requests?  Again, this part is above my pay grade but if it helps, here's Blockstream's API documentation: https://github.com/blockstream/esplora/blob/master/API.md

  ▄▄███████▄███████▄▄▄
 █████████████
▀▀▀▀▀▀████▄▄
███████████████
       ▀▀███▄
███████████████
          ▀███
 █████████████
             ███
███████████▀▀               ███
███                         ███
███                         ███
 ███                       ███
  ███▄                   ▄███
   ▀███▄▄             ▄▄███▀
     ▀▀████▄▄▄▄▄▄▄▄▄████▀▀
         ▀▀▀███████▀▀▀
░░░████▄▄▄▄
░▄▄░
▄▄███████▄▀█████▄▄
██▄████▌▐█▌█████▄██
████▀▄▄▄▌███░▄▄▄▀████
██████▄▄▄█▄▄▄██████
█░███████░▐█▌░███████░█
▀▀██▀░██░▐█▌░██░▀██▀▀
▄▄▄░█▀░█░██░▐█▌░██░█░▀█░▄▄▄
██▀░░░░▀██░▐█▌░██▀░░░░▀██
▀██
█████▄███▀▀██▀▀███▄███████▀
▀███████████████████████▀
▀▀▀▀███████████▀▀▀▀
▄▄██████▄▄
▀█▀
█  █▀█▀
  ▄█  ██  █▄  ▄
█ ▄█ █▀█▄▄█▀█ █▄ █
▀▄█ █ ███▄▄▄▄███ █ █▄▀
▀▀ █    ▄▄▄▄    █ ▀▀
   ██████   █
█     ▀▀     █
▀▄▀▄▀▄▀▄▀▄▀▄
▄ ██████▀▀██████ ▄
▄████████ ██ ████████▄
▀▀███████▄▄███████▀▀
▀▀▀████████▀▀▀
█████████████LEADING CRYPTO SPORTSBOOK & CASINO█████████████
MULTI
CURRENCY
1500+
CASINO GAMES
CRYPTO EXCLUSIVE
CLUBHOUSE
FAST & SECURE
PAYMENTS
.
..PLAY NOW!..
NotATether (OP)
Legendary
*
Offline Offline

Activity: 1610
Merit: 6746


bitcoincleanup.com / bitmixlist.org


View Profile WWW
June 02, 2023, 05:18:42 PM
 #3

The idea is for my library to connect to the network of SPV nodes, so in this context it's not feasible to self-host an SPV server.

As for communicating with the server, could it be as simple as creating API requests?  Again, this part is above my pay grade but if it helps, here's Blockstream's API documentation: https://github.com/blockstream/esplora/blob/master/API.md

Well, I tried interfacing with Esplora via the Blockstream.info instance. It's not bad, but I'd like to have a fallback option available for querying address balance & tx history, hence the question.

I also have Blockchain, Blockchair, BTC.com APIs as well, all of them without API keys as these will be for public use - though that also means that they too have varying degrees of reliability.

Electrum servers are open and not rate-limited, without requiring heavy fullnode software running on the client, so they'd be the perfect fallback option here Smiley

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
June 02, 2023, 06:42:51 PM
 #4

There is some documentation of the server API here:
 https://electrumx-spesmilo.readthedocs.io/en/latest/protocol.html
nc50lc
Legendary
*
Offline Offline

Activity: 2422
Merit: 5605


Self-proclaimed Genius


View Profile
June 03, 2023, 04:40:34 AM
 #5

You can also use other open-source clients that connects to Electrum server as reference.

Example: BlueWallet - github.com/BlueWallet/BlueWallet/blob/master/blue_modules/BlueElectrum.js

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!