Floresta Update: Simplifying Bitcoin Node Integration for Wallets

Davidson Souza
Vinteum_org
Published in
5 min readAug 20, 2024

A year ago, I announced a project called Floresta, a fully validating Bitcoin full node powered by utreexo. Our goal was straightforward yet challenging: create a node implementation that offers full security and privacy, while significantly reducing the resource requirements compared to traditional full nodes like Bitcoin Core or btcd. Today, we’re excited to share the progress we’ve made over the past year with the support of Vinteum, culminating in the release of Floresta v0.6.0, and we invite the community to test the software.

On mainnet, Floresta requires just around 800 MB of disk space and less than 300 MB of RAM to work, making it possible to run on a $15 Raspberry Pi Zero 2W, with 512 MB of RAM and an SD card slot. The CPU load is also remarkably low, even while processing blocks. More research is being done to reduce the time taken to bootstrap a node from scratch. For those interested in a deep dive into the technical details, take a look at my deep-dive blog post about this topic.

When I first envisioned Floresta, I wanted to make a full node that could operate on any hardware (even in browsers, why not?). However, not everyone has the desire or means to run dedicated hardware, especially if it requires an internet connection that might not be reliable when they need it most. The most obvious way of incentivizing people to use a full node is by not requiring extra-steps to use it. That’s why in mid-2023 I introduced the idea of libfloresta. Rather than having Floresta as one single binary that people have to run along with their wallet, why not integrate it directly within the wallet? Floresta is compact enough that even if multiple wallet apps use their copy of it, the impact would be minimal. Thus, we refactored Floresta’s core into reusable libraries that that can be embedded within other applications. The florestad binary is just a program that parses the configuration and options, calling libfloresta’s internal functions.

Initially, I went for full customization, exposing all the bells and whistles. But after thinking about this a little more, I think it’s not a good idea to ask wallet implementations to rework all their chain backend. To drive adoption, changes must be as effortless as possible — a no-brainer. The current approach is inspired by LND’s embeddable mode that is used by Zeus wallet. With this mode, you can start an LND instance within your program, running in the background and responding to GRPC requests, just like a standalone node.

In our first post introducing Floresta, we highlighted the inclusion of an integrated Electrum Server from the start, a feature that will vastly facilitate the potential adoption by wallets. If you have a wallet that speaks Electrum Protocol (or even Core’s JSON-RPC), you just have to connect with the locally running florestad, and that’s it, no further adjustments are required to your blockchain backend. Your wallet, upon startup, will spawn florestad, encapsulated inside a simple function, and then connect with Floresta’s Electrum server to grab the data it needs, just like any electrum server.

From the user’s perspective, little will change. Maybe a little more waiting during the first run, especially for your balance to show up. However, this delay is minimal, and smart wallets could initiate florestad while users are setting up their wallet, such as entering their seed phrase or creating an in-app password. Notifications for wallet transactions and further speedups may be obtained if florestad is running as a background process, so it can keep working even if the wallet is closed. While these changes have a minimal impact on the user experience, they significantly enhance security and privacy. Let’s see how:

Privacy: One major issue with Electrum is that it requires you to share the hash of all your scripts with an unknown server, that may or may not be logging this and doing something nasty with this info. You’re basically telling a stranger your transactional history, and that’s terrible!

If you run a node, you’re the server, so you’re not leaking any information to an untrusted third party. Floresta uses BIP158 compact block filters to search for your wallet’s historical transactions and monitor new blocks. Everything is done locally.

Security: One of Bitcoin’s most fascinating properties is the fact you can have a level of security that once was only available to the people in power. You can verify that a payment is valid (you’re not receiving fool’s gold) without any special tool. You can make sure the monetary policy is being followed without needing to trust anyone’s information. But to achieve this, you have to run a node. Your security dramatically declines if you’re using someone else’s node. But running a node has historically been an onerous task, requiring a good 24/7 running computer and a good internet connection. Floresta changes that by enabling you to run a full node on almost any device, without hassle.

The new daemon and library have reached a stable release, with more features like a new async runtime, parallel sync support, and performance enhancements on the horizon. We’ll be rolling out additional updates in the near future, but for now, we’re excited to share this robust feature set with the community.

Conclusion

With Floresta integrated into wallets, users can leverage Bitcoin’s full capabilities without needing specialized hardware or technical know-how. Your full node will be wherever your wallet is. If your wallet is available, your node is also available. This has the potential to bring full ownership to many people around the world, with different levels of expertise, massively improving Bitcoin’s decentralization, privacy and censorship-resistance.

If you’re a Bitcoin wallet or application developer and see the potential benefits of Floresta for your project, let’s talk!

Acknowledgments

We’d like to extend our gratitude to the contributors who have played a key role in Floresta’s latest release: @jaoleal, @joaothallis, @JoseSK999, @lla-dane, @lord2anil, @mystical-prog, and @OsauravO. Your contributions have been invaluable to the project’s progress.

--

--