Softchat

The authored Android/Kotlin facade for Softchat identity, events, private messaging, chat/account projections, relay state, Noise, synchronization, Rust-owned account SQLite, media transforms, request plans, and diagnostics. This host build exists for tests and Dokka; the supported consumer artifact is the Android AAR.

Import a local identity once and keep it in a normal val. It is not a closeable block resource. Immutable messages, event drafts, and signed events are Kotlin-owned values; generated UniFFI/JNA types remain internal.

val alice = SoftchatIdentity.import(aliceSecretBytes)
aliceSecretBytes.fill(0)
val bob = SoftchatIdentity.import(bobSecretBytes)
bobSecretBytes.fill(0)

val encrypted = alice.encrypt(bob.publicKey, "hello")
check(bob.decrypt(encrypted) == "hello")

val draft =
NostrEventDraft(
createdAt = 1_700_000_000,
kind = NostrEventKind.SHORT_TEXT_NOTE,
tags = listOf(NostrTag.of("p", bob.publicKey.hex, "", "")),
content = "A signed protocol event",
)
val authored = alice.sign(draft)
val received = SignedNostrEvent.parse(authored.toJson())
check(received == authored)

Construction validates values in Rust. Signing always uses the caller's explicit timestamp and preserves exact tag fields and order. Stable failures use one SoftchatException carrying a SoftchatErrorCode.

Rust owns Android protocol/use-case SQLite through SoftchatAccount. HTTP execution, attachment files, Android lifecycle, WorkManager, notifications, and UI remain application-owned.

The complete operation cookbook is generated from the shared supported-language source at https://softchat-sdk.jackl.dev/?lang=android. The Android selector always includes the complete callable recipe plus dispatcher, Rust SQLite, WorkManager, file-staging, and device-performance guidance. Dokka is the exact symbol reference; it does not duplicate those lifecycle recipes.

Packages

Link copied to clipboard

Android account lifecycle and Rust-owned product state; NIP-44; Softchat chat/account values; relay sessions and persistence results; Noise and Negentropy state; attachment metadata and streams; NIP-42/NIP-98 plans; version metadata, redacted diagnostics, and stable public failures.

Link copied to clipboard

Validated NIP-19 and Nostr scalar values, exact raw tags, explicit event drafts, verified signed events, rumors, NIP-17 views, and NIP-59 envelopes.