ton-net
A direct TON network client. It speaks TON's own protocols, TL over ADNL over TCP, and verifies what a liteserver returns against a block it walked to itself, so a balance is proven rather than taken on the server's word. No HTTP indexer in the path.
This crate is the entry point. It composes the layers below it: ton-net-tl,
ton-net-cell, ton-net-block, ton-net-adnl and ton-net-lite.
It is early. Reading a proved account works and is tested against mainnet. Sending a transaction, wallets, the DHT and local contract execution do not exist yet. The roadmap is the order the rest arrives in.
Reading an account
use ;
# async
account returns a Verified<Account>, a type with a private constructor that
cannot be built outside this crate without a proof having checked out. A read that
fails verification is an error, never a value. account_reported is the same read
with nothing checked, and it returns a different type, so the two cannot be
confused.
Paying for the walk once
The first walk covers every key block published since the pinned one. Against mainnet in July 2026 that was 1246 links over 78 replies and a little over two minutes. Saving the block it ended on turns the next run into a single link.
use ;
#
# async
That anchor is the client's root of trust. Everything derived from it is worth exactly what the storage it came from is worth: whatever can write to where it is kept can choose what this client believes.
What is still taken on trust
Two things, and they are the whole list:
- The block the config pins. A walk has to start somewhere. Passing an anchor
to
connect_fromsupplies that block instead. - The local clock. A proof establishes that a block is real and was committed
by the validators, and says nothing about when it was handed over. A server
replaying a genuine chain from last year passes every other check.
Config::with_max_head_agesets how much age is tolerated, and a clock far enough behind is reported rather than quietly passed.
Knowing when the rules changed
VERIFY_EPOCH is an integer that rises whenever the set of things this library
accepts as proven changes. The crate version cannot answer that, because the
accept and reject boundary moves independently of any signature. Storing it beside
a result makes an upgrade answerable:
# let cached_epoch = 0u32;
if cached_epoch < VERIFY_EPOCH
Scope
Working today: the TL codec, ADNL over TCP, liteserver reads, cell and proof verification, and key-block sync. Everything else, including the write path, the DHT, RLDP and a local TVM, is ahead. See the roadmap and NET-ADR-008.
License
Apache-2.0. Copyright 2026 Nirapod Labs; maintained by athexweb3.