I'm reading NIP-01 again.
Ask me questions so I can explain it. If I succesfully explain that means I understand it.
I'm reading NIP-01 again.
Ask me questions so I can explain it. If I succesfully explain that means I understand it.
In nostr there is only one object type called an event. An object is kind of a way to define a thing. For example, contrary to popular belief, humans are objects. Even me. We have attributes that are common between us. Like eyes, hair, melanin, etc.
These attributes are in general the same, they can be described differently. For example my eyes might be blue, yours might be green.
This is true for events in nostr. Events, in general, will have the following attributes:
- id - a unique id
- pubkey - a public key
- created_at - timestamp of even creation
- kind - kind of event
- tags - list of tags
- content - content as a string (in simple terms, a string is text, this whole post is a string)
- sig - the signature
quick note about tags:
Tags is a list. But each tag is also a list.
In the list the represents a given tag it has a tag identifier as the first item. Like "p" (which means pubkey). After the identifier is arbitrary amounts of information as strings.
For example if you tag someone in your note. In the event data would be a tag that likes something like this:
["p", "06a533dahdahdahmoretext"]
In NIP 01 there are three basic event kinds described:
0 (zero), 1, 2 which are the set_metadata, text_note, and recommend_server respectively.
Here is the link to it, if you want to read it for yourself:
Relays can send 3 types of messages which must be JSON arrays (JSON is a popular data format)
Examples from the doc:
```json
["EVENT",
["EOSE",
["NOTICE",
```
This probably doesn't look great on mobile.
If you want a look at what JSON is you can look at this: https://www.json.org/json-en.html
This might be a more friendly intro to JSON: https://www.w3schools.com/js/js_json_intro.asp