clone

every nostr nip as a chapter of an illustrated, early-2000s printed game manual

main
nip.guide / source-nips / 73.md
73.md 5.6K rendered
1NIP-732======34External Content IDs5--------------------67`draft` `optional`89There are certain established global content identifiers such as [Book ISBNs](https://en.wikipedia.org/wiki/ISBN), [Podcast GUIDs](https://podcastnamespace.org/tag/guid), and [Movie ISANs](https://en.wikipedia.org/wiki/International_Standard_Audiovisual_Number) that are useful to reference in nostr events so that clients can query all the events associated with these ids.101112`i` tags are used for referencing these external content ids, with `k` tags representing the external content id kind so that clients can query all the events for a specific kind.1314## Supported IDs1516| Type | `i` tag | `k` tag |17| --- | --- | --- |18| URLs | "`<URL, normalized, no fragment>`" | "web" |19| Books | "isbn:`<id, without hyphens>`" | "isbn" |20| Geohashes | "geo:`<geohash, lowercase>`" | "geo" |21| Countries | "iso3166:`<code, uppercase>`" | "iso3166" |22| Movies | "isan:`<id, without version part>`" | "isan" |23| Papers | "doi:`<id, lowercase>`" | "doi" |24| Hashtags | "#`<topic, lowercase>`" | "#" |25| Podcast Feeds | "podcast:guid:`<guid>`" | "podcast:guid" |26| Podcast Episodes | "podcast:item:guid:`<guid>`" | "podcast:item:guid" |27| Podcast Publishers | "podcast:publisher:guid:`<guid>`" | "podcast:publisher:guid" |28| Blockchain Transaction | "`<blockchain>`:[`<chainId>`:]tx:`<txid, hex, lowercase>`" | "`<blockchain>`:tx" |29| Blockchain Address | "`<blockchain>`:[`<chainId>`:]address:`<address>`" | "`<blockchain>`:address" |3031---3233## Examples343536### Webpages3738For the webpage "https://myblog.example.com/post/2012-03-27/hello-world" the "i" and "k" tags are:3940```yaml41[42 ["i", "https://myblog.example.com/post/2012-03-27/hello-world"],43 ["k", "web"]44]45```4647### Geohashes:4849- Geohash: `["i", "geo:ezs42e44yx96"]` - https://www.movable-type.co.uk/scripts/geohash.html5051Geohashes are a geocoding system that encodes geographic locations into short strings of letters and digits. They MUST be lowercase.5253### Countries:5455ISO 3166 codes can reference countries (ISO 3166-1 alpha-2) or subdivisions like states/provinces (ISO 3166-2).5657- Country (Venezuela): `["i", "iso3166:VE"]`58- Subdivision (California, USA): `["i", "iso3166:US-CA"]`5960ISO 3166 codes MUST be uppercase. More info: https://en.wikipedia.org/wiki/ISO_31666162### Books:6364- Book ISBN: `["i", "isbn:9780765382030"]` - https://isbnsearch.org/isbn/97807653820306566Book ISBNs MUST be referenced _**without hyphens**_ as many book search APIs return the ISBNs without hyphens. Removing hyphens from ISBNs is trivial, whereas adding the hyphens back in is non-trivial requiring a library.6768### Podcasts:6970- Podcast RSS Feed GUID: `["i", "podcast:guid:c90e609a-df1e-596a-bd5e-57bcc8aad6cc"]` - https://podcastindex.org/podcast/c90e609a-df1e-596a-bd5e-57bcc8aad6cc71- Podcast RSS Item GUID: `["i", "podcast:item:guid:d98d189b-dc7b-45b1-8720-d4b98690f31f"]`72- Podcast RSS Publisher GUID: `["i", "podcast:publisher:guid:18bcbf10-6701-4ffb-b255-bc057390d738"]`7374### Movies:7576- Movie ISAN: `["i", "isan:0000-0000-401A-0000-7"]` - https://web.isan.org/public/en/isan/0000-0000-401A-0000-77778Movie ISANs SHOULD be referenced _**without the version part**_ as the versions / edits of movies are not relevant. More info on ISAN parts here - https://support.isan.org/hc/en-us/articles/360002783131-Records-relations-and-hierarchies-in-the-ISAN-Registry7980### Blockchain8182`<blockchain>` can be any layer 1 chain (`bitcoin`, `ethereum`, `solana`, ...). If necessary (e.g. for ethereum), you can specify a `<chainId>`.8384#### Bitcoin8586```87bitcoin:address:<bech32, lowercase | base58, case sensitive>88bitcoin:tx:<txid, hex, lowercase>89```9091E.g. https://blockstream.info/tx/a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d9293```yaml94[95 ["i", "bitcoin:tx:a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"],96 ["k", "bitcoin:tx"]97]98```99100E.g. https://blockstream.info/address/1HQ3Go3ggs8pFnXuHVHRytPCq5fGG8Hbhx101102```yaml103[104 ["i", "bitcoin:address:1HQ3Go3ggs8pFnXuHVHRytPCq5fGG8Hbhx"],105 ["k", "bitcoin:address"]106]107```108109#### Ethereum (and other EVM chains)110111```112ethereum:<chainId, integer>:tx:<txHash, hex, lowercase>113ethereum:<chainId, integer>:address:<hex, lowercase>114```115116E.g. https://etherscan.io/address/0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045117118```yaml119[120 ["i", "ethereum:1:address:0xd8da6bf26964af9d7eed9e03e53415d37aa96045"],121 ["k", "ethereum:address"]122]123```124125E.g. https://gnosisscan.io/tx/0x98f7812be496f97f80e2e98d66358d1fc733cf34176a8356d171ea7fbbe97ccd126127```yaml128[129 ["i", "ethereum:100:tx:0x98f7812be496f97f80e2e98d66358d1fc733cf34176a8356d171ea7fbbe97ccd"],130 ["k", "ethereum:tx"]131]132```133134135136---137138### Optional URL Hints139140Each `i` tag MAY have a url hint as the second argument to redirect people to a website if the client isn't opinionated about how to interpret the id:141142`["i", "podcast:item:guid:d98d189b-dc7b-45b1-8720-d4b98690f31f", https://fountain.fm/episode/z1y9TMQRuqXl2awyrQxg]`143144`["i", "isan:0000-0000-401A-0000-7", https://www.imdb.com/title/tt0120737]`