What is Nostr?
crrdlx
npub1qpd…082j
2024-06-25 18:15:37

Kind 30040 is here

Nostr has events. Anything done on Nostr is an “event.” Nostr has kinds. A “kind 1” is a text message, like below.

kind1.png

Source: https://nostr.com/the-protocol/events

Now, there’s a new kind on the block. There is a kind 30040 (as well as an accompanying 30041).

Note: kind 30040 is an “NKBIP” and not a “NIP,” which is why it’s not listed as an event kind on the NIPS GitHub.

Finding kind 30040

I first read about about a kind 30040 in this note by npub1m4ny6hjqzepn4rxknuq94c2gpqzr29ufkkw7ttcxyak7v43n6vvsajc2jl and I immediately thought, “This is fantastic.” Three reasons made me think this:

  1. Her goal, as I understand, is to get public domain (Projet Gutenberg) books onto Nostr. As a reader, I see this as a good thing.
  2. First up is to first get the Bible onto Nostr in an organized, “clickable” manner. As a Christian, I see this as a good thing.
  3. The kind 30040 reminded me of bitcoin recursive ordinals and BitVM. This is great. What can we possibly mash up on Nostr with a kind 30040 or 30041?
Toying with kind 30040

Curious yesterday, I began to futz around. The habla.news note referenced a wikifreedia post. Nostr user npub1m3xdppkd0njmrqe2ma8a6ys39zvgp5k8u22mev8xsnqp4nh80srqhqa5sf and npub149p5act9a5qm9p47elp8w8h3wpwn2d7s2xecw2ygnrxqp4wgsklq9g722q were on this. I referenced Liminal’s guide and Niel’s fork). After creating a Nostr profile (Turc Testerman) to mess around and use as a testing platform, below is what I achieved:

hello-world-30040.png

At first glance, the image above is unimpressive. It’s only two words. But, there may be more going on than is initially evident. The animated gif below reveals a bit more:

hello-world.gif

See it on highlighter.com

In the gif above, we are looking at a kind 30040 showing two other independent notes. Hovering over those two notes in Highligher reveals them as unique, as does the URL bar when they’re clicked.

So, what’s going on here is that those two notes, “Hello” and “world!” are just hanging out somewhere on Nostr relays. Then, the third event, the kind 30040 aggregated them together.

The kind 30040 can be viewed in raw form on njump.me (image below). That’s great, though not particularly viewer-friendly or useful to a human. Finally, thanks to Highlighter, a useful, more visually appealing, and interactive UX is achieved. (See it on highlighter.com and read note by npub1l2vyh47mk2p0qlsku7hg0vn29faehy9hy34ygaclpn66ukqp3afqutajft today debuting this ability.)

njump.png The kind 30040 viewed on njump.me The first yellow “e” is “Hello” and the second yellow “e” is “world!”

Pushing a bit farther…an example how-to

Why not do more? Let’s do this: I’ll now try to replicate what I did yesterday, I’ll try to make a new kind 30040 that adds a smidge more, and document what I do as a how-to tutorial in case anyone else wants to try.

This is how we push ahead open source style, right?

Step 1 - grab the basic code for a kind 30040

{ “id”: “972ffe9168c37241491735e3edb802b1877a56c29cb475dfeb5aba41807b5088”, “pubkey”: “5f078e90cef786fa0ac775218290c514e33313e0793507ed15375cc5b2bacaa3”, “created_at”: 1719227601, “kind”: 30040, “tags”: [

[
  "e",
  "19d8949206cdc775b94e82de6d77b75c1485e0aa3ee671c058415120a16adf46",
  "wss://nos.lol"
],
[
  "e",
  "6428c8ac9a992a6b6e5789fc398e221ab1457b39839b174047a3cbfef4ca9214",
  "wss://nos.lol"
]

], “content”: “Testing a kind 30040 event on nostr” }

Note: This is a bit different from the code in the NKBIP. I had trouble with the “content” portion of it. The format in the NKBIP threw errors, something about the backticks. Hence, my “Testing a kind…” appeared in njump, but is not picked up by highlighter and shows “untitled.” That’s something for me to learn.

Step 2 - go to https://nostrudel.ninja

Nostrudel, to me, has a ton of usages beyond just reading notes. One is the “Event Publisher” function. Go to Nostrudel, then “More,” then “Event Publisher.” There is some pre-populated data. You want to put the kind 30040 basic code in there instead. However, you do want to keep but alter the “created_at” timestamp. Take note of the number in the “created_at” line, then delete everything, paste in the kind 30040 basic code, then go back to “created_at” and put in your updated timestamp number. If you use the old timestamp, then I think it will work, but your kind 30040 will be timestamped incorrectly. Use the up-to-date and correct timestamp.

nostrudel.gif

If you get to the green “Yolo” button, things are good. If your json is incorrectly formatted, it’ll throw errors and you’ll need to fix those. (This is where the backticks in the “title” halted me.) Pressing Yolo will create a new Nostr event. It will be visible on njump.me as raw code and on highlighter in a pretty fashion.

Step 3 - create your own kind 30040 with unique Event IDs

Using the “basic code” above will replicate my “Hello world!” because it uses the two “e” events I published yesterday. If you wish to create your own kind 30040, you need to gather your own preferred notes to aggregate.

For this example, I’ll use a few notes I published yesterday from the npub1turcayxw77r05zk8w5sc9yx9zn3nxylq0y6s0mg4xawvtv46e23srqqnv7 profile. I’ll keep the “Hello” and “world!” notes, but add a three more. What I need is the “event ID” for each note I wish to include. Below I’ll illustrate how to get that ID on nostrudel.ninja. Notice there are three “IDs,” for this, we want the first one simply called “Event ID.”

grabbingeventid.gif

For my new kind 30040 example, I’ll list all five Event IDs here in the order I want them to appear:

  1. 19d8949206cdc775b94e82de6d77b75c1485e0aa3ee671c058415120a16adf46
  2. 6428c8ac9a992a6b6e5789fc398e221ab1457b39839b174047a3cbfef4ca9214
  3. 9418ba17d1a918ded94cc65112daf41cee8e90daa8afd32623edb0d5846450c5
  4. b6f03e814fbaea810c997bb59bdb0918105f74ebaecc98d0a5d7d74aad23d1f5
  5. f9a6c3b9a1309ec9ded615d4463e2b49e914d15e74d09441ffa7343460baef4f

Step 4 - build your json

Next, for each Event ID you wish to include, create a new “e” in the json code. You can change the relay if you wish (and maybe even leave it blank?).

[

  "e",
  "this_is_where_you_paste_in_your_new_event_id",
  "wss://nos.lol"
],

You will have to be careful with your commas. Each square bracket [ ] is separated by a comma and there is not one at the end. Otherwise, your json will throw an error. (I had several yesterday!) You can use something like https://jsoneditoronline.org/ to work and see errors as you go.

Below illustrates pasting in the basic kind 30040 code, adding one additional “e” event, then adding the Event ID for that event. Notice the red json errors that emerged and needed to be corrected until it was “all green” and good to go.

addingtojson.gif

I did this twice more to get my five desired notes included. The final json code I wanted for my new kind 30040 (code below).

{ “id”: “972ffe9168c37241491735e3edb802b1877a56c29cb475dfeb5aba41807b5088”, “pubkey”: “5f078e90cef786fa0ac775218290c514e33313e0793507ed15375cc5b2bacaa3”, “created_at”: 1719227601, “kind”: 30040, “tags”: [ [ “e”, “19d8949206cdc775b94e82de6d77b75c1485e0aa3ee671c058415120a16adf46”, “wss://nos.lol” ], [ “e”, “6428c8ac9a992a6b6e5789fc398e221ab1457b39839b174047a3cbfef4ca9214”, “wss://nos.lol” ], [ “e”, “9418ba17d1a918ded94cc65112daf41cee8e90daa8afd32623edb0d5846450c5”, “wss://nos.lol” ], [ “e”, “b6f03e814fbaea810c997bb59bdb0918105f74ebaecc98d0a5d7d74aad23d1f5”, “wss://nos.lol” ], [ “e”, “f9a6c3b9a1309ec9ded615d4463e2b49e914d15e74d09441ffa7343460baef4f”, “wss://nos.lol” ] ], “content”: “Testing a kind 30040 event on nostr” }

Step 5 - create your kind 30040

Back on Nostrudel.ninja–>More–>Event Publishing, I pasted in my new kind 30040 json code, changed the timestamp number, and pushed Yolo, as below:

newkind30040veed.gif

Then I grabbed the event ID (go to “Custom Event on Nostrudel, then the code symbols <>, then IDs). Go to https://njump.me/about, paste in the ID, and “View.” And there is my new kind 30040 on njump, screencapture below:

newnjump.gif

And, finally, here it is in a prettier fashion on highlighter with five different notes aggregated:

newkind30040highlighter.gif

See it on highlighter.

Conclusion

This kind 30040 does seem like a great fit for things like books. It can assemble individual notes scattered across Nostr in a hierarchical manner, present them in a usable interface, then deliver them. I imagine a stack of index cards. Each card is a note and on it is some information. They’re strewn everywhere out there in the Nostrverse. A kind 30040 can gather the ones it wishes, order those cards however it wishes, then present a new “Table of Contents” for a reader.

With books, each note might be a chapter, or a paragraph, or in the case of the Bible, it might even be each verse.

I don’t think a kind 30040 would work as I initially was thinking like a bitcoin Ordinal. For that to work, things would need to be concatenated…merged together, not listed on a page. My kind 30040 would have to read “Hello world!” instead of “Hello” and then “world!” as independent, although in order, notes.

Still, this kind 30040 business is neat. Books seem like a natural use case. People are very clever though. We’ll come up with more things to use this ability, grow it, morph it, fork it, launch from it.

What can we build out on it from here?

As an epilogue, regarding Ordinals…

I know ordinals can be a divisive topic around bitcoin. (Even that word concatenated might have raised hackles with bitcoin’s current OP_CAT debate.) People get impassioned over silly frog jpg Ordinals clogging block space and ramping up fees (both true, but then, freedom and free market). However, I think there is great potential. Recursive ordinals aggregate data already the Bitcoin blockchain. If A, B, and C are already on chain separately, recursive ordinal D can simply stick them together into one as ABC. As I see it, this is what a Nostr kind 30040 does.

I made this recursive ordinal with all of Satoshi’s written words. It looks unimpressive, but everything, the content of Satoshi’s words and even the orange “website” code is stored on the Bitcoin blockchain, not some server somewhere that can be shut down. Satoshi’s words will persist as long as Bitcoin persists. Details on this project are here.

Author Public Key
npub1qpdufhjpel94srm3ett2azgf49m9dp3n5nm2j0rt0l2mlmc3ux3qza082j