-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NIP-21 extension. Adding Nostr Data URI #1447
Comments
NACK, this has been done before in the early days, and it has lots of problems associated with it. Relay operators do not want to store images, because they are often treated differently from text in terms of legal liability. Files of a size large enough to be useful are also a completely different problem in terms of implementation (postgres for example does weird things like TOAST to deal with inline files). The only thing this could really be useful for are emoji and profile images, and even those aren't trivially small. |
This proposal for small files. A tiny feature for exceptional cases. I have hundreds of scripts that are <10 KB, for example. |
Ok, let's try to come in from the other side, since I was intially thinking how to make widgets.
can be limited based on mime-type, so let's say we have something like this
and so as relay operator you can check the mime-type and then if you want dynamic content w/o legal liabilities / scripts / clicks etc, you use DOMParser to sanitize
and if you want clickable objects you take the
and then you render it like so
EXAMPLE
I don't really understand what the problem is. It seems to me that it has more to do with the knowledge to be able to work with data and depends on the relay operator. |
My point is, you can do what you want to put large payloads in events, but relays are generally going to block your events. Creating a NIP that recommends doing something that won't generally work on the network is an exercise in futility. |
I can show you my event of kind 3 that is around 512kB and is on the network for at least a year and is still there. Anyway, thanks for your comment and for taking care of the network, I respect that. Widgets will appear one way or another and it will probably be better if we think about the standards before everyone will do what they decide for them. |
Another point I have completely forgot to mention is widgets are kind=30031 as proposed by NIP-22 which is parameterized replaceable, so it may solve the issue you were talking about. |
I just looked through all the widgets available on the network based on proposed in NIP-22 and the largest takes up about 6kB, so I think there is really nothing to worry about. |
Maybe I'm misunderstanding what you're trying to accomplish here, because I'm not sure how widgets relate. Are you talking about embedding widgets in kind 1 notes? Or using SVGs instead of widgets? I'm not quite following. |
I was thinking how to make widgets using what is already there, so that you don't have to reinvent the wheel for interpretation on the client's side
Just like now I can write a long-form content and then link it with naddr/nevent NIP-19 and reference according to NIP-27 and NIP-21, It seems to me widgets need the same mecahnics. The most flexible imo is to use svg as you can describe any animation you want this way w/o scripts, but you can probably do similar things using html/css or whatever I need some time to implement this and then we’ll continue if you don't mind. |
NIP-22 Smart WidgetsSmart Widgets are customizable, interactive components that can be embedded within Nostr events and allow to create rich, dynamic content. This proposal outlines the structure, implementation, and potential use cases of Smart Widgets. MotivationTraditional static content limits user interaction and engagement. Smart Widgets provide a way to embed dynamic components, such as buttons, images, and polls, directly into Nostr events, enabling more interactive and responsive content. Event kindA new addressable event kind is proposed for Smart Widgets kind 30031. This event kind will encapsulate the data necessary to render and interact with the Smart Widgets. Event StructureThe content of these events The list of tags are as follows:
A stringified JSON of the kind 30031 smart widget would look like this:
|
did you think about putting the mime type in a tag? |
can be done no problems |
### NIP-21 extensionNIP-22 extension
Nostr Data URINostr Smart Widgets
The idea is to store small files inline in nostr events.The idea is to introduce smart widgets.
The rationale is when you store data as proposed with bossom or according to NIP-92 and NIP-94 guidance you can spot if the original file was edited and prevent the loading, but then you can't serve complete message to the end user. This is where nostr Data URI come into play to provide user with immutable data.For more info see Data URLs, MIME type
instead of creating new tlv, use naddr
nostr:naddr1....
More details below 👇
The text was updated successfully, but these errors were encountered: