Peer-to-peer donation platform. Direct human-to-human giving over Bitcoin Lightning, with NOSTR as the invisible communication substrate.
Status: draft, in active iteration. Last revised 2026-11-11.
Help people in difficult situations by enabling direct gifts from one human to another — without any organizational middleman taking a cut, gatekeeping, or politicizing the flow of help.
Bitcoin Lightning is the only payment rail for a gift. A shop till is the
decided exception: USDT or USDC on the same OpenCryptoPay QR is paid by
Orchestra as one BOLT11 minted for that wallet, specified and implemented per
docs/shop-stablecoin-payment.md.
NOSTR is the only message rail. Both are plumbing — the user just sees a
website where they can ask for help or send help.
21.gifts is built on three convictions. They are the reason 21.gifts exists; the Core Principles below say how it is built.
Giving is not an optional extra of Christian life. Jesus assumes it: “When you give to the needy” (Matthew 6:2) — when, not if. Whoever has material possessions, sees a brother or sister in need, and has no pity on them does not have the love of God in them (1 John 3:17). Faith by itself, if it is not accompanied by action, is dead (James 2:17). To neglect the hungry, the thirsty, the stranger, the naked, the sick, and the prisoner is to neglect Christ himself (Matthew 25:31–46). “And do not forget to do good and to share with others, for with such sacrifices God is pleased” (Hebrews 13:16).
The measure is free — “each of you should give what you have decided in your heart to give, not reluctantly or under compulsion, for God loves a cheerful giver” (2 Corinthians 9:7). The New Testament sets no rate. The tithe of the Law is never laid on the church; the duty is to give, and the amount is between the giver and God.
Giving is not only money. A smile, time, a coat, a visit are gifts too. 21.gifts is the path for the money gift: one person to another.
The signature verse of 21.gifts is Matthew 10:8: “Freely you have received; freely give.”
A gift that goes straight to the receiver’s own address is the short path. Advantages:
- The whole gift arrives: 21.gifts takes no cut, charges no fee, and adds no program overhead.
- No charity, platform, or program sits between giver and receiver to skim, delay, or politicize the gift; the only party in the path is the wallet the receiver chose.
- Giver and receiver stay people to each other, not a case file and a campaign.
- Both keep their dignity: one asks, one gives, and they meet as people in the living room.
- 21.gifts never holds the receiver’s Bitcoin. If 21.gifts disappeared
tomorrow, the funds stay self-custodial and recoverable with the 12
words in any compatible wallet; the
@21.giftsaddress does not survive the service. - Help moves at the speed of the payment, not of a committee.
- The giver can see the person who asked — not an abstract cause.
This is Core Principle 2 (Truly P2P) in practice on the receiving side; the v1 sending-side compromise is documented under the transitional model below.
Bitcoin is the rail because it is the strongest money 21.gifts can put in a person’s hand.
- Censorship-resistant. Bitcoin itself cannot be told to refuse a gift that the sender and receiver have agreed. Capital controls, frozen bank accounts, war, a closed branch — none of them can stop the network.
- Permissionless. No account application, no ID gate, no banking hours. A phone and the in-app wallet are enough, also for people no bank will open a file for.
- Borderless and always on. One network, every country; nights, weekends, bank holidays, and crises included. An international gift does not wait on correspondent banks or a money-transfer shop: it is sent like an email and arrives as Bitcoin, not as a form.
- Cheap and fast at human scale. Lightning makes small gifts practical; an email-like address is enough to receive.
- Hard cap. 21 million, so inflation cannot quietly tax people who already have little.
- Bearer money. In the self-custodial in-app wallet nobody holds it for the receiver. 21.gifts never holds it in any case.
On the website we say “Bitcoin” and “wallet”; Lightning, LNURL, and keys are plumbing and stay out of sight.
The public version of these convictions is /about in the app, in
every catalog locale. This section is the full argument.
- Non-profit — the platform itself earns nothing beyond what it costs to operate
- Truly P2P — funds flow donor → receiver directly; the platform never custodies money
- Open protocol — anyone can build a client; the website is one reference implementation
- NOSTR-native, NOSTR-invisible — every message in the UI is also a NOSTR event, visible in Damus/Amethyst/etc., but the user is never asked about keys or relays
- Self-sovereign keys — Passkey + PRF derives the NOSTR key client-side; the server never sees raw key material
- In-app wallet mandatory — a member receives only on their verified in-app wallet, at the LUD-16 address
<username>@<host of PUBLIC_BASE_URL>; the platform never custodies receiver funds - English canon, localized visitor UI — CONCEPT, identifiers, commits,
handbook, and api payloads stay English. Visitor-facing app copy is
localized (
en,de,es,fil). Adding a fifth locale is out of scope unless Brand changes. - Thin client, thick server — the browser holds only what must be client-side (keys, signing, wallet flow). Everything else — relay communication, indexing, discovery, LN-Address resolution, anti-abuse — lives in the backend API. The app bundle stays tiny.
- Public applications, private wallet — the public 21.gifts application
surfaces include the forum and its notes, forum gifts, hearts, credit
requests and repayments, shops, and the Fond's activity and transactions;
conversations (including their gifts and invoices), notifications, the
contact mailbox, a shop's own till (including its payments), and notes
hidden by staff stay private. The Fond is a 21.gifts application whose
activity and transactions are public.
GET /fond/summaryis the existing surface; a public transaction list is separate work. The wallet, the member's in-app Bitcoin wallet for sending, receiving, and holding, is a separate thing: private to the public apart from the exceptions in CONTRIBUTING.md, and stored completely in the api database, readable by the admin team (role at leastsoftware_developer) and by operator debug access. The binding detail is in CONTRIBUTING.md, Wallet data. The api reads every current and previous wallet through its own read-only Spark viewer identity; wallets grant that identity while Spark private mode remains on. The viewer can never move funds. Its mnemonic is stored only encrypted underNOSTR_NSEC_KEK, never in plaintext. The operator ledger stores Bitcoin movements inwallet_transferand only explicit non-secret token facts inwallet_token_transaction(never raw SDK rows, signatures, commitments, secret keys, or revocation secrets); the supplementarywallet_paymentreport adds app-only fee, destination, invoice, memo, and method details. Together they are the complete non-secret record of the value-movement facts those two sources observe or report.
v1 ships with a deliberately simplified account and custody model so the platform can go live and be dogfooded. It deviates from Core Principle 2 on the donor's sending side (recurring payouts are sent from the Fond account's in-app wallet, not donor → receiver directly) and from Core Principle 5 for all v1 accounts (no client-side keys; each account's NOSTR identity is custodial, held and used for signing server-side — see "NOSTR in v1" below). Both deviations are transitional and will be replaced by a non-custodial setup. Receiving stays non-custodial (the self-custodial in-app wallet).
One exclusive account.role per account. Ranks: basis 0, verified 1,
moderator 2, fond 3, software_developer 4, initiator 5, founder 6.
A higher rank can always do and see everything a lower rank can; equal ranks
can do the same things. Permission text names the minimum rank only. Do not
write "moderator or initiator" or „Moderator oder Initiator“. The daily payout
roster is roleAtLeast(role, 'initiator'). The software developer is in the
closed Moderators group with every moderator permission, does not earn the
moderator-group payout, and cannot edit the daily payout roster. The boot
migration runs under a fixed advisory lock. When the old staff_tag column
exists, it promotes rows labelled software_developer from basis,
verified, moderator, or fond (every rank below software developer), so an
initiator or founder with that label keeps its role, then drops the column.
New passkey accounts are Basis.
verified is a moderator confirming this person in real life
(forum badge), not a verified wallet. POST /trust/verify must have
confirmed the stored name. A funding-program grant is
independent of that role: moderators review living-room posts against the
three convictions (human decision). basis cannot apply. Spend pings and
payout invoices require an admitted grant or a trial on today's UTC day, and,
from the UTC day RECOVERY_SHARE_REQUIRED_FROM,
a stored 21.gifts recovery share for the account's current verified wallet
(social recovery, below). A member may leave the program on their own
(POST /funding/withdraw) so that someone else can be admitted: the grant
becomes withdrawn, payouts stop at once, an admitted place is free again,
and the member may apply again later without priority. A daily payout also
requires that the member's server-verified completed payments from their wallet
to live 21.gifts shops on the payout's UTC day and the day before sum to at
least half the daily grant, rounded up in whole sats from the stored BTC-USD
spot. A missing or unusable stored spot, or a daily roster that decides a
skip, fails closed. Moderator stipends keep the 1-sat rule: at least one such
payment in the same two-day window. This shop-payment rule applies from
deployment, with no start date. The one-time welcome gift is exempt
only when server-owned facts show an exactly verified non-platform account with no stored
welcome, comment exactly Welcome, neither messageId nor groupMessageId,
and a normalized exact USD 1.00, and amountMsat is at most the server's
usdToMsat("1.00", spot) conversion plus the fixed 10% spot-drift tolerance.
Without a usable current spot, the exception fails closed and the shop-payment
condition is required.
A moderator is proposed by
an existing moderator and confirmed by a different staff
member, or appointed directly by a founder. Those grants persist as trust
edges (POST /trust/verify, POST /trust/propose-moderator,
POST /trust/confirm-moderator, POST /trust/reject-moderator,
POST /trust/appoint-moderator).
GET /trust-chain requires a member Bearer session (any role) and returns
founder seeds; ?around=<id> returns one hop of stored public edges with
at most one incoming edge per subject (no inferred links).
Operator PATCH /debug/accounts/:id can still set role and does not
write trust edges; POST /debug/trust-edges backfills stored edges and
DELETE /debug/trust-edges removes the latest stored (subjectId, kind)
row (createdAt desc, then id desc), both without changing role.
| Role | Capabilities |
|---|---|
| Basis | Log in, maintain a profile, receive gifts (default). No forum tag. Pays 1 sat to 21.gifts before posting or replying, except a free first top-level post and a reply on their own note. |
| Verified | Everything Basis can, plus a forum tag: a moderator physically met this person. Not a verified wallet. May post and reply without a Bitcoin payment. |
| Moderator | Everything Verified can, plus content moderation, the staff inbox, the closed Moderators group and the staff trust routes (verify a member, propose, confirm, or reject a moderator). Forum tag. |
| Fond | Everything Moderator can (rank 3). The configured Fond account (FOND_USERNAME, not the platform account) can sign Fond payouts from its own wallet when PAYOUT_SIGNER=fond (canSignFondPayouts, at least fond). Forum tag. |
| Software Developer | Everything Moderator can, including the closed Moderators group and every moderator permission. No moderator-group payout. Cannot edit the daily payout roster. Forum tag. |
| Initiator | Rank 5, above the software developer, fond and moderator. Can edit the daily payout roster. Forum tag. |
| Founder | Everything Initiator can, plus appointing moderators directly. Forum tag. |
Becoming a donor is an upgrade available to every account, not a role of its own (see below). The forum shows a tag only for Verified, Moderator, Fond, Software Developer, Initiator, and Founder.
- Passkey (WebAuthn) is the only login method. No email, no password, no
LNURL-auth. The browser creates or asserts a discoverable credential; the
api issues a bearer session immediately. Account identity is
account.id. - Lost passkey: if the user loses the passkey and any platform sync, the
account comes back with the 12 words or with social recovery
(
docs/social-recovery.md). Without either, it is unrecoverable. LNURL-auth was removed (2026-08-24); leftoveraccount.linking_keyvalues are historical and cannot log in. - WebAuthn RP ID is
WEBAUTHN_RP_ID(21.gifts/dev.21.gifts/staging.21.gifts). Missing RP ID → passkey routes 500; the process still boots. - Operator provision / viewKey claim (2026-08-30):
POST /debug/accountscan create accounts with a name (and an optional username) and no passkey. The publicviewKeyURL is the invite.POST /auth/passkey/register/beginwith{ "viewKey" }binds a passkey to that row (name and username stay); living-room rules agreement remains a later/mestep.
Any account can additionally become a donor and spend money:
- Recurring paying is done by the Fond member from its own in-app wallet
(
PAYOUT_SIGNER=fond). The api queues each decided payout infond_payout, issues the recipient BOLT11 invoice (POST /fond/payouts/:id/invoice), and settles the payout once it is paid. This api does not pay. - A settled payout records the outbound gift for public
GET /gifts/stats.
A member receives only on their in-app wallet, at
<username>@<host of PUBLIC_BASE_URL>. The wallet counts once the
self-hosted LNURL server has accepted its registration
(sparkPubkeyVerifiedAt). A member without a verified wallet cannot
receive and cannot post. Linking an external Lightning address, and its
micro-payment proof of control, were removed on 2026-10-02.
Donors can configure fixed USD amounts to a list of recipients. This api
does not pay. A payout is decided when the recipient posts a top-level
forum note (ping from this api); replies do not pay. With
PAYOUT_SIGNER=fond the decided payout is queued in fond_payout; the
Fond member pays it from its own in-app wallet through the /fond routes,
for which the api issues the BOLT11 invoice (LNURL-pay to the recipient)
and settles the payout, recording the outbound gift for public
GET /gifts/stats. Without PAYOUT_SIGNER no payout is queued.
Recurring donor UI and an in-process scheduler are not HTTP yet. Do not
invent /me/recurring.
Passkey begin options request PRF so the client can derive a recovery phrase;
API authentication and Nostr custody do not use it, so v1 runs NOSTR fully
custodially (decided 2026-07-05, restated 2026-09-21, resolves Open Question #9): on sign-up the
api generates a NOSTR keypair for the account, stores the nsec encrypted at
rest, and signs that account's events server-side with the account's own key.
Every profile, campaign, and comment therefore appears on the public NOSTR
network under the user's own npub — attribution stays per-user, and
external clients (Damus, Amethyst, …) see ordinary per-identity events.
User-owned keys (Passkey + PRF → NIP-06) arrive with the non-custodial phase;
the custodial-to-user-owned migration path is the remaining open part of
Open Question #9.
Post-v1 target architecture. v1 login is still a server-issued session after passkey. Begin options request WebAuthn PRF so the client can derive a recovery phrase in tab memory; PRF is not used for API authentication or server-side Nostr custody — see "v1 Transitional Model" above. Everything in this section describes the non-custodial phase that replaces that custody.
The full key flow, end-to-end:
WebAuthn Passkey (PRF extension)
│
▼ prf.eval.first(SHA-256("21gifts-nostr-v1"))
PRF output (32 bytes, deterministic from Secure Enclave)
│
▼ HKDF-SHA256(salt="21gifts-seed-derivation", info="mnemonic-v1")
128 bits of entropy
│
▼ BIP-39
12-word mnemonic
│
▼ BIP-39 seed → BIP-32 master
BIP-32 derivation at m/44'/1237'/0'/0/0 (NIP-06 path, 1237 = NOSTR slip-44)
│
▼
32-byte secp256k1 private key (NOSTR nsec)
│
▼ schnorr_pubkey
NOSTR npub
Key design choices — directly modeled after the zkCoins app passkey module:
- PRF salt is cached —
SHA-256("21gifts-nostr-v1")computed once per session and reused so all PRF evaluations yield the same deterministic output - Domain-separated HKDF — different
infotags for different uses (mnemonic derivation, AES key derivation, future expansion). Same PRF output, different outputs by purpose. - Versioning —
DERIVATION_VERSION = "v1"stored alongside the credential. Future versions can derive in parallel for migration. - Hard-fail on missing PRF — no silent fallback to a weaker scheme. If the authenticator doesn't expose PRF, the user is told to use a supported device.
- Address in cleartext for the locked view — public NOSTR pubkey stored unencrypted so the locked UI can display "this is your wallet" without requiring authentication.
Why NIP-06 (BIP-39 mnemonic in the middle) instead of PRF → HKDF → nsec directly?
- User-readable 12-word backup (familiar to anyone who has used a Bitcoin wallet)
- Cross-client compatibility — Damus, Amethyst, and all NOSTR clients that implement NIP-06 can import the same mnemonic and recover the same identity
- Future-proof — the same mnemonic can derive other keys (LN, BTC) later if the scope grows, without breaking the existing identity
- Matches the architecture of related projects in the same stack, minimizing mental overhead
Recovery paths:
- Platform Passkey sync — iCloud Keychain, Google Password Manager, 1Password, Bitwarden, hardware authenticator with sync
- Optional explicit 12-word backup, shown once on sign-up, never sent to the server
Social recovery gives an owner who lost their passkey the same account on a
new phone and puts the original 12 words back together. It is optional, found
in the settings, and needs a verified wallet; for members in the grant program
it becomes a payout condition, and they are prompted to set it up. The 12
words are split 2-of-3: one share each for two chosen people, passed only by
QR code to their own signed-in 21.gifts app, and one backup share for
21.gifts that the api stores encrypted and never decrypts. Two shares recover
at once, in person. The old wallet key signs the account transfer, the
account gets a new passkey with its own new 12 words, and the old words move
the Lightning address and the whole wallet balance to the new wallet. The v1
custodial NOSTR key does not change; with NIP-06 keys after v1, new 12 words
would mean a new npub. Specified and implemented per
docs/social-recovery.md; the routes are in
SPEC.md.
The shop payment in
docs/shop-stablecoin-payment.md does not read
those words and does not deliver to a Spark address.
The server never holds the nsec. All NOSTR signing happens in the browser.
| Platform / Authenticator | PRF Support |
|---|---|
| iOS / macOS Safari 18+ | ✅ |
| Chrome on macOS/iOS | ✅ |
| Edge (Chromium) | ✅ |
| Android Chrome 132+ | ✅ |
| 1Password 8+ | ✅ |
| Bitwarden | ✅ |
| YubiKey 5 (firmware 5.7+) | ✅ |
| Firefox | partial — lagging behind |
Unsupported-tail handling is deferred with Open Question #1 to the non-custodial phase (this table, like the rest of this section, is post-v1).
- Receiver must have a verified in-app wallet; its LUD-16 address is
<username>@<host of PUBLIC_BASE_URL> - The api resolves and caches LUD-16 metadata server-side, with health checks
- Donor flow in the browser: click Donate → app reads cached LN-Address from api → browser fetches LNURL-pay callback → invoice → pay
- For a member's wallet address, the LNURL-pay metadata and invoice callback
are served at the api's
PUBLIC_BASE_URLand forwarded to the self-hosted LNURL server, so the api sees the requested amount and the returned invoice; it never pays the invoice and never holds the funds (an address on any other domain keeps its provider's callback, and the api is not involved) - v1 addition (see "v1 Transitional Model"): recurring gifts are paid by the Fond member from its own in-app wallet. This api queues the payout, fetches the invoice, and settles the paid payout — it does not pay. The browser flow above remains for guests and one-off gifts.
- Optional: NIP-57 Zap receipts published to NOSTR for transparent acknowledgements
The shop QR stays the OpenCryptoPay link. A customer who pays USDT or USDC
through that same QR pays Orchestra, which pays one BOLT11 for the shop's
sats, minted by the mint POST /pay/:username/invoice already uses. A
till charge or an amount the payer enters opens one shop payment. It pins
the pay link for at most five minutes and never blocks the till. The api checks each transfer on chain before it hands it to Orchestra (by its successful receipt; the api first validates and sends a hex
transaction); a transfer whose Orchestra order the api already holds is not handed to it again, and the
paid watcher records the payment paid when that BOLT11 settles. The shop
does not hold USDT or USDC, and this payment does not deliver to a stored
Spark address. The 12 words stay on the phone. This payment does not read
them.
Specified in
docs/shop-stablecoin-payment.md and implemented; the
routes are in SPEC.md.
The till knows when a charge is paid. While a charge is open, a 21.gifts
in-app wallet that scans the shop's QR (or enters the shop's address) gets a
Spark invoice for the charge amount from POST /pay/:username/invoice and
pays it without a fee; any other wallet pays over Lightning as before. The
api watches the invoices it handed out for that charge (the Spark invoice
through the Spark coordinator, each BOLT11 through the LNURL server's LUD-21
verify) and marks the charge paid; the first confirmation wins. GET /pos
then shows the paid charge for 60 s, and a paid charge no longer pins the
pay link's amount. Orchestra paying a shop payment's BOLT11 is one of those
BOLT11s. No zap receipt, gift, or message is written for a till
payment.
The till also shows money that arrived without a charge. A customer can pay
the shop's address (its static sticker QR) with no open charge and type the
amount in their own wallet. GET /pos lists, for the signed-in shop only,
the completed Lightning receipts and plain Spark transfers the server
observed in the shop's own wallets over the last 24 hours that settled none
of its open or paid charges: amount, time, and whether it came over
Lightning or Spark, and nothing about the payer. A move between the shop's
own wallets is not a payment and is not listed. A payment that settled a
charge is shown only as that charge. A signed paid notice from the LNURL
server makes the api read that wallet at once, so the payment shows without
waiting for the next minute's pass.
Every public shop (a live top-level #21GiftsShop note with a till account)
gets its own custodial NOSTR identity, generated, held and
published by the api exactly like an account's. Its page is
https://21.gifts/{npub}. OpenCryptoPay requires that same public key for
every shop on its map and uses it as the shop's id; it holds no keys and
maintains no profiles. Specified in
docs/shop-identity.md. S1, S2, S3 and S5 are
implemented in this api; S4, the shop page, is in the app.
Every "message" the user writes in the UI is a NOSTR event. (v1 note: NOSTR
is fully custodial in v1 — the api holds one keypair per account and signs
events server-side with the account's own key, see "NOSTR in v1". The table
below applies to v1 for the surfaces v1 ships — profile metadata, campaign
post, public comment, and the custodial PN channel on /conversations.
Zap-receipt / leaderboard rows stay deferred, see MVP scope. The
client-side-signing flow beneath it is target state.)
| UI surface | NOSTR primitive |
|---|---|
| Profile metadata (name, photo, story) | kind:0 (NIP-01 metadata) |
| Receiver profile / campaign post | kind:1 (text note), tagged with campaign metadata |
| Public comment / encouragement | top-level kind:1 (frozen t=bitcoin / t=21gifts / r=https://21.gifts; no e/p/q; Damus-visible #bitcoin #21gifts in kind:1 content; pending fan-out is not reset to stamp hashtags or photo URLs) |
| Private message donor ↔ receiver | kind:14 (NIP-17 sealed DM, modern) or kind:4 (legacy) |
| Donation acknowledgement | kind:9735 Zap receipt (when NIP-57 enabled) |
Flow — the app does not talk to NOSTR relays directly. It talks to the backend API, which acts as the user's edge to the network:
app ──signed event──→ api ──fan-out──→ relays (public NOSTR network)
(Damus, Amethyst, etc. observe)
app ←──indexed feed── api ←──subscribe── relays
- The app signs every event client-side with the PRF-derived key
- The app POSTs the signed event to the api
- The api verifies the signature, applies anti-abuse filters, then fans out to the configured relay set
- For reading, the api maintains an indexed view aggregated from the relay set and exposes simple REST/GraphQL endpoints — the app fetches one paginated resource, not raw relay traffic
- Default relay set is configured server-side; users can opt into a "raw mode" later (deferred) where the app talks to relays directly with the same key
- Target-state private DMs pass through the api as opaque encrypted payloads
(client-side nsec). v1 is custodial: the api unwraps NIP-17 / decrypts
kind:4 with the account nsec for the
/conversationsPN channel.
The /messages thread is a forum / messenger group, not a social-media
feed. Visitors read it top-to-bottom like a group chat: oldest notes at the
top, newest at the bottom, composer under the newest note. A new post is
inserted at the bottom. GET /messages still returns the latest 200 notes
newest-first so the window is "what is recent"; every client reverses that
array for display.
Every member chooses in the settings how many whole sats one heart sends
(default 1). A heart click pays exactly that amount; the server accepts the
amount the app sends, even when another device changed the setting in between.
The heart counter counts one per paid heart, whatever the amount, so a 21-sat
heart adds 1. The reactions view (GET /messages/:id/replies) lists who sent a
heart and the exact sat amount, newest first.
Protocol level: completely open. Anyone publishes. Trust emerges from NOSTR reputation (who follows / vouches for whom).
Website level: stricter, to protect donors from obvious scams:
- External NOSTR identities are shown only after a verified zap of at least 1 sat on a 21.gifts forum note; the protocol stays open. This applies retroactively both ways — a reply stored before its author's first zap stays invisible until that zap is recorded, and becomes visible immediately once it is recorded.
- NIP-05 verification (optional, badged)
- Profile completeness (story, photo, LN-Address resolves successfully)
- Community vouching (other NOSTR identities sign off)
- No KYC, no government ID
(v1 note: NIP-05 badging and NOSTR-identity vouching are post-v1 — v1 NOSTR
identities are custodial, server-held. The account flag
lightningAddressVerified is true once the in-app wallet is verified, see
"Receiving address". That flag is not the forum role Verified,
which means a moderator physically met the person (account.role,
via POST /trust/verify or an edge-less operator PATCH /debug/accounts/:id).)
The website is not a gatekeeper — it's a curator with transparent rules. If a receiver doesn't meet website requirements, they can still use a different client on the same protocol.
Central to the architecture from day one. Holds the project's canonical documentation, schema, and protocol. The app is just one client of this api; other clients (mobile apps, third-party reference implementations) can target the same endpoints later.
Responsibilities:
- NOSTR fan-out — accept signed events from clients and verify their signatures (target state — in v1 events originate and are signed server-side, see the v1 additions below), publish to the configured relay set
- NOSTR aggregation / indexing — subscribe to relays, index events, expose paginated read endpoints for the app
- LN-Address resolution + caching — LUD-16 endpoints get cached server-side with health checks; the app fetches a single normalized response
- Discovery — recent campaigns, ordering, eventual categories / search
- Anti-abuse signals — rate-limiting, spam scoring, suspicious-pattern detection at the edge
- v1 additions (see "v1 Transitional Model"): passkey register/authenticate
and sessions; the Fond payout queue and its invoice HTTP
(
/fond/*); receiving address = verified in-app wallet; custodial per-account NOSTR identities (nsecencrypted at rest) with server-side event signing
Non-responsibilities (stay client-side; target state — the v1 additions above temporarily move key generation/custody and event signing server-side; recurring paying stays with the Fond member's wallet):
- Passkey ceremonies, PRF evaluation, key derivation
- Event signing (the api never sees the nsec)
- Paying in the guest Donate LNURL-pay flow (the browser pays the invoice
itself; for a member's wallet address the api only forwards the LNURL
metadata and invoice callback, so it sees the amount and the invoice but
never pays or holds funds; an address on any other domain keeps its
provider's callback and the api takes no part). Fond payout invoices are
the exception (
POST /fond/payouts/:id/invoice). - Client-side decryption of NIP-17 sealed DMs (v1 custodial unwrap is on
the api for
/conversations)
The api lives in its own repository (21gifts/api) and is the canonical
home for project-level documentation, including this concept document. The
app repo (21gifts/app) only carries frontend-specific docs.
Durability: Durable Postgres writes are also appended to db_change with
at / op / before / after. Secret columns token, challenge,
nostr_nsec_ciphertext, viewer_mnemonic_ciphertext, nonce, view_key, endpoint, p256dh, auth,
delivered_endpoints, skip_endpoints, session_token, recovery_share_ciphertext, and
ciphertext (held_share_box) are stored as SHA-256 hex in that JSON; other columns including name stay
plaintext.
Post-v1 target architecture (like "Identity & Keys" above). The api never stores a mnemonic or PRF output. The v1 session is a server-issued token bound to
account.idafter passkey authentication. The client may hold a PRF-derived 12-word phrase in tab memory only.
IndexedDB, two object stores:
| Store | Contents |
|---|---|
credentials |
Passkey metadata (credential ID, derivation version, creation timestamp) |
keystore |
Encrypted secret material (encrypted mnemonic / encrypted nsec); plus the NOSTR npub in cleartext for the locked view |
Encryption: AES-GCM 256, with two key-derivation paths:
- Passkey path — HKDF-SHA256 from PRF output, salt
"21gifts-encryption", info"aes-key-v1" - Password path — PBKDF2-SHA256 from user password, 100,000 iterations, 16-byte random salt persisted with the ciphertext
In — app:
- Sign-in via passkey (WebAuthn discoverable credential; session bound to
account.id) - Receiver profile UI: name, photo, story, and the in-app wallet as the
receiving address (
lightningAddressVerified= wallet verified; not the forum role Verified) - Public campaign feed (rendered from api response)
- Donate button → LNURL-pay (browser flow, works without an account)
- Recurring gifts: configure USD amounts per recipient (paid by the Fond member when the recipient posts a top-level note, not on a daily timer; replies do not pay)
- Public comment composer (POST to api; signed server-side with the account's custodial key)
- Moderation actions on campaigns/comments (Moderator role)
In — api:
- Passkey endpoints: register/authenticate/replace begin and finish, session issuance;
POST /me/wallet-backup-seen - Social recovery (
docs/social-recovery.md):POST /auth/passkey/recovery/beginand/finish, the address transferPOST /lnurlpay/:pubkey/transfer,PUT /me/recovery-share,GET /me/previous-wallets,DELETE /me/previous-wallets/:sparkPubkey, and the holder's encrypted boxesGET /me/held-shares,PUT /me/held-shares/:id, andDELETE /me/held-shares/:id - Fond payout queue and invoice HTTP:
/fond/*(paying stays in the Fond member's wallet) - Receiving address: verified in-app wallet only
- Custodial NOSTR identities: per-account keypair generated on sign-up,
nsecstored encrypted at rest, events signed server-side - NOSTR fan-out to a default relay set
- Subscribe to relays + index
kind:0,kind:1events - Read endpoints: feed, profile, replies-to-event, recent campaigns
- LN-Address (LUD-16) resolution + cache + health check
- Basic anti-abuse: rate-limit per account, malformed-input rejection
- Moderation: hide/unhide content endpoints (Moderator role); staff POST
/trust/verify, confirm-moderator, appoint-moderator write role + edge;
POST /trust/propose-moderator writes the propose edge only; POST
/trust/reject-moderator writes append-only
moderator_reject(role unchanged); PATCH /debug/accounts/:id may still set role and does not write edges - USD → sats conversion for recurring-gift amounts via an exchange-rate source (fail-closed on a missing or implausible rate; paying stays with the Fond member)
- Custodial PN channel on
GET/POST /conversations(NIP-17 + kind:4; official platform account;Account.isPlatform;moderator_groupis a closed HTTP group for moderators with no Nostr) - Forum replies (
replyCount,GET /messages/:id/replies) and publicGET /messages/:id
Out, deferred:
- Passkey + PRF → NOSTR identity (NIP-06) — moves to the non-custodial phase
- Client-side event signing (v1 signs server-side with custodial keys)
- Any second login method (no email, no password, no backup auth). A lost
passkey comes back only with the 12 words or with social recovery
(
docs/social-recovery.md). - Linking multiple LNURL-auth wallets to one account
- Non-custodial donor spending (replaces the v1 Fond payout path)
- Non-custodial client-side DMs (v1 ships a custodial PN channel on
/conversations: NIP-17 + kind:4, official platform account;moderator_groupis a closed HTTP group for moderators with no Nostr) - NIP-57 Zap receipts / leaderboards
- NIP-05 verification badge
- Native mobile app
- Categories / filters / search
- Smart matching / recommendations
- Advanced anti-abuse (spam scoring, ML)
- Pinned relay
- "Raw mode" where the app talks to relays directly
PRF fallback — what happens if the user's browser doesn't support PRF?Restated 2026-09-21: v1 begin options request PRF so the client can derive a recovery phrase. Missing PRF aborts register before finish. API authentication still does not consume PRF; server-side Nostr keys stay custodial until the non-custodial phase.- Verification rigor beyond the external-identity floor — the website now shows an external NOSTR identity only after a verified zap of at least 1 sat, while the protocol remains open. Which additional reputation or platform-level checks, if any, belong above that fixed floor?
Relay strategy — public relays only, or run a pinned relay for the platform?Resolved 2026-05-25: 21.gifts uses the sharednostr.spacerelay (strfry) maintained as part of the wider NOSTR-space infrastructure. No relay operation is in 21.gifts' scope.- Funding the platform — hosting, domain, dev work need someone to pay. Options: rounding-up donations, optional tip on every flow, sponsor, founder funds. Must align with "non-profit" principle.
- Legal exposure — gift law vs. fundraising law per jurisdiction. Liability if a receiver turns out to be a scammer? Clear "this is a gift, not a contract" disclaimers probably essential.
- Discovery UX — how do donors find receivers? Random? Curated front page? Categories (medical, education, refugee, etc.)? Time-sensitive urgency?
- Anti-abuse — scammers, fake stories, AI-generated profiles. How to detect without becoming a centralized gatekeeper?
- Sybil resistance — one person, many profiles? NOSTR Web of Trust helps but isn't bulletproof.
Platform-signed NOSTR events in v1 — one platform key for everything, or one derived key per account? How is authorship attributed?Resolved 2026-07-05: v1 NOSTR is fully custodial — one keypair per account, generated server-side on sign-up,nsecencrypted at rest, events signed with the account's own key, so public attribution is per-user. Still open: the migration path from custodial to user-owned keys in the non-custodial phase (key hand-over/export vs. fresh identity plus republish).
Goal: smallest viable browser bundle. Only what must run client-side.
| Layer | Choice | Rationale |
|---|---|---|
| Framework | Next.js 15 (App Router) | SSR, standalone Docker output, broad ecosystem |
| Language | TypeScript (strict mode) | Type safety |
| Styling | Tailwind CSS only | No CSS files, no styled-components |
| State | Zustand | Minimal boilerplate, encrypted IndexedDB persistence |
| WebAuthn / PRF | navigator.credentials.* directly, no external library |
Smallest surface |
| Crypto primitives | Web Crypto API (HKDF, PBKDF2, AES-GCM, SHA-256) | Native, audited, no dependency cost |
| secp256k1 / Schnorr | @noble/curves |
Pure TypeScript, audited, no WASM needed |
| BIP-32 / BIP-39 | @scure/bip32, @scure/bip39 |
Pure TypeScript, NIP-06-compatible |
| NOSTR event helpers | nostr-tools (encoding + signing only; no relay code) |
App uses it for event construction and NIP-19 bech32, not for relay I/O |
| Lightning | light-bolt11-decoder for invoice decoding |
LUD-16 metadata comes pre-resolved from api |
| Schema validation | zod |
API response validation |
| Icons | lucide-react |
Minimal icon set |
| Test | Vitest (unit), Playwright (e2e) | Standard |
| Lint | next lint + Prettier |
Standard |
The WebAuthn/PRF, BIP-32/39, and client-side signing rows describe the non-custodial phase. v1 already requests PRF so the app can show a recovery phrase in tab memory; API auth and server-side Nostr keys do not use it. The rest of the app crypto surface is passkey login and LNURL-pay.
Dependency philosophy: stay minimal. Target ~12 runtime dependencies. The app does UI plus — in the non-custodial phase — crypto + signing; everything else (relay I/O, indexing, discovery, anti-abuse, LN-Address resolution) is the api's job.
The workload is I/O-bound (HTTP, WebSocket, JSON) — not CPU-bound. The language choice optimizes for iteration speed, dependency sharing with the app, and operational simplicity.
| Layer | Choice | Rationale |
|---|---|---|
| Runtime | Bun ≥ 1.4.4 | Fast TS execution, built-in package manager, native HTTP server, small image |
| Language | TypeScript (strict mode) | Same language as app → shared types, mental-model symmetry |
| Framework | Hono | TypeScript-first, runs natively on Bun, tiny surface, ergonomic test ergonomics |
| Validation | zod |
Same as app; shared schemas down the line |
| NOSTR client | nostr-tools (subscriptions, encoding, signature verification; v1 additionally: key generation + server-side event signing for custodial identities) |
Same lib as the app; one mental model |
| Lightning | LUD-16 JSON resolution via fetch; LNURL-pay invoice fetch + light-bolt11-decoder for Fond payout invoices; paying stays in the Fond member's wallet |
LN node not required |
| Storage | TBD (Postgres for relational; potentially Redis for relay-event cache) | Decision deferred until indexer surface stabilizes |
| Relay endpoint | Shared wss://relay.nostr.space (PRD), wss://dev-relay.nostr.space (DEV) |
Operated as separate infrastructure; configured via env var |
| Test | Vitest + @vitest/coverage-v8 |
Explicit coverage.thresholds: { lines, branches, functions, statements: 100 } |
| Lint | ESLint (flat config) + Prettier + eslint-plugin-tsdoc |
TSDoc on every exported function enforced |
Quality bar: 100% coverage on every function (lines, branches, functions,
statements). Unreachable defensive code is exempted via v8 ignore markers
with a one-line written reason — never to silence the gate. CI is red until
thresholds are met.
GitHub organization: 21gifts (created 2026-05-25).
| Repo | Purpose | Status |
|---|---|---|
21gifts/api |
Backend service + canonical project docs (this file, ROADMAP, SPEC, etc.) | Created 2026-05-25 |
21gifts/app |
Web frontend client (21.gifts) — thin, only frontend-specific docs |
Created 2026-07-05 |
21gifts/docs |
Public developer documentation site (docs.21.gifts) |
Later |
21gifts/landing-page |
Whitepaper / manifest landing page | Later |
21gifts/marketing (private) |
Brand assets, launch material | Later |
Where docs live:
21gifts/api—CONCEPT.md(this file),SPEC.md,FLOWS.md(UI-journey sketch), futureROADMAP.md, protocol decisions, schema, architecture diagrams. The api is the brain of the system, so it owns the canonical project specification.21gifts/app—README.md(short, points at api repo for protocol),CONTRIBUTING.md(frontend-specific: dev setup, component conventions, styling, testing). Nothing protocol-level.
Per-repo conventions:
developis the default branchmainis the production branch- Feature branch → PR; feature pull requests of both app and api target
develop. No pull request targetsstagingat present. No feature pull request targetsmain. mainis protected; updates flow via an auto-generated Release PR (develop → main)- Every repo has
README.md,CONTRIBUTING.md,SECURITY.md,LICENSE - Strict linting (Prettier + ESLint)
- No
console.login committed code - Commit messages in English, concise, describe what changed
- Domain:
21.gifts(secured 2026-05-25). The21is a Bitcoin reference (21M cap);.giftssemantically captures the intent — these are gifts, not donations, not transactions - Tone: warm, direct, dignified. Not charity-speak ("the needy"; quoted Scripture excepted), not techbro-speak ("disrupting philanthropy"). People helping people, with the best money humans have ever had.
- Origin: 21.gifts comes from Christian faith. The three Convictions
above are the foundation. The public copy is
/aboutin the app: it states the convictions and quotes the verses. It does not explain who is welcome: no inclusion slogan, and no FAQ entry asking whether the project is Christian. - Signature verse: Matthew 10:8 — "Freely you have received; freely
give." It is the gift principle of the living-room rules (
/rulesin the app) in one line: a gift has no price. Shown quietly in the marketing footer; not on the hero. - Visual: minimal, photo-driven, large typography. Receiver photos and stories are the hero. Tech is invisible. No cross, fish, or second typeface as brand marks; Bitcoin orange stays the accent.
- Language: English for CONCEPT, code, commits, handbook, and api payloads. Visitor-facing app copy is localized (en, de, es, fil).
- Docker Hub organization:
21gifts(created 2026-05-25) - Image names match the repo:
21gifts/app,21gifts/api - Tag convention per image:
:beta— built fromdevelop, deployed to DEV:staging— built fromstaging, deployed to staging:latest— built frommain, deployed to PRD.:latestis an independent rebuild frommain, not a retag of:staging
- One image, multiple environments — for the app, build-time placeholders
for
NEXT_PUBLIC_*variables are replaced at container start by anentrypoint.shwith runtime values; the api reads its config purely from environment variables at startup. Same image runs DEV and PRD without rebuild.
Five GitHub Actions workflows, identical structure for app and api:
| Workflow | Trigger | Action |
|---|---|---|
ci.yaml |
PR, push to develop | Lint + build + test (required for merge) |
deploy-dev.yaml |
push to develop | Docker build → push :beta → notify infra repo |
deploy-staging.yaml |
push to staging | Docker build → push :staging → notify infra repo |
deploy-prd.yaml |
push to main | Docker build → push :latest → notify infra repo |
auto-release-pr.yaml |
push to develop or staging | Auto-create staging → develop and develop → main only. Never staging → main. |
Pre-push local checks:
app:npm run lint && npm run build && npm testapi:bun install --frozen-lockfile && bun run typecheck && bun run lint && bun run test:coverage && bun run build
CI red is unacceptable; it's caught locally.
Testing rule: new code on the activated surface (features actually shipped) must hit 100% line/branch/statement/function coverage. Feature-gated code (behind a build-time flag or a server-side capability gate) is excluded — gated code does not need coverage as long as the gate stays off in production builds.
Image-build → deploy hand-off: the product repo's deploy-*.yaml
workflow pushes the image to Docker Hub and sends a repository_dispatch
event to a separate infrastructure repository (private, not part of this
project's scope). That repo handles the actual host-level deploy, secrets,
DNS, and reverse-proxy routing.
Three environments per service. Staging is the environment for experimental testing. A change that is good there is released to develop first. main receives changes only from develop. Staging is never released directly to main. Feature pull requests of app and api target develop, never main or staging; no pull request targets staging at present. Opening pull requests against staging again (and how experimental changes reach it) is a product-owner decision that updates this section first.
| Service | Env | Source branch | Image tag | Public URL |
|---|---|---|---|---|
| app | DEV | develop |
:beta |
dev.21.gifts |
| app | PRD | main |
:latest |
21.gifts |
| api | DEV | develop |
:beta |
dev-api.21.gifts |
| api | PRD | main |
:latest |
api.21.gifts |
| app | staging | staging |
:staging |
staging.21.gifts |
| api | staging | staging |
:staging |
staging-api.21.gifts |
app.21.gifts / dev-app.21.gifts remain transitional aliases for the app
container. staging-app.21.gifts redirects to the apex staging.21.gifts.
Passkey RP ID is the apex (21.gifts / dev.21.gifts / staging.21.gifts), not the
api hostname.
Subdomain convention: dash, not dot (e.g., dev-api.21.gifts rather than
dev.api.21.gifts). staging.api.21.gifts is not a name. This keeps every subdomain at exactly one level deep,
which sidesteps the multi-level wildcard certificate problem on Cloudflare.
Public routing: behind a reverse proxy / tunnel that terminates TLS and forwards to the container's port. Specific host names, secret stores, monitoring hooks, and deploy mechanics live in the operator's separate infrastructure repository — they're intentionally not part of this project's scope.
| Date | Decision |
|---|---|
| 2026-11-28 | A fiat credit (ask in USD, CHF, EUR, or PHP with a typed amount) is funded once the amount collected in the ask currency reaches the typed amount; sats do not count (owner decision). On invoices minted from this decision on, a payer's shown fiat amount counts toward that total and toward the giver's claim only after POST /messages/:id/invoice bounded it by a stored spot quote younger than 10 minutes (FX_SPOT_MAX_AGE_MS, the shop price check's window) (at most 10 % above the exact spot value of the sats, never rounded up to a cent, so tiny gifts together cannot claim more than their sats are worth plus 10 %; above is 400). Without a usable spot the invoice fails closed (503, nothing minted), because a shown amount is never replaced later by the sats priced at another spot (docs/fiat-amounts.md); the public heart list shows only checked amounts for those invoices. An invoice minted earlier keeps the unchecked shown amount it was pinned with: it counts when it settles, also later (settlement has no age limit), and it is not priced again. |
| 2026-11-16 | A member whose daily grant is blocked by the shop-spending rule sees on the grant page what is still missing. The owner's GET /me carries funding.shopPaymentSats (their own qualifying shop payments today and yesterday UTC, whole sats) and funding.shopPaymentRequiredSats (half the daily grant, rounded up, at least 1); both are owner-only wallet data and null outside the grant program, each is null when its own read fails, and the required amount is also null without a stored USD quote or on a roster skip. |
| 2026-11-14 | Fond-queue payouts post their forum gift reply (daily grant) and their Moderators-group stipend (moderator stipend) as the Fond account (FOND_USERNAME, only when it passes canSignFondPayouts); otherwise both are skipped, never posted as 21.gifts. A welcome payout carries no post and posts no reply. The /invoices/proof path keeps the platform account. Supersedes the house-message wording of 2026-09-20 for Fond payouts. |
| 2026-11-14 | The static operator token DEBUG_TOKEN is removed. The only operator credential is a key token of the operator login with SSH keys (GET /debug/auth/challenge, POST /debug/auth; DEBUG_ALLOWED_SIGNERS_DIR and DEBUG_SIGNING_NAMESPACE; levels read < write < admin; 15 minutes). Without a loaded key login every operator-gated route answers 503 Debug is not configured; a missing or unknown bearer is 401 and a key token below the route's level 403. Staff routes that also accept an operator keep their member-session path. api_log.authKind keeps its values; debug now always carries the operator name. gifts-debug needs DEBUG_SSH_KEY and has no spend recipients command. Supersedes every earlier row that names DEBUG_TOKEN as an operator credential, including "DEBUG_TOKEN keeps working next to it" in the row below. |
| 2026-11-14 | Operators log in on the debug surface with SSH keys: GET /debug/auth/challenge issues a 60-second single-use challenge, the operator signs it with ssh-keygen -Y sign -n 21gifts-debug-<env>, and POST /debug/auth returns a 15-minute token of level read, write, or admin from three allowed-signers files (ssh-ed25519 only) read at boot. DEBUG_TOKEN keeps working next to it. DEBUG_READ_TOKEN is removed; read access is a read key token. api_log.operator names the operator of a key-token request. |
| 2026-11-14 | POST /me/wallet/counterparties, the counterparty exception of the Wallet data rule (CONTRIBUTING.md, Wallet data), names the other member of a payment the member reported as completed only when the server itself observed that Spark transfer as completed in the member's own wallet, with a single counterparty key that resolves to the other member's verified or previous wallet. Neither the other member's own report nor a member invoice the server issued names anyone. The returned fields, the exclusion of the platform account, and the privacy of every other wallet field stay as decided. Supersedes the condition in the 2026-11-13 counterparty row that the other member reported the same Spark payment id as completed or the member's report carries a member invoice the server issued for the other member. |
| 2026-11-14 | A daily grant is paid only when the member's qualifying server-verified shop payments on the payout UTC day and the day before sum to at least 50 % of that daily grant, in sats. The required sats are max(1, ceil(grantSats / 2)) with grantSats = floor(usdToMsat(grantUsd, storedSpot) / 1000); the grant USD is the live roster's decideSpendInstruction({ kind: 'daily' }) amount, and the spot is the stored FxSpotStore.latest() quote, never an external fetch. A qualifying payment keeps the existing definition (outgoing, completed, transfer, external counterparty resolving to a live top-level #21GiftsShop note with a till account, window D-1..D by COALESCE(transfer_updated_at, transfer_created_at) in UTC), and each transfer counts once even when several keys resolve to shops. Equal spending meets the rule. A missing or unusable spot, or a roster that decides a skip, fails closed as shop_payment / no_shop_payment. The daily roster's paymentsEnabled switch does not change the minimum: a pause is decided where the payout is decided, and the grant page reports it as payments_paused. A Fond gift invoice without a stored quote is refused with a retryable 503 so the queued row stays owed; a failing moderator-group lookup keeps the 1-sat minimum. Moderator stipends keep the 1-sat minimum; the welcome gift keeps its exception. |
| 2026-11-13 | In a member's own wallet history, the other side of a payment between two 21.gifts member wallets is shown by its 21.gifts username instead of a Spark address; this is a decided exception of the Wallet data rule (CONTRIBUTING.md, Wallet data). For each payment id the signed-in member sends, POST /me/wallet/counterparties returns that id with the other member's account id and username, only for a payment the member reported as completed, and only when the other member reported the same Spark payment id as completed or the member's report carries a member invoice the server issued for the other member. It never returns the platform account. Spark addresses, amounts, fees, times, invoices, and every other wallet field stay private. |
| 2026-11-13 | GET /wallets/usage is a decided wallet data exception (CONTRIBUTING.md, Wallet data). It publishes usage aggregates over all wallets for payments since the in-app wallet release at 2026-11-09 11:17 UTC, without any account, person, shop, or payment identifier; CONTRIBUTING.md states the exact grain. For shops it publishes only totals over all shops, including the daily number of till charges created and paid. Supersedes, for these totals over all shops only, the sentence of the 2026-11-12 row that till payments stay private with the shop's own GET /pos; per-shop till data stays private. |
| 2026-11-13 | The product owner decided that the welcome recipient is exactly role verified and non-platform; promoted roles are not eligible. A live welcome lease is exclusive: another canonical issue is a conflict, reservation storage failure is unavailable, and two live leases make an account merge refuse without writes. At most 128 unfinished token-owner lookups run; additional pages remain in waitingOwnerResolutions until admission. A refreshed page whose unresolved set changes restarts that lookup in place. A finished result stays cached until a later page.transactions response returns it, and is removed only then. Catch-up pings claim account/day before asynchronous work, and reclaimed Fond issuance keeps the payout row's booked D-1..D shop window. Wallet-transfer merge collisions use the newer operator update time when both rows have one (equal times keep the survivor), and the row with the time when only one has one. Only when both times are null, a completed outgoing transfer wins over a row without that shape. When both rows have that shape, the row the shop-payment check would count wins if only one qualifies: it has a creation time and a counterparty key resolving to a different account with a live top-level #21GiftsShop note. If both or neither qualify, a final state (completed, cancelled, expired, or returned) wins over pending, then the later last_seen_at wins (a tie keeps the survivor); the winner supplies every mutable field and never clears a stored operator time. |
| 2026-11-13 | Not-yet-invoiced fiat loan-share units are priced in sats from the current stored FxSpotQuote, read once per request through the existing FxSpotStore. Gift rows and their daily proportions are not a repayment pricing source. Open invoices, settled parts, frozen debt, and every other committed figure keep their stored values. A missing or failed spot read keeps the existing null / 503 unavailable behaviour; there is no fallback and no gift backfill. |
| 2026-11-13 | Members may leave the grant program on their own (POST /funding/withdraw), so that someone else can be admitted. The stored status withdrawn frees an admitted place at once and ends every payout from the moment of the write. The member sees no grant (none); staff see withdrawn. The member may apply again, without priority and without a reserved place. The daily roster and loans are not changed. Every withdrawal stays in db_change after a new application; operators list them with GET /funding/withdrawals. |
| 2026-11-13 | Wallet balances are identities, not accounts: current app reports and viewer observations carry the verified wallet key, the latest snapshot is retained per account, wallet key, and UTC day, and public totals carry each such wallet separately. Legacy null-key rows remain the account fallback while it has no visible keyed row and are not an additional wallet beside keyed rows. Account-scoped current-balance reads prefer the current verified key and use a legacy null-key app row only when that key has no row; a previous wallet can never replace the current balance. For a multi-party outgoing transfer, completion requires every receiver edge reached from that wallet's sender leaves to have SDK receiver status completed; a missing or unfinished receiver stays pending. A platform-note compose daily ping uses the payer's newest qualifying media note from today and sends nothing without one. |
| 2026-11-13 | The Spark viewer requests every transfer type and persists explicit non-secret token facts as well as Bitcoin transfers; raw token rows, signatures, commitments, secret key material, and revocation secrets never enter wallet history or db_change. Multi-party transfer direction and amount are wallet-relative leaf sums, all outgoing recipients are retained, and the same transfer id may exist once per current or previous wallet. Incremental reads run every tick and a durable daily full reread repairs late indexing and unresolved counterparties; unresolved token inputs remain in the retry cursor, every unresolved page gets one bounded owner step, timeouts retain safe viewer progress, and a full pass is not marked complete while inputs remain unresolved. Durable input-resolution counts prevent a less-resolved observation from replacing a better direction, amount, or counterparty projection. Transfer update times are compared only with transfer update times, never poll time. Paging fails safely on a repeated cursor. UTC payout-day checks do not depend on the Postgres session time zone. As a refinement of the 2026-11-12 row, the one-time welcome exemption applies only when the account is exactly verified, non-platform, and not welcomed yet, the comment is exactly Welcome, neither messageId nor groupMessageId is present, the normalized label is exactly USD 1.00, and amountMsat is no more than the server's USD 1.00 spot conversion plus the fixed 10% tolerance; a missing or unusable spot fails closed. A roster Welcome with a message id or another amount remains shop-payment-required. The Fond is a 21.gifts application, so its activity and transactions are public; GET /fond/summary is the existing surface and a public transaction list is separate work. |
| 2026-11-14 | Stored member↔Damus threads whose counterpart the inbound direct-message admission rule would not admit (no message sent by the member, counterpart not an entitled external zapper) are removed once at boot (removeUnadmittedDamusThreads), with their messages, read markers, photos, translations, conversation push rows, and invoice attempts. Threads in which the member wrote, zapper threads, and every other thread kind stay, so no stored message of an admitted counterpart is lost. The dismiss pushes for the removed threads, with the new badge count, and the app_setting run marker commit in the same transaction as the deletes; a failure rolls all of it back for the next boot. It runs only after a complete external-zapper backfill (no error, below its ceiling) and reads nostr_zapper again under a lock inside its transaction, so no zapper thread is removed for a missing or late entitlement. A removed thread's event that a relay returns again is skipped by the admission rule. |
| 2026-11-12 | Inbound direct messages (kind:4 / kind:1059) whose sender pubkey is not a 21.gifts account are stored only for a known contact of the recipient: an entitled external zapper (nostr_zapper), or a member↔Damus thread in which the member already sent a message. A blocked pubkey is skipped, and a per-pubkey and global sliding limit applies (same windows as external forum replies, its own budget). Other such messages stay on Nostr only: no thread, no row, no push. The relay query takes since = now minus three days, because NIP-59 gift wraps date created_at up to two days back; the worker also skips events older than that window itself, and an event dated more than 10 minutes ahead is left for a later pass. Member↔member and member↔platform messages are unchanged. |
| 2026-11-12 | The spend daily run now requires a live top-level photo or video posted by the member on the current UTC day and uses that same post as messageId, exactly like the grant page's payoutToday fact; an older live media post cannot make the daily run pay. |
| 2026-11-12 | The member's grant page shows one reason why today's daily grant was or was not paid. A recorded daily gift wins first, then a same-day welcome gift; that row has reason welcome only for an exactly verified non-platform recipient, while every other role and the platform account remain paid with no reason so the row still suppresses the daily payout. Otherwise the api stops at the first missing condition in this order: real-life verification (verify), admission or today's trial (admission), verified in-app wallet (wallet), the recovery share when required (recovery_share), a completed server-verified shop payment today or yesterday (shop_payment), and today's live top-level photo or video (media_post). When all conditions hold, an unrecorded payout is due, with payments_paused only when the daily roster switch is off. Store failures make the explanation unknown without failing owner JSON. funding remains null for basis, so its explanation is the top-level compatibility field grantPayoutToday; other roles receive funding.payoutToday. |
| 2026-11-12 | A member in the funding grant program receives a daily grant or moderator stipend only when the member's own wallet has a server-verified completed transfer to a 21.gifts shop on the payout UTC day or the UTC day before. A shop is the till account of a live top-level note with the #21GiftsShop hashtag token. The rule applies from deployment, with no start date, environment variable, or constant day. The one-time welcome gift is not affected. A payment stored after the member posted catches up by pinging today's media; spend still pays at most once per member and day. |
| 2026-11-12 | 21.gifts has one deployment Spark viewer key. Wallets grant its 66-hex public identity while Breez SDK Spark private mode stays on; the read-only viewer can never move funds. Its 12-word mnemonic is generated once under a Postgres advisory lock, stored only as an AES-GCM envelope under NOSTR_NSEC_KEK, and never logged or returned. The api pages current and previous wallets from the Spark operators into wallet_transfer and records viewer balance snapshots, replacing reliance on incomplete, unverifiable app reports. GET /me returns the public viewer key to grant. Admin sessions at least software_developer and operator debug access can read the wallet tables; the public cannot. |
| 2026-11-12 | The 21.gifts applications and the wallet are separate (Core Principle 9; CONTRIBUTING.md, Wallet data). Public application activity includes forum gifts, hearts, credit requests and repayments, shops, and the Fond's activity and transactions. Conversation gifts and invoices stay private with the conversation; till payments stay private with the shop's own GET /pos; a public shop application does not make its till payments public. The Fond is a 21.gifts application; GET /fond/summary is the existing surface, and a public transaction list is separate work. The wallet is private to the public and keeps Breez SDK Spark private mode on. The owner-only previous-wallet lookup returns the stored key, address and replacement time plus the public explorer soft balance or null. Every observed wallet event is stored in the api database, and the admin team (role at least software_developer) and operator debug access (DEBUG_TOKEN, DEBUG_READ_TOKEN) can read all of it. Supersedes, for the wallet tables, the sentence of the 2026-10-06 row that only the operator reads them through GET /debug/db and that no app screen or role has access; member_event is unchanged. |
| 2026-11-11 | No pull request targets staging at present; feature pull requests of app and api target develop. The staging environment and its workflows stay. This supersedes the pull-request base rules of the 2026-10-16 row. |
| 2026-11-09 | Every member chooses a whole-sat heart amount in settings (POST /me/heart-sats, default 1). Each heart click pays exactly that amount. POST /messages/:id/invoice accepts any positive whole sats for a heart and does not force it to match the stored heartSats. heartCount still counts one per paid heart, so a 21-sat heart adds 1. GET /messages/:id/replies adds hearts newest first with sender identity, the exact sat amount, the frozen invoice fiat amounts (amountUsd, amountChf, amountEur, amountPhp, or null), and the invoice time. |
| 2026-11-09 | Forum replies have their own per-account rate limit (1 per second, 30 per sliding hour, 100 per UTC day), separate from top-level notes (1 per second, 6 per sliding hour, 20 per UTC day). Members who reacted a few times in a thread were blocked by the shared 6/h cap. POST /messages and the platform-note compose fee pick the budget by whether the created note is a reply. Accounts at least software_developer (software_developer, initiator, founder) are exempt from the note, reply, gift invoice and heart limits (forumRateLimitExempt). The burst window of the post, invoice and heart limiters is 1 s; Retry-After is 1 when it refused. |
| 2026-11-05 | The grant payout condition on the 21.gifts recovery share has its own start date, RECOVERY_SHARE_REQUIRED_FROM (ISO date, UTC). Before that day the share is not required, so payouts continue while members set it up; unset or blank means not required yet, so the day can be set later without a code change; an invalid value throws at boot. The wallet requirement and the grant-program gate are unchanged. Supersedes '(1) No start date' in the 2026-10-28 row on social recovery. |
| 2026-11-11 | A loan author can end collecting at any time (POST /messages/:id/repayment/close) and repay any freely chosen amount at any time (POST /messages/:id/repayment with optional { amount } body), also ahead of schedule and on a loan that never reached 100 %. Close is final: goal_closed_at is set, a still-collecting loan gets goal_funded_at at that instant, and an early fiat close freezes the actually collected cents per giver rather than the original goal. Prepay applies the amount to unpaid remainders in plan order. A giver who cannot receive or whose wallet refuses is skipped and consumes nothing; the unused amount moves to later receivers. Paid plus open plus newly reserved parts never exceed a share: mint and settlement are serialized by one lock per message. Legacy full shares live only in message_repayment; partial shares live only in message_repayment_part, including when complete. |
| 2026-10-30 | A social recovery holder's share is kept on the api as an encrypted box under the holder's own login (docs/social-recovery.md, Held-share boxes), no longer in the app's browser storage, which a browser can delete without notice. The box is encrypted in the holder's browser under a key from the holder's own 12 words; the api stores opaque bytes (held_share_box, GET /me/held-shares, PUT /me/held-shares/:id, DELETE /me/held-shares/:id) and never learns whose share a box holds or who protects whom. Nothing on the owner's side refers to a box, holders are not notified, and the payout gate is unchanged. Accepted risk: a holder who loses their passkey for good and never recovers loses the boxes, and nobody is told. Supersedes the holder-storage statement of decision (2) in the 2026-10-28 row (shares in the app's browser storage, a share never reaching the server). |
| 2026-10-29 | Shop identity is implemented: S1, S2, S3 and S5 of docs/shop-identity.md (shop key, shop kind 0, GET /shops and GET /shops/:npub, OpenCryptoPay outbox). A public shop is a live top-level #21GiftsShop note with a till account; pin and address are optional (#512, #514). payUsername and the shop lud16 follow the till account's receiving address (verified wallet). This supersedes the listing rule and the "Not implemented" of the 2026-10-17 row. |
| 2026-10-28 | Social recovery (docs/social-recovery.md) is implemented. Two owner decisions: (1) No start date. The grant payout condition has no start date of its own. eligibleToday requires a stored 21.gifts share for the account's current verified wallet wherever the code runs: on staging at once, on production once merged to main. The owner field socialRecoverySetUp and the /welcome dialog carry no date. (2) Holders need their own account. Person 1 and person 2 need their own 21.gifts account. They hold a share only while signed in, in their app's browser storage under their own account id. There is no public holder page, and a share still never reaches the server. The key of the 21.gifts share is RECOVERY_SHARE_KEK (64 lowercase hex, required at boot with DATABASE_URL, distinct from NOSTR_NSEC_KEK). Routes POST /auth/passkey/recovery/begin, POST /auth/passkey/recovery/finish, POST /lnurlpay/:pubkey/transfer, PUT /me/recovery-share, GET /me/previous-wallets, DELETE /me/previous-wallets/:sparkPubkey; tables recovery_share, pending_recovery, previous_wallet. Supersedes 'for payouts from a start date set then' in the 2026-10-28 row on grant payouts, and the holder description 'Person 1/2, on their phone' of docs/social-recovery.md (2026-10-27 design). |
| 2026-10-28 | Social recovery (docs/social-recovery.md, not implemented) is an optional entry in the settings. For members in the grant program (an admitted grant or a trial on today's UTC day) it becomes a payout condition: once built, and for payouts from a start date set then, eligibleToday also requires a stored 21.gifts share for the account's current verified wallet; storing the share pings that day's newest media post as admitting a grant does, and a day that ends without a share is not paid, except by an operator replay, which checks eligibility when it runs. The api reads only whether such a share is stored, never its content; this refines "never uses" in the two rows below. From the release on, those members without it see a dialog on /welcome like the introduce-yourself dialog, based on the same stored-share fact as the payouts. |
| 2026-10-28 | The 21.gifts backup share of social recovery (docs/social-recovery.md, not implemented) is stored in the api database, encrypted with AES-GCM under its own key from the deployment environment, which 21.gifts also keeps in its password vault. The database alone gives no share; the database with the environment gives the 21.gifts share of every account, which is accepted because one share alone rebuilds nothing. Its column is a secret column, so db_change keeps only its SHA-256. The api never decrypts, returns or uses it. No release is planned; 21.gifts keeps the share only as an option. |
| 2026-10-27 | Social recovery is redesigned in docs/social-recovery.md and is not implemented. SLIP-39 2-of-3: two chosen people get a share each by QR code only, and 21.gifts holds a backup share that the api never uses. Any two shares act at once, in person, with no waiting period. The account keeps its id, username and Lightning address and gets a new passkey with new 12 words. The old words sign the account transfer, checked against the verified spark_pubkey; it commits when the LNURL server accepts the move of the Lightning address to the new wallet, and the old words then move the whole wallet balance. Any verified account can be recovered with its 12 words, with or without shares. No seed is stored. A completed recovery is the only path that gives an account a different recovery phrase; POST /auth/passkey/replace/* keeps refusing. Supersedes the 2026-09-29 and 2026-09-30 social-recovery rows, and, for a completed recovery only, the 2026-10-01 sentence that a verified wallet is fixed (the username stays fixed). |
| 2026-10-17 | Every listed shop (live top-level #21GiftsShop note with a pin, a till account and complete under #478) gets its own custodial NOSTR key, stored and published like an account key, page https://21.gifts/{npub}. The same public key is sent to OpenCryptoPay, which requires one per shop, uses it as the shop id and maintains no profile. The shop note stays signed by its author. Specified in docs/shop-identity.md. Not implemented. |
| 2026-10-16 | Operator DEBUG_TOKEN or DEBUG_READ_TOKEN also reads, without a session, the staff GETs GET /funding/payout-days, GET /funding/applications, GET /funding/applications/:accountId, GET /funding/daily-roster, GET /trust/proposals, GET /members/:accountId/activity, GET /messages/hidden, and GET /messages/:id/edits (isOperatorBearer; gifts-debug has one command each). Session rules for members and staff are unchanged; writes still need a session. Private member reads (/me, /conversations, /notifications, /pos) stay closed to the debug tokens. Supersedes the "not DEBUG_TOKEN" lines for these routes. |
| 2026-10-16 | GET /funding/goal also accepts the operator DEBUG_TOKEN or DEBUG_READ_TOKEN without a session, so operators read the grant goal natively (gifts-debug funding-goal). The body holds only counts. Member sessions are unchanged. Supersedes the handbook line "Not DEBUG_TOKEN" for this route. |
| 2026-10-16 | The 10-active-shop goal is reached, so the grant program reopens. Applications are open to every verified member and stay open (no pause, no username exemptions). Moderators may admit at most 10 people in round 1, counted from UTC 2026-10-16 (CURRENT_GRANT_ROUND); POST /funding/admit counts and writes atomically and answers 409 All grant places are taken when the round is full. Public GET /funding/places shows round, places, admitted, places left, and the next goal. The next round opens when 20 shops are active; its size is decided then. Supersedes the 2026-10-02 application pause. |
| 2026-10-16 | Api feature pull requests target develop, never main. An api feature pull request whose change depends on commits that are on staging but not yet in develop targets staging instead; once those commits are in develop, it is retargeted to develop, then closed and reopened so CI runs against the new base. App feature pull requests target staging unless another base was explicitly requested, and never main, as the app repository's CONTRIBUTING.md says. Developers rebase staging onto develop regularly, because pull requests that land on develop do not update staging. In the api repository, every feature pull request with base staging is merged, closed, or retargeted to develop before such a rebase; the app repository's CONTRIBUTING.md sets its own rebase rule. Supersedes the 2026-10-02 sentence that feature pull requests always target develop and never staging. |
| 2026-10-12 | A live top-level note with goalRepayable true is a credit; the author owns it; funded, unfunded, and still-live repaid notes all count; deleted notes and replies do not. Credit counts are uncapped. Lists are capped, newest by createdAt then id, and include replyCount of live attributed children. GET /members/:accountId includes creditCount; GET /members/:accountId/credits lists member credits; the public external profile includes creditCount; and GET /messages/:id/external-credits lists external credits with payable false. Credits remain in the posts list. |
| 2026-10-12 | A live top-level #21GiftsShop note belongs to its assigned shop account when set, otherwise to its author; assignment to another member removes it from the author's shops, while external shops require no member author and no shop assignment. Shop counts are uncapped. Lists are capped, newest by createdAt then id, and include replyCount of live attributed children. GET /members/:accountId includes shopCount; GET /members/:accountId/shops lists member shops; the public external profile includes shopCount; and GET /messages/:id/external-shops lists external shops with payable false. |
| 2026-10-09 | A text reply on a note the member wrote is free for every role: POST /messages with inReplyTo accepts it unpaid below verified when the caller is the parent's author, because a wallet cannot pay its own invoice. It still passes the post limiter and the Sunday rule, and it does not use the free first post. POST /messages/:id/invoice refuses a paid reply (non-empty text) on the payer's own note with 400 (attempt self_reply). This narrows the 2026-09-21 row, which made the parent author pay too; replies on someone else's note are unchanged. |
| 2026-10-08 | The country of a map pin is read from its coordinates with an offline boundary dataset (ISO 3166-1 alpha-2, territory level), never from the free-text label and never through a geocoding service. It is derived on every read and not stored, so existing pins need no backfill. GET /messages/places returns it as countryCode (null in the open sea), and GET /messages?country= lists only notes pinned in that country. The app's Shops page filters by it. |
| 2026-10-07 | POST /trust/verify requires confirmedName. The string must equal the stored account.name exactly. A null or trim-empty stored name is 409 Conflict, as is any other mismatch, including the idempotent repeat. No edge and no role change. Other trust POSTs still take only accountId. |
| 2026-10-04 | A point-of-sale charge knows when it is paid: pending, paid, cancelled, or expired, with paidAt. While a charge is open, POST /pay/:username/invoice also returns a Spark invoice for the charge amount (memo pos:<chargeId>) that a 21.gifts in-app wallet pays without a fee; other wallets pay over Lightning. A background worker marks the charge paid when that Spark invoice is finalized or a BOLT11 the api handed out for the charge settles (LUD-21 verify), first confirmation wins. The hand-written Spark status query stays; no Spark SDK. Supersedes the earlier "no paid status" for the till. |
| 2026-10-02 | Staging is the experimental test environment. A change that is good there is released to develop first. main receives changes only from develop. A release from staging directly to main is not allowed. Feature pull requests always target develop, not staging and not main. Developers rebase staging onto develop regularly, because those pull requests land on develop and do not update staging. This supersedes the release-direction sentence of 2026-10-01. |
| 2026-10-02 | POST /funding/apply writes no grant while paused. A verified or higher caller gets 403 { error: 'Applications are paused' }, except joey-rosima, vincent, and jewel-bacolbas. Those three, and every caller when applicationsPaused is false, still get 400 { error: 'About me is required' }, { error: 'About me photo is required' }, or { error: 'Location is required' }, 409 { error: 'Conflict' }, 200 { funding } (logs funding.applied), or 503 { error: 'Funding is unavailable' }. basis is 403 Forbidden. Trial, admit, reject, and the staff queue stay unchanged. The pause is not a shop-transaction count. Production omits the flag. |
| 2026-10-01 | Three environments per service. Branch staging publishes image tag :staging. The app public URL is staging.21.gifts. The api public URL is staging-api.21.gifts. staging-app.21.gifts redirects to the apex. staging.api.21.gifts is not a name. Release pull requests stay develop → main. :latest is an independent rebuild from main, not a retag of :staging. The passkey RP ID includes staging.21.gifts. |
| 2026-09-25 | A moderator can set, replace, or clear the map pin on an existing live top-level shop note (#21GiftsShop) via PATCH /messages/:id/place. Columns stay place_lat / place_lng / place_label. No Nostr republish, no text change, no notification. |
| 2026-09-24 | Signed-in language and fiat are stored on the account (locale, fiat, both nullable). Null means not defined yet: the app writes the resolved value once (onlyIfUnset). A stored value always wins over Accept-Language and the cookies. An explicit control updates the stored value. Signed-out visitors stay on the cookie and Accept-Language and write nothing. |
| 2026-05-25 | Domain 21.gifts registered (premium .gifts TLD on Identity Digital) |
| 2026-05-25 | GitHub organization 21gifts created |
| 2026-05-25 | Docker Hub organization 21gifts created |
| 2026-05-25 | Tech stack: Next.js 15 + TS strict + Tailwind + Zustand, mirroring the zkCoins-app pattern |
| 2026-05-25 | Passkey + PRF + NIP-06 derivation chosen as the key model (over PRF → HKDF → nsec direct path) |
| 2026-05-25 | No external WebAuthn library — navigator.credentials.* directly |
| 2026-05-25 | Lightning Address (LUD-16) mandatory for receivers; platform never custodies funds |
| 2026-05-25 | English-only product (no i18n in v1) |
| 2026-05-25 | Hard-fail on PRF-unsupported authenticators (no silent fallback) |
| 2026-05-25 | Multi-repo architecture: api, app, docs (later), landing-page (later), marketing (private, later) |
| 2026-05-25 | Thin-client / thick-server: app holds only keys+signing+UI; everything else (relay I/O, indexing, discovery, LN-Address resolution, anti-abuse) lives in api |
| 2026-05-25 | Backend service is named api and is built from day one — not deferred |
| 2026-05-25 | Canonical project documentation (CONCEPT, ROADMAP, SPEC) lives in 21gifts/api; the app repo carries only frontend-specific docs |
| 2026-05-25 | Backend stack: TypeScript + Bun + Hono + Vitest (revised from Rust + Axum). Workload is I/O-bound, not CPU-bound; language symmetry with the app wins |
| 2026-05-25 | NOSTR relay: shared nostr.space infra (wss://relay.nostr.space / wss://dev-relay.nostr.space). 21.gifts is a client, not an operator. Closes OQ #3 |
| 2026-05-25 | Hard 100% coverage gate (lines + branches + functions + statements) enforced via vitest.config.ts thresholds; CI red until met |
| 2026-05-25 | TSDoc on every exported symbol, enforced via eslint-plugin-tsdoc |
| 2026-07-05 | v1 account model: Basis (login + receive, default for every account) and Moderator (content moderation); donor is an upgrade, not a role |
| 2026-07-05 | v1 login: LNURL-auth (LUD-04) only — no email, no password, no passkey; linkingKey = account identifier; lockout risk explicitly accepted; auth callback host pinned to api.21.gifts / dev-api.21.gifts |
| 2026-08-22 | Auth callback host (wallet linkingKey domain) moved to the public apex 21.gifts / dev.21.gifts. Supersedes the 2026-07-05 pin to api.21.gifts. App public URL is the apex; app.21.gifts stays a transitional alias. In-memory accounts from the old host do not survive. |
| 2026-07-05 | v1 donor spending: custodial via deposited lndhub:// export, restricted to lightning.space wallets; explicit transitional deviation from Core Principles 2/5, replaced by a non-custodial setup later |
| 2026-07-05 | Recurring daily gifts are a v1 feature: server-side scheduler in the api with fail-closed payout semantics |
| 2026-07-05 | Receiver verification: micro-payment with one-time nonce in the LUD-12 comment (WoS-compatible, min 1 sat); no LUD-21 dependency (WoS lacks it) |
| 2026-07-05 | Research recorded: WoS has no official API; WoS supports LNURL-auth (Classic since 2023, Self-Custody since app v3.2.5 / 2026-02-04) |
| 2026-07-05 | v1 NOSTR events are platform-signed (users hold no keys until the non-custodial phase) — attribution details open in OQ #9 |
| 2026-07-05 | Revised same day: v1 NOSTR is fully custodial — one keypair per account, generated server-side, nsec encrypted at rest, events signed with the account's own key. Supersedes the platform-signed row above; resolves OQ #9 (migration path to user-owned keys stays open) |
| 2026-08-15 | CORS on the api allows DELETE so the browser app can unlink a Lightning Address; SPEC.md added as the HTTP contract home |
| 2026-08-15 | Receiver address verification endpoints: POST /me/lightning-address/verification and …/confirm; api pays 1 sat (or provider minSendable ≤ 10 sat) with a LUD-12 comment nonce; 503 until an invoice payer is wired (process still boots) |
| 2026-08-15 | Core UI journeys sketched in FLOWS.md (sign-in, profile, donate, recurring gifts, message). Implemented screens cite SPEC.md only; donate / recurring / message remain CONCEPT sketches with no HTTP |
| 2026-08-15 | Public GET /lightning-address resolves LUD-16 metadata (callback, min/max sendable, optional commentAllowed) with a 5-minute in-memory cache; the process still boots with no extra env. Gift invoices stay browser-side. |
| 2026-08-23 | Spend-worker invoice HTTP: POST /invoices fetches a recipient BOLT11 via LNURL-pay; POST /invoices/proof accepts the payment preimage. Paying is the external spend worker via lightning.space LNDHub — this api does not store LNDHub credentials or pay. SPEND_API_TOKEN optional (503 until set). Supersedes the 2026-07-05 in-api scheduler/LNDHub-pay decision and the 2026-08-15 “gift invoices stay browser-side” note for the spend-worker path. |
| 2026-08-24 | v1 login is passkey only; LNURL-auth (LUD-04) endpoints, QR login, and /auth/session poll removed. linkingKey remains a nullable historical column. LNURL-pay (donate / invoices / address verification) is unchanged. Supersedes the 2026-07-05 LNURL-auth-only login decision. |
| 2026-08-24 | Matching POST /invoices/proof inserts an outbound gift row when DATABASE_URL is set so GET /gifts/stats includes spend-worker payments. Insert failure logs gifts.record_failed and still returns 200. Memory boots keep a no-op recorder. |
| 2026-08-24 | Public GET /gifts?day=YYYY-MM-DD lists each outbound gift on that UTC day (time, recipient, sats/BTC/USD at that day's close). No invoices. Empty day is 200. |
| 2026-08-28 | v1 public comments ship as custodial HTTP GET/POST /messages (name snapshot, text, timestamp); kind:1 relay fan-out remains unwired. |
| 2026-08-29 | Member-forum posts are top-level kind:1 notes (not replies). GET/POST /messages include sats and payable. POST /messages/:id/invoice is a NIP-57 zap. Guest Send-a-gift is removed from the app. Worker fans out when NOSTR_PUBLISH=1. |
| 2026-08-29 | Worker indexes validated kind:9735 zap receipts onto message.sats (durable nostr_zap_receipt, LNURL provider pubkey + bolt11 amount). Kind:1 EVENT frames are published as JSON objects so relays can ACK. |
| 2026-08-29 | POST /me/lightning-address live-resolves LUD-16 and requires NIP-57 zap metadata before save (no migration of existing rows). Invoice limiter on POST /messages/:id/invoice runs only after auth, amount, payable, and KEK checks so early 400/404/401/503 do not burn quota. |
| 2026-08-29 | Forum display roles on exclusive account.role: basis | verified | moderator | founder. New passkey accounts stay basis. verified = moderator physically met the person (not lightningAddressVerified). GET/POST /messages always include live author role (missing author → basis). Operator assignment via PATCH /debug/accounts/:id (DEBUG_TOKEN). |
| 2026-08-29 | Public member forum UX is a messenger-group thread (oldest top, newest bottom above the composer). GET /messages remains the latest-200 window newest-first; clients reverse for display. |
| 2026-08-29 | Zap ingest and invoice relays always include the public list (space plus Damus / Primal / nos.lol); kind:1 public write stays gated on NOSTR_PUBLISH_PUBLIC. |
| 2026-08-29 | Zap-receipt sats UPDATE qualifies message.sats so Postgres can apply it. |
| 2026-08-30 | Web Push is self-hosted VAPID in this api (no third-party push SDK). Missing VAPID_PUBLIC_KEY / VAPID_PRIVATE_KEY → process still boots; push HTTP 503. Subscriptions bind to account.id. Outbox worker sends. Events: forum posts notify every other subscribed account (collapse tag forum); a newly indexed zap notifies the note author. iOS v1 is Home Screen (A2HS). Payloads are English { type, title, body, url, tag }. |
| 2026-09-09 | forum.post requires a non-blank Lightning Address in addition to rules + name (skip timestamps still do not satisfy). POST /messages 409 missing_requirements includes lightning-address when it is factually missing. ensureProfileMessage no-ops without LN; linking LN after a name creates the profile note. contact.post, forum.read, and forum.pay unchanged; existing message rows are not deleted. |
| 2026-09-11 | Forum UI/API lists only 21.gifts-author replies (account_id IS NOT NULL); replyCount and GET /messages/:id/replies omit unknown-npub children. The worker no longer persists inbound kind:1 replies whose pubkey is not a 21.gifts account. Existing Damus-only reply rows stay in storage but are omitted from lists/replyCount. Public GET /messages/:id of a Damus-only reply is 404; top-level Damus-only notes stay 200. No migration or soft-hide backfill. |
| 2026-09-12 | A 21.gifts-author forum reply writes a Notifications row for the parent author and enqueues one targeted Web Push (/notifications, tag forum_reply:<parentId>). The booted process always has those stores (memory or Postgres). It does not copy into the member↔member inbox. Top-level notes still broadcast. Self-replies and Damus-only parents do not notify. Failure does not fail POST /messages. |
| 2026-09-12 | Operator DEBUG_TOKEN debug reads every persisted forum row (live, soft-hidden, and replies) via GET /debug/messages and GET /debug/messages/:id; hidden JPEG/PNG/WebP bytes via GET /debug/messages/:id/photo. Soft-hide remains a public-API filter only; public GET /messages hide behaviour is unchanged. |
| 2026-09-12 | Public gift stats/day also return historical CHF/EUR/PHP (USD × Frankfurter ECB; missing fiat is null, not 503). |
| 2026-09-13 | Three convictions are canonical (CONCEPT "Convictions"): giving is a duty of every Christian; direct giving with no middleman is the best and most beautiful way; Bitcoin is the most effective money available today. Public copy is /about in the app: states the convictions, quotes the verses, no inclusion slogan. Matthew 10:8 unchanged. Principle 7: visitor UI localized (en, de, es, fil). Supersedes the 2026-05-25 English-only decision. |
| 2026-09-14 | Spend-worker payouts are ping-triggered from a new top-level POST /messages; replies do not pay. Unset SPEND_URL or SPEND_API_TOKEN skips the ping; the process still boots. |
| 2026-09-14 | Living-room post, reply, and zap notify every bell subscriber (accounts with ≥1 push_subscription) except the actor/payer. In-app kinds forum_post / forum_reply / zap. Push URLs /notifications; tags forum_post:<id>, forum_reply:<replyId>, zap:<id>. Damus-only parents still fan out. Self-reply skips only the actor. Missing pushStore is a no-op. Unique remains (recipient, type, reply_id). Supersedes the 2026-09-12 parent-author-only reply notify. |
| 2026-09-15 | In-app living-room notifications go to every account except the actor/payer. Web Push still goes only to bell subscribers (push_subscription). Missing pushStore no longer drops in-app rows when auth is set. Supersedes the 2026-09-14 in-app-only-via-subscription rule. |
| 2026-09-16 | A zap that inserts a gift-reply fans out only notifyZap (one in-app row + one Web Push), not a second forum_reply. Gift-reply row still lands in the thread. Supersedes the 2026-09-14/15 dual fan-out for that path. |
| 2026-09-16 | Stored per-account notificationLevel (all / active / mentions). Fan-out filters in-app rows and Web Push by that level (POST /me/notification-level; default all). GET /notifications lists stored rows unfiltered, including moderator_appointed. Supersedes the 2026-09-15 every-account in-app notify. |
| 2026-09-20 | GET /notifications applies the owner's notificationLevel to stored rows (same wantsNotification rules as write-time fan-out). unreadCount is matching unread. moderator_appointed always stays. Supersedes the 2026-09-16 unfiltered GET list. |
| 2026-10-01 | Level mentions is only a reply or zap on the recipient's own note, or an @username mark for that recipient. A staff or platform actor does not satisfy mentions. moderator_appointed and moderator_proposal are unchanged. Supersedes the staff half of the 2026-09-16 and 2026-09-20 mentions rule. |
| 2026-09-12 | Trust edges persist who verified whom and who proposed/confirmed/appointed a moderator. Public graph JSON is stored nodes+edges only (no synthetic links; moderator_propose is omitted). Staff POST /trust/verify, confirm-moderator, and appoint-moderator write role + edge; POST /trust/propose-moderator writes the propose edge only. Operator POST /debug/trust-edges backfills edges without changing role. PATCH /debug/accounts/:id still sets role only and does not write trust edges. |
| 2026-09-13 | Public GET /trust-chain returns founder seeds only. GET /trust-chain?around=<id> returns that chain member plus one hop of stored public edges so a thousand-person chain is loaded by click, not dumped on first paint. Supersedes the 2026-09-12 GET form (stored graph, never a first-paint dump). |
| 2026-09-16 | GET /trust-chain requires a member Bearer session (any role, including basis). Missing or invalid Bearer is 401 { "error": "Unauthorized" }. Neighborhood shape is unchanged: founder seeds on the bare GET; ?around=<id> one hop of stored public edges (moderator_propose omitted). Supersedes the 2026-09-13 public GET form. |
| 2026-09-17 | Public Trust Chain credits the proposer, not the confirmer. Projected kinds are stored verify / moderator_propose (only once the subject is a moderator) / moderator_appoint. moderator_confirm is omitted. A pending propose (subject still verified) stays private and is not a hop neighbor. Operator DELETE /debug/trust-edges removes one stored (subjectId, kind) row without changing role. Supersedes the 2026-09-12 public-graph kinds (moderator_propose omitted) and the 2026-09-16 neighborhood kinds parenthetical. |
| 2026-09-17 | Public Trust Chain picks one incoming kind per subject: the oldest eligible sibling (createdAt then id). Eligible: verify, moderator_appoint, and moderator_propose only when the subject is a moderator. First contact wins; later appoint, confirm, or propose do not replace it. A pending propose (subject still verified) stays private. Supersedes the 2026-09-17 kind-priority projection (moderator_propose if moderator, else verify, else moderator_appoint). |
| 2026-09-16 | confirm/appoint notify only the subject (moderator_appointed); Web Push url /welcome, tag moderator_appointed:<subjectId>; not a living-room fan-out; unique (recipient, type, reply_id) with reply_id = subject id; missing stores no-op; failure does not fail the trust POST. |
| 2026-09-17 | Staff Bearer GET /trust/proposals lists pending moderator_propose (verified subject, no confirm/appoint). Session GET /trust-chain still omits a pending propose; once the subject is a moderator, that propose is eligible as the public incoming edge only when it is the oldest eligible sibling. |
| 2026-09-30 | eligibleToday does not require a grant until UTC 2026-10-10 (FUNDING_REQUIRED_FROM_UTC). Until then, non-basis accounts stay eligible (passkey and living-room post still gate issue). From that day the 2026-09-20 grant matrix applies. Supersedes the date in the 2026-09-24 row (was UTC 2026-09-30). |
| 2026-10-01 | eligibleToday requires a funding grant from UTC 2026-10-01 (FUNDING_REQUIRED_FROM_UTC), not from UTC 2026-10-10. Before that UTC day, non-basis accounts stay eligible (passkey and living-room post still gate issue). From that day the 2026-09-20 grant matrix applies. Supersedes the date in the 2026-09-30 row (was UTC 2026-10-10). Six named accounts with no grant row get owner funding.dailyPayoutStoppedNotice: true; any stored grant status clears it. Admit and trial still ping today's live top-level photo or video. |
| 2026-09-24 | eligibleToday does not require a grant until UTC 2026-09-30 (FUNDING_REQUIRED_FROM_UTC). Until then, non-basis accounts stay eligible (passkey and living-room post still gate issue). From that day the 2026-09-20 grant matrix applies. Supersedes the date in the 2026-09-21 row (was UTC 2026-09-25). |
| 2026-09-21 | eligibleToday does not require a grant until UTC 2026-09-25 (FUNDING_REQUIRED_FROM_UTC). Until then, non-basis accounts stay eligible (passkey and living-room post still gate issue). From that day the 2026-09-20 grant matrix applies. Softens the 2026-09-20 spend/invoice grant cutover. |
| 2026-09-20 | Funding-program grants (funding_grant) are independent of account.role. verified remains a real-life meeting (forum badge). Moderators review posts against the three convictions. basis cannot apply; owner JSON funding is null. Status none → pending → trial (eligible only on that UTC day) or admitted (recurring) or rejected (may re-apply). Expired trial is effective pending (lazy persist). Spend ping and POST /invoices require eligibleToday; GET /invoices/eligible?address= returns { eligible }. |
| 2026-09-17 | Inbox last-read is per (account, conversation). GET /conversations adds per-row unread and list unreadCount; POST /conversations/:id/read stamps last-read. Does not copy DMs into Notifications. |
| 2026-09-17 | Inbound private messages enqueue Web Push (type: conversation, url /messages?c=<id>, tag conversation:<id>) to bell subscribers only. No in-app Notification rows for DMs. Every outbox unreadCount (forum, zap, conversation) is notification unread plus listed inbox unread. Push failure does not fail HTTP 200 or Nostr ingest. |
| 2026-09-17 | A living-room note may carry up to 10 JPEG/PNG/WebP stills. Photo 0 stays on message.photo (Damus /photo.jpg unchanged). Extras 1–9 live in message_extra_photo and are served at /messages/:id/photo/1.jpg … /photo/9.webp. Public JSON includes photoCount (0–10). POST accepts photos[] (max 10) and still accepts singular photo. Video stays exclusive (poster = photo 0, no extras). |
| 2026-09-18 | External NOSTR identities become visible on the website only after a verified zap of at least 1 sat on a 21.gifts forum note; the protocol remains open. The zap creates an external gift-reply on an eligible top-level note and permanently entitles that pubkey's kind:1 replies. Staff hiding an external row blocks the pubkey and hides its other live rows. Public JSON marks these rows with via: "nostr" and never exposes the pubkey. Supersedes the 2026-09-11 rule that all unknown-pubkey replies are omitted. |
| 2026-09-20 | Roles are a strict hierarchy founder > moderator > verified > basis; every permission is a minimum role (roleAtLeast), and text names only that minimum role. The closed Moderators group follows the same rule. |
| 2026-09-20 | Staff DELETE /messages/:id still only soft-hides on 21.gifts, then best-effort publishes NIP-09 kind: 5 (author nsec, durability relay plus Damus/Primal/nos.lol, not gated on NOSTR_PUBLISH*) and purges cached public photo/video URLs at Cloudflare when CLOUDFLARE_ZONE_ID + CLOUDFLARE_API_TOKEN are set. Failure still 204. Debug restore does not undelete Nostr. Supersedes the 2026-09-12 “soft-hide remains a public-API filter only” note. |
| 2026-09-20 | Staff GET of a soft-hidden forum note returns who hid it and when. Hide retracts in-app notifications for the note and its direct children. GET /notifications drops leftover hidden forum_post / forum_reply rows (zap still checks only the parent because replyId is a receipt UUID). |
| 2026-09-20 | Official platform account (isPlatform) never fans out living-room forum_post / forum_reply / zap (in-app or Web Push). House daily gift-replies still persist. Supersedes the 2026-09-14/15/16 living-room fan-out for the platform actor only. |
| 2026-09-20 | Moderators-group Web Push (type: conversation) opens /moderate/group (the staff-room thread). Member DM push stays /messages?c=<id>; forum/zap stay /notifications. Tag remains conversation:<id>. No in-app Notification rows; GET /conversations still omits moderator_group. Supersedes only the staff-room URL in the 2026-09-17 conversation-push row. |
| 2026-09-20 | A paid moderator stipend appears in the closed Moderators group as a house ("21.gifts") message carrying the paid sats, after the triggering group message, at payment time. Spend pings { address, kind: "moderator", groupMessageId }; proof attaches that row. A missing or mismatched group reference never blocks the payout. |
| 2026-09-20 | Passkey authenticate/register finish and operator debug session mint refuse an account whose stored sessionRefused flag is true: HTTP 403 with the wrong-account error and no bearer. GET /me with an already-minted token for that row is the same 403 so the client can sign the visitor out. Other authenticated routes treat that token as missing (401). Operators set the flag with PATCH /debug/accounts/:id. The account row is not deleted. Supersedes the same-day listed-id copy of this row. |
| 2026-09-20 | A paid moderator stipend in the closed Moderators group carries a durable gift_for_message_id / public giftFor link to the group message that triggered it, so the app can render the stipend row attached under that message. Absent or null on every other conversation row. |
| 2026-09-21 | GET /conversations (and other public conversation list rows) include per-row unreadMessageCount (inbound messages strictly after last-read; 0 when none). unread stays unreadMessageCount > 0. Envelope unreadCount remains the number of listed unread threads (menu/PWA badge). Gift-only inbound counts; outbound does not. |
| 2026-09-20 | Staff may reject an open moderator proposal. Reject is append-only moderator_reject (role stays verified). Re-propose after reject inserts a new moderator_propose (history kept). Pending = latest propose/reject is propose, subject still verified, no confirm/appoint. Unique live kinds are verify/confirm/appoint only (propose/reject may repeat). An open proposal fans out in-app moderator_proposal plus Web Push to other staff until confirm/reject; mark-read does not dismiss it. Supersedes the 2026-09-17 pending-propose list row (pending was any propose without confirm/appoint). |
| 2026-09-21 | Optional GET /messages?hashtag= token filter on live top-level text (name without #; token match; combines with mode/limit/cursor). No new entity, table, or index. A shops page of 20 is 20 matching notes, not 20 mixed notes filtered later. |
| 2026-09-21 | Basis accounts pay 1 sat to 21.gifts before they can post or reply (GET /messages/compose-target then invoice the platform profile note). Unpaid POST /messages is 403 for anyone below verified, including the parent author. Verified, moderator, and founder stay unpaid-write exempt. Extra gifts on someone else’s note still pay that author. The worker always queries that profile note’s event id even after it ages out of listLatest. Supersedes the Roles table line that only mentioned unpaid replies for Verified. |
| 2026-09-21 | JPEG/PNG/WebP stills (max 10, photo-only send) on every private conversation kind (Direct, Contact, Damus, Moderators group). Bytes stay on authenticated GET photo routes (Cache-Control: private, no-store). Photo-bearing rows skip Nostr (nostrPublishState: skipped); text-only Direct/Contact/Damus stay pending. Spend ping stays moderator_group only. |
| 2026-09-21 | Propose/confirm/reject re-list after insert so a concurrent older propose, a concurrent reject, or a concurrent confirm/appoint cannot leave two live outcomes. The public graph projects at most one incoming edge per subject (winning id), skipping non-chain oldest siblings. |
| 2026-09-21 | Propose/confirm/reject re-list after insert so a concurrent older propose, a concurrent reject, or a concurrent confirm/appoint cannot leave two live outcomes. Confirm and reject compare the pending propose by edge id (same-actor same-ms re-propose is a different row). After propose notify, re-list and drop or refresh moderator_proposal rows when that insert is no longer pending. The public graph projects at most one incoming edge per subject (winning id), skipping non-chain oldest siblings. |
| 2026-09-21 | Optional GET /messages?hashtag= token filter on live top-level text (name without #; token match; combines with mode/limit/cursor). No new entity, table, or index. A shops page of 20 is 20 matching notes, not 20 mixed notes filtered later. |
| 2026-09-21 | Propose/confirm/reject re-list after insert so a concurrent older propose, a concurrent reject, or a concurrent confirm/appoint cannot leave two live outcomes. Confirm and reject compare the pending propose by edge id (same-actor same-ms re-propose is a different row). After propose notify, re-list and drop or refresh moderator_proposal rows when that insert is no longer pending. The public graph projects at most one incoming edge per subject (winning id), skipping non-chain oldest siblings. Supersedes the 2026-09-17 “one incoming kind” / first-contact-wins row. |
| 2026-09-24 | Initiator ranks above moderator; permissions still name the minimum rank only. Supersedes the 2026-09-20 strict total order founder > moderator > verified > basis. |
| 2026-10-01 | A member may bind the public key of the self-custodial in-app wallet to the account (PUT /me/wallet). A self-hosted LNURL server behind this api serves username@<domain> for that wallet. A registration the LNURL server accepts is the proof of the key. The wallet key can be replaced until it is verified; from then on the wallet and the username of the account are fixed. External Lightning addresses keep working. Off unless LNURL_SERVER_URL and PUBLIC_BASE_URL resolve. |
| 2026-10-02 | An account has one receiving address: with a verified wallet and the LNURL server configured, the wallet-backed username@<domain>, resolved inside the deployment; otherwise the linked Lightning address. Nostr lud16 follows it. Payments between members are free: next to the zap invoice the api issues a Spark invoice to the recipient's wallet, and once the Spark operators report it finalized it signs the zap receipt with the member's receipt key and feeds it into the receipt ingest. Gifts are still credited only from zap receipts, once per payment hash. Off unless the settings in SPEC (Free in-app payments) resolve. |
| 2026-10-02 | Every member receives only on the in-app wallet at <username>@<host of PUBLIC_BASE_URL>. Linking an external Lightning address is removed, with no fallback and no transition mode. A member without a verified wallet cannot receive and cannot post. Funds stay self-custodial and recoverable with the 12 words in any compatible wallet; the @21.gifts address does not survive the service. The stored lightning_address column and its data stay for rollback and a later data step. Supersedes the external-address fallback of the 2026-10-01 and the earlier 2026-10-02 rows, the 2026-08-15 address verification and unlink, the 2026-08-29 link-time NIP-57 probe, and the 2026-09-09 Lightning Address posting requirement (now a verified wallet). The welcome gift is once per account, not once per address, so a member whose receiving address changed is not paid twice. |
| Date | Decision |
| --- | --- |
| 2026-05-25 | Domain 21.gifts registered (premium .gifts TLD on Identity Digital) |
| 2026-05-25 | GitHub organization 21gifts created |
| 2026-05-25 | Docker Hub organization 21gifts created |
| 2026-05-25 | Tech stack: Next.js 15 + TS strict + Tailwind + Zustand, mirroring the zkCoins-app pattern |
| 2026-05-25 | Passkey + PRF + NIP-06 derivation chosen as the key model (over PRF → HKDF → nsec direct path) |
| 2026-05-25 | No external WebAuthn library — navigator.credentials.* directly |
| 2026-05-25 | Lightning Address (LUD-16) mandatory for receivers; platform never custodies funds |
| 2026-05-25 | English-only product (no i18n in v1) |
| 2026-05-25 | Hard-fail on PRF-unsupported authenticators (no silent fallback) |
| 2026-05-25 | Multi-repo architecture: api, app, docs (later), landing-page (later), marketing (private, later) |
| 2026-05-25 | Thin-client / thick-server: app holds only keys+signing+UI; everything else (relay I/O, indexing, discovery, LN-Address resolution, anti-abuse) lives in api |
| 2026-05-25 | Backend service is named api and is built from day one — not deferred |
| 2026-05-25 | Canonical project documentation (CONCEPT, ROADMAP, SPEC) lives in 21gifts/api; the app repo carries only frontend-specific docs |
| 2026-05-25 | Backend stack: TypeScript + Bun + Hono + Vitest (revised from Rust + Axum). Workload is I/O-bound, not CPU-bound; language symmetry with the app wins |
| 2026-05-25 | NOSTR relay: shared nostr.space infra (wss://relay.nostr.space / wss://dev-relay.nostr.space). 21.gifts is a client, not an operator. Closes OQ #3 |
| 2026-05-25 | Hard 100% coverage gate (lines + branches + functions + statements) enforced via vitest.config.ts thresholds; CI red until met |
| 2026-05-25 | TSDoc on every exported symbol, enforced via eslint-plugin-tsdoc |
| 2026-07-05 | v1 account model: Basis (login + receive, default for every account) and Moderator (content moderation); donor is an upgrade, not a role |
| 2026-07-05 | v1 login: LNURL-auth (LUD-04) only — no email, no password, no passkey; linkingKey = account identifier; lockout risk explicitly accepted; auth callback host pinned to api.21.gifts / dev-api.21.gifts |
| 2026-08-22 | Auth callback host (wallet linkingKey domain) moved to the public apex 21.gifts / dev.21.gifts. Supersedes the 2026-07-05 pin to api.21.gifts. App public URL is the apex; app.21.gifts stays a transitional alias. In-memory accounts from the old host do not survive. |
| 2026-07-05 | v1 donor spending: custodial via deposited lndhub:// export, restricted to lightning.space wallets; explicit transitional deviation from Core Principles 2/5, replaced by a non-custodial setup later |
| 2026-07-05 | Recurring daily gifts are a v1 feature: server-side scheduler in the api with fail-closed payout semantics |
| 2026-07-05 | Receiver verification: micro-payment with one-time nonce in the LUD-12 comment (WoS-compatible, min 1 sat); no LUD-21 dependency (WoS lacks it) |
| 2026-07-05 | Research recorded: WoS has no official API; WoS supports LNURL-auth (Classic since 2023, Self-Custody since app v3.2.5 / 2026-02-04) |
| 2026-07-05 | v1 NOSTR events are platform-signed (users hold no keys until the non-custodial phase) — attribution details open in OQ #9 |
| 2026-07-05 | Revised same day: v1 NOSTR is fully custodial — one keypair per account, generated server-side, nsec encrypted at rest, events signed with the account's own key. Supersedes the platform-signed row above; resolves OQ #9 (migration path to user-owned keys stays open) |
| 2026-08-15 | CORS on the api allows DELETE so the browser app can unlink a Lightning Address; SPEC.md added as the HTTP contract home |
| 2026-08-15 | Receiver address verification endpoints: POST /me/lightning-address/verification and …/confirm; api pays 1 sat (or provider minSendable ≤ 10 sat) with a LUD-12 comment nonce; 503 until an invoice payer is wired (process still boots) |
| 2026-08-15 | Core UI journeys sketched in FLOWS.md (sign-in, profile, donate, recurring gifts, message). Implemented screens cite SPEC.md only; donate / recurring / message remain CONCEPT sketches with no HTTP |
| 2026-08-15 | Public GET /lightning-address resolves LUD-16 metadata (callback, min/max sendable, optional commentAllowed) with a 5-minute in-memory cache; the process still boots with no extra env. Gift invoices stay browser-side. |
| 2026-08-23 | Spend-worker invoice HTTP: POST /invoices fetches a recipient BOLT11 via LNURL-pay; POST /invoices/proof accepts the payment preimage. Paying is the external spend worker via lightning.space LNDHub — this api does not store LNDHub credentials or pay. SPEND_API_TOKEN optional (503 until set). Supersedes the 2026-07-05 in-api scheduler/LNDHub-pay decision and the 2026-08-15 “gift invoices stay browser-side” note for the spend-worker path. |
| 2026-08-24 | v1 login is passkey only; LNURL-auth (LUD-04) endpoints, QR login, and /auth/session poll removed. linkingKey remains a nullable historical column. LNURL-pay (donate / invoices / address verification) is unchanged. Supersedes the 2026-07-05 LNURL-auth-only login decision. |
| 2026-08-24 | Matching POST /invoices/proof inserts an outbound gift row when DATABASE_URL is set so GET /gifts/stats includes spend-worker payments. Insert failure logs gifts.record_failed and still returns 200. Memory boots keep a no-op recorder. |
| 2026-08-24 | Public GET /gifts?day=YYYY-MM-DD lists each outbound gift on that UTC day (time, recipient, sats/BTC/USD at that day's close). No invoices. Empty day is 200. |
| 2026-08-28 | v1 public comments ship as custodial HTTP GET/POST /messages (name snapshot, text, timestamp); kind:1 relay fan-out remains unwired. |
| 2026-08-29 | Member-forum posts are top-level kind:1 notes (not replies). GET/POST /messages include sats and payable. POST /messages/:id/invoice is a NIP-57 zap. Guest Send-a-gift is removed from the app. Worker fans out when NOSTR_PUBLISH=1. |
| 2026-08-29 | Worker indexes validated kind:9735 zap receipts onto message.sats (durable nostr_zap_receipt, LNURL provider pubkey + bolt11 amount). Kind:1 EVENT frames are published as JSON objects so relays can ACK. |
| 2026-08-29 | POST /me/lightning-address live-resolves LUD-16 and requires NIP-57 zap metadata before save (no migration of existing rows). Invoice limiter on POST /messages/:id/invoice runs only after auth, amount, payable, and KEK checks so early 400/404/401/503 do not burn quota. |
| 2026-08-29 | Forum display roles on exclusive account.role: basis | verified | moderator | founder. New passkey accounts stay basis. verified = moderator physically met the person (not lightningAddressVerified). GET/POST /messages always include live author role (missing author → basis). Operator assignment via PATCH /debug/accounts/:id (DEBUG_TOKEN). |
| 2026-08-29 | Public member forum UX is a messenger-group thread (oldest top, newest bottom above the composer). GET /messages remains the latest-200 window newest-first; clients reverse for display. |
| 2026-08-29 | Zap ingest and invoice relays always include the public list (space plus Damus / Primal / nos.lol); kind:1 public write stays gated on NOSTR_PUBLISH_PUBLIC. |
| 2026-08-29 | Zap-receipt sats UPDATE qualifies message.sats so Postgres can apply it. |
| 2026-08-30 | Web Push is self-hosted VAPID in this api (no third-party push SDK). Missing VAPID_PUBLIC_KEY / VAPID_PRIVATE_KEY → process still boots; push HTTP 503. Subscriptions bind to account.id. Outbox worker sends. Events: forum posts notify every other subscribed account (collapse tag forum); a newly indexed zap notifies the note author. iOS v1 is Home Screen (A2HS). Payloads are English { type, title, body, url, tag }. |
| 2026-09-09 | forum.post requires a non-blank Lightning Address in addition to rules + name (skip timestamps still do not satisfy). POST /messages 409 missing_requirements includes lightning-address when it is factually missing. ensureProfileMessage no-ops without LN; linking LN after a name creates the profile note. contact.post, forum.read, and forum.pay unchanged; existing message rows are not deleted. |
| 2026-09-11 | Forum UI/API lists only 21.gifts-author replies (account_id IS NOT NULL); replyCount and GET /messages/:id/replies omit unknown-npub children. The worker no longer persists inbound kind:1 replies whose pubkey is not a 21.gifts account. Existing Damus-only reply rows stay in storage but are omitted from lists/replyCount. Public GET /messages/:id of a Damus-only reply is 404; top-level Damus-only notes stay 200. No migration or soft-hide backfill. |
| 2026-09-12 | A 21.gifts-author forum reply writes a Notifications row for the parent author and enqueues one targeted Web Push (/notifications, tag forum_reply:<parentId>). The booted process always has those stores (memory or Postgres). It does not copy into the member↔member inbox. Top-level notes still broadcast. Self-replies and Damus-only parents do not notify. Failure does not fail POST /messages. |
| 2026-09-12 | Operator DEBUG_TOKEN debug reads every persisted forum row (live, soft-hidden, and replies) via GET /debug/messages and GET /debug/messages/:id; hidden JPEG/PNG/WebP bytes via GET /debug/messages/:id/photo. Soft-hide remains a public-API filter only; public GET /messages hide behaviour is unchanged. |
| 2026-09-12 | Public gift stats/day also return historical CHF/EUR/PHP (USD × Frankfurter ECB; missing fiat is null, not 503). |
| 2026-09-13 | Three convictions are canonical (CONCEPT "Convictions"): giving is a duty of every Christian; direct giving with no middleman is the best and most beautiful way; Bitcoin is the most effective money available today. Public copy is /about in the app: states the convictions, quotes the verses, no inclusion slogan. Matthew 10:8 unchanged. Principle 7: visitor UI localized (en, de, es, fil). Supersedes the 2026-05-25 English-only decision. |
| 2026-09-14 | Spend-worker payouts are ping-triggered from a new top-level POST /messages; replies do not pay. Unset SPEND_URL or SPEND_API_TOKEN skips the ping; the process still boots. |
| 2026-09-14 | Living-room post, reply, and zap notify every bell subscriber (accounts with ≥1 push_subscription) except the actor/payer. In-app kinds forum_post / forum_reply / zap. Push URLs /notifications; tags forum_post:<id>, forum_reply:<replyId>, zap:<id>. Damus-only parents still fan out. Self-reply skips only the actor. Missing pushStore is a no-op. Unique remains (recipient, type, reply_id). Supersedes the 2026-09-12 parent-author-only reply notify. |
| 2026-09-15 | In-app living-room notifications go to every account except the actor/payer. Web Push still goes only to bell subscribers (push_subscription). Missing pushStore no longer drops in-app rows when auth is set. Supersedes the 2026-09-14 in-app-only-via-subscription rule. |
| 2026-09-16 | A zap that inserts a gift-reply fans out only notifyZap (one in-app row + one Web Push), not a second forum_reply. Gift-reply row still lands in the thread. Supersedes the 2026-09-14/15 dual fan-out for that path. |
| 2026-09-16 | Stored per-account notificationLevel (all / active / mentions). Fan-out filters in-app rows and Web Push by that level (POST /me/notification-level; default all). GET /notifications lists stored rows unfiltered, including moderator_appointed. Supersedes the 2026-09-15 every-account in-app notify. |
| 2026-09-20 | GET /notifications applies the owner's notificationLevel to stored rows (same wantsNotification rules as write-time fan-out). unreadCount is matching unread. moderator_appointed always stays. Supersedes the 2026-09-16 unfiltered GET list. |
| 2026-10-01 | Level mentions is only a reply or zap on the recipient's own note, or an @username mark for that recipient. A staff or platform actor does not satisfy mentions. moderator_appointed and moderator_proposal are unchanged. Supersedes the staff half of the 2026-09-16 and 2026-09-20 mentions rule. |
| 2026-09-12 | Trust edges persist who verified whom and who proposed/confirmed/appointed a moderator. Public graph JSON is stored nodes+edges only (no synthetic links; moderator_propose is omitted). Staff POST /trust/verify, confirm-moderator, and appoint-moderator write role + edge; POST /trust/propose-moderator writes the propose edge only. Operator POST /debug/trust-edges backfills edges without changing role. PATCH /debug/accounts/:id still sets role only and does not write trust edges. |
| 2026-09-13 | Public GET /trust-chain returns founder seeds only. GET /trust-chain?around=<id> returns that chain member plus one hop of stored public edges so a thousand-person chain is loaded by click, not dumped on first paint. Supersedes the 2026-09-12 GET form (stored graph, never a first-paint dump). |
| 2026-09-16 | GET /trust-chain requires a member Bearer session (any role, including basis). Missing or invalid Bearer is 401 { "error": "Unauthorized" }. Neighborhood shape is unchanged: founder seeds on the bare GET; ?around=<id> one hop of stored public edges (moderator_propose omitted). Supersedes the 2026-09-13 public GET form. |
| 2026-09-17 | Public Trust Chain credits the proposer, not the confirmer. Projected kinds are stored verify / moderator_propose (only once the subject is a moderator) / moderator_appoint. moderator_confirm is omitted. A pending propose (subject still verified) stays private and is not a hop neighbor. Operator DELETE /debug/trust-edges removes one stored (subjectId, kind) row without changing role. Supersedes the 2026-09-12 public-graph kinds (moderator_propose omitted) and the 2026-09-16 neighborhood kinds parenthetical. |
| 2026-09-17 | Public Trust Chain picks one incoming kind per subject: the oldest eligible sibling (createdAt then id). Eligible: verify, moderator_appoint, and moderator_propose only when the subject is a moderator. First contact wins; later appoint, confirm, or propose do not replace it. A pending propose (subject still verified) stays private. Supersedes the 2026-09-17 kind-priority projection (moderator_propose if moderator, else verify, else moderator_appoint). |
| 2026-09-16 | confirm/appoint notify only the subject (moderator_appointed); Web Push url /welcome, tag moderator_appointed:<subjectId>; not a living-room fan-out; unique (recipient, type, reply_id) with reply_id = subject id; missing stores no-op; failure does not fail the trust POST. |
| 2026-09-17 | Staff Bearer GET /trust/proposals lists pending moderator_propose (verified subject, no confirm/appoint). Session GET /trust-chain still omits a pending propose; once the subject is a moderator, that propose is eligible as the public incoming edge only when it is the oldest eligible sibling. |
| 2026-09-30 | eligibleToday does not require a grant until UTC 2026-10-10 (FUNDING_REQUIRED_FROM_UTC). Until then, non-basis accounts stay eligible (passkey and living-room post still gate issue). From that day the 2026-09-20 grant matrix applies. Supersedes the date in the 2026-09-24 row (was UTC 2026-09-30). |
| 2026-10-01 | eligibleToday requires a funding grant from UTC 2026-10-01 (FUNDING_REQUIRED_FROM_UTC), not from UTC 2026-10-10. Before that UTC day, non-basis accounts stay eligible (passkey and living-room post still gate issue). From that day the 2026-09-20 grant matrix applies. Supersedes the date in the 2026-09-30 row (was UTC 2026-10-10). Six named accounts with no grant row get owner funding.dailyPayoutStoppedNotice: true; any stored grant status clears it. Admit and trial still ping today's live top-level photo or video. |
| 2026-09-24 | eligibleToday does not require a grant until UTC 2026-09-30 (FUNDING_REQUIRED_FROM_UTC). Until then, non-basis accounts stay eligible (passkey and living-room post still gate issue). From that day the 2026-09-20 grant matrix applies. Supersedes the date in the 2026-09-21 row (was UTC 2026-09-25). |
| 2026-09-21 | eligibleToday does not require a grant until UTC 2026-09-25 (FUNDING_REQUIRED_FROM_UTC). Until then, non-basis accounts stay eligible (passkey and living-room post still gate issue). From that day the 2026-09-20 grant matrix applies. Softens the 2026-09-20 spend/invoice grant cutover. |
| 2026-09-20 | Funding-program grants (funding_grant) are independent of account.role. verified remains a real-life meeting (forum badge). Moderators review posts against the three convictions. basis cannot apply; owner JSON funding is null. Status none → pending → trial (eligible only on that UTC day) or admitted (recurring) or rejected (may re-apply). Expired trial is effective pending (lazy persist). Spend ping and POST /invoices require eligibleToday; GET /invoices/eligible?address= returns { eligible }. |
| 2026-09-17 | Inbox last-read is per (account, conversation). GET /conversations adds per-row unread and list unreadCount; POST /conversations/:id/read stamps last-read. Does not copy DMs into Notifications. |
| 2026-09-17 | Inbound private messages enqueue Web Push (type: conversation, url /messages?c=<id>, tag conversation:<id>) to bell subscribers only. No in-app Notification rows for DMs. Every outbox unreadCount (forum, zap, conversation) is notification unread plus listed inbox unread. Push failure does not fail HTTP 200 or Nostr ingest. |
| 2026-09-17 | A living-room note may carry up to 10 JPEG/PNG/WebP stills. Photo 0 stays on message.photo (Damus /photo.jpg unchanged). Extras 1–9 live in message_extra_photo and are served at /messages/:id/photo/1.jpg … /photo/9.webp. Public JSON includes photoCount (0–10). POST accepts photos[] (max 10) and still accepts singular photo. Video stays exclusive (poster = photo 0, no extras). |
| 2026-09-18 | External NOSTR identities become visible on the website only after a verified zap of at least 1 sat on a 21.gifts forum note; the protocol remains open. The zap creates an external gift-reply on an eligible top-level note and permanently entitles that pubkey's kind:1 replies. Staff hiding an external row blocks the pubkey and hides its other live rows. Public JSON marks these rows with via: "nostr" and never exposes the pubkey. Supersedes the 2026-09-11 rule that all unknown-pubkey replies are omitted. |
| 2026-09-20 | Roles are a strict hierarchy founder > moderator > verified > basis; every permission is a minimum role (roleAtLeast), and text names only that minimum role. The closed Moderators group follows the same rule. |
| 2026-09-20 | Staff DELETE /messages/:id still only soft-hides on 21.gifts, then best-effort publishes NIP-09 kind: 5 (author nsec, durability relay plus Damus/Primal/nos.lol, not gated on NOSTR_PUBLISH*) and purges cached public photo/video URLs at Cloudflare when CLOUDFLARE_ZONE_ID + CLOUDFLARE_API_TOKEN are set. Failure still 204. Debug restore does not undelete Nostr. Supersedes the 2026-09-12 “soft-hide remains a public-API filter only” note. |
| 2026-09-20 | Staff GET of a soft-hidden forum note returns who hid it and when. Hide retracts in-app notifications for the note and its direct children. GET /notifications drops leftover hidden forum_post / forum_reply rows (zap still checks only the parent because replyId is a receipt UUID). |
| 2026-09-20 | Official platform account (isPlatform) never fans out living-room forum_post / forum_reply / zap (in-app or Web Push). House daily gift-replies still persist. Supersedes the 2026-09-14/15/16 living-room fan-out for the platform actor only. |
| 2026-09-20 | Moderators-group Web Push (type: conversation) opens /moderate/group (the staff-room thread). Member DM push stays /messages?c=<id>; forum/zap stay /notifications. Tag remains conversation:<id>. No in-app Notification rows; GET /conversations still omits moderator_group. Supersedes only the staff-room URL in the 2026-09-17 conversation-push row. |
| 2026-09-20 | A paid moderator stipend appears in the closed Moderators group as a house ("21.gifts") message carrying the paid sats, after the triggering group message, at payment time. Spend pings { address, kind: "moderator", groupMessageId }; proof attaches that row. A missing or mismatched group reference never blocks the payout. |
| 2026-09-20 | Passkey authenticate/register finish and operator debug session mint refuse an account whose stored sessionRefused flag is true: HTTP 403 with the wrong-account error and no bearer. GET /me with an already-minted token for that row is the same 403 so the client can sign the visitor out. Other authenticated routes treat that token as missing (401). Operators set the flag with PATCH /debug/accounts/:id. The account row is not deleted. Supersedes the same-day listed-id copy of this row. |
| 2026-09-20 | A paid moderator stipend in the closed Moderators group carries a durable gift_for_message_id / public giftFor link to the group message that triggered it, so the app can render the stipend row attached under that message. Absent or null on every other conversation row. |
| 2026-09-21 | GET /conversations (and other public conversation list rows) include per-row unreadMessageCount (inbound messages strictly after last-read; 0 when none). unread stays unreadMessageCount > 0. Envelope unreadCount remains the number of listed unread threads (menu/PWA badge). Gift-only inbound counts; outbound does not. |
| 2026-09-20 | Staff may reject an open moderator proposal. Reject is append-only moderator_reject (role stays verified). Re-propose after reject inserts a new moderator_propose (history kept). Pending = latest propose/reject is propose, subject still verified, no confirm/appoint. Unique live kinds are verify/confirm/appoint only (propose/reject may repeat). An open proposal fans out in-app moderator_proposal plus Web Push to other staff until confirm, until reject when pending is then empty, or until appoint; mark-read does not dismiss it. Supersedes the 2026-09-17 pending-propose list row (pending was any propose without confirm/appoint). |
| 2026-09-21 | Optional GET /messages?hashtag= token filter on live top-level text (name without #; token match; combines with mode/limit/cursor). No new entity, table, or index. A shops page of 20 is 20 matching notes, not 20 mixed notes filtered later. |
| 2026-09-21 | Propose/confirm/reject re-list after insert so a concurrent older propose, a concurrent reject, or a concurrent confirm/appoint cannot leave two live outcomes. Confirm and reject compare the pending propose by edge id (same-actor same-ms re-propose is a different row). After propose notify, re-list and drop or refresh moderator_proposal rows when that insert is no longer pending. The public graph projects at most one incoming edge per subject (winning id), skipping non-chain oldest siblings. Supersedes the 2026-09-17 “one incoming kind” / first-contact-wins row. |
| 2026-09-22 | Payments store USD/CHF/EUR/PHP at payment time. A USD stipend keeps the USD amount that was sent. |
| 2026-09-22 | A top-level forum note may store an optional place pin (latitude, longitude, label at most 80 characters). Replies cannot. Public JSON includes place only when set. GET /messages/places lists live top-level pins for a map. The label is not a kind:1 hashtag and is not the profile location. |
| 2026-09-24 | Initiator ranks above moderator; permissions still name the minimum rank only. Supersedes the 2026-09-20 strict total order founder > moderator > verified > basis. |
| 2026-09-29 | Social recovery of the user-held seed is specified in docs/social-recovery.md and is not implemented. Guardians hold SLIP-39 shares of the frozen mnemonic-v1 entropy. They do not hold the passkey. The api must not be the source of the public keys those shares are encrypted to. Custodial nsecs are out of scope. |
| 2026-09-30 | Mein Konto absichern is optional. The account works without it. An owner who continues is told what social recovery does, then chooses two people. Both are required to open the same account on a new device and restore the same 12 seed words. If a moderator verified the owner, that person is suggested as person 1 and can be replaced. 21.gifts does not hold a share. Specified in docs/social-recovery.md. Not implemented. Supersedes the 2026-09-29 social-recovery row. |
| 2026-10-01 | A shop's OpenCryptoPay QR stays the same link. USDT or USDC paid through it settles as bitcoin on the shop's own Breez Spark wallet. The shop does not hold USDT or USDC. The till is paid only when those sats have arrived. The wallet seed is the 12-word phrase the app already derives (mnemonicFromPrfFirst); the api already records that seed passkey (POST /auth/passkey/seed/begin and /finish). Specified in docs/shop-spark-payment.md. Not implemented. Today's Lightning pay link is unchanged. |
| 2026-10-13 | A shop payment in USDT or USDC is specified in docs/shop-spark-payment.md and is not implemented. None of its routes are mounted, and SPEC.md does not list them. Orchestra pays the BOLT11 stored on the quote it accepted. The invoice is minted once by the same mint POST /pay/:username/invoice already uses, on the shop's verified in-app wallet. The public invoice route does not select one page payment when several are open for the same amount. The shop does not hold USDT or USDC. The payment does not deliver to a stored Spark address. The till's existing Spark invoice and GET /pos response are unchanged. While a shop payment for a charge is accepted, the same paid watcher keeps watching the BOLT11 stored on that proof's quote until it settles or Orchestra reports the order refunded or failed. A Spark invoice, or another BOLT11 handed out for that charge, that has already marked the charge paid does not stop that watch and does not mark the shop payment paid. That longer watch is not mounted. The shop payment is paid when a BOLT11 stored on one of its quotes settles, including a direct Lightning payment of that same invoice. Acceptance does not record paid. It is not paid when the Spark invoice, or another BOLT11 handed out for that charge that is not stored on this payment, pays the charge. An unanswered proof stays unresolved until Orchestra answers. The clock does not record it refused and does not end the payment. A payment of the charge by the Spark invoice, or by another BOLT11 handed out for that charge, does not end that open payment either, and only the charge is marked paid. Orchestra accepting it moves an open payment to accepted. Orchestra accepting a stored proof after that paid charge has moved that payment to ended moves it from ended to accepted when the BOLT11 stored on that proof's quote is not settled, and the same paid watcher keeps watching that quote's BOLT11. Orchestra refusing it leaves the payment open. A different proof of the same quote is stored, and it is sent only after that refusal, not while another sent proof of this payment has no result. The next read ends that open payment when the charge is already paid by the Spark invoice or by another BOLT11 handed out for that charge, and no stored proof is unresolved. Supersedes the 2026-10-01 sentence that this payment settles on the shop's own Breez Spark wallet. |
| 2026-10-14 | A shop payment is one payment. A till charge and an amount the payer enters fix the same sat count and do not create two kinds of payment. One account has one open shop payment. That payment pins the pay link for the same five minutes, blocks the next payment the same way, and is marked paid by the same paid watcher when the BOLT11 stored on it settles, whether or not it has a charge. This does not add a second watch. Specified in docs/shop-spark-payment.md. Not implemented. Supersedes the 2026-10-13 sentences that several page payments may be open, that a page payment does not pin the pay link, and that a page payment with no charge is not that watcher. |
| 2026-10-14 | The shop payment in USDT or USDC is respecified in docs/shop-stablecoin-payment.md (formerly docs/shop-spark-payment.md) to meet three hard requirements: the OpenCryptoPay standard, the DFX reference behaviour, and Tether Wallet for Android 1.11.0 (134). Methods are a fixed table of EVM chains with exact OpenCryptoPay names (Ethereum, Arbitrum, Optimism, Polygon, Base, BinanceSmartChain). A proof is tx or hex, verified on chain before it is submitted to Orchestra, and every verified transfer whose Orchestra order the api does not already hold is submitted so that Orchestra can fill or refund it. Acceptance frees the sticker at once, and a pay-link request with timeout answers the standard's 404 when nothing is waiting. A shop payment never blocks the till, and a proof that stays unanswered never blocks anything. Not implemented. Supersedes the 2026-10-14 sentence that a shop payment blocks the next payment the same way, and the 2026-10-13 sentences that the GET /pos response is unchanged (it gains charge.shopPayment), that a payment of the charge by the Spark invoice does not end an open shop payment (it ends it with charge_paid), that a shop payment is paid by a BOLT11 stored on one of its quotes (a shop payment has exactly one BOLT11), that a different proof is sent only after a refusal, that an unanswered proof stays unresolved without a limit, and that the watch of an accepted payment ends when Orchestra reports the order refunded or failed (it runs until 10 min after the BOLT11 expiry); it also supersedes the 2026-10-14 sentence that this adds no second watch (the paid watcher gains a settlement duty for shop payments). Every quote sends a 21.gifts refund address (SHOP_REFUND_ADDRESS) as Orchestra requires for exact-out into Lightning; refunds land there. |
| 2026-10-01 | Opening a forum note, translating it, or opening Notifications stamps the matching unread in-app rows and tells the account's other devices to close those banners. POST /notifications/read-by-message stamps unread forum_post, forum_reply, forum_mention, and zap whose parent or reply id is that note. Read-all and a freshly stamped single read do the same for the rows they mark. moderator_proposal stays unread and is not dismissed. Private-message pushes are not dismissed. |
| 2026-10-02 | One forum note notifies each recipient once. The marked account keeps only forum_mention; everyone else keeps the single forum_post or forum_reply. POST /messages excludes mention account ids from the post/reply fan-out. GET /notifications drops and deletes a stored generic row when the scan also has forum_mention for the same replyId. Zaps stay a separate event. Supersedes the extra mention-on-top-of-post fan-out. |
| 2026-10-06 | A member's first post is free. "First post" means the account has no top-level forum note of its own other than its profile note (About me), live or hidden; replies and conversation messages do not count, and it is once per account, not per period. GET /messages/compose-target returns firstPostFree. A text-only top-level POST /messages from anyone below verified is stored without the 1-sat fee while the rule holds; the insert checks the rule again and a per-account unique marker keeps two concurrent first posts from both going through. Verified and above stay unpaid-write exempt. Narrows the 2026-09-21 fee rule. |
| 2026-10-06 | POST /me/wallet/report stores the balance and every payment the wallet lists (idempotent per account and payment id) with a server-side category and counterparty. POST /me/events stores allow-listed first-party events of signed-in members. Never collected, stored, or logged: recovery phrase, seed, PRF output, preimages, or any private or spending key. Only the operator reads the three tables, through GET /debug/db; no app screen or role has access. |
| 2026-10-16 | Wallet of Satoshi is removed with the in-app wallet release. Every daily grant and moderator stipend is paid only to <username>@<host>. There is no intermediate stage: the API change and the app change ship through the release pull requests staging → develop and develop → main of each repository, and both go live together. At boot, roster rows on a legacy address are linked to that member's account, and each payout address is resolved from the account's verified wallet when it is paid. The production check of 2026-10-16 is in docs/wallet-release-payouts.md. |
| 2026-10-17 | The shop payment in USDT and USDC specified in docs/shop-stablecoin-payment.md is implemented. POST /pay/:username/payment, GET /lnurlp/cb/:username, GET /lnurlp/tx/:username, GET /lnurlp/wait/:payment, and POST /debug/shop-proofs/:id/retry are mounted when LNURL_SERVER_URL and PUBLIC_BASE_URL resolve, together with the shop payment cases of GET /.well-known/lnurlp/:username and /pos and the watcher tick next to the charge watch. Stablecoin rows are offered only when ORCHESTRA_BASE_URL, ORCHESTRA_API_KEY, SHOP_EVM_RPC, and SHOP_REFUND_ADDRESS also resolve. They stay off in production until the document's release checks pass on staging. SPEC.md lists the routes. Supersedes the "not implemented" status of the 2026-10-01, 2026-10-13, and 2026-10-14 shop payment rows. |
| 2026-10-27 | A Web Push subscription belongs to the login that registered it. POST /me/push-subscriptions records the session; a re-POST from another session rebinds the endpoint. When that session expires, is removed, or its account is refused sessions, the worker stops sending to the endpoint and deletes it (also hourly, without a send). Subscriptions stored before this rule have no session and are deleted; a still logged-in device registers again on its next app start. Sent and failed outbox rows are deleted 7 days after they finished; pending rows stay. |
| 2026-11-14 | The api no longer delivers payout instructions to an external spend worker. PAYOUT_SIGNER=fond queues them in fond_payout as before; unset or blank PAYOUT_SIGNER means no payout sink; spend is rejected at boot like any other invalid value. The routes only that worker called are removed: GET /invoices/passkey, GET /invoices/eligible, GET /invoices/posted, POST /invoices, POST /invoices/proof, POST /spend/daily-instruction, GET and POST /funding/daily-roster/document, and POST /funding/daily-roster/worker/*. SPEND_URL is no longer read. SPEND_API_TOKEN authenticates nothing and stays the key for addressRef on log lines. Supersedes the spend-worker parts of the 2026-08-23, 2026-08-24, and 2026-09-14 entries. |
Create— done 2026-05-25: TS + Bun + Hono + Vitest, 100% coverage on21gifts/apirepo skeleton/healthzand/info, this CONCEPT.md committed as the canonical homeCreate— done 2026-07-05: public repo exists21gifts/apprepo skeleton (Next.js 15 + TS strict + Tailwind + Zustand)Port the passkey + PRF + key-derivation primitives from the reference app— restated 2026-09-21: v1 begin options request PRF for client phrase export; API auth and Nostr custody do not use itDefine the v1 api surface (passkey login, donor wallets, recurring-gift scheduler, address verification, custodial NOSTR identities + server-side event signing, feed, LN-Address resolver) —— done 2026-08-15: implemented HTTP surface documented inSPEC.mdin the api repoSPEC.md; remaining CONCEPT capabilities listed there as not implementedWire up the four CI/CD workflows on both repos and Docker Hub publishing— done 2026-07-05:ci,deploy-dev,deploy-prd, andauto-release-prexist on api and appValidate LNURL-auth end-to-end with real wallets— cancelled 2026-08-24: LNURL-auth login was removed; login is passkey-onlySketch core UI flows: sign-in → profile → donate → recurring gifts → message— done 2026-08-15:FLOWS.mdsketches the five journeys and labels each Shipped vs Sketch; HTTP stays inSPEC.mdChoose initial NOSTR relay set— done 2026-05-25: sharednostr.spacerelay (see Decisions Log 2026-05-25 / Open Question #3)First public DEV deploy— done 2026-07-05: public DEV URLs are live (dev-api.21.gifts,dev-app.21.gifts)- Iterate MVP, dogfood early
This document is the canonical source for product-level decisions on 21.gifts. Hosting, secrets, DNS, and any other operator-specific details are out of scope and live in the operator's separate infrastructure repository.