verbiricha
March 27, 2023
Mentioning nostr content
Learn how to mention nostr content in Habla
The recently merged NIP-27 introduces a new way for handling mentions in nostr text content. Instead of using the #[idx] and tags, mentions are now NIP-21 URIs.
Habla implements NIP-27 mentions and will no longer create content with NIP-08 mentions. When editing an article that contains NIP-08 mentions they will be automatically converted to NIP-27.
How do I mention an event?
Add the nostr: prefix to a identifier like nevent1qqsxhr3hlkurt3ncrasgj4fx4p2yef92ml8403elunyhfe63raenk0sppemhxue69uhkummn9ekx7mp04p24wr and it'll be interpreted as a mention and rendered inline. The appropriate tags will also be added to the event.
nostr:nevent1qqsxhr3hlkurt3ncrasgj4fx4p2yef92ml8403elunyhfe63raenk0sppemhxue69uhkummn9ekx7mp04p24wr
note identifiers also work, but prefer nevent over note identifiers since they include relay information. This makes sure the content can be fetched by clients.
How do I mention a person?
Use a persons npub with a nostr: prefix to mention and show their username inline: nostr:npub107jk7htfv243u0x5ynn43scq9wrxtaasmrwwa8lfu2ydwag6cx2quqncxg
A nprofile identifier includes pubkey and relay information. These will be rendered as a card with the user and relay list: nostr:nprofile1qqsyxev2ayfc90h8m73u0smqkya9ajxzyf3472e24577whjtkgx6jpspz3mhxue69uhhyetvv9ujuerpd46hxtnfduz2vt3r
How do I mention a replaceable event?
Replaceable events have a naddr identifier so you can use the same notation for mentioning them. This will work for articles like nostr:naddr1qqfkummnd35j6vfkxuunsv3nx5envvpcxqqsuamnwvaz7tmwdaejumr0dshsz9thwden5te0wfjkccte9ejxzmt4wvhxjme0qywhwumn8ghj7atwd9mx2unnv5hxummnw3exjcmg9ekxzmny9upzpmzzcaj5rzeah8y940ln4z855wa72af4a6aac4zjypql55egcpsqqvzqqqr4gurxxmr3 or other kinds of events like badges
nostr:naddr1qqgkummnw3e97am0wfkxghmgxdax5uqzyqgypfzqf236prjdtx4pw6q582xte9s39khfmyjggx3dngsjqu5tzqcyqqq82wg8r3u2l
Lists are also replaceable events and can be referenced with an naddr:
nostr:naddr1qqphq6twqgs8lft0t45k92c78n2zfe6ccvqzhpn977cd3h8wnl579zxhw5dvr9qrqsqqqaf33t3788
Happy writing!