Applesauce v7.1

Messaging clients, encrypted attachments, napplet hosting, and faster timelines

Applesauce v7.1 is out, with reusable messaging clients, encrypted attachments, napplet hosting, and faster timelines.

This post was drafted with AI assistance from the release changes, documentation, and examples.

Messaging clients

applesauce-extra adds LegacyMessagesClient for NIP-04 and WrappedMessagesClient for NIP-17. Both use your application’s relay pool and storage, with conversation discovery, history loading, decryption caching, drafts, relay authentication, and retryable publishing.

Conversation indexes let apps show paginated inboxes before loading every message. Prepared messages retain their signed events for publication retries; legacy clients can also persist unpublished messages across reloads.

Examples: Legacy messages, gift-wrap messages. Documentation.

A shared gift-wrap receiver

GiftWrapReceiver validates and decrypts NIP-59 envelopes into a shared rumor store. It handles rumors of any kind, shares processing between consumers, and keeps malformed envelopes from stopping the inbox.

It supports cached decryption and optional processing checkpoints for restarts. The app still supplies storage for the actual rumors and plaintext.

Examples: Receiver, dashboard, stress-test generator.

Double-ratchet messaging

The optional NdrMessagesClient integrates nostr-double-ratchet for forward-secret direct and group messaging. It includes device linking and revocation, replies, reactions, typing indicators, read receipts, disappearing messages, and a durable send queue.

Import it from applesauce-extra/messages/ndr. Applications must provide durable, encrypted, device-scoped storage with a single writer: ratchet state cannot simply be restored from relays.

Example: Double-ratchet messages. Documentation.

Encrypted file attachments

NIP-17 and NDR clients can now send encrypted attachments. Files are AES-GCM encrypted locally; servers receive ciphertext, while decryption information travels inside the encrypted message.

applesauce-common adds encryptFile, decryptFile, encryption fields in imeta, and FileMessageFactory for NIP-17 kind 15 messages. Use binary uploads that preserve the ciphertext, and encrypt local caches, drafts, and staged files at rest.

Documentation: Encrypted files.

Hosting napplets with Kehto

v7 added napplet manifests. v7.1 adds hosting through applesauce-extra/kehto, letting napplets share an application’s event store, relay pool, and active account.

Pick service adapters for identity, outbox reads and publishing, social actions, lists, counts, resources, uploads, messaging, and ContextVM. The optional browser host verifies manifests and artifact hashes and manages concurrent sandboxed iframes. Your app controls consent and signing approval.

Examples: Napplet host, outbox feed, publishing, messages. Hosting guide.

Napplet handler preferences

New kind 31129 events store preferred napplets and ordered fallbacks for an archetype or intent, with public and encrypted private choices. References can follow updates or pin a snapshot.

The release includes helpers, factories, casts, models, and actions for managing preferences, plus convention matching and public recommendations for app pickers.

Example: Handler preferences.

Faster timeline updates

TimelineModel and eventStore.timeline() now batch live updates over 16 ms and merge additions instead of repeatedly sorting the whole timeline. Initial snapshots still emit immediately once the query resolves.

Disable batching when you need synchronous live updates:

const immediate$ = eventStore.timeline({ kinds: [1] }, { batchWindow: false });

Removed and superseded events release their claims promptly, and failed casts are cached to avoid repeated validation. The boolean version-retention argument is deprecated; use { includeOldVersion: true } instead.

More reactive timeline loading

createTimelineLoader accepts observable relays and filters. Added relays load the current window, unchanged relays retain progress, and removed relays stop loading.

createFilterMapTimelineLoader routes different filters to different relays while keeping cache queries independent. isTimelineWindowCovered checks successful coverage rather than just request completion.

Documentation: Timeline loading.

Caching, fixes, and smaller additions

  • Decryption caches support synchronous adapters, preserve empty plaintext, and restore streams with bounded concurrency.
  • NIP-46 and serial signer debug logs redact sensitive content and key material.
  • Mute filtering removes muted events correctly, with Unicode-aware word matching.
  • Event removal clears stale indexes, and known account identities avoid unnecessary signer discovery.
  • Message models fix outgoing-only conversations, duplicate rumors, and participant matching.
  • Wallet fixes add opt-in recovery storage for interrupted deposits and invoice-funded nutzaps, require relay acceptance, and provide KeyValueCouch migration helpers. Recovery guide.
  • Vertex is deprecated in favor of OpenRanking with https://ranking.vertexlab.io.
  • A lower-level Cordn coordinator integration is included, not a complete MLS client.

Upgrading from v7.0.0 also picks up the intervening deletion, logging, count-scheduling, and Android signer fixes.

New guides cover messaging, napplets, and worker-relay caching. Try the new outbox video gallery too.

Upgrade

All 13 packages move to v7.1.0. Update the packages you use together:

pnpm add applesauce-core@7.1.0 applesauce-common@7.1.0 applesauce-relay@7.1.0 applesauce-loaders@7.1.0

Update companion packages too, and check code relying on synchronous timeline emissions. Core and relay require nostr-tools 2.26.0 or later within v2; SQLite adds compatibility with libsql 0.18 and better-sqlite3 13.

Documentation · Full release diff


Write a comment