Skip to main content

Softchat

Build Softchat clients without rebuilding the protocol.

Softchat implements validation, cryptography, private envelopes, chat projections, relay state, synchronization, and attachment transforms once in Rust, then exposes reviewed APIs for every supported language.

Start building

What the SDK is

Softchat is a protocol SDK, not an application framework. It gives an application deterministic, bounded operations for:

  • local and external identities;
  • NIP-01, NIP-19, NIP-44, NIP-59, NIP-17, NIP-42, NIP-77, and NIP-98;
  • Softchat chat, account, and application-data events;
  • relay frames, batches, delivery state, and ingestion acknowledgements;
  • Rust-owned Android account SQLite, recovery, and bounded use-case queries;
  • the deployed Noise NK transport profile and Negentropy reconciliation; and
  • attachment metadata plus bounded streaming encryption and decryption.

The same authenticated raw event remains the source of identity in every language. Typed chat and account objects are projections; they never rewrite the tags that produced an event ID.

What stays in your application

Your platform continues to own HTTP, attachment files, background work, clocks, secure-key acquisition, notifications, and UI. Portable relay APIs leave WebSockets to the host; native consumers can instead enable the optional managed WSS/TLS/Noise transport, and the Android AAR exposes it directly. On Android, Softchat also owns protocol/use-case SQLite; the application supplies its private path, connectivity context, and lifecycle. Rust verifies managed TLS against SDK-pinned Mozilla roots on Android. Other languages retain their current database boundary. See the boundary guide before integrating a platform service.

One semantic core

Protocol rules, bounds, cryptography, and projections live in Rust.

Four developer surfaces

Rust, Android, Swift, and TypeScript use their normal value and lifecycle conventions.

Generated internals stay internal

Consumers import only the authored package. UniFFI, JNA, C, and raw wasm-bindgen symbols are implementation details.

Choose a language once

Code examples throughout this site share one selector. Choosing Android here also selects Android on the relay, media, and diagnostics pages. The selected language is stored locally and is shareable with ?lang=android.

use softchat::{LocalIdentity, NostrPublicKey};

Maturity

The API and packages are pre-release. See support and maturity for the tested matrix, compatibility guarantees, and remaining release gates.

This site documents source 2a693a638083. It describes current behavior, while the decision register records the rules that must remain consistent across languages.