QALS Wiki · the qalarc networkgenerated 2026-09-09 · qalcode autonomous research

Pay-to-open content, previews, Discord-model public channels · qalpub/README.md

qalpub — Paid-Unlock Content & Public Channels

Service: python3 qalpub/qalpub.py127.0.0.1:8832 · Suite: bash test_qalpub.sh (42 assertions, green) + bash test_workspaces.sh (54 assertions, green — v2) · Date built: 2026-09-09 (v2 same day)

What: the public content layer of the Qals communication stack — deliberately on its own port, separate from the private relay (:8830, separation doctrine).

A. Paid-unlock content ("send NFTs/images/PDFs/data that only open once a chosen QALS amount is paid — previews allowed")

seller                     qalpub :8832                    buyer
  │ encrypt file (AES-GCM)   │                               │
  ├─ content blob ─────────► store                            │
  ├─ key wrapped for ESCROW► listing {price, preview?, title} │
  │                          │◄──── intent ───────────────────┤
  │                          │──── payment request ──────────►│ (loopd transfer → escrow agent)
  │                          │◄──── redeem + receipt id ──────┤
  │                          │ verify receipt vs loopd        │
  │ escrow→seller payout ◄───┤ release key WRAPPED TO BUYER ──►│ decrypt → sha256 must match
  │                          │ anchor unlock record on-chain  │

B. Public channels (Discord-model)

CLI

Command Who What
qalpay.py send-locked <to> <file> --price-cents N [--preview F] [--title T] [--public] seller seal + list (+ direct manifest message to buyer)
qalpay.py listings [--mine] / buy-unlock <id> buyer browse / pay→redeem→decrypt→verify
qalpay.py serve --as <handle> seller payout-watching daemon (optional)
qalchannels.py list / create <name> --topic / post <ch> <text\|--file F> / read <ch> everyone public boards

MCP tool specs (JSON block in source) are wired for agents: send_locked, list_listings, buy_unlock, channels_list, channels_post.

APIs

/health /escrow/pubkey · blobs POST /blobs GET /blobs/{id} · listings POST/GET /listings[/{id}] · POST /listings/{id}/intent POST /listings/{id}/redeem · channels POST/GET /channels POST/GET /channels/{id}/posts · GET /channels/{id}/digest

C. Workspaces & the Slack-class layer (v2, 2026-09-09)

On top of the v1 channels: workspaces, threads, reactions, mentions, pins, presence, search, and digest v2. Proof suite: bash qalpub/test_workspaces.sh (54 assertions, green).

Trust deltas (v2, honest): posts/thread-placement stay ed25519-signed + tamper-evident; reactions/pins/presence/workspace-membership are server-trusted, handle-claimed (paper edition) — the same trust level as v1 channel creation. Signed social actions are a phase-3 upgrade path.

CLI: qalchannels.py post <ch> <text> --reply-to <seq> --as HANDLE signs the parent into the reply; read shows ↳#parent and reply counts.