TgWitness 0.7.0

GETTING STARTED

From account connection to a verifiable journal

The collector runs as a separate process. Your browser controls it and displays saved observations.

  1. Telegram accountPhone, QR code or session file
  2. CollectorRuns on your computer or server
  3. Signed journalEvery change becomes a signed record
  4. Export and verifySignatures can be checked independently

Choose a sign-in method

Four ways in. Use the one that matches what you already have.

API ID and API hash are optional

Your own API ID and API hash are optional. When no pair is entered, imported or saved in the workspace, TgWitness picks one from a built-in pool of public pairs and tries the next if Telegram refuses it. API settings identify the application; they do not replace account authorization. The TgWitness panel token opens the panel and is separate from Telegram login.

Open Account and select Phone, QR code, Files, or Auth key. To use your own application, open API ID + Hash in the form and enter its credentials. You can paste one app_id:app_hash pair into API ID. This workspace reuses its saved pair or falls back to the built-in pool.

Supported formats

Phone number, code, and optional two-step verification
Sign in directly in Account. Telegram chooses how the code is delivered; SMS is not guaranteed.
QR login
Select QR code, press Show QR code and confirm in an already-authorized Telegram app under Settings → Devices → Link Desktop Device. Enter two-step verification if requested. Expired codes can be regenerated.
Telethon StringSession
Paste an authorized session string or load a plain-text .tgwitness-session or .txt file, up to 4 KiB.
Telethon SQLite .session
Load a closed, consistent schema 7/8 file directly. The optional Telethon-only CLI converter also accepts files up to 64 MiB.
Pyrogram SQLite .session
Load a schema 2/3 production user session. The panel detects its contents; renaming a file is not conversion.
Telegram Desktop TData ZIP
Quit Telegram Desktop, then ZIP only key_datas and the 16-character file ending in s beside it (usually D877F783D5D3EF8Cs) from the tdata folder; the whole folder with its cache is usually too large. Supply the Desktop local passcode if one is set. One account per archive; legacy layouts, multi-account folders, and encrypted ZIP containers are unsupported.
Session + JSON pair
Accounts are often supplied as name.session plus name.json. Select both together: the JSON supplies app_id/app_hash; other fields such as phone, device or a stored 2FA password are ignored, and TgWitness asks for 2FA when Telegram requires it.
Account JSON
Supported fields include api_id/app_id, api_hash/app_hash, Telethon StringSession, or complete 512-character Auth Key HEX with dc_id. A companion JSON may contain only API metadata; load it with a session or use phone/QR login.
Other formats
TDLib, Pyrogram StringSession, CSV/JSON bulk account lists, and bots are unsupported. Add each account in its own workspace.

Limits at a glance

Files: what to select and how they are checked

In Files, choose one session format: Telethon/Pyrogram .session, TData ZIP, or Telethon StringSession text. Add its companion JSON if supplied; you do not need every session format. Select up to four matching files, totaling at most 8 MiB, then press Connect account. Use Passcode or session text for a protected TData archive or a session string. Conversion runs in memory on your own TgWitness server without saving uploads, extracting ZIPs, or contacting a conversion service. The Connect button then checks the account with Telegram. To read files without authorization, use Passcode or session text → Read files without signing in. Conflicting files are rejected; imported user IDs are checked online.

JSON is limited to one object of 64 KiB. TData ZIPs are limited to 512 entries and 32 MiB expanded size, with 64 KiB authorization files. Close the original SQLite client and create a consistent copy; do not discard an unfinished WAL to bypass validation.

I only have an API ID and API Hash

Enter them under API ID + Hash, then sign in with your phone number and login code, scan a QR code with an already-signed-in Telegram app, or import a session. API credentials identify your application; they do not provide access to an account by themselves.

I have an Auth Key (HEX) and DC ID

Select Auth key, paste the complete key, and choose the supplied DC ID (1–5). Optionally enter User ID to check the account identity. Your own API ID and Hash are optional. Press Connect account. An Auth Key contains 512 hexadecimal characters; an API Hash contains 32. Shortened keys containing ... cannot work.

You can also save an account JSON with the fields below and select it in Files, replacing the example values with your own:

{
  "auth_key": "REPLACE_WITH_ALL_512_HEXADECIMAL_CHARACTERS",
  "dc_id": 2
}

