Skip to content

[Feature Request] Cache decrypted content to avoid repeated NIP-44 decryption #411

@nogringo

Description

@nogringo

Feature Request

Problem

Currently, when decrypting NIP-44 content or unwrapping gift wraps, the decryption is performed every time the content is accessed. The decrypted content is never stored in the cache.
This is particularly problematic with:

  • Gift wraps (NIP-59): fromGiftWrap() calls decryptNip44() twice (unwrap + unseal)
  • NIP-46 signers: Each decryption can trigger a network call to the remote bunker

Proposed solution

Store decrypted content in the cache (keyed by event ID) so subsequent reads don't require re-decryption.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions