Expand description
§blossom-rs
Full-featured Blossom blob storage library for Rust.
Content-addressed blob storage over HTTP with BIP-340 Schnorr authorization via Nostr kind:24242 events.
§Features
- Embeddable server: mount a Blossom-compliant Axum router into your app
- Async client: upload/download with multi-server failover and SHA256 integrity
- BIP-340 auth: kind:24242 Nostr events for upload/download/delete authorization
- Pluggable storage: memory (testing), filesystem, S3-compatible backends
- Database layer: metadata persistence with SQLite/Postgres support
- Access control: pluggable authorization (whitelist, custom policies)
- File statistics: egress tracking with DashMap accumulator
- Trait-based: implement
BlossomSignerfor your own identity type
§Quick Start
ⓘ
use blossom_rs::{BlobServer, FilesystemBackend, Signer};
// Generate a signer (or implement BlossomSigner for your own type)
let signer = Signer::generate();
// Create a server with filesystem storage
let server = BlobServer::new(
FilesystemBackend::new("/tmp/blobs")?,
"http://localhost:3000",
);
// Mount into your Axum app
let app = server.router();Re-exports§
pub use access::AccessControl;pub use access::Role;pub use access::RoleBasedAccess;pub use auth::auth_header_value;pub use auth::build_blossom_auth;pub use auth::BlossomSigner;pub use auth::Signer;pub use db::BlobDatabase;pub use db::MemoryDatabase;pub use labels::MediaLabeler;pub use labels::NoopLabeler;pub use lfs::compress;pub use lfs::LfsContext;pub use lfs::LfsFileVersion;pub use lfs::LfsStorageStats;pub use lfs::LfsStorageType;pub use lfs::LfsVersionDatabase;pub use lfs::LfsVersionError;pub use lfs::MemoryLfsVersionDatabase;pub use locks::LockDatabase;pub use locks::LockError;pub use locks::LockFilters;pub use locks::LockRecord;pub use locks::MemoryLockDatabase;pub use media::MediaProcessor;pub use media::PassthroughProcessor;pub use protocol::BlobDescriptor;pub use protocol::NostrEvent;pub use storage::BlobBackend;pub use storage::MemoryBackend;pub use traits::BlobClient;pub use storage::FilesystemBackend;pub use server::BlobServer;pub use client::batch::upload_batch;pub use client::batch::upload_batch_concurrent;pub use client::batch::DEFAULT_MAX_CONCURRENT;pub use client::multi::MultiTransportClient;pub use client::multi::Transport;pub use client::BlossomClient;pub use db::SqliteDatabase;
Modules§
- access
- Pluggable access control for Blossom servers.
- auth
- BIP-340 Schnorr authentication for Blossom.
- client
- Async HTTP client for Blossom blob storage.
- db
- Database backends for blob metadata persistence.
- integrity
- Build integrity and release verification.
- labels
- Content labeling and classification.
- lfs
- LFS-aware storage (BUD-20).
- locks
- LFS file locking database (BUD-19).
- media
- Media processing pipeline.
- nostr_
events - Nostr event publishing for blob operations.
- otel
- OpenTelemetry integration helpers.
- protocol
- Blossom protocol types.
- ratelimit
- Token-bucket rate limiter for Blossom servers.
- server
- Embeddable Blossom server (BUD-01/02/04/06 compliant).
- stats
- File access statistics with in-memory accumulator.
- storage
- Pluggable blob storage backends.
- traits
- Common traits for blob operations.
- transport
- Transport layer for Blossom blob operations.
- webhooks
- Webhook notification system for blob lifecycle events.