Replace the example DC ID with the supplied value, from 1 to 5. An optional numeric user_id is checked during authorization. Keep this JSON private; it grants account access. A JSON containing only app_id and app_hash supplies app settings and still needs a session or phone/QR login.

A session grants account access. Keep original and converted files private. Conversion transfers authorization, not message history, and cannot restore a revoked login.

1. Connect an account

Sign in, choose your chats and start observing.

Connect a dedicated account, never your main one. Why, and how to get one ↗

  1. Open Account. If needed, configure a proxy first under Settings → Connection settings → Change connection route.
  2. Enter your phone number and press Continue, select Files → Connect account, or choose QR code → Show QR code.
  3. Optionally enter your own API ID/hash from my.telegram.org; otherwise a pair from the built-in pool is used. Complete code/2FA or QR confirmation in an already-signed-in Telegram app. Saved API credentials are reused within this workspace.
  4. Check the displayed account ID. Open Sources: your chats load automatically. Add the sources your account can access.
  5. In Sources → Capture settings → Choose which changes to preserve, select event categories or use Messages, edits & deletions, then save monitoring settings.
  6. Set the attachment policy separately, then press Start observation.
I have a .session file or TData ZIP

Load supported Telethon/Pyrogram SQLite or TData ZIP directly with its optional JSON companion. A separate API pair is optional; imported or saved settings take precedence over the built-in pool. For an offline Telethon-only conversion, close its original client and use a consistent copy:

python -m tgwitness.sessions account.session --out account.tgwitness-session

The result grants account access. Do not run concurrent clients using cloned authorizations. QR attempts are cancelled by lock, workspace switch, route change, or a new login; a closed/reloaded tab may leave an attempt pending until expiry.

How observation works

Every change becomes its own signed record. Nothing captured is overwritten.

  1. Choose the workspace and scope. Each workspace belongs to one Telegram account and has its own sources, settings, journal, queue, and signing key. Add as many workspaces as you need.

  2. Save the collection policy. Select new messages, edits, deletions, reactions, and membership events as needed. Settings apply to the workspace's selected sources. Re-enabling a category does not recover missed events.

  3. Start observation. Updates from the active account client become separate signed records. An edit adds a version; a deletion notice does not erase text already captured. Unknown editors and deletion actors stay unknown.

  4. Review outcomes and gaps. Attachments download separately when enabled. A queued attachment is not yet preserved. An explicit history snapshot saves current visible messages and cannot reconstruct missed changes.

What keeps collecting

Service events, pausing and the panel token

Operational records and other group service events remain separate from the event switches. Captured messages can retain embedded reaction or membership metadata. Some deletion notices do not identify a chat; they are saved as unscoped account-level notices without guessing a source.

Pause observation stops that collector. Lock and closing a tab do not stop collection; switching workspaces only changes the view. Stopping the Python process stops all workspaces. After a restart, observation resumes and asks Telegram for the updates missed while it was off.

The administrator can issue access to selected workspaces and chats, with separate permissions, expiry, IP restrictions and session limits. The main panel token remains unrestricted. An existing journal cannot be reassigned to another Telegram account.

Open Access to give a reviewer their own token. Keep View for reading; add Export for downloads. Chat-limited access cannot open whole-workspace settings or full journal exports. Revoking access ends its sessions but cannot recall downloaded files.

2. Check the connection route

Choose how this workspace reaches Telegram, then test it before signing in.

Proxy formats, public lists and testing

Each workspace supports Direct, SOCKS5, HTTP CONNECT and experimental MTProxy. MTProxy accepts a 16-byte hex key or dd + key. Fake TLS ee secrets are unsupported. Stored proxy passwords/secrets are never returned to the panel.

Automatic MTProxy checks built-in public lists, keeps a working route and replaces failing entries. Open Account → Settings → Connection settings to choose the route and IP mode. Parameters controls rotation, sharing, checking intervals and retry delays.

Open Where the list comes from for providers, saved dates and the download route. Unavailable sources keep their previous entries. You can also enter your own proxy or use an operator catalog.

Hide IP refuses direct fallback. Allow fallback can use Direct after the configured delay. Tunnel / VPN permits the host's direct network route but does not create a VPN. Pause observation before changing routes; saving cancels unfinished login. Test Telegram connection checks transport, not complete delivery.

