Introducing Floresta, a Utreexo-powered Electrum Server implementation

Davidson Lucas de Souza
Vinteum_org
Published in
4 min readMar 28, 2023

--

Bitcoin is a groundbreaking technology that enables users worldwide to transfer value in a trustless and borderless manner. Bitcoin’s core value proposition is its decentralization, where no one has superior power over the network.

For the network to function properly, Bitcoin requires people from all over the world to run software capable of speaking its native protocol. These computers running the software are known as nodes, and they form Bitcoin’s backbone, which controls and manages its monetary value. However, running Bitcoin nodes can be challenging for users who lack technical expertise.

To make running a Bitcoin node accessible to everyone, I created the “Floresta” project. It’s a user-friendly and resource-efficient implementation of an Electrum Server that allows even novice users to run the software. The source code and releases are available on my GitHub repository.

If you build the project from the source code, you’ll get a single binary that runs a new Electrum Server on port 50001, which listens on all interfaces. Any Electrum protocol-compatible wallet can connect to this server. When you first connect your wallet to the server, your Bitcoin balance will show up as zero, even if you have Bitcoins in your wallet. This is because Floresta doesn’t keep an address index like ElectrumX or Electrs. You’ll need to provide your wallet’s xpub to the server to create an index for your UTXOs. If you’re using Electrum, click on the “Wallet” menu and then “Information” to find your xpub (Master Public Key).

Copy config.toml.sample and add your xpub to the xpubs field. Finally, run utreexo-electrum-server with the following options:

$ utreexo-wallet — config-file config.toml run

It will validate and scan all blocks from the genesis block, looking for transactions related to your wallet. Once it finishes, you can see your balance on Electrum!

Why an Electrum Server?

As you can see in the binary name, this was supposed to be an end-user wallet, showcasing utreexo’s ability to create a small node that anyone can run, even within the wallet itself. But maintaining a working wallet is painful! To avoid some UI/UX trouble and tons of unrelated stuff, we chose the easiest path: create an utreexo-based electrum server and let people use whatever wallet they want. Furthermore, a small and modular wallet that is both easy to set up and maintain, is a valuable piece for the Bitcoin ecosystem, especially for newcomers and non-enthusiasts that just want to use something simple.

What is the improvement over a setup with Bitcoin Core + EPS?

This setup offers significant improvements over a setup with Bitcoin Core + Electrum Personal Server (EPS). It requires significantly less disk I/O and disk space than even a pruned node + EPS. This setup is intended for users who do not have the necessary resources for running a full node with EPS, and only need a compact node. If you are okay with the tradeoffs of assumeUTXO, you can have an assumeUtreexo full node running on your smartphone. This is a remarkable development because it was not possible before. Considering that some people only have a smartphone and not desktops or laptops, allowing them to run a node is a big step towards decentralization. By removing all unneeded data, without losing trustlessness, we are making nodes more accessible for end-users.

What comes next?

This software is continuously being developed, and there is still a long way to go in terms of improving its code quality, testing procedures, and anti-DoS measures. Some of the significant features that would be useful for users include a JSON-RPC interface to control the software, a TLS server for Electrum, and an intuitive interface for setup and monitoring. Once the software has been thoroughly tested and proven to be stable, it can then be deployed on the mainnet.

Disclaimer: Rust-Utreexo and Floresta are open-source software projects and are not owned by Vinteum in any way. Vinteum provides support to the author in their work on these projects, but does not control or dictate the direction of the projects. All contributions and feedback from the community are welcome and appreciated.

--

--