Skip to content

feat: check the Telegram login only at login (/api/v1/init) - #109

Merged
cmnisal merged 10 commits into
mainfrom
xbuddhi/feat/p2p-session-only-main
Nov 20, 2026
Merged

cmnisal merged 10 commits into
mainfrom
xbuddhi/feat/p2p-session-only-main

Conversation

@xbuddhi

@xbuddhi xbuddhi commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Brings #106 (the combined DCA backend guide), #107 (the Telegram login checked only on /api/v1/init) and #108 (the spec status) to main. All are already merged and testing in dev.

  • /api/v1/p2p/* accepts only X-BDB-User (signed text …-V2). /api/v1/init accepts only the Telegram credential (…-V1) and links the user.
  • Removes service_user_auth and spend_init_data_max_age.
  • Breaking for the DCA backend: after login, P2P calls must send X-BDB-User.

Merge order: #98 → #99 → #102 → #105 → this. Please use a merge commit.

Tests: go build, go vet and the non-cgo test packages pass.

… Start

POST /api/v1/init creates the wallet from the verified Telegram
credential, like /start, with the same P2P service signature.

(cherry picked from commit 4e60b07)
(cherry picked from commit 6e0a3e3)
The signed Mini App / web app request is now the approval:
- P2P sends and invoice payments run straight away; no Confirm / Cancel
  message, no confirm_threshold, no unconfirmed allowance.
- Collect requests send no Pay / Decline message and drop chat_prompt
  and notified; users approve in the Mini App or web app.
- /me drops confirm_threshold and unconfirmed_remaining; invoice decode
  drops needs_confirmation; transfers drop confirm_by.

Transfers saved as awaiting_confirmation before this still expire and
give back their counters. max_amount and daily_limit still apply.
Passkey approval through the DCA backend is planned.

(cherry picked from commit cd68a26)
With api.p2p.service_user_auth, P2P calls can carry X-BDB-User instead
of a Telegram credential. The service signature (BDB-P2P-ED25519-V2)
covers the user ID. Only users linked by a Telegram-verified call
(POST /api/v1/init) can be named; /api/v1/init always needs the
Telegram credential. V1 keeps working. Off by default.

(cherry picked from commit 0c4e950)
Covers keys, both signing schemes, DCA wallet endpoints, collect,
init, P2P with V1 and V2 auth, collect approval, errors, flows and a
checklist, matching dev as it is now.

(cherry picked from commit 652ff48)
Every /api/v1/p2p/* call now names the user with X-BDB-User (signed text
BDB-P2P-ED25519-V2) and no longer accepts a Telegram credential. Only
POST /api/v1/init takes the Telegram credential; it links the user.

- removes api.p2p.service_user_auth (always on) and
  spend_init_data_max_age (no Telegram login on spends any more)
- AuthSpend merged into Auth
- docs: P2P, init, collect, DCA guide, spec and example config

(cherry picked from commit 0188eba)
@cmnisal
cmnisal changed the base branch from xbuddhi/feat/p2p-service-user-auth-main to main November 20, 2026 01:23
…n already equals this PR's base after the squash merges)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016uf9cmd4w65NVRsvrctidb
@cmnisal
cmnisal merged commit 08a3619 into main Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants