PHPackages                             amashukov/ton-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. amashukov/ton-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

amashukov/ton-php
=================

Standalone TON (The Open Network) SDK for PHP — TLB Cell/BOC primitives, Ed25519 + TON-flavoured mnemonic, Wallet v4r2 + address parser, and a typed toncenter v2 client. Umbrella package pulling the full pure-PHP TON stack.

v0.1.0(2mo ago)0372↑30.8%1MITPHPPHP &gt;=8.3CI passing

Since May 24Pushed 2mo agoCompare

[ Source](https://github.com/AndreyMashukov/ton-php)[ Packagist](https://packagist.org/packages/amashukov/ton-php)[ RSS](/packages/amashukov-ton-php/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (9)Versions (2)Used By (1)

amashukov/ton-php
=================

[](#amashukovton-php)

Pure-PHP TON (The Open Network) SDK — TLB Cell/BOC primitives, Ed25519 wallets, mnemonic, and a typed toncenter client in one `composer require`.

[![CI](https://camo.githubusercontent.com/ff42d10f3ec278b5b32623f0d562b80548be9d57ec55a7e02a971ced76245a34/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f416e647265794d617368756b6f762f746f6e2d7068702f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d4349)](https://github.com/AndreyMashukov/ton-php/actions)[![PHPStan L9](https://camo.githubusercontent.com/48c6fb39d27fc8d5a8779cd87ffbec0f1118a0821cf21430e93d5ec82b9756fd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f416e647265794d617368756b6f762f746f6e2d7068702f7374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d5048505374616e2532304c39)](https://github.com/AndreyMashukov/ton-php/actions)[![Latest Version](https://camo.githubusercontent.com/519ad41cda0488d270e04fb67c6eb8c884aaca074cc58e2c7909f688175836b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616d617368756b6f762f746f6e2d706870)](https://packagist.org/packages/amashukov/ton-php)[![Downloads](https://camo.githubusercontent.com/cbdf169323dc1347fcb8d526218ec671976f3cfb962a6320f70f45f83667db01/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616d617368756b6f762f746f6e2d706870)](https://packagist.org/packages/amashukov/ton-php)[![PHP](https://camo.githubusercontent.com/3c10f8c88881aaccde1c53db2799e319d41a4d0fee01a7715339c85ce8422093/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f616d617368756b6f762f746f6e2d7068702f706870)](https://packagist.org/packages/amashukov/ton-php)[![License](https://camo.githubusercontent.com/8a4a64eb3cd3ccde43bccfb1a2a47c8b3a332a73f0fe69985a982a4c65f2621e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616d617368756b6f762f746f6e2d706870)](LICENSE)[![Stars](https://camo.githubusercontent.com/ab3c319bd38f340cc64591ef0aa173d8f70d7c0e17bf3eaeb40f2a41538e7193/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f416e647265794d617368756b6f762f746f6e2d7068703f7374796c653d736f6369616c)](https://github.com/AndreyMashukov/ton-php)

`amashukov/ton-php` is a standalone **TON SDK for PHP** — a single umbrella package that pulls the whole pure-PHP TON stack: TLB `Cell` / `Builder` / `Slice` with a canonical BOC encoder, Ed25519 `KeyPair` with TON-flavoured mnemonic derivation, a `WalletV4R2` contract wrapper with an `Address` parser, and a typed toncenter v2 JSON-RPC client. Zero blockchain-library dependencies, no Symfony, no native extensions beyond the standard `gmp` / `sodium` / `bcmath` trio. Install it and the full TON wallet + toncenter stack is on your autoloader.

Features
--------

[](#features)

- **Canonical BOC** — TLB `Cell` / `Builder` / `Slice` with a byte-exact bag-of-cells encoder (matches `@ton/core`).
- **Ed25519 crypto** — `KeyPair` signing/verification plus TON-flavoured PBKDF2 `Mnemonic` derivation (not BIP-39).
- **Wallet v4r2** — `WalletV4R2` contract wrapper, `InternalMessage` builder, and a full TON `Address` parser (UQ/EQ, raw, bounceable flags).
- **Typed toncenter client** — toncenter v2 over any PSR-18 transport, with typed value objects instead of raw arrays.
- **Composable ports** — `ToncenterWalletRpc` implements the wallet's `WalletRpcInterface`, so a wallet reads its seqno and broadcasts a signed transfer through toncenter with no glue.
- **One install** — the full TON stack ships through a single `composer require`.

Why amashukov/ton-php
---------------------

[](#why-amashukovton-php)

`olifanton/ton` is the best-known PHP TON SDK (~300★), but it ships partial wallet coverage and no canonical bag-of-cells encoder, so cells you serialise may not round-trip byte-for-byte against `@ton/core`. `amashukov/ton-php` gives you a **byte-exact canonical BOC encoder**, a complete `WalletV4R2` + `Address` surface, and a typed toncenter client — the entire stack behind **one** `composer require`, each layer separately versioned and individually installable.

Installation
------------

[](#installation)

```
composer require amashukov/ton-php
```

Usage
-----

[](#usage)

Each layer keeps its own namespace; import what you need:

```
use Amashukov\TonCell\Builder;
use Amashukov\TonWallet\WalletV4R2;
use Amashukov\Toncenter\ToncenterClient;
use Amashukov\Toncenter\ToncenterWalletRpc;

// Build cells, derive a wallet, broadcast through toncenter — see each
// sub-package README for the full API.
```

The packages compose cleanly: `Amashukov\Toncenter\ToncenterWalletRpc` implements the `Amashukov\TonWallet\WalletRpcInterface` port, so a wallet can read its seqno and broadcast a signed transfer through toncenter with no glue.

Requirements
------------

[](#requirements)

- PHP 8.3+
- `ext-gmp` (bigint cell / address math)
- `ext-sodium` (Ed25519)
- `ext-bcmath`
- A PSR-18 HTTP client + PSR-17 factories for the toncenter client (e.g. [`amashukov/http-client-php`](https://github.com/AndreyMashukov/http-client-php) + [`nyholm/psr7`](https://github.com/Nyholm/psr7))

Related packages
----------------

[](#related-packages)

PackageLayer[amashukov/ton-cell-php](https://github.com/AndreyMashukov/ton-cell-php)TLB `Cell` / `Builder` / `Slice` + canonical BOC encoder[amashukov/ton-crypto-php](https://github.com/AndreyMashukov/ton-crypto-php)Ed25519 `KeyPair` + TON-flavoured PBKDF2 `Mnemonic`[amashukov/ton-wallet-php](https://github.com/AndreyMashukov/ton-wallet-php)`WalletV4R2` wrapper, `InternalMessage` builder, `Address` parser[amashukov/toncenter-client-php](https://github.com/AndreyMashukov/toncenter-client-php)Typed toncenter v2 client over any PSR-18 transport[amashukov/http-client-php](https://github.com/AndreyMashukov/http-client-php)PSR-18 cURL HTTP client[amashukov/eth-php](https://github.com/AndreyMashukov/eth-php)Sister umbrella SDK for Ethereum / EVM[amashukov/blockchain-context-bundle](https://github.com/AndreyMashukov/blockchain-context-bundle)Symfony 7 bundle wiring the TON + EVM stacksQuality
-------

[](#quality)

- **PHPStan level 9** across the whole stack.
- **php-cs-fixer** with the `@PER-CS` ruleset.
- **GitHub Actions CI** on every push.
- **Parity tests** pin the BOC encoder byte-for-byte against `@ton/core`.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE). Each bundled package is MIT-licensed in its own repository.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance88

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

62d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b3e86ca79a82515b23e0239b1d3616c747e59b64c40e169d538d5c759c9bbc4?d=identicon)[Andrey Mashukov](/maintainers/Andrey%20Mashukov)

---

Top Contributors

[![AndreyMashukov](https://avatars.githubusercontent.com/u/24682497?v=4)](https://github.com/AndreyMashukov "AndreyMashukov (3 commits)")

---

Tags

blockchainbocphpsdkthe-open-networktontoncenterwalletsdkwalletblockchainBOCtonthe open networktoncenterCell

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/amashukov-ton-php/health.svg)

```
[![Health](https://phpackages.com/badges/amashukov-ton-php/health.svg)](https://phpackages.com/packages/amashukov-ton-php)
```

###  Alternatives

[olifanton/ton

PHP library for The Open Network blockchain

8961.6k2](/packages/olifanton-ton)[olifanton/interop

Olifanton interop library

1076.0k3](/packages/olifanton-interop)[blocktrail/blocktrail-sdk

The BlockTrail PHP SDK, for integration of Bitcoin functionality through the BlockTrail API

4821.1k3](/packages/blocktrail-blocktrail-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
