Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 121 additions & 2 deletions ecosystem/rpc/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,126 @@
---
title: "Overview"
description: "Understand the main ways to access the TON blockchain."
---

import { Stub } from '/snippets/stub.jsx';
import { Aside } from '/snippets/aside.jsx';

<Stub issue="159" />
## Types of API

TON exposes several access layers for interacting with the blockchain, each serving different needs:

- **HTTP API** - standard web access for querying accounts, blocks, and sending transactions.
- **Indexed API** - database-backed API providing structured, decoded, and historical data.
- **ADNL** - low-level peer-to-peer protocol for direct communication with nodes.

<Aside type="note">
**Indexed vs Non-Indexed**\
In TON, APIs differ by how deeply they process data before returning it.\
**Non-indexed APIs** fetch results from liteservers through `tonlibjson`. They’re simple and fast, but the data comes directly from the node: no decoding, joins, or long-term history.\
**Indexed APIs** run an indexer alongside a node. The indexer reads blocks from RocksDB, decodes transactions and actions, and stores them in PostgreSQL for structured access.\
That extra database layer makes it possible to query decoded, historical, and aggregated data without talking to the node directly.
</Aside>

## HTTP API

The HTTP API exposes the TON blockchain through both **REST** and **JSON-RPC** interfaces.\
It allows developers to fetch account and wallet information, explore blocks and transactions, send messages, call smart contract methods, and more.

<Aside type="note">
For production, it’s recommended to integrate at least two providers to ensure uptime.
</Aside>

### Typical use cases

- Querying accounts, balances, or transactions
- Sending messages or deploying smart contracts
- Building wallets and basic dApps

### Run your own instance

Use the open-source [ton-http-api](https://github.com/toncenter/ton-http-api) to host your own endpoint.

## Indexed API

Indexed APIs extend HTTP functionality by offering structured, decoded, and historical blockchain data.\
They are built on top of the **TON Indexer**, which reads data from a full node, decodes transactions and actions, and stores them in a PostgreSQL database for efficient querying.

These APIs power explorers and analytics tools that need complex searches or decoded data.

### Typical use cases

- Blockchain explorers and analytics dashboards
- Historical or decoded transaction queries
- NFT and Jetton tracking

### HTTP vs Indexer

| Type | Best for | What you get |
| ----------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **HTTP** | Sending messages or performing standard read requests | Data processed by `tonlib` and served through liteservers over REST or JSON-RPC. Useful for querying accounts, balances, or transactions without indexing overhead. |
| **Indexer** | Accessing decoded, historical, or aggregated data | Responses served from an indexing database built from a full node’s data. Ideal for explorers, analytics, and structured blockchain queries. |

<Aside type="tip">
Prefer **Indexed APIs** for nearly all read operations, as they provide broader coverage, better performance, and decoded data.\
Use **HTTP APIs** when you need to **send messages or transactions** directly to the network.
</Aside>

### Run your own instance

Use the open-source [ton-indexer](https://github.com/toncenter/ton-indexer) to host your own endpoint.

## ADNL API

**ADNL (Abstract Datagram Network Layer)** is TON’s peer-to-peer protocol for direct node communication.\
It provides verifiable, low-level access to blockchain data and transaction submission.

Clients connect directly to **liteservers** using a binary protocol, downloading key blocks, account states, and Merkle proofs to verify data authenticity.

For read operations (such as `runGetMethod`), the client executes a local TVM run using the verified state, without downloading the full blockchain.

### Typical use cases

- Running validators or custom node software
- Building node management and monitoring tools
- Applications requiring Merkle-proof validation

### HTTP vs ADNL

| Type | Best for | What you get |
| -------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **HTTP** | General-purpose access to blockchain data and message submission | Returns processed data produced by `tonlib` through liteservers, exposed over REST or JSON-RPC. The data is already parsed and formatted for applications, not a raw or verifiable ledger snapshot. |
| **ADNL** | Direct and verifiable access to the blockchain state | Native peer-to-peer protocol used by TON nodes. Provides binary responses with Merkle proofs, allowing clients to verify the authenticity of account states and transactions directly. |

<Aside type="tip">
For most applications, prefer an **Indexed API** for reads, because it provides broader coverage and faster, decoded data.\
Use **HTTP** when you need to **send messages or transactions** directly to the network.\
Choose **ADNL** for low-level, verifiable access or when running your own node or validator infrastructure.
</Aside>

### Run your own instance

Use [MyTonCtrl](../node/setup-mytonctrl) to enable a liteserver and expose an ADNL endpoint.

## Providers

### Official providers

| Provider | Type | Public Endpoints | Docs |
| -------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------- | ------------------------------- |
| [TON Center API v2](https://github.com/toncenter/ton-http-api) | HTTP | `https://toncenter.com/api/v2/`, `https://testnet.toncenter.com/api/v2/` | [Docs](./toncenter/get-api-key) |
| [TON Center API v3](https://github.com/toncenter/ton-indexer) | Indexer | `https://toncenter.com/api/v3/` | [Docs](./toncenter/get-api-key) |
| [dTON](https://t.me/dtontech_bot) | ADNL | Provided by dTON via [request through official bot](https://t.me/dtontech_bot) | — |
| Public liteservers | ADNL | `https://ton.org/global-config.json`, `https://ton.org/testnet-global.config.json` | — |

### Third party providers

| Provider | Type | Public Endpoints | Docs |
| ----------------------------------------------------------- | ------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
| [Chainstack](https://chainstack.com/build-better-with-ton/) | HTTP, Indexer, ADNL | Access via dashboard or project workspace | [Docs](https://docs.chainstack.com/reference/getting-started-ton#getting-started-ton) |
| [TON API](https://docs.tonconsole.com/tonapi) | Indexer | `https://testnet.tonapi.io`,`https://tonapi.io` | [Docs](https://docs.tonconsole.com/tonapi) |
| [Ankr](https://www.ankr.com/rpc/ton/) | HTTP | `https://rpc.ankr.com/http/ton_api_v2` | [Docs](https://www.ankr.com/docs/rpc-service/chains/chains-api/ton/) |
| [QuickNode](https://www.quicknode.com/chains/ton) | HTTP | Access via dashboard or project workspace | [Docs](https://www.quicknode.com/docs/ton) |
| [Tatum](https://tatum.io/) | HTTP, Indexer | `https://ton-mainnet.gateway.tatum.io`, `https://ton-testnet.gateway.tatum.io` | [Docs](https://docs.tatum.io/guides/blockchain/the-open-network-ton) |
| [GetBlock](https://getblock.io/nodes/ton/) | HTTP | `https://ton.getblock.io/mainnet/`, `https://ton.getblock.io/testnet/` | [Docs](https://docs.getblock.io/api-reference/the-open-network-ton) |
| [Chainbase](https://chainbase.com/) | HTTP | Access via dashboard or project workspace | [Docs](https://docs.chainbase.com/api-reference/overview) |
| [NowNodes](https://nownodes.io/nodes/ton) | HTTP, Indexer | `https://ton-open-api.nownodes.io/v2`, `https://ton-index.nownodes.io/api/v3` | [Docs](https://nownodes.gitbook.io/ton-toncoin) |
1 change: 1 addition & 0 deletions resources/dictionaries/custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Catchains
Catchcain
Certik
Chainbase
Chainstack
Ciphertexts
Circom
Coalus
Expand Down