Download the PHP package amashukov/ton-crypto-php without Composer

On this page you can find all versions of the php package amashukov/ton-crypto-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ton-crypto-php

amashukov/ton-crypto-php

Correct TON mnemonic + Ed25519 keypair derivation for The Open Network in pure PHP.

CI PHPStan L9 Latest Version Downloads PHP Stars

TON cryptography for PHP: Ed25519 keypairs (sign / verify via libsodium) and TON-flavoured mnemonic seed derivation for The Open Network. The TON mnemonic format is PBKDF2-HMAC-SHA512 with salt "TON default seed" and 100 000 iterations — it is not BIP-39. The wordlist and derivation procedure mirror the TON reference implementation, so the same 24-word phrase produces the same Ed25519 keypair (and therefore the same wallet address) across all TON tooling.

Features

Why amashukov/ton-crypto-php

BIP-39 mnemonic libraries derive the wrong key for TON. TON does not use the BIP-39 PBKDF2 salt ("mnemonic") or iteration scheme — it uses a distinct entropy → seed pipeline (hash_hmac pass feeding PBKDF2-HMAC-SHA512 with salt "TON default seed", 100 000 iterations). Feeding a TON phrase to a generic BIP-39 library yields a seed and address that do not match TON wallets. This package implements the TON procedure exactly, so derived addresses match official TON tooling byte-for-byte.

Installation

Usage

Derive a keypair from a mnemonic phrase

toSeed() and toKeyPair() normalise the phrase (trims leading/trailing whitespace, collapses any inter-word run of whitespace — including tabs and newlines — to a single space). Both accept an optional $password argument that is fed through the HMAC step.

Generate a fresh keypair

Sign + verify

verify() returns false for any signature whose length is not exactly 64 bytes, in addition to the cryptographic check.

KeyPair layout

TON mnemonic parameters

These constants are exposed on Mnemonic::DEFAULT_SALT, Mnemonic::PBKDF2_ITERATIONS, Mnemonic::PBKDF2_OUTPUT_BYTES.

Requirements

No composer dependencies.

Related packages

Package Tier Purpose
amashukov/ton-cell-php leaf TLB Cell / BoC serialization
amashukov/ton-wallet-php composite TON wallet contracts + address derivation
amashukov/toncenter-client-php RPC toncenter v2/v3 API client
amashukov/ton-php meta TON umbrella package
amashukov/keccak-php leaf keccak-256 hashing

Quality

License

MIT.


All versions of ton-crypto-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
ext-sodium Version *
ext-hash Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package amashukov/ton-crypto-php contains the following files

Loading the files please wait ...