2026-08-26 10:23:53 -07:00
|
|
|
# psf-memo — Prioritized Feature Backlog
|
|
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
**Status**: DRAFT — research refresh 2026-08-27.
|
|
|
|
|
**Owner**: specifier.
|
|
|
|
|
**Last updated**: 2026-08-27
|
2026-08-26 10:23:53 -07:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Goal
|
|
|
|
|
|
|
|
|
|
Make `psf-memo` feature-equivalent to [memo.cash](https://memo.cash), a Bitcoin
|
|
|
|
|
Cash (BCH) social network built on `OP_RETURN` transactions. Every social action
|
2026-08-26 18:22:03 -07:00
|
|
|
is a BCH transaction carrying a Memo protocol payload (`0x6d` + action byte)
|
|
|
|
|
that is broadcast from the client to the chain and later indexed by
|
2026-08-26 10:23:53 -07:00
|
|
|
`psf-memo-indexer` into `psf-memo-db`.
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
## Research notes
|
|
|
|
|
|
|
|
|
|
- **Protocol reference**: `https://memo.sv/protocol` (Wayback Machine snapshot
|
|
|
|
|
2025-12-15). It lists action bytes, payload shapes, and byte limits. The page
|
|
|
|
|
is on the BSV fork (`memo.sv`) but the action codes match the BCH
|
|
|
|
|
`memo.cash` implementation.
|
|
|
|
|
- **memo.cash access**: the live site is behind Cloudflare. Direct `curl` and
|
|
|
|
|
headless Firefox login attempts from this environment were blocked, so the
|
|
|
|
|
roadmap is derived from the protocol spec plus an audit of the existing
|
|
|
|
|
mono-repo code.
|
|
|
|
|
- **Implementation audit** (2026-08-27):
|
|
|
|
|
- Indexer already has handlers for: `setName`, `post`, `reply`, `like`,
|
|
|
|
|
`setProfile`, `follow`/`unfollow`, `setProfilePic`, `topicMessage`,
|
|
|
|
|
`topicFollow`/`topicUnfollow`.
|
|
|
|
|
- `psf-memo-db` already has LevelDB stores for all of those actions and raw
|
|
|
|
|
`/level/*` CRUD routes.
|
|
|
|
|
- Client already supports: posting, replying, setting name, and the like/tip
|
|
|
|
|
broadcast UI.
|
|
|
|
|
- **Main gaps**: client UI for setting profile text/picture and
|
|
|
|
|
follow/unfollow; high-level read APIs for like counts, follow state, topic
|
|
|
|
|
feeds, polls, and mutes.
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-08-26 10:23:53 -07:00
|
|
|
## Architecture constraints
|
|
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
- **Identity/auth**: the auto-generated HD wallet (12-word mnemonic) persisted
|
|
|
|
|
in browser Local Storage by the existing React app is the Memo identity.
|
2026-08-26 10:23:53 -07:00
|
|
|
- **Write path**: broadcasting is done via `minimal-slp-wallet.sendOpReturn()`.
|
2026-08-26 18:22:03 -07:00
|
|
|
- Correct public API: `await wallet.sendOpReturn(message, prefix, bchOutput)`.
|
2026-08-26 10:23:53 -07:00
|
|
|
- `prefix = '6d02'` posts a memo; other action bytes replace `02`.
|
2026-08-26 18:22:03 -07:00
|
|
|
- Binary payloads (txid 32 bytes, address hash 20 bytes, topic/poll text)
|
|
|
|
|
must be encoded correctly.
|
|
|
|
|
- **Read path**: `psf-memo-db` REST API (`/posts/*`, `/profile/*`, `/level/*`).
|
|
|
|
|
API changes are in scope for specs.
|
2026-08-26 10:23:53 -07:00
|
|
|
- **Indexer path**: `psf-memo-indexer` scans blocks and mempool for Memo
|
|
|
|
|
`OP_RETURN` outputs and writes structured records to `psf-memo-db`.
|
2026-08-26 18:22:03 -07:00
|
|
|
- The write path (broadcast), indexer path, and read path (DB) are
|
|
|
|
|
asynchronous: a broadcasted action becomes visible only after confirmation +
|
|
|
|
|
indexing.
|
2026-08-26 10:23:53 -07:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Memo protocol action codes
|
|
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
Reference: https://memo.sv/protocol (Wayback snapshot 2025-12-15)
|
|
|
|
|
|
|
|
|
|
| Action byte | Meaning | Payload |
|
|
|
|
|
|-------------|---------|---------|
|
|
|
|
|
| `0x6d01` | Set name | `name` (≤ 217 bytes) |
|
|
|
|
|
| `0x6d02` | Post memo | `message` (≤ 217 bytes) |
|
|
|
|
|
| `0x6d03` | Reply to memo | `txhash` (32 bytes) + `message` (≤ 184 bytes) |
|
|
|
|
|
| `0x6d04` | Like / tip memo | `txhash` (32 bytes) |
|
|
|
|
|
| `0x6d05` | Set profile text | `message` (≤ 217 bytes) |
|
|
|
|
|
| `0x6d06` | Follow user | `address` (20 bytes) |
|
|
|
|
|
| `0x6d07` | Unfollow user | `address` (20 bytes) |
|
|
|
|
|
| `0x6d0a` | Set profile picture | `url` (≤ 217 bytes) |
|
|
|
|
|
| `0x6d0b` | Repost memo | `txhash` (32 bytes) + `message` (≤ 184 bytes) — *planned* |
|
|
|
|
|
| `0x6d0c` | Post topic message | `topic_name` + `message` (combined ≤ 214 bytes) |
|
|
|
|
|
| `0x6d0d` | Topic follow | `topic_name` |
|
|
|
|
|
| `0x6d0e` | Topic unfollow | `topic_name` |
|
|
|
|
|
| `0x6d10` | Create poll | `poll_type` (1) + `option_count` (1) + `question` (≤ 209 bytes) |
|
|
|
|
|
| `0x6d13` | Add poll option | `poll_txhash` (32) + `option` (≤ 184 bytes) |
|
|
|
|
|
| `0x6d14` | Poll vote | `poll_txhash` (32) + `comment` (≤ 184 bytes) |
|
|
|
|
|
| `0x6d16` | Mute user | `address` (20 bytes) |
|
|
|
|
|
| `0x6d17` | Unmute user | `address` (20 bytes) |
|
|
|
|
|
| `0x6d24` | Send money | `address` (20) + `message` (≤ 194 bytes) |
|
|
|
|
|
| `0x6d30` | Sell tokens | MIP-0009 token exchange |
|
|
|
|
|
| `0x6d31` | Token buy offer | MIP-0009 token exchange |
|
|
|
|
|
| `0x6d32` | Attach token sale signature | MIP-0009 token exchange |
|
|
|
|
|
| `0x6d35` | Pin token post | MIP-0009 token exchange — *planned* |
|
2026-08-26 10:23:53 -07:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Component legend
|
|
|
|
|
|
|
|
|
|
| Code | Component | Typical changes |
|
|
|
|
|
|------|-----------|-----------------|
|
|
|
|
|
| C | `psf-memo-client` | React components, services, pages, unit/acceptance tests |
|
|
|
|
|
| I | `psf-memo-indexer` | Memo action handler, parser support, filter logic |
|
|
|
|
|
| D | `psf-memo-db` | LevelDB store, REST route, query adapter, tests |
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
## Tier P0 — Already shipped to `master`
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
| # | Feature | Memo action | Components | Status |
|
|
|
|
|
|---|---------|-------------|------------|--------|
|
|
|
|
|
| 0.1 | Post a Memo | `0x6d02` | C, I, D | ✅ |
|
|
|
|
|
| 0.2 | Set display name | `0x6d01` | C, I, D | ✅ |
|
|
|
|
|
| 0.3 | Reply to a Memo | `0x6d03` | C, I, D | ✅ |
|
|
|
|
|
| 0.4 | Efficient post pagination | read | D, I | ✅ |
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
---
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
## Tier P1 — Core social verbs (close the read loop)
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
These features already have indexer storage and (for like/tip) client
|
|
|
|
|
broadcast. The remaining work is exposing the read side in `psf-memo-db` and
|
|
|
|
|
adding/editing the client UI.
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
| # | Feature | Memo action | Components | Status | Next work |
|
|
|
|
|
|---|---------|-------------|------------|--------|-----------|
|
2026-08-26 19:14:21 -07:00
|
|
|
| 1.1 | Like / tip a Memo — read side | `0x6d04` | D | ✅ | `likeCount` returned on `/posts/*` and `/posts/:txid/thread` |
|
2026-08-26 20:52:25 -07:00
|
|
|
| 1.2 | Like / tip a Memo — client display | `0x6d04` | C | ✅ | Feed/Profile/Thread read `likeCount` from API instead of defaulting to 0 |
|
2026-08-26 19:14:21 -07:00
|
|
|
| 1.3 | Set profile text (bio) | `0x6d05` | C, I, D | 🟡 partial | C: add "Set Bio" UI on Account page; I/D already read |
|
|
|
|
|
| 1.4 | Set profile picture | `0x6d0a` | C, I, D | 🟡 partial | C: add "Set Avatar URL" UI; I/D already read |
|
|
|
|
|
| 1.5 | Follow a user | `0x6d06` | C, I, D | 🔴 missing | C: follow button on profile; D: follow state + following/followers lists |
|
|
|
|
|
| 1.6 | Unfollow a user | `0x6d07` | C, I, D | 🔴 missing | C: unfollow button; D: follow state |
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
### Priority order within P1
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 19:14:21 -07:00
|
|
|
1. **Like / tip a Memo — read side** ✅ DONE.
|
2026-08-26 20:52:25 -07:00
|
|
|
2. **Like / tip a Memo — client display** ✅ DONE. The feed, profile, and
|
|
|
|
|
thread views now read `likeCount` from the API (profile shows a read-only
|
|
|
|
|
like button).
|
2026-08-26 19:14:21 -07:00
|
|
|
3. **Set profile text** — simple text broadcast + Account page UI.
|
|
|
|
|
4. **Set profile picture** — URL broadcast + Account page UI.
|
|
|
|
|
5. **Follow / Unfollow user** — social graph; enables the following feed later.
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
### Like / tip details
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
- The like action carries the liked post txid (32 bytes). A pure like has no
|
|
|
|
|
BCH output to the author; a tip adds a P2PKH output paying the author.
|
|
|
|
|
- `psf-memo-indexer` stores each like in `likesDb` and records `tip` (sats)
|
|
|
|
|
when the like tx pays the author.
|
2026-08-26 19:14:21 -07:00
|
|
|
- `psf-memo-db` aggregates `likesDb` into per-post `likeCount` in
|
|
|
|
|
`/posts/recent`, `/posts/by/:addr`, and `/posts/:txid/thread` responses.
|
2026-08-26 18:22:03 -07:00
|
|
|
- The client already has `MemoLike`, `LikeTipPage`, `LikeButton`, and
|
2026-08-26 20:52:25 -07:00
|
|
|
`LikeTipModal`; the feed/profile/thread views now read `likeCount` from the
|
|
|
|
|
API (profile renders a read-only `LikeButton`).
|
2026-08-26 10:23:53 -07:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
## Tier P2 — Topics
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
Topics add a second feed axis. The indexer already stores topic messages and
|
|
|
|
|
follows in `roomsDb`; the DB and client need query/render support.
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
| # | Feature | Memo action | Components | Status |
|
|
|
|
|
|---|---------|-------------|------------|--------|
|
|
|
|
|
| 2.1 | Topic list / discovery | read | D, C | 🔴 missing |
|
|
|
|
|
| 2.2 | Topic feed page | read | D, C | 🔴 missing |
|
|
|
|
|
| 2.3 | Post a topic message | `0x6d0c` | C, I, D | 🟡 partial (I/D store; no C UI) |
|
|
|
|
|
| 2.4 | Follow a topic | `0x6d0d` | C, I, D | 🟡 partial |
|
|
|
|
|
| 2.5 | Unfollow a topic | `0x6d0e` | C, I, D | 🟡 partial |
|
2026-08-26 10:23:53 -07:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
## Tier P3 — Polls
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
Polls require a new data model and rendering. The indexer has no handler yet.
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
| # | Feature | Memo action | Components | Status |
|
|
|
|
|
|---|---------|-------------|------------|--------|
|
|
|
|
|
| 3.1 | Create a poll | `0x6d10` | C, I, D | 🔴 missing |
|
|
|
|
|
| 3.2 | Add a poll option | `0x6d13` | C, I, D | 🔴 missing |
|
|
|
|
|
| 3.3 | Vote in a poll | `0x6d14` | C, I, D | 🔴 missing |
|
2026-08-26 10:23:53 -07:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
## Tier P4 — Moderation
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
| # | Feature | Memo action | Components | Status |
|
|
|
|
|
|---|---------|-------------|------------|--------|
|
|
|
|
|
| 4.1 | Mute a user | `0x6d16` | C, D | 🔴 missing |
|
|
|
|
|
| 4.2 | Unmute a user | `0x6d17` | C, D | 🔴 missing |
|
2026-08-26 10:23:53 -07:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
## Tier P5 — Money & token exchange
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
| # | Feature | Memo action | Components | Status |
|
|
|
|
|
|---|---------|-------------|------------|--------|
|
|
|
|
|
| 5.1 | Send money with memo | `0x6d24` | C | 🔴 missing |
|
|
|
|
|
| 5.2 | Token sell offer | `0x6d30` (MIP-0009) | C, I, D | 🔴 missing |
|
|
|
|
|
| 5.3 | Token buy offer | `0x6d31` (MIP-0009) | C, I, D | 🔴 missing |
|
|
|
|
|
| 5.4 | Attach token sale signature | `0x6d32` (MIP-0009) | C, I, D | 🔴 missing |
|
|
|
|
|
| 5.5 | Pin token post | `0x6d35` (MIP-0009) | C, I, D | 🔴 missing |
|
2026-08-26 10:23:53 -07:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
## Tier P6 — Advanced social & discovery (later)
|
2026-08-26 10:23:53 -07:00
|
|
|
|
|
|
|
|
| # | Feature | Components | Notes |
|
|
|
|
|
|---|---------|------------|-------|
|
2026-08-26 18:22:03 -07:00
|
|
|
| 6.1 | Repost a memo | C, I, D | `0x6d0b` is marked *planned* in the protocol |
|
|
|
|
|
| 6.2 | Ranked feed | C, D | memo.cash "ranked" post ordering |
|
|
|
|
|
| 6.3 | Notifications | C, D | replies / likes / follows to my posts |
|
|
|
|
|
| 6.4 | Search | C, D | posts / profiles / topics |
|
|
|
|
|
| 6.5 | Tags / hashtags | C, D | link + filter by tag |
|
|
|
|
|
| 6.6 | Following feed | C, D | feed filtered to followed users |
|
2026-08-26 10:23:53 -07:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
## Suggested first spec for the next session
|
|
|
|
|
|
2026-08-26 20:52:25 -07:00
|
|
|
**Set profile text (bio)** (P1.3):
|
|
|
|
|
- `psf-memo-client`: add a "Set Bio" UI on the Account page that broadcasts the
|
|
|
|
|
`0x6d05` Set profile text action via `minimal-slp-wallet.sendOpReturn()`.
|
|
|
|
|
- `psf-memo-indexer` and `psf-memo-db` already read/store profile text, so this
|
|
|
|
|
is primarily a client broadcast + Account page UI feature.
|
|
|
|
|
- The profile page already renders `profileText` from the API; the missing piece
|
|
|
|
|
is the write path (broadcast) and the Account page editor.
|
2026-08-26 10:23:53 -07:00
|
|
|
|
2026-08-26 20:52:25 -07:00
|
|
|
This is the next smallest end-to-end win toward memo.cash parity after the
|
|
|
|
|
like-count read/display loop closed.
|
2026-08-26 10:23:53 -07:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Notes for future cycles
|
|
|
|
|
|
2026-08-26 18:22:03 -07:00
|
|
|
- Broadcast result (txid) is returned immediately; the action appears in the
|
|
|
|
|
feed only after block confirmation + indexing. Specs must reflect this async
|
|
|
|
|
visibility.
|
|
|
|
|
- Mutations/specs are Gherkin feature files under per-component `specs/` in
|
|
|
|
|
the format defined by github.com/unclebob/Acceptance-Pipeline-Specification.
|
2026-08-26 10:23:53 -07:00
|
|
|
- Root `specs/` contains this backlog and cross-component architecture notes.
|