MTProxy carries Telegram traffic only. External requests need a separate SOCKS5/HTTP proxy, the account's SOCKS5/HTTP route, or Direct where the IP mode permits it. External requests can be disabled; an explicit feed-download proxy is a separate override. The independent witness keeps its own route.

This configures the Telegram client, not a system VPN. Remote access to the web panel needs HTTPS or an SSH tunnel.

3. Export and verify

Download the journal and let others check that nothing was changed.

  1. Download

    Exports provides ZIP, JSONL, CSV, HTML, a checkpoint and a signed run receipt. Exports cover a full journal prefix for the selected workspace, regardless of search filters.

    Browsers with file-streaming support ask you to choose a destination first and write data as it arrives. Other browsers buffer at most 128 MiB. For larger files, use the streaming CLI while the server is running:

    python -m tgwitness.download --token-file data/live/panel-token.txt --out evidence.zip
    Other workspaces, remote servers and limits

    For another workspace, add --profile PROFILE_ID. The ID appears at the top of Exports → Workspace ID. See all command options with:

    python -m tgwitness.download --help

    The token is sent in an HTTP header, not in the URL or command arguments. For a remote server, add --url https://your-server. The default transfer limit is 5 GiB, configurable with --max-mib. Signed ZIP content has a separate 4 GiB uncompressed limit. Existing output files are not overwritten.

  2. Verify

    Verify using a trusted copy of the program:

    python -m tgwitness.verify evidence.zip --fingerprint TRUSTED_SHA256 --checkpoint checkpoint.json
  3. Keep the fingerprint

    A signature establishes integrity relative to the trusted key, not Telegram origin. Retain the fingerprint and checkpoint independently. An RFC 3161 request alone is not a trusted timestamp; obtain and verify the authority's reply.

4. Protect storage

Secrets are encrypted for you. Messages and files need an encrypted disk.

Encrypted by TgWitness
  • Sessions
  • Secrets
Needs an encrypted disk
  • Messages
  • Attachments
  • Exports

Never delete or replace vault.key: you would lose access to sessions and signing keys.

Troubleshoot startup

Three commands answer most startup questions.

From the project directory, run:

python start.py --setup-only
python start.py --check





python start.py

OPTIONAL EXTRAS

Start simple. Add what you need.

Your bot, in three steps.

Open Extras in the panel and choose Set up a bot. The form prepares the files for a separate witness process.

  1. Create read-only access for the selected account and save its access file.
  2. Choose your channel and check interval, then save the configuration.
  3. Install TgWitness on the witness host, add your BotFather token and follow the launch commands in step 3.

After launch, check the first signed post in your channel. The host runs the checks; the bot publishes their result. Another host and operator make the witness more independent.

What does the bot actually prove?

A retained signed check lets you compare a later export with the journal as it was observed. It does not establish that every Telegram event was delivered. Unavailable checks and failed posts need attention; there is no guarantee of uninterrupted publication.

VERIFIED CODE

Know which software made the record.

In Extras, open Verified code from GitHub and enter your fork or the official repository with a release tag or commit. TgWitness compares every program file with that commit and saves the result in the signed journal, so an export shows which public code was running. No GitHub token is needed.

  1. Fork the repository on GitHub and review the code, or use the official one.
  2. Enter the repository and a release tag or commit: a commit cannot change later, a branch can.
  3. Check again after every update; the badge shows when the running code is no longer the checked one.

A GitHub token grants repository access; it does not prove that the running server is unchanged. Build verification and independent witnesses provide different checks. No GitHub token is needed on this page.

Open to everyone

Mathematics and cryptographic truth belong to everyone across the globe.

Many expect standard geographic or political blocks, such as OFAC lists or regional bans against Russia. TgWitness enforces none of them: it is released under the MIT License for everyone, in every country.

The only incompatibility we name is Taylor Wessing and anyone who believes their words or authority stand above mathematics: those who enable or defend corporatocracy, privatized or commercial justice, plutocracy, kleptocracy and institutional corruption. Truth is available to all, except to those who think their signature under a lie turns it into reality.

This is our position as the authors of TgWitness, not a licence condition. Read our full notice