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

TL-B

Type Language - Binary, TON's formal language for describing on-chain data structures. Used to define message schemas, contract storage, and all cell layouts.

Aliases: tlb, tl-b, type language binary

TL-B (Type Language - Binary) is the formal language used in TON to describe every data structure that lives inside a cell. It plays the role Protobuf or ASN.1 plays elsewhere, but is purpose-built for TVM’s cell model. The full schema of blocks, transactions, messages, jetton/NFT operations, and any custom contract interface is written in TL-B.

Why it’s needed

A cell on TON is the only way to store structured data on chain — but a cell is just bits and references. For a parser to know that the first 32 bits are an int, then an address, then a reference to another cell with signatures, you need a schema. TL-B provides exactly that, declaratively:

transfer#0f8a7ea5 query_id:uint64 amount:Coins
                  destination:MsgAddress response_destination:MsgAddress
                  custom_payload:(Maybe ^Cell) forward_ton_amount:Coins
                  forward_payload:(Either Cell ^Cell)
                = JettonMsg;

That’s the TL-B for the standard jetton-transfer message (TEP-74). With it, any client knows exactly how to build or parse the message.

What it describes

  • Message layouts — internal, external, and contract-specific message bodies.
  • Contract storage — what sits in the contract’s data cell.
  • System structures — block, transaction, dictionary, and account-state formats.
  • Custom protocols — TEP-74 (jetton), TEP-62/64/66 (NFT), TON Connect.

Tooling

  • tlbgen — code generator that turns TL-B into TypeScript / Go / Python structures with ready-made serialise/parse helpers.
  • block.tlb — the canonical schema file for the network, in the ton-blockchain/ton repository.
  • Tact and Tolk automatically emit TL-B for incoming messages declared as message / struct.

If you’re integrating a TON contract and the author hasn’t shipped TL-B, that’s a bad sign: anything seriously used on the network has a TL-B definition, and without it parsing cells by hand is a chore.

Related terms