ARCHITECTURE.md raw

Musiquay — Architecture

Overview

Musiquay is built on the Nostr protocol — a simple, open protocol for decentralized social networking based on cryptographic keypairs and relays. But Musiquay is not just a music player on Nostr. It is a social and professional network for the entire music scene, layered on top of an open event system.

The platform rests on six core pillars that sit on top of the infrastructure layers:

  1. The Scene Graph — identity and relationships for every participant in the music ecosystem (see Identity and the Scene Graph below).
  2. The Event Calendar — location-based, social-first discovery of shows, gigs, festivals, and cultural events (see FEATURES_CALENDAR.md).
  3. The Event Roster — wiki-style, scene-validated records of everyone who made each event happen, plus setlists (see FEATURES_ROSTER.md).
  4. Release Credits — exhaustive, structured credits for recorded music: every performer, engineer, studio, label, format, and edition. Discogs meets Metal Archives meets Bandcamp (see FEATURES_CREDITS.md).
  5. Merchandise and Physical Sales — merch stores, record shop inventory, distro catalogs, and fan resale. Zero-fee commerce for the entire physical economy of music (see FEATURES_MERCHANDISE.md).
  6. The Services Marketplace — structured, zero-fee matchmaking for freelance and professional work across the scene (see FEATURES_MARKETPLACE.md).

The event roster (#3) and release credits (#4) together form a unified credits system — the same validation model (scene police, wiki-style editing, cryptographic confirmations) applied to both live events and recorded music. Together they build the complete professional history of everyone in the scene.

The merchandise system (#5) is the storefront for the credits system's catalog — physical releases for sale link directly to their edition data, giving buyers full provenance (pressing plant, mastering engineer, catalog number) right from the product listing.

All six pillars share the same Nostr identities, the same relay infrastructure, the same social graph, and the same payment layer. They reinforce each other: the calendar creates events, the marketplace fills crew needs, the roster documents the live side, the credits document the studio side, the merch system sells the physical artifacts, and the scene graph accumulates everything into the reputation that generates more work.

The architecture is designed around five infrastructure layers:

┌─────────────────────────────────────────────┐
│              Client Layer                   │
│         (Web UI, Mobile Apps)               │
├─────────────────────────────────────────────┤
│             Social Layer                    │
│  (Scene Graph, Discovery, Networking)       │
├─────────────────────────────────────────────┤
│            Payment Layer                    │
│     (Lightning Network / Stripe)            │
├─────────────────────────────────────────────┤
│             Relay Layer                     │
│   (Musiquay Relay + Nostr Network)          │
├─────────────────────────────────────────────┤
│             Media Layer                     │
│       (Blossom Servers / CDN)               │
└─────────────────────────────────────────────┘

MVP Scope

The initial release is a full-stack deployment: relay, media infrastructure, payment layer, and client applications — all shipping together.

MVP decisions:

Nostr Fundamentals

How Nostr Works

Nostr is a protocol, not a platform. The key concepts:

Why Nostr for Music — and for the Scene

Nostr was designed for social networking, which makes it a natural fit not just for music distribution but for the entire social and professional layer Musiquay aims to build.

Platform Pillars

The music layer and six pillars — scene graph, event calendar, event roster, release credits, merchandise, and services marketplace — are the product-level features that define what Musiquay is. They are documented in detail across this file and dedicated feature docs:

The pillars share everything: identities, social graph, relay infrastructure, media layer, and payment rails. A record shop is one Nostr identity that lists inventory (NIP-15), hosts in-store events (NIP-52), gets tagged on rosters, and connects with labels and distros — all on the same key, the same relay, the same protocol.

Identity and the Scene Graph

This is the architectural heart of what makes Musiquay different from a simple music player. The platform models the entire music ecosystem as a graph of Nostr identities and their relationships.

Participant Types

Every user is a Nostr keypair. Profile metadata indicates their role(s) in the scene. A single identity can hold multiple roles (e.g., a musician who also promotes shows and does sound engineering).

RoleDescriptionExample Activity
Artist / BandMusicians, solo or collectivePublish tracks, albums, tour dates
Listener / FanMusic consumers and supportersStream, build playlists, support artists
VenuePhysical spaces for live musicList shows, capacity, technical specs, location
PromoterEvent organizersCreate and promote events, book artists
LabelMusic labels, collectivesCurate rosters, publish releases, manage catalogs
Agent / ManagerArtist representationConnect with venues and promoters
ProducerStudio producersShowcase credits and portfolio
EngineerSound, mix, mastering engineersShowcase credits and portfolio
Tech StaffLive sound, lighting, stagingAvailability, skills, past work
Road Crew / RiggerTouring and rigging professionalsAvailability, skills, tour history
Designer / IllustratorVisual artists for album art, merch, postersPortfolio, availability
PhotographerMusic and event photographersPortfolio, gig coverage
FilmmakerMusic video, live recordingPortfolio, showreel
Record ShopIndependent physical retailCatalog inventory, sell new and used records, host in-store events
DistroDistribution labels and servicesCatalog carried titles, connect with labels, ship to customers and retail
Merch CompanyScreen printers, merch manufacturersProduce physical merch, get credited on products

Scene Relationships

The social graph isn't just "follows." It encodes professional and creative relationships:

These relationships are expressed as Nostr events — taggable, queryable, and owned by the participants. They form the connective tissue that turns Musiquay from a music platform into a scene platform.

The primary mechanisms for building these relationships are the [event roster](./FEATURES_ROSTER.md) and [release credits](./FEATURES_CREDITS.md) — together forming a unified credits system. Every confirmed roster entry (live) and every confirmed release credit (studio) creates a node in the scene graph: a connection between people, a credit on a profile, a piece of professional history. Over time, the combined system builds a dense, verifiable map of who has worked with whom — on stage and in the studio — across every role in the scene.

Discoverability

The scene graph enables powerful discovery:

This is the professional network the music scene has never had — and it emerges naturally from structured Nostr events rather than from a proprietary database.

Layer Details

1. Relay Layer

The Musiquay relay is the core infrastructure the foundation operates. It is a Nostr relay optimized for music and scene events.

Responsibilities:

Design considerations:

Federation model:

2. Media Layer

Audio files and artwork are not stored inside Nostr events (which are lightweight JSON). Instead, media is hosted on Blossom servers — the media storage layer of the Nostr ecosystem.

Blossom (Bitcoin Lightning Object Storage Model):

Streaming:

Content policy:

3. Social Layer

The social layer is what transforms Musiquay from a music distribution tool into a home for the scene. It sits on top of the relay layer and leverages Nostr's native social primitives.

Core capabilities:

Social features are protocol-native:

4. Payment Layer

Payments flow directly from listeners to artists using the Lightning Network, a Layer 2 protocol on Bitcoin that enables instant, near-zero-fee micropayments.

How it works for listeners:

How it works for artists:

Payment distribution:

5. Client Layer

Musiquay develops and maintains reference client applications — but because the protocol is open, anyone can build a client that interacts with the same network.

Reference clients:

Client responsibilities:

Third-party clients:

Data Model (Event Kinds)

Musiquay's data model is expressed as Nostr events. The strategy is to maximize reuse of existing NIPs and only create custom event kinds when nothing suitable exists.

Music Events

Full spec: FEATURES_MUSIC.md.

ConceptDescriptionNIP Strategy
TrackA single recording; addressable event carrying all published encodings (Blossom blobs identified by SHA-256 + codec spec), with metadata modeled on ID3/MusicBrainz tagsCustom kind 32210
Album / ReleaseAn ordered collection of tracks; references track event addresses. Full structured credits, format editions, and manufacturing details via release credits system.Custom kind 32211
PlaylistAn ordered list of track references; can be public or private (NIP-44 encrypted)Custom kind 32212, NIP-51 set conventions
Play EventA record of a listener playing a track; used for payment distribution and play statisticsCustom kind 3221; NIP-38 kind 30315 d:music for the live now-playing layer

Scene Events

ConceptDescriptionNIP Strategy
Scene ProfileExtended Nostr profile metadata with role(s), skills, location, portfolio links, Lightning addressExtend NIP-01 metadata
CreditLinks a participant to a work (e.g., "mixed by", "artwork by", "photographed by")Release credits 32214 / track credits 32215, plus NIP-32 labels for validation
BookingA professional connection between promoter/venue and artist for a showFuture work, likely custom

Calendar Events (NIP-52)

See FEATURES_CALENDAR.md for full details.

ConceptDescriptionNIP
Date-Based EventAll-day/multi-day events (festivals, release dates)NIP-52, kind 31922
Time-Based EventShows, gigs, listening parties with specific start/end times; includes geohash, location, participant tagsNIP-52, kind 31923
CalendarCollection of events (venue calendar, tour schedule, promoter season)NIP-52, kind 31924
RSVPAttendance response (accepted/declined/tentative) linked to a calendar eventNIP-52, kind 31925
Waitlist PositionQueue entry for sold-out eventsNIP-52, kind 31925 — RSVP with status: waitlist + position/joined_at tags
Release CountdownFuture release date with subscriber notificationsDate-based event + custom tags

Roster Events (NIP-52 + NIP-32 + NIP-22, one custom kind)

See FEATURES_ROSTER.md for full details.

ConceptDescriptionNIP
RosterStructured post-event record of all participants with roles — wiki-style, open for community contributionsNIP-52, kind 31923 — the calendar event updated post-show
Roster ConfirmationParticipant confirms their role on a roster (cryptographically signed)NIP-32, kind 1985 — label event
Roster AttestationThird-party vouch for a participant's role ("I was there, can confirm")NIP-32, kind 1985 — label event
Roster ContributionCommunity member adds a missing participant to a roster (wiki-style)NIP-22, kind 1111 — comment scoped to the roster
SetlistPer-artist song list for an event — songs linked to published tracks, featured artists taggedCustom kind 32213

Release Credit Events (Custom)

See FEATURES_CREDITS.md for full details.

ConceptDescriptionNIP
Release CreditsFull structured credits for a release — all participants with roles (performers, engineers, producers, label, visual, etc.)Custom kind 32214
Track CreditsPer-track credits that override/extend release-level credits (session musicians, featured artists, different songwriters)Custom kind 32215
EditionFormat-specific variant of a release — vinyl, CD, cassette, etc. with manufacturing details, catalog numbers, and edition-specific creditsCustom kind 32216; NIP-73 i/k tags for external IDs

Confirmation, attestation, and contribution events are shared with the roster system — the same mechanisms (NIP-32 label events and NIP-22 comments), referencing different targets. This means the scene graph treats live and studio credits uniformly.

Merchandise Events (NIP-15 + NIP-99)

See FEATURES_MERCHANDISE.md for full details.

ConceptDescriptionNIP
StallA named product collection — artist merch store, record shop inventory, distro catalog. Includes currency and shipping zones.NIP-15, kind 30017
ProductA single item for sale — merch, physical music, accessories. Structured specs for size, format, condition, edition linking.NIP-15, kind 30018
Resale ListingOne-off fan-to-fan sale of merch or physical music. Same protocol as services marketplace.NIP-99, kind 30402

The merchandise system requires zero new custom event kinds — it fully reuses NIP-15 and NIP-99 with Musiquay-specific conventions for specs and tags.

Services Marketplace Events (NIP-99)

See FEATURES_MARKETPLACE.md for full details.

ConceptDescriptionNIP
Service Listing (Active)"Available for hire" or "Looking to hire" — structured with role, location, price, availabilityNIP-99, kind 30402
Service Listing (Draft)Unpublished or closed listingNIP-99, kind 30403

Standard Nostr Events (Reused)

ConceptDescriptionNIP
Profile MetadataDisplay name, bio, avatar, bannerNIP-01
Follow / Contact ListWho a user followsNIP-02
Direct MessagesEncrypted peer-to-peer messagesNIP-17 (NIP-04 legacy)
ReactionsLikes, emoji reactionsNIP-25
RepostsSharing someone else's eventNIP-18
DeletionRequesting removal of own eventsNIP-09

Musiquay Kind Registry

Addressable kinds occupy the block 32210-32217. The regular (immutable) kinds are 3221, 3222, 32218, 32219, and 32220 - stored and counted, so they cannot be addressable, replaceable, or ephemeral. Re-checked free of collisions against the registry of kinds as of 2026-09-28; register there before implementation.

KindNameReplaceabilitySpec
32210TrackAddressableFEATURES_MUSIC.md
32211AlbumAddressableFEATURES_MUSIC.md
32212PlaylistAddressableFEATURES_MUSIC.md
32213SetlistAddressableFEATURES_ROSTER.md
32214Release creditsAddressableFEATURES_CREDITS.md
32215Track creditsAddressableFEATURES_CREDITS.md
32216EditionAddressableFEATURES_CREDITS.md
32217Access filterAddressableFEATURES_ACCESS.md
3221Play reportRegularFEATURES_MUSIC.md
3222Purchase orderRegular, NIP-59 onlyFEATURES_ACCESS.md
32218Delivery receiptRegularFEATURES_ACCESS.md
32219Host aggregateRegularFEATURES_ACCESS.md
32220Publisher rollupRegularFEATURES_ACCESS.md

Access filters are blob-backed: the 32217 event carries filter parameters, the accepted payment legs (mint tags), and an x tag pointing at a Blossom blob holding the filter itself, so filters scale to any size while events stay small. An asset is free if and only if no filter event exists for it; free assets are served by open GET and still produce delivery receipts for listen counts. A requester identifies with a BUD-11 kind 24242 authorization token (Authorization: Nostr <base64url>), and the filter — not a payment token presented per request — is the entitlement.

NIP-reused event kinds (no custom kind): roster (NIP-52 kind 31923), confirmation and attestation (NIP-32 kind 1985), contribution (NIP-22 kind 1111), calendar (NIP-52 31922-31925), marketplace (NIP-15/NIP-99), live now-playing (NIP-38 kind 30315), private receipt delivery (NIP-59), payment requests (NUT-24/BUD-07), blind signatures (Cashu NUT-00 BDHKE).

Message flows. This registry says what each message type is; PROTOCOL_FLOWS.md says how messages move — who sends what, in what order, over which transport (Nostr WebSocket, Blossom HTTP, Cashu mint HTTP, NIP-59 wraps), and what each side must verify first. It also carries the open decisions that must be settled before implementation, including the purchase-order message, blob-to-asset resolution, blind-signature verification, and ticket representation.

Security Model

Infrastructure

                         ┌──────────────┐
                         │    Scene     │
                         │  (Clients)   │
                         └──────┬───────┘
                                │ WebSocket
                         ┌──────▼───────┐
                         │   Musiquay   │
              ┌──────────┤    Relay     ├─────────┐
              │          └──────┬───────┘         │
              │                 │                 │
     ┌────────▼──┐  ┌──────────▼─────────┐  ┌─────▼─────────┐
     │  Blossom  │  │   Public Nostr     │  │  Lightning    │
     │  Server   │  │   Relays           │  │  Node         │
     │  (Media)  │  │   (Federation)     │  │  (Payments)   │
     └───────────┘  └────────────────────┘  └──────┬────────┘
                                                   │
                                             ┌─────▼─────┐
                                             │  Stripe   │
                                             │ (On-ramp) │
                                             └───────────┘

The foundation operates:

Independent operators can run:

Development Roadmap Context

The architecture is designed to be built incrementally, but the MVP ships as a full stack:

PhaseScope
MVPFull stack: relay + blossom + Lightning + web client. Nostr-native identity only. Originals only. Core music features (publish, stream, pay). Basic scene profiles and social.
Calendar pillarLocation-based event calendar — NIP-52 calendar events, RSVPs, venue calendars, social discovery. See FEATURES_CALENDAR.md.
Roster pillarEvent rosters with wiki-style editing, scene police validation, setlists, and live-to-recorded track linking. See FEATURES_ROSTER.md.
Credits pillarRelease credits — exhaustive structured credits for recorded music, format/edition tracking, shared validation model with rosters. Together with rosters, builds the complete scene graph. See FEATURES_CREDITS.md.
Merchandise pillarMerch stores, record shop inventory, distro catalogs, fan resale — NIP-15 stalls/products and NIP-99 classifieds. Physical releases link to edition data. See FEATURES_MERCHANDISE.md.
Marketplace pillarServices marketplace — NIP-99 classified listings, structured service offerings and hiring needs, scene graph reputation. See FEATURES_MARKETPLACE.md.
Onboarding chapterCustodial identity management — managed keys behind email signup to lower the barrier for non-technical users.
Moderation chapterTakedown processes, content policy enforcement, reporting mechanisms.
Scene expansionDeeper professional networking — advanced credits, bookings, availability, waitlists, ticket pre-sales, release countdowns.

Each phase builds on the protocol foundation laid in the MVP. The Nostr-native architecture means nothing is thrown away — custodial onboarding wraps the same keypair system, moderation adds policy layers on the same event model, the calendar, roster, credits, merchandise, and marketplace are just event kinds (NIP-52, NIP-15, NIP-99, and custom kinds) on the same relay, and every confirmed credit — live or studio — deepens the scene graph.