Damus
craigraw profile picture
craigraw
@craigraw
Frigate v1.4.0 has been released with significant performance improvements. It’s not just another release though. Here’s why:

Silent payments is not just a new approach to static payment codes. It's the first serious contender to improve the address derivation system since HD wallets in 2013. HD wallets were a big win over single keys, and silent payments could be a similar leap forward.

Why? The first reason is of course static payment codes, which with BIP353 look like ₿[email protected]. A payment system which requires an back-and-forth interaction for every new payment to maintain receiver privacy is archaic, so this is long overdue.

Perhaps more important though is the corollary: address reuse is eliminated. Because every address is calculated using the transaction inputs - which can only be spent once - every address is guaranteed to be unique, addressing the original privacy problem in the whitepaper.

And as a bonus, the gap limit is eliminated too. The gap limit is how far ahead HD wallets look for transactions, and is the reason restoring a wallet can miss transactions if too many addresses were generated without receiving payments.

With these advantages, you might ask why silent payments is not already the default wallet type. The reason lies in an apparently fatal flaw - scanning for received transactions requires significant computation on every transaction that might contain a silent payments output.

Naively this means retrieving every block and performing thousands of computations on it just to see if it has any outputs to your wallet. This is incredibly onerous, and an immediate non-starter.

Fortunately the silent payments BIP suggested an immediate improvement - reducing the information needed from the block to just one public key per transaction. This was a big step forward, reducing each block to about 50-100 kilobytes of data.

It's not enough though. Catching up a few months takes an hour when on mobile it must occur within a few seconds. Users give up quickly, and iOS severely limits background computation. In practice the mobile wallet experience is unusable.

Further, downloading megabytes of data to scan a wallet is too expensive for many mobile users. And most mobile phones don't have nearly enough compute to attempt the scanning within a reasonable time period. I decided to try a different approach: Frigate.

Frigate is an experimental Electrum server for silent payments scanning. In moving the scanning burden to the server, you give up some privacy. But so long as you keep the client data ephemeral (not saved to disk), privacy is similar to that of Electrum servers for HD wallets.

Performance is essential. The fastest way to perform the computation on all the block data is to put it in a database, and then create a custom database function to perform the computation inside the database. This avoids copying it out for every scan.

This was the first step, and it took scanning a few months of blocks from an hour down to a minute. Promising, but not enough - and the server's CPU was saturated, making it less responsive to other requests.

The second step was performing the compute on a GPU. Because every transaction can be scanned independently, a highly parallel pipeline is possible. The GPU computation was implemented as a database function, and brought a few months of scanning down to a handful of seconds.

Just as importantly, the CPU was freed up to do other things. This was again promising, but not enough - it required powerful hardware, and was still only marginally capable enough for a public server. More was required.

The solution lay in optimizing the computation. Optimization typically gives modest improvements, but using a new library (UltrafastSecp256k1) delivered an incredible ~14x improvement in scanning time on the same GPU. A few months of scanning can now be done in half a second.

This is a breakthrough because it makes silent payments wallets on mobile easy. A public server with a few GPUs can handle thousands of connected wallets, and wallets sync immediately.

And it goes further - Frigate supports CUDA, OpenCL and Metal GPU backends. Practically this means most chips produced in the last decade can be used - integrated GPUs, Apple Silicon, and discrete NVIDIA and AMD boards - allowing existing nodes to leverage unused GPU capacity.

Frigate is still experimental. But it proves for the first time that silent payments wallets are practical for widespread adoption. This is not only a long overdue upgrade for Bitcoin wallets, but a significant step forward for privacy.

https://github.com/sparrowwallet/frigate




2945❤️68🤙10🧡5🚀4👍3💜2
blackcat · 2d
Very interesting, the reason I haven't tried silent payments yet is exactly what you mentioned, it needs to check every block looking for a payment, I also have my bitcoind pruned so I think that would be a problem too in case it gets desynchronized?
Ryan Callahan · 2d
"Frigate’s silent payments could streamline UX, but static payment codes risk privacy trade-offs—HD wallets abstracted keys without exposing reuse patterns. Your point about innovation timing is fair though; big leaps do come in waves. Reminds me of how macro shifts sneak up—oil at $103 and...
ManyKeys · 2d
Very nice. Thanks for the excellent work.
𝖋𝖎𝖆𝖙𝖉𝖊𝖓𝖎𝖊𝖗 (¯`◕‿◕´¯) · 2d
Frigate is different from Sparrow?
jostric · 2d
Can normie with some self hosting experience run their own server?
marp · 2d
Who would be running these frigate servers? Wallet operators?
Centurio · 2d
Nice, that sounds promising. So even a own node with just a gen7 intel cpu could be enought for private use. Cool, thanks a lot!
djmeistro✝️ 🍊💊⚡️ · 2d
Wen nostr:nprofile1qqs9df4h2deu3aae83fmet5xmrlm4w5l9gdnsy3q2n7dklem7ezmwfc6c32nl ?
twentyone · 2d
Hopefully someone will do a podcast covering this 🤙🏼
Camillo≋ · 2d
Congrats and thank you for the hard work your putting towards privacy for bitcoin 🖤
xlh155 · 2d
Awesome work thank you. Could frigate ultimately be run on umbrel or start 9 and then sorrow connect to this instead of the normal electrum server? I don’t need sub second scanning of silent payments but appreciate the use case. Is there an idiots guide to using silent payments on Sparrow? Is it p...
DC · 2d
Just wanted to say, I absolutely love sparrow wallet, have used it for many years now, it is perfect
A Non-Moose · 2d
Not to be confused with the other Frigate that I'm already using ... *sigh* https://github.com/blakeblackshear/frigate
/dev/fd0 · 2d
https://delvingbitcoin.org/t/silent-payments-notifications-via-nostr/2203
Ryan Callahan · 1d
"Silent payments could be a game-changer for privacy, but adoption will hinge on merchant/UX buy-in—same hurdle HD wallets faced early on. Reminds me of how geopolitical shocks (like oil at $103) force infrastructure evolution whether markets are ready or not. https://theboard.world/articles/oi...
LowIQDev · 1d
Have you ever considered erlang/elixir in your projects?