BE_TAM Open standard

// catalog standard · live example: /catalog

The betam-catalog/1 standard

An open format for curated, subscribable, Bitcoin-verifiable catalogues of publishers, places and routes. Anyone can publish one; any client speaking the standard can consume it. The BE_TAM app ships with the BE_TAM catalogue as its pre-installed primary source and lets users add any other catalogue by URL.

Redefined 2026-07-21 (pre-publication, no documents existed in the wild): unified entry model with a kind discriminator and a required catalogue title. One theme = one catalogue: "Kam na pivo" IS a catalogue; a curator with N themes publishes N catalogues.

1. Document #

A catalogue is a single JSON document served over HTTPS:

{
  "standard": "betam-catalog/1",
  "publishedAt": "2026-09-01T12:00:00Z",
  "publisher": { "name": "BE_TAM", "npub": "<64-hex, optional>" },
  "title": "Kam na pivo",
  "description": "optional, ≤500 chars",
  "entries": [
    {
      "kind": "creator",
      "npub": "<64-hex publisher pubkey>",
      "registryKey": "<64-hex channel-registry pointer>",
      "displayName": "Cvernovka",
      "category": "venue",
      "description": "optional, ≤500 chars",
      "placeId": "<64-hex, optional: links the entry to a BE_TAM place>",
      "geohash": "u2s1v (optional, precision 4–8)",
      "promoted": { "rank": 1 }
    },
    {
      "kind": "place",
      "id": "cvernovka-taproom",
      "name": "Cvernovka Taproom",
      "lat": 48.1543,
      "lng": 17.1348,
      "type": "pub",
      "note": "optional curator sentence, ≤280",
      "castle:history": "rich extensions attach as namespaced fields"
    },
    {
      "kind": "catalog",
      "url": "https://curator.example/kam-na-kavu/catalog.json",
      "name": "Kam na kávu"
    },
    {
      "kind": "route",
      "routeKey": "<64-hex route key>",
      "name": "Pivný okruh Starým Mestom",
      "description": "optional, ≤500 chars"
    }
  ]
}
  • title is required: the catalogue's theme. description optional.
  • Every entry carries a required kind. Four kinds are defined:
    • kind: "creator": a subscribable publisher. Required: npub, registryKey, displayName, category. npub + registryKey form the subscribe handle (tam://<npub>?r=<registryKey>); both are 64-hex. Optional: description (≤500), placeId, geohash, promoted.
    • kind: "place": a named point in space; no betam identity required (a curator lists a venue before the venue ever claims one). Required core is exactly id (free string, unique within the document), name (≤80), lat, lng, type (free string, ≤32); a motivated developer must produce a valid catalogue from a CSV in one afternoon. Optional: description (≤1000), address (≤200), photo (URL), note (≤280), hours (opening-hours string; interpretation is the client's concern), links (URL list), npub (the venue's own identity once claimed), placeId (explicit join to an in-app BE_TAM place).
    • kind: "catalog": a reference to another betam-catalog/1 document: catalogues compose (playlists of playlists). Required: url (https only, ≤500) and name (≤80); optional description (≤500). A referenced catalogue is an independent document; its verify state is its own. Readers resolving references MUST guard against cycles and SHOULD cap resolution depth (the BE_TAM app caps at 3 levels).
    • kind: "route": a published BE_TAM route, listed by reference. Required: routeKey (64-hex, the public key of the route's append-only core; the route itself, its stops and every later version live there, not in the catalogue) and name (≤80). Optional: description (≤500) and npub (64-hex, the route's creator as the curator states it, so a client can keep a user's own routes out of a feed of other people's content; a client names a route's creator from the route itself, never from this field). A route key appears at most once per document. As with a place entry, a malformed route entry (a key or npub that is not 64-hex, a missing or over-long name) invalidates the document; only an unknown kind is skipped. A route's stops may name places (§7).
  • Per-entry forward compatibility: an entry with an unknown kind MUST be skipped (readers may surface a warning); it never invalidates the document. Future kinds extend the same list.
  • Unknown extra fields MUST be tolerated everywhere (read-tolerance). Rich optional data attaches as namespaced fields ("castle:history", "gov:heritage_id"); validators warn on unknown non-namespaced keys but never fail. Validation schema: packages/protocol/schemas/curated-catalog.js.
  • Extensions: a place's own catalogue (a hotel's "what's nearby") may add languages, inline sections, an origin, bookable services and an owner signature, all optional, all ignored by readers that predate them (§8).
  • Canonical encoding: the published bytes are canonical JSON: objects with their keys sorted, no insignificant whitespace (packages/protocol/schemas/canonical-json.js). The timestamp proof commits to these exact bytes. The order is exactly the one §8 states ("The canonical bytes, exactly"): keys sorted by UTF-16 code unit, strings and numbers as ECMAScript's JSON.stringify writes them, which writes an integer-like key (0, 9, 10 …) before every other key, in numeric order. An implementation in another language must do the same for a document that holds one.

2. Ordering, promotion & consumption #

  • entries array order = the publisher's editorial order, across kinds.
  • Creator entries MAY carry promoted.rank (integer ≥ 1). Clients render promoted entries first (ascending rank), then the rest in array order, and MUST label promoted entries visibly (the BE_TAM app renders [PROMOTED] + a paid-placement caption).
  • In multi-source clients, catalogues MUST NOT be interleaved: each source renders as its own attributed section. Promotion is only honoured for the client's primary source.
  • Consumption by kind (how the BE_TAM app does it): creator entries render in the catalogue/Discover surface; place entries flow into geo surfaces (Nearby) with provenance back to the catalogue; route entries render as route cards (the catalogue's detail and the feed), and the app reads each route from its core by the key. Other clients may choose differently; the document just carries every kind.

3. Timestamp proof (detached OpenTimestamps) #

  • The proof lives at <catalog-url>.ots and is a standard OpenTimestamps detached proof for sha256(canonical-json bytes).
  • Detached is mandatory: a proof cannot live inside the document whose hash it commits to. Re-stamping or upgrading the proof never rewrites catalog.json.
  • Publishing flow (see tools/catalog-publisher/): build (editorial list → canonical JSON) → optional sign (§4) → stamp (submit to OTS calendars → pending proof) → host both files → upgrade once the calendars anchor into Bitcoin (hours) → re-host the .ots.

4. Publisher signature (optional) #

The timestamp proof answers when; it cannot answer who. A publisher MAY additionally sign the document with a secp256k1 key:

{
  "standard": "betam-catalog/1",
  "…": "…",
  "signature": {
    "npub": "<64-hex BIP-340 x-only public key>",
    "sig": "<128-hex BIP-340 schnorr signature>"
  }
}
  • Fully additive. signature is an optional top-level object; readers that predate it treat it as an unknown extra field (read-tolerance, §1) and lose nothing. An unsigned document is exactly as valid as before.
  • Signed message: the sha256 digest of the canonical-JSON bytes (§1) of the document with the signature field removed. Because canonical encoding is key-order independent, verification survives any JSON re-serialisation that preserves content.
  • Scheme: BIP-340 schnorr over secp256k1, the same key family as npub identities elsewhere in the standard. npub is the signer's x-only public key (64-hex), sig the 128-hex signature.
  • Ordering with the timestamp proof: the detached OTS proof commits to the full served bytes, signature included: sign before stamp. Re-signing changes the bytes and requires a re-stamp. Verifying the signature never requires the proof and vice versa: the two are independent axes.
  • Verification verdict (separate from document validity):
Verdict Meaning
unsigned No signature field. Absence of a claim: not a defect, not a downgrade of the document.
valid The signature verifies over the signature-stripped canonical bytes against the embedded npub.
invalid The signature object is malformed or does not verify. The document remains schema-valid: a tampered signature is not an invalid document (same honesty split as no-proof vs failed in §5).
  • What valid means, and what it does not. A valid signature proves integrity: these exact bytes were produced by the holder of npub. It does not prove identity: anyone can mint a key and put any name in publisher. A signature whose npub merely matches the document's own publisher.npub is self-attestation. Clients MUST NOT present a valid signature as "official" or as endorsement; the honest client claim is "signed by <npub>" (the BE_TAM app renders a SIGNED pill suffix and a # signed by <short-npub> caption). "Official" labels require an out-of-band trust anchor (a client-side list of known keys), which is outside this document's scope.

5. Verification levels (what clients should display) #

State Meaning
verified (block H) Proof parses, commits to the fetched bytes, and its Bitcoin attestation digest equals the merkle root of block H (checked against independent block explorers).
pending Proof commits to the bytes but only carries calendar (pending) attestations, not yet anchored.
structural-only Proof commits to the bytes; the chain check was unavailable (offline / explorers unreachable or disagreeing). Show the last successful full verification if known.
no-proof No .ots published. An unstamped catalogue is unverifiable, not tampered.
failed The proof does not commit to the fetched bytes, or the merkle root does not match: the snapshot is not what was anchored.

Honesty rule: never render verified without the chain check, and never claim tamper (failed) for a merely missing/unconfirmed proof.

6. Serving #

Static hosting is sufficient: two files (catalog.json, catalog.json.ots), any CDN or web server, CORS open (Access-Control-Allow-Origin: *) so in-app fetch works. Cache headers short enough for edits to propagate (the proof pins content, not the URL).

7. Place types (shared vocabulary) #

type stays a free string (§1): a hand-written catalogue from a CSV must stay possible. So that a client can filter places from any curator's catalogue the same way, the standard recommends a vocabulary: an English type id for the common kinds of place, grouped into eight kinds. A client maps a place's type to its kind; the document itself does not change.

  • Matching: a client compares a folded spelling. Folding, in this order:

    1. trim, then lower-case;
    2. fold the Slovak and Czech letters á ä č ď é ě í ĺ ľ ň ó ô ö ŕ ř š ť ú ů ü ý ž to their base letter;
    3. drop any combining accent that is left (U+0300–U+036F, so decomposed input reads the same as precomposed);
    4. read the dashes U+2010–U+2015 as a hyphen;
    5. join each run of spaces and hyphens into one _.

    So Zámok reads as zamok, and wine bar or wine–bar reads as wine_bar.

  • Aliases: a Slovak, Czech or legacy spelling listed below stands for the type id written before its arrow, so catalogues already published need no re-publish (hrad is castle, Kopec is peak).

  • Anything else (an empty, unknown or misspelt type) is the kind Other. Clients MUST NOT guess a kind from a place's name or its catalogue's title. Leisure types such as an aquapark or a spa have no kind yet and read as Other.

  • Publishers SHOULD use the type ids. A type outside the list stays valid; it shows as Other.

  • The BE_TAM app shows the kinds as the feed's "Druh miesta" filter chips, labelled as in the first column (English, then Slovak). The vocabulary's source of truth is packages/protocol/enums/place-kinds.js.

  • Route stops. A route entry carries no type; its stops can each name the place they are: a BE_TAM place by its placeId, or a place of any betam-catalog/1 document by that document's url and the entry's id, together with the name and type the place had when the route's author linked it. A client reads that type through this vocabulary as well, so a stop shows its place's kind even when the reader's catalogues do not hold the place. The link lives in the route (BE_TAM's route records, not this document); a catalogue that lists the place needs no change.

Kind Type ids Aliases (type id ← spellings)
Food (Jedlo) restaurant bistro fast_food street_food bakery ice_cream restaurant ← reštaurácia jedáleň pizzeria salaš; fast_food ← fastfood; street_food ← food truck stánok; bakery ← pekáreň cukráreň; ice_cream ← zmrzlina zmrzlináreň
Drink (Pitie) pub bar wine_bar brewery winery cocktail_bar club pub ← krčma hostinec piváreň pivo taproom hospoda; wine_bar ← vináreň vinotéka víno; brewery ← pivovar brewpub; winery ← vinárstvo; club ← klub nightclub
Coffee (Káva) cafe tea_room cafe ← kaviareň kavárna káva coffee coffee shop; tea_room ← čajovňa tea house
Heritage (Pamiatky) castle chateau ruins fortress monument church monastery memorial castle ← hrad; chateau ← zámok zámek kaštieľ palace palác; ruins ← zrúcanina zřícenina ruin castle ruins; fortress ← pevnosť fort; monument ← pamätník; church ← kostol chrám kaplnka katedrála cathedral; monastery ← kláštor klášter; memorial ← pomník
Nature (Príroda) peak viewpoint park garden lake waterfall cave forest zoo peak ← kopec vrch vrchol hill mountain; viewpoint ← vyhliadka rozhľadňa rozhledna; garden ← záhrada; lake ← jazero; waterfall ← vodopád; cave ← jaskyňa; forest ← les
Culture (Kultúra) museum gallery theatre cinema library concert_hall museum ← múzeum skanzen; gallery ← galéria; theatre ← divadlo theater; cinema ← kino; library ← knižnica
Shopping (Obchody) shop market bookshop farm_shop shop ← obchod store; market ← trh trhovisko; bookshop ← kníhkupectvo
Lodging (Nocľah) hotel hostel guesthouse apartment camping hotel ← motel; guesthouse ← penzión pension ubytovanie chata; apartment ← apartmány apartmán; camping ← kemp campsite

8. Extensions: a place's own catalogue #

A catalogue a place makes for its guests (a hotel's selection of what is nearby) may carry these optional fields on top of §1. Each is read per field: a reader that predates them ignores them all and lists the places flat in the plain language; a newer reader that finds one broken reads that field as absent and never fails the document for it (validators warn).

{
  "standard": "betam-catalog/1",
  "…": "…",
  "id": "q4z7m2k9x3c8v6b1n5t0r7w2ya",
  "seq": 12,
  "lang": "sk",
  "i18n": { "en": { "title": "Tips from Hotel Dunaj", "description": "What to do nearby" } },
  "origin": "hotel",
  "sections": [
    { "id": "plaz", "title": "Plážový deň", "i18n": { "en": { "title": "Beach day" } } }
  ],
  "entries": [
    { "kind": "place", "id": "hotel", "name": "Hotel Dunaj", "lat": 48.1435, "lng": 17.1077, "type": "hotel" },
    {
      "kind": "place",
      "id": "kajak",
      "name": "Požičovňa kajakov",
      "lat": 48.139,
      "lng": 17.115,
      "type": "shop",
      "npub": "<64-hex, the venue's own identity>",
      "sections": ["plaz"],
      "i18n": { "en": { "name": "Kayak rental", "description": "…", "note": "…" } },
      "services": [{ "product": "<32-hex listing id>", "name": "Kajak 1 h", "i18n": { "en": { "name": "Kayak 1 h" } } }]
    }
  ],
  "owner": {
    "key": "<64-hex ed25519 public key>",
    "name": { "type": "tam/name/1", "…": "…" },
    "registry": "<64-hex, optional>",
    "sig": "<128-hex ed25519 signature>"
  }
}
  • id: the catalogue's own id, 26 lowercase Crockford base32 characters (0–9 and a–z without i, l, o, u), drawn at random by its author (128 bits). With owner.key it names one catalogue across all its copies.
  • seq: a positive integer, strictly increasing per (owner.key, id): of two copies, the one with the higher seq is the newer.
  • lang: the language of the plain text fields (title, description, an entry's name, …), a BCP 47 primary language subtag in lower case (sk, en). Default sk.
  • i18n: translations, { "<lang>": { "<field>": "<text>" } }, on the document (title, description), on an inline section (title), on a place entry (name, description, note) and on a service (name). Keys are primary subtags; each text has the cap of the plain field it translates. At most 6 languages per text holder and per catalogue; per catalogue, the plain lang counts as one of them (a writer's rule; a reader only drops a text holder's translations past 6).
  • origin: the id of the place entry distances are measured from (the hotel itself). A client measures every place from it in a straight line, and states once which place that is.
  • sections: themed sections inside the one document, in display order, each { id, title, i18n? } with a unique id of 1–64 characters from a–z, 0–9, _ and -, and a title of at most 80, at most 12 sections. A place entry lists the sections it is in by id ("sections": ["plaz"]); it may sit in several, and places in none come after them. These are tags, not sub-catalogues: a section published as its own document stays a kind: "catalog" entry (§1).
  • services on a place entry: what can be booked there, at most 6, each { product, name, i18n? }, where product is the seller's 32-hex listing id and name at most 80 characters. The seller is the place's own npub; a place without one has no services. The catalogue only names them: times, free places and the booking itself are the venue's.

Reading rules.

  • A broken field reads as absent: an origin that names no well-formed place entry, sections or services that are not a list, translations that are not an object of languages or hold more than 6. A malformed section or service is dropped (the first of a repeated id or product wins), and at most 12 sections and 6 services are read: only the first 12 items of sections (on the document and on a place) and the first 6 of services, so a reader's cost does not grow with a hostile list.

  • A lang that names no language makes the plain fields' language unknown (never assumed Slovak): the text rule below then skips its step 2. A region tag reads as its language (de-AT is German).

  • A section title and a service name are shown cleaned, like every text (one plain line).

  • Validators list at most 50 problems, then count the rest.

  • Text in the reader's language. One rule for apps and the web, "their own language, otherwise English":

    1. the translation into the reader's language (the primary subtag of the phone's or the browser's language);
    2. the plain field, when that language is the catalogue's lang;
    3. the English translation;
    4. the plain field.

    A text counts only when it is within its cap and not blank once cleaned, so an empty translation falls back. A catalogue written in one language shows that language. Reference implementation: pickText in packages/protocol/schemas/curated-catalog.js.

Owner signature #

owner names the BE_TAM identity that made the catalogue, and its signature:

  • key: the owner's identity, an ed25519 public key, 64 lowercase hex.
  • name (optional): the owner's own signed name, a tam/name/1 record. A reader shows it only when the record's key is owner.key and the record's own signature holds.
  • registry (optional): the owner's channel-registry key, 64 lowercase hex.
  • sig: ed25519 (RFC 8032, strict: canonical encodings, no small-order key) by key over the bytes betam/catalog-owner/v1 and a line feed, followed by the 32-byte sha256 digest of the canonical JSON (§1) of the document with signature removed and with owner.sig removed. It covers every field but the publisher signature (§4), publisher.npub included; the publisher signature, made after it, covers owner. The two keys vouch for each other: a reader that shows both checks that signature.npub is publisher.npub.
Verdict Meaning
unsigned No owner field.
valid The signature verifies over the signed bytes against owner.key.
invalid The owner block is malformed (it carries exactly key and sig, plus an optional name and registry), the signed body is not plain JSON data, or the signature does not verify. The document remains schema-valid.
  • Plain JSON data: the document as received (not a copy of it) holds no __proto__, constructor or prototype key at any depth, no integer-like key (0, 9, 10 …), no lone UTF-16 surrogate in a string or a key, only finite numbers, and nests at most 32 levels; its signed body is at most 1.5 MiB (1 572 864 bytes) of canonical JSON. A key a parser or a copy would turn into a prototype, or a value serialised as another value, would make the signed bytes differ from the document a reader keeps, so such a document is invalid.
  • The canonical bytes, exactly: object keys sorted by UTF-16 code unit, arrays in order, strings and numbers as ECMAScript's JSON.stringify writes them, no whitespace. JSON.stringify writes an integer-like key before every other key, in numeric order; an owner-signed body never holds one, so the order is the plain sort in every language.
  • Verify the parsed object, and show that same object. JSON.parse keeps the last of two equal keys; an implementation whose parser does otherwise must reject a document with a duplicate key.
  • Writers' caps: a writer writes a catalogue with an owner of at most 300 entries and 256 KiB (262 144 bytes) of signed canonical JSON. A reader checks up to 1.5 MiB, the most the BE_TAM app stores. The reference implementation's catalogOwnerBody, catalogOwnerDigest and catalogOwnerMessage are a writer's: they enforce these caps, so a reader verifies with verifyCatalogOwner and never computes the digest through them.
  • valid proves integrity and authorship by that key, not who the key belongs to (§4's rule holds).
  • Reference implementation: packages/protocol/schemas/catalog-owner.js.

Mixed versions. A reader that predates this section validates such a catalogue unchanged, lists its places flat in the plain language, shows the publisher as a stated claim, and reads an owner-signed document without a publisher signature as unsigned (§4). A client that finds no origin keeps its usual view of the catalogue.