Softchat Identity
A local Nostr identity backed by Rust-owned secret material.
Import is synchronous and copies the caller's bytes into Rust. The caller should clear its own ByteArray after import returns. Keep the identity in an ordinary val for the authenticated session; it is not a closeable resource and does not require use. The generated native owner is reclaimed automatically when this object becomes unreachable.
erase is an optional security action for logout or early key removal. It waits for native work already in flight, is idempotent, and makes later calls fail with SoftchatException.IdentityErased. Operations and erasure are safe to invoke from different JVM or Android threads.
Phase 1 operations are synchronous CPU work. No coroutine dependency is introduced merely to wrap them; applications choose their own dispatcher when moving work off the Android main thread.
Functions
Create directly signed and self-encrypted kind-30079 data.
Create one directly signed generic NIP-78 value.
Create a complete canonical message through the retained identity.
Create a canonical private deletion request.
Create a canonical text-and-emoji edit.
Create one canonical private author-copy contact list.
Create one minimal one-to-one NIP-17 text-message rumor.
Create a NIP-42 authentication event bound to one relay challenge.
Create a NIP-98 authorization plan bound to one exact HTTP request.
Create a canonical private reaction.
Create one unsigned rumor authored by this identity.
Create a canonical group-subject update.
Create an ephemeral typing notification.
Create canonical private kind-0 user metadata.
Authenticate and decrypt one received message as UTF-8.
Authenticate and decrypt one self-authored kind-30079 event.
Encrypt one non-empty UTF-8 message for recipient.
Create one fresh NIP-59 envelope for exactly one recipient.
Sign one explicit NIP-01 event draft.
Authenticate every NIP-59 layer and return the enclosed rumor.