Rust backend for the Veritas iOS/macOS app. Embeds yuki (Bitcoin light client) and spaced (Spaces protocol daemon) as libraries, exposing a Swift-friendly API via UniFFI.
cargo buildRun the backend standalone (without Swift/Xcode):
cargo run --bin veritasOptions:
| Flag | Description |
|---|---|
-d, --data-dir <PATH> |
Custom data directory |
--no-checkpoint |
Skip checkpoint, sync from scratch |
--latest-checkpoint |
Use latest checkpoint without prompting |
-v, --verbose |
Show full log output |
--seed <URL> |
Custom fabric relay seed URLs |
core/src/lib.rs-VeritasUniFFI object: manages service lifecycle, exposes async RPC methods to Swiftcore/src/runner.rs-ServiceRunner: launches yuki and spaced in isolated threads with dedicated tokio runtimescore/src/checkpoint.rs- Checkpoint download/verification on first launchcore/src/nostr.rs- Nostr relay communication: fetch and verify#veritastagged eventscore/src/logging.rs- Tracing capture layer that buffers log entries for the Swift log viewer
All data is stored under ~/Library/Application Support/Veritas/:
Veritas/
yuki/ # yuki chain data
spaced/
mainnet/
root.sdb # spaces state db
nums.sdb # nums state db
index.sqlite # block index
.cookie # RPC auth cookie
New users would need to sync the entire chain from scratch, which takes a long time. Checkpoints let them bootstrap from a recent snapshot.
- On first launch, if no
root.sdbexists, the app downloads acheckpoint.tar.gzfrom the latest GitHub release - The archive's SHA-256 is verified against a hash compiled into the binary
- The archive is extracted into the spaced data directory
- yuki starts syncing from the checkpoint height instead of genesis
On first launch, the app calls checkCheckpoint() to see if a newer checkpoint is available from the server. If one exists, it can be selected with useCheckpoint() before calling start(). The CLI prompts interactively; the --latest-checkpoint flag auto-selects it.
The hardcoded checkpoint in the binary serves as a fallback when the server is unreachable.