Skip to main content
T TON Adoption
← Glossary
NODE/03 · Term

txid (transaction hash)

TON transaction hash: SHA-256 of the serialised transaction body. The unique identifier used by explorers and APIs; format is 64 hex chars or a 44-char base64-url string.

Aliases: tx-id, tx hash, transaction hash

txid (transaction hash) is the SHA-256 hash of a TON transaction’s serialised content, uniquely identifying it across the whole network. Format: 64 hex characters (abc123...) or a 44-char base64-url string (AbC...=).

Where to find it

  • Tonviewer: https://tonviewer.com/transaction/<txid> — every phase (compute, action, storage) and the final operation semantics.
  • Tonscan: https://tonscan.org/tx/<txid> — the same, in a more raw view.
  • APIs (toncenter, tonapi) return txid alongside lt and utime.

txid vs message hash

These often get confused: message hash ≠ transaction hash. A transaction has an inbound message, an execution, and produces outbound messages. Each has its own hash. To trace a user-facing operation you usually need the txid + lt of the account that started the chain.

Formats and mutual conversion

The same txid can be represented in two encodings, and explorers/APIs accept both:

  • hex (64 chars): 9f5b...c1 — the canonical form, straight out of BoC.
  • base64-url (44 chars): n1tA...wQ= — shorter, URL-friendly, used by TON Connect.

A one-liner in JavaScript:

const hex = Buffer.from(base64url, 'base64url').toString('hex');
const back = Buffer.from(hex, 'hex').toString('base64url');

In Python via base64.urlsafe_b64decode / binascii.hexlify. If an explorer “can’t find” your transaction by hash — try the other encoding.

How to get txid after sending

In @ton/ton, after walletContract.sendTransfer() the call only returns a “future” semantic; the real txid appears later, once the transaction is included in a block. The standard pattern is to poll the account by lt and match the outgoing message:

const before = await client.getLastTransaction(wallet.address);
await wallet.sendTransfer({ seqno, secretKey, messages });
// poll for 30s, look for a new transaction with lt > before.lt
const tx = await waitForTransaction(client, wallet.address, before.lt);
console.log('txid:', tx.hash().toString('hex'));

Troubleshooting: “txid not found”

The most common causes:

  • Shard hasn’t committed the block yet — finality is 5-6 seconds, explorers can lag 10-15 seconds behind.
  • Message is in the queue, transaction hasn’t executed — between sendBoc and actual inclusion there can be up to 10 seconds. Until then the txid literally doesn’t exist yet.
  • Wrong hash encoding — see hex ↔ base64-url above.
  • Wrong account specified — many explorers search by hash within a single account context; use full-text search or tonviewer.com/transaction/<hash> directly.

Cell-hash, message-hash, tx-hash

All three are SHA-256, but of different structures:

  • cell-hash — hash of a Cell (BoC’s universal unit).
  • message-hash — hash of a serialised Message X, lives in out_msgs on the transaction.
  • tx-hash (txid) — hash of the whole transaction together with the phase description.

For inbound operations the user usually only knows the message-hash (their wallet signed it); to find the matching transaction you need to match through lt + dst via the API.

Related terms