I know that many wallets will only connect to bitcoind through electrum, but is there any advantage beyond that over using a wallet that connects directly to your node? It seems that everyone uses electrs or another iteration, but I can't find a simple explanation as to why. It seems like it just takes up resources.
I'm aware that this is probably a dumb question, but I specialize in dumb questions.
Is not at all a dumb question. Dumb questions are only about shitcoins or related :)
Electrum makes a faster reading of blocks for an onchain wallet app. Because is indexing the blocks and create his own db from where is delivering the data. But this come with a catch: any electrum server will read your xpub when you connect to it. That's why many are running their own electrum server or connect through Tor for more privacy. Yes, Electrum server is taking a lot of resources and it is a main reason why so many RPi nodes are struggling to survive. But users are quite clueless...
But you are right, if you run your own bitcoind and you have a fast node and connection, connecting a Sparrow wallet app directly to your bitcoin node, is the same as using an electrum server. With Sparrow you are quite well covered for all the onchain operations.
reply
Wallets do not send the xpub directly to the Electrum server. Instead, they derive the addresses (--> script hashes) from the xpub and then request the balance for each individual address.
reply
Wallets do not send the xpub directly to the Electrum server.
Correct, my mistake, I didn't explain it exactly, just trying to make the connection by saying "it sends the xpub".
reply
That's what I've heard too. Electrum (client) doesn't leak your xpub to the Electrum server it connects to, and I'd assume neither does Sparrow.
Another big benefit of using Electrum server is authenticated connection.
Bitcoin Core, otoh, was never designed to be a backend. Connecting to bitcoind directly uses RPC, which is not secure.
reply
I think OP is asking about his own local node not a random remote node. Or you are not trusting yourself?
reply
OP didn't say if it was a local or remote setup.
If it's a local setup, your wallet can only be operational while staying within the LAN. Some people might be fine with not having your wallet accessible on-the-go. Most users will probably find that too limiting, though.
reply
I know siggy from long time ago posting on SN... I know why he asked that, he's running a node too. Sometimes you need to know a bit of OPs history....
reply
Fair point.
reply
Thanks for this explanation. Exactly what I was looking for. In fact, I am using sparrow wallet on my Start9 node. I did read there could be a security issue related to directly connecting to bitcoin core, but it seemed hypothetical, ie, if there was a bug in core.
reply
bitcoind was not explicitly designed for fast querying of address balances or historical transaction searches. While it can be used for that, its primary job is validating and relaying transactions and maintaining the blockchain. Performing these types of queries directly on bitcoind can be slow and resource-intensive, depending on your hardware.
Electrs is optimized for fast queries and can quickly return address balances, transaction histories, etc. This is especially useful when you're interacting with lots of addresses, as is common in applications like wallets that use hierarchical deterministic (HD) key structures. One of the largest advantages of using Electrum or Electrs is its indexing capabilities. bitcoind does not come with a built-in, efficient index for fetching transactions by address.
However, Fulcrum may be more performant.
reply
Thanks for this reply. There is a lot to consider.
reply
I found a good article on this topic.
reply
Thanks. I'll check it out
reply
The fact of whether or not to use electrum in wallets is rather technical and resource-related. Although the ideal is to have your own node, which is highly recommended; but in practice not everyone is capable of doing it, knowledge and desire. Mobile devices are those that have been the traction for the use of servers like electrum, security is a little lower but mechanisms have been implemented to not fully reveal our public addresses to the electrum provider, as is the case with the BIT37 bloom filters, this has its security problems, and in 2018 with BIT157 and 158 implemented in wallets such as Wasabi, Blixt, Breez, LND, and LDK, the implementation of neutrino used for lightning implements this mechanism. If you want to delve deeper into the subject https://bitcoinmagazine.com/technical/why-bitcoin-wallets-need-block-filters
reply
Thanks for the answer. So electrum benefits mobile. I will check out the link you suggested.
reply
Exactly, Satoshi made the SPV proposal with that objective, aimed at low-resource devices. Of course, today there are mobile phones with better hardware than a PC, but the issue is the battery. No one in their right mind would run a bitcoin node on a smartphone.
reply
"I think there is no such thing as a stupid question, only a stupid person who doesn't ask." Thank you for your question, which triggered a response from someone wiser, enlightening us with a mini-lesson in a single comment.
reply
It might be
reply