What is Nostr?
PABLOF7z
npub1l2v…ajft
2024-01-31 15:13:13

PABLOF7z on Nostr: 📢 NDK 2.4 is out: “Safely embrace the chaos” An (optional) answer to how to ...

📢 NDK 2.4 is out:

“Safely embrace the chaos”

An (optional) answer to how to deal with incompatible events that deviate from their NIP definition.

Typically, we rely on servers to enforce/sanitize data, on nostr that’s not possible. This release lays the groundwork to allow developers to have better guarantees on the data they render.

E.g. video events should have a video.
Article events should not be in markdown, not HTML
I just hit the big red PUBLISH button on NDK 2.4.

(well, actually, I did it from the command line, the big red button is imaginary)

## Codename: Safely Embrace the Chaos

Nostr is a, mostly, friendly environment with not too many developers and no ill-intent among them.

But this will not always be the case. Compatibility issues, mistakes, and all kinds of chaos is to be expected.

This version of NDK introduces validation at the library-level so that clients built using NDK can rely on some guarantees on handled-kinds that events they are consuming comply with what is defined on their respective NIPs.

An example?

NIP-88, recurring subscriptions, defines that Tier events should have amount tags of what subscribers are expected to pay and the cadence.

Prior to NDK 2.4 some malformed events would render like this:



But with NDK 2.4 the malformed parts of the events don't reach the client code.



This is just a beginning, but event-validation is now moving into the library!
Author Public Key
npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft