LBC Technology
Under the Hood
Architecture
LBC consists of two main components: the server and the client (SAGAN).
Server
The server drives the web pages at https://lbc.cryptoguru.org, issues work intervals to clients, tracks what has been done, computes stats, and validates client integrity to prevent cheating. It includes mechanisms to protect against DoS attacks and blacklists misbehaving clients.
Client (SAGAN)
SAGAN is a unified client that combines what was previously separate components (client and generator) into a single binary. It handles:
- Server communication — requesting work intervals and reporting completed work
- Key generation — GPU-accelerated elliptic curve computation via OpenCL
- Bloom filter lookup — checking generated hash160 values against funded addresses
- Self-updates — automatic binary and bloom filter updates
- Integrity verification — cryptographic fingerprints for binary and kernel validation
The original generator was based on brainflayer by Ryan Castellucci. SAGAN is a complete rewrite in Rust with GPU acceleration, replacing the legacy Perl client and C generator.
Technologies
Server
The server is written in Perl using the Dancer2 web framework. Data is stored in SQLite databases, with a shared-memory stats database for high-frequency updates.
Client (SAGAN)
SAGAN is written in Rust for performance and safety. GPU acceleration is provided via OpenCL, supporting both NVIDIA and AMD GPUs. The OpenCL kernels perform elliptic curve point multiplication, SHA-256, and RIPEMD-160 hashing entirely on the GPU.
Communication
Client-server communication uses JSON over HTTPS. Data volume is minimal — a few kilobytes every few minutes to report completed work and request new intervals. The connection is SSL-encrypted (via Let's Encrypt) to protect sensitive data like client secrets and BTC addresses.
Bloom Filter
The bloom filter is a 512 MB probabilistic data structure containing hash160 values of all Bitcoin addresses with funds. It allows O(1) lookup with a negligible false positive rate. The filter is compressed with zstd for distribution (~300 MB) and updated periodically as the Bitcoin blockchain evolves.