NIP-17 is awful. I can’t even get it to work. Obviously I’m doing something really dumb, but spent a few days before giving up.

This is exactly where #nostr could fail. The NIP process is long and tedious, yet incomplete. Is anyone thinking about the scalability and long term impacts of these proposals? More time should be spent on that as opposed to all these dumb little proposals that have almost no usage. Let’s get the foundation right first.

Reply to this note

Please Login to reply.

Discussion

Which part is not working? giftwraps ?

Tbh I don’t know. Tried running the following code, expected it to show up on this npub on a client that supports NIP-17. But didn’t receive any message.

https://gist.github.com/fishcharlie/4197914636ce17a8e2817d2537ea3eeb

Happy to help if you have any questions I can answer

https://gist.github.com/fishcharlie/4197914636ce17a8e2817d2537ea3eeb

Here is my code. Ran this code, expected to receive a message on this npub when using a client that supported NIP-17. But didn’t receive any messages. So not sure even how to begin debugging.

Swapped out my pubkey for yours, and it worked just fine first try. My best guess is it's a relay selections issue. First, make sure damus isn't rate limiting you when you send the message, which can happen sometimes. Second, make sure the client you're using is asking for DMs on the correct relays. In Coracle, you'll want to mark damus as an "inbox" relay in your relay settings.

Ok I didn’t mark any relay as an “inbox”. I’m still really new to the whole inbox concept. Is there documentation for it? Or do you have a quick explanation of it?

I’ll try setting it as an inbox when I get some free time later today.

I really appreciate your help!! I was actually using Coracle to test this in the first place 😝.

The relay stuff is definitely a work in progress (both from a protocol point of view as well as on coracle). The idea is that kind 10050s are a relay list specifically for DMs (see NIP 17 for details), and clients aren't supposed to send messages anywhere else. Coracle only looks at inbox relays when fetching DMs, which is likely why you didn't find the test events.

This did work! It turns out I was missing an import “websocket-polyfill” in my code as well. Thanks so much for taking the time to help me debug this!

Of course, glad I could resolve it for you!

Yeah, I've found that documentation is really a big thing in open source projects. And I have a deep appreciation for people who contribute to open source. But I definitely think that especially with nostr NIPs, we could do with better documentation. I think just having examples would go a long way when you're implementing the NIPs.

This. Documentation is tough. It’s the boring part of software engineering. But if you’re gonna build software that you expect others to use, it’s critical. Even more so for a protocol like this. You have to brute force it to be a priority.