NDK v2.10: Performance Gains, New Tutorials, Cache Adapter, ndk-wallet

NDK is a user-friendly and reliable Nostr development kit designed to improve the experience of building Nostr-related applications, including relays, clients, and more.

NDK v2.10: Performance Gains, New Tutorials, Cache Adapter, ndk-wallet
  • "Happy to announce a new major version of NDK. A lot of work has been going on behind the scenes to improve NDK in a lot of fronts," announced developer PABLOF7z.
"This work, and all the stuff I work on, would literally not be possible without the support from OpenSats and the freedom groups and people sending generous zaps. We are laying the foundation of a new, freer, more prosperous era; I feel incredibly fortunate to be able to focus my undivided energy to this," he added.

What's new

  • Optimistic Signature verification. "NDK introduces signature verification sampling. Each relay gets a lower and upper threshold of what ratio of events need to be verified. An unknown relay might start at getting 100% of it's events verified and, over time, lower the ratio to 50%. Whereas a relay the user has in their NIP-65 list might start at 50% and lower to 1%."
  • Nostr Cache Adapter. "ndk-cache-nostr is a cache adapter that connects to a single local relay. This could be your a relay running in your user's computer/phone, like the nostr-tray-relay, Citrine, or it can even be a local relay you run in your server to assist in creating server-side-rendering."
    • "If you've been envious of njump previews when sharing a link, now you can implement the same in your app by leveraging this adapter in your SSR calls."
  • Refactored Zapping interface. "This is the one breaking change; the code for sending zaps was tightly coupled to the assumption that LN was the interface. This new interface abstracts away the funding mechanism (NWC, WebLN, built-in-wallet) and the delivery mechanism (LN, ecash, Rai stones)."
  • Major subscription Lifecycle refactor. "The core of how NDK works was completely refactored from the ground-up, removing a lot of dependencies from nostr-tools, and bringing a lot of clarity to how NDK orchestrates subscriptions at the relay level."
  • Tutorials and other stuff. "A few months ago I started a new effort to write more high-level documentation, instead of focusing on interface specs of NDK. https://nostr-dev-kit.github.io/ndk is the ongoing result."
  • NIP-60 ndk-wallet extension. NIP-60 is a new NIP that proposes a nostr-native wallet. It leverages multiple ecash mints, making it completely frictionless to onboard into Nostr with the capability to send and receive (via NIP-61 or a proxy like npub.cash) zaps. It is the wallet that Nutsack.me is built on. It comes with the following features:
    • wallet creation/discovery
    • token verification
    • nutzap redemption
    • UTXO management
    • balance tracking
"With this package you'll be able to give your users a non-kyc wallet from which they can send both NIP-61 nutzaps and the usual NIP-57 lightning zaps," said PABLOF7z.

Blog Post / Archive
GitHub Repo