Ton.Crypto 0.2.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package Ton.Crypto --version 0.2.5
                    
NuGet\Install-Package Ton.Crypto -Version 0.2.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ton.Crypto" Version="0.2.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ton.Crypto" Version="0.2.5" />
                    
Directory.Packages.props
<PackageReference Include="Ton.Crypto" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Ton.Crypto --version 0.2.5
                    
#r "nuget: Ton.Crypto, 0.2.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Ton.Crypto@0.2.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Ton.Crypto&version=0.2.5
                    
Install as a Cake Addin
#tool nuget:?package=Ton.Crypto&version=0.2.5
                    
Install as a Cake Tool

Ton.NET

Banner

A modern, comprehensive .NET SDK for the TON (The Open Network) blockchain. Built from scratch with clean architecture, targeting compatibility with the official TON JavaScript SDK.

Documentation License: MIT

โœจ Features

  • ๐ŸŽฏ API compatibility with TON JavaScript SDK
  • ๐Ÿ”’ Type-safe primitives and TL-B structures
  • ๐Ÿงช 553+ tests with comprehensive coverage
  • ๐Ÿ“ฆ Modular architecture - use only what you need
  • ๐Ÿš€ Production-ready with .NET 8 & 9 support
  • ๐Ÿ“š Complete documentation with examples

๐Ÿ“ฆ Packages

Package Version Description
Ton.Core NuGet Core primitives: Cells, BOC, Addresses, Types
Ton.Crypto NuGet Ed25519, Mnemonics (BIP39), SHA, HMAC
Ton.Contracts NuGet Smart contracts: Wallets V5R1
Ton.LiteClient NuGet ADNL protocol for direct node communication
Ton.HttpClient NuGet HTTP API clients (Toncenter v2/v4)

๐Ÿš€ Quick Start

Install packages:

dotnet add package Ton.LiteClient

Create a wallet and check balance:

using Ton.Crypto.Mnemonic;
using Ton.Contracts.Wallets.V5;
using Ton.LiteClient;

// Generate mnemonic
var mnemonic = Mnemonic.New(24);
var keys = Mnemonic.ToWalletKey(mnemonic);

// Create wallet
var wallet = new WalletV5R1(keys.PublicKey);
Console.WriteLine($"Address: {wallet.Address}");

// Connect to blockchain
var client = await LiteClientFactory.CreateFromUrlAsync(
    "https://ton.org/global-config.json"
);

// Get balance
var info = await client.GetMasterchainInfoAsync();
var state = await client.GetAccountStateAsync(wallet.Address, info.Last);
Console.WriteLine($"Balance: {state.BalanceInTon} TON");

๐Ÿ“š Documentation

View Full Documentation โ†’

Getting Started

Modules

Guides

API Reference

๐Ÿงช Testing

dotnet test

Test Coverage:

  • 298 Core tests (BOC, TL-B, Dictionaries, Addresses)
  • 47 Crypto tests (Mnemonics, Ed25519, Hashing)
  • 41 Contracts tests (Wallets)
  • 156 ADNL tests (Protocol, Serialization, Crypto)
  • 11 LiteClient tests (Integration)

Total: 553 passing tests

All tests validate compatibility with TON JavaScript SDK behavior.

๐Ÿ—๏ธ Architecture

Ton.LiteClient  โ†’ High-level blockchain queries (ADNL protocol)
    โ”œโ”€โ”€ Ton.Adnl      โ†’ Low-level ADNL protocol
    โ”œโ”€โ”€ Ton.Core      โ†’ Core primitives (Cell, Address, BOC)
    โ””โ”€โ”€ Ton.Crypto    โ†’ Cryptographic operations

Ton.HttpClient  โ†’ HTTP API client (Toncenter v2/v4)
    โ”œโ”€โ”€ Ton.Core
    โ””โ”€โ”€ Ton.Crypto

Ton.Contracts   โ†’ Smart contract implementations
    โ”œโ”€โ”€ Ton.Core
    โ””โ”€โ”€ Ton.Crypto

Key Design Principles

  • Type Safety - Nullable reference types, records, pattern matching
  • Zero External Dependencies - Only System.Text.Json for HTTP clients
  • Performance - Efficient cell serialization and hashing
  • Compatibility - 1:1 API compatibility with TON JS SDK
  • Testability - Comprehensive test coverage

๐Ÿ› ๏ธ Development

Requirements

  • .NET 8.0 or .NET 9.0
  • C# 12 language features

Samples

Check out the /samples directory:

  • LiteClientPlayground - LiteClient usage examples
  • AdnlSample - Low-level ADNL protocol examples

๐Ÿค Contributing

Contributions are welcome! This project aims for API compatibility with the TON JavaScript SDK.

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

๐Ÿ“„ License

MIT License - see LICENSE file for details.

๐Ÿ”— Resources

Official TON

Community

Ton.NET


Made with โค๏ธ for the TON community

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Ton.Crypto:

Package Downloads
Ton.HttpClient

TON blockchain HTTP client library for .NET - Toncenter API v2/v4, wallet contracts (V1-V5), jettons, multisig. 1:1 API compatibility with @ton/ton JavaScript library.

Ton.Contracts

TON smart contract implementations for .NET - Wallet contracts (V1-V5), Jettons, and NFTs. 1:1 API compatibility with @ton/ton JavaScript library.

Ton.Adnl

ADNL (Abstract Datagram Network Layer) client for TON blockchain - Direct node communication with TL serialization, encryption, and auto-generated schema. Enables lite client implementation for TON.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.7 682 12/2/2025
0.2.6 355 11/16/2025
0.2.5 251 11/6/2025
0.2.4 257 10/30/2025
0.2.3 248 10/30/2025
0.2.2 243 10/29/2025
0.2.1 247 10/29/2025
0.2.0 218 10/29/2025
0.1.5 227 10/28/2025
0.1.4 212 10/28/2025
0.1.3 192 10/27/2025
0.1.2 194 10/27/2025
0.1.1 186 10/27/2025
0.1.0 163 10/26/2025
0.0.13 158 10/26/2025
0.0.12 156 10/26/2025
0.0.11 159 10/26/2025
0.0.10 157 10/26/2025
0.0.9 161 10/26/2025
0.0.8 158 10/26/2025
0.0.7 161 10/26/2025
0.0.6 157 10/26/2025
0.0.5 162 10/26/2025
0.0.4 161 10/26/2025
0.0.3 160 10/26/2025