pull down to refresh

I've been looking at nostr marketplace apps such as Shopstr and Plebeian Market and although they're major steps towards seamless shopping experiences with nostr+Bitcoin, I've noticed that there's a very clear absence of a standardized robust product taxonomy.

We're all familiar with how products are categorized and subcategorized on sites like Amazon and Ebay- there's clear universally accepted hierarchical product categorization e.g. on Amazon you have: Electronics -> Computers & Accessories -> Computer Components -> Graphics Cards -> GeForce RTX 40 Series

This is a fixed taxonomy provided and maintained by Amazon which users are bound to. But on nostr marketplaces clients implement a flat user-generated taxonomy using the "d" tag. For instance:

{
  "kind": 30402,
  "id": "12345.....",
  "pubkey": "12345....",
  "created_at": ,
  "tags": [
    [
      "alt",
      "Product listing: Shirt studs"
    ],
    [
      "title",
      "Shirt studs"
    ],
    [
      "summary",
      "Sterling Silver enamel shirt studs or waistcoat studs"
    ],
    [
      "t",
      "Accessories"
    ],
    [
      "t",
      "Clothing"
    ],
    [
      "t",
      "Collectibles"
    ],

This product is categorized using ["t", "Accessories" ], ["t", "Clothing"] etc. This is problematic for a number of reasons:

  1. Tags can't be bundled into a hierarchy that represents parent -> child e.g. Vehicles -> Cars -> Electric Cars
  2. Tags can't be given a unique ID (that would prevent splintering due to typos + prevent breaking things in case of renaming)
  3. There is no normalized spelling e.g. Art can be either "t": "Art" "t": "art" "t": "ART" or "t": "oil painting" "t": "oil-painting" "t": "oil_painting"
  4. No versioning or updates. If a client decides "Computers" becomes "Computers & Accessories", there's no migration path.
  5. No metadata possible. You can't attach: description, localized names, associated images/icons, mapping to other taxonomies, SEO keywords etc.
  6. Cumbersome discoverability: You can't query “Give me all categories”. You'd need to instead fetch every listing event and then loop through all tag values and build a taxonomy from that.

Is this an issue that's been discussed before?
I'm thinking that using NIP-78 Arbitrary custom app data -k 30078 can be a good solution. It's a kind that already exists and is in use as a kind of "junk drawer".

For example, to create a "Vehicles and Parts" parent category - using Google's free taxonomy - you use the following events - root:

{
  "kind": 30078,
  "pubkey": "<taxonomy-publisher-pubkey>",
  "created_at": 1766271000,
  "tags": [
    ["d", "google:888"],
    ["t", "vehicles"],
    ["alt", "Product category"]
  ],
  "content": {
    "name": "Vehicles & Parts",
    "description": "Products related to vehicles, including complete vehicles and their parts and accessories.",
    "parent": null,

    "i18n": {
      "en": "Vehicles & Parts",
      "he": "רכב וחלקים",
      "es": "Vehículos y repuestos"
    },

    "mappings": {
      "google": "888",
      "wikidata": "Q334166",
      "schema_org": "Product"
    },

    "deprecated": false,
    "source": "google"
  }
}

Child:

{
  "kind": 30078,
  "pubkey": "<taxonomy-publisher-pubkey>",
  "created_at": 1766272000,
  "tags": [
    ["d", "google:916"],
    ["t", "vehicles"],
    ["alt", "Product category"]
  ],
  "content": {
    "name": "Vehicles",
    "description": "Self-propelled or towed conveyances used for transportation.",
    "parent": "google:888",

    "i18n": {
      "en": "Vehicles",
      "he": "כלי רכב",
      "fr": "Véhicules"
    },

    "mappings": {
      "google": "916",
      "wikidata": "Q42889"
    },

    "deprecated": false,
    "source": "google"
  }
}

and so on.

Classified listing can then reference the category via "a" tag:

{
  "kind": 30402,
  "pubkey": "<seller-pubkey>",
  "created_at": 1766273548,
  "tags": [
    ["d", "product_1766262301910_rdbg0"],
    ["title", "Used Electric Hatchback"],
    ["price", "2500", "GBP"],
    ["stock", "1"],

    ["a", "30078:<taxonomy-publisher-pubkey>:google:919"],

    ["t", "vehicle"]
  ],
  "content": "Reliable used electric motor vehicle in good condition."
}

What do you all think of this? Is this the right direction?

100 sats \ 1 reply \ @k00b 18h

I love information trees so I think the goal is worthy.

afaict the main issue is that in an environment where finding a single note is not guaranteed, finding note that depends on other notes that depends on other notes and so on is going to provide even worse guarantees.

reply

Yes, seeing "art" "Art" and "ART" for the same category really grinds my gears. Not to mention the absence of any type of standardized hierarchy.

I think the solution to that would be to use dedicated relays (for each marketplace client or a federation of clients) that host products and these kinds of events in their entirety. Unless I'm missing something...

reply