Mosaic is the garbled-circuit component of Strata Bridge, a Bitcoin ↔ Alpen L2 bridge. Each bridge operator runs a Mosaic node; Mosaic peers exchange garbling material over QUIC and execute the Mosaic protocol's Garbler and Evaluator state machines.
The Mosaic protocol is described in detail in https://eprint.iacr.org/2026/812, along with an informal security analysis.
This repository contains a full-stack open-source implementation: the mosaic node binary, the protocol crates, storage and network handling, Docker configuration, and a functional-test harness.
Warning: This implementation is being written with eventual production deployment in mind. However, it is still an active work in progress and has not been externally reviewed.
bin/mosaic— node binary (composition root)bin/mosaic-peer-id— helper to generate Ed25519 signing keys / peer IDscrates/cac/— protocol state machines and message typescrates/job/— job scheduler and executors (network I/O, crypto, garbling)crates/net/— QUIC transport and typed clientcrates/storage/— FoundationDB state store, S3/local table storecrates/vs3,crates/adaptor-sigs— cryptographic libraries for secret sharing and adaptor signaturesdocker/— Dockerfile and a 2-nodecompose.ymlfor local runsfunctional-tests/— Python-driven end-to-end testsdocs/— deeper notes (architecture, network, scheduler, SM executor)
The fastest way to see Mosaic running is the bundled compose file. It boots a FoundationDB instance plus two Mosaic nodes and wires them as peers.
cd docker
docker compose up -d foundationdb
./init-fdb.sh # one-time: configure the fresh FDB cluster
docker compose up -d --build mosaic_1 mosaic_2
docker compose logs -f mosaic_1 mosaic_2RPC is exposed on 127.0.0.1:8000 (node 1) and 127.0.0.1:8001 (node 2). To shut down:
docker compose downThe compose file mounts artifacts/g16.v5c as a test circuit.
- Rust nightly (
rustup toolchain install nightly) - FoundationDB 7.3.x client library — install from the FDB releases (the
foundationdb-clientspackage on Linux, the.pkgon macOS) - A running FoundationDB cluster reachable via a
fdb.clusterfile - A Mosaic circuit artifact (
.v5c; a test circuit is included)
cargo build --release --bin mosaic
cargo build --release --bin mosaic-peer-idEach node needs a 32-byte Ed25519 signing key. Its public key is the peer ID that other nodes use to address it.
./target/release/mosaic-peer-id
# signing_key_hex=...
# peer_id=...Copy bin/mosaic/config/config.example.toml and fill in:
circuit.path— path to your.v5ccircuitnetwork.signing_key_hex— this node's signing key (frommosaic-peer-id)network.bind_addr— QUIC listen address[[network.peers]]— one entry per other operator (peer_id_hex+addr)storage.cluster_file— path to yourfdb.clustertable_store—local_filesystem(setroot) ors3_compatible(setbucket,region, credentials)rpc.bind_addr— private RPC for Bridge Core
./target/release/mosaic path/to/config.tomlLogs go to stderr; level is controlled by logging.filter (env-filter syntax, e.g. info,mosaic_job_scheduler=debug). Send SIGINT/SIGTERM for clean shutdown.
Unit tests:
cargo nextest run --workspaceEnd-to-end functional tests (spawn local FDB + Mosaic instances; require fdbserver, fdbcli, and uv):
cd functional-tests
./run_tests.shSee functional-tests/README.md for setup details.
Contributions are welcome — see CONTRIBUTING.md. Security issues: please email security@alpenlabs.io instead of opening a public issue (SECURITY.md).
Dual-licensed under MIT or Apache 2.0, at your option.