Capture a live Telegram id_token

Generates a throwaway Ed25519 session key, runs Login with Telegram with nonce = base64url(session public key), and turns the resulting id_token into the exact bytes TgWallet verifies on-chain. Everything runs in this page — no backend, no client secret.

Before you start

  1. Open @BotFather/mybots → your bot → Login Widget.
  2. Trusted Origins → this page's origin, e.g. (no trailing slash).
  3. Redirect URIs → this page's full URL, e.g. . That is what the library sends as redirect_uri.
  4. Under Advanced, set the signing algorithm to ES256K. The default is RS256, which TVM cannot verify.
  5. Copy the Client ID from that same screen into the field below.

ES256K is restricted to the openid scope, so the token carries only iss/aud/sub/iat/exp/nonce — no user-controlled strings for the contract to parse.

Bot

@BotFather → /mybots → your bot → Login Widget → Client ID.

Session key

public key (hex)
nonce sent to Telegram

Kept in localStorage so a reload does not invalidate a token you just captured. In a real wallet this key never leaves the device and is worth at most one session.

Ready.