Skip to content
Open
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
51 changes: 49 additions & 2 deletions ecosystem/wallet-apps/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,53 @@
title: "Overview"
---

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

<Stub issue="135" />
This article provides an overview of wallet apps built on the standard [wallet contract](/standard/wallets/how-it-works), explaining how they are classified based on _key management, storage method, and intended use_.

<Aside
type="caution"
>
**Wallet apps** are user-facing applications for managing assets and interacting with contracts.

**Wallet contracts** are separate on-chain smart contracts.
</Aside>

## Wallet types

Wallets are classified by how they manage private keys, store them, and their intended usage.

### Custodial and non-custodial

Wallets are defined by _how private keys are managed_.

- **Custodial wallets** store private keys with a third party, such as an exchange or service provider. The custodian manages security and may provide account recovery. However, users must trust the custodian with full access to their assets.
- **Non-custodial or self-custody wallets** store private keys only with the user. Keys are protected with a **seed phrase** — a sequence of 24 words generated at wallet creation. This gives the user _complete ownership_ and _control over their data_. However, full responsibility also applies: losing the seed phrase means permanent loss of access.

### Hardware and software

The storage of private keys defines wallet types — _online (hot) or offline (cold)_.

- **Hardware (cold) wallets** are physical devices that keep private keys offline, isolated from internet exposure. When authorizing a transaction, the device signs it internally, ensuring that private keys remain on the device.
- **Software (hot) wallets** run on devices such as smartphones or computers. Private keys are stored in the device’s secure storage, making them readily available for transactions but also exposed to online risks. Software wallets include **mobile**, **web**, and **desktop** applications.

### Developer and user

Wallets differ by their intended use.

- **User wallets** are designed for everyday operations, including storing, sending, and receiving Toncoin or tokens, as well as interacting with applications. Their design emphasizes usability and accessibility.
- **Developer wallets** are designed for testing and development purposes. They are typically used with Testnet, SDKs, or command-line tools to deploy contracts, generate keys, and send transactions in controlled environments.

<Aside
type="caution"
>
Developer wallets, such as TonDevWallet, are intended for Testnet only. Do **not** use them on Mainnet, as this may result in irreversible loss of funds.
</Aside>

## Wallet apps

| Wallet app | Description | Creator |
| --------------------------------------------- | :--------------------------------------------------------------------------: | ----------- |
| [Tonkeeper](/ecosystem/wallet-apps/tonkeeper) | Self‑custodial wallet supports jettons, NFTs, and TON Connect. | Open-source |
| [TonDevWallet](/ecosystem/wallet-apps/dev) | Self‑custodial desktop wallet designed for development and testing. | Open-source |
| [wallet.ton.org](/ecosystem/wallet-apps/web) | Self-custodial wallet supports jettons, NFTs, TON DNS, TON Sites, TON Proxy. | TON Core |
16 changes: 8 additions & 8 deletions standard/wallets/mnemonics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebarTitle: "Mnemonics"
import { Aside } from '/snippets/aside.jsx';


## Key pair
## Key pair

TON Blockchain uses asymmetric cryptography, such as the [Ed25519](https://en.wikipedia.org/wiki/EdDSA#Ed25519) signature scheme.

Expand All @@ -32,7 +32,7 @@ The most commonly used values are:
| `c` | Number of iterations desired | 100000
| `dkLen` | Desired bit-length of the derived key | 64

### Generate a key pair
### Generate a key pair

```ts title="TypeScript"
import { mnemonicToPrivateKey, mnemonicNew } from "@ton/crypto";
Expand All @@ -41,7 +41,7 @@ import { mnemonicToPrivateKey, mnemonicNew } from "@ton/crypto";
const mnemonicArray = await mnemonicNew();

// derive private and public keys from the mnemonic
const keyPair = await mnemonicToPrivateKey(mnemonicArray);
const keyPair = await mnemonicToPrivateKey(mnemonicArray);

console.log("Public Key: " + keyPair.publicKey.toString('hex'));
console.log("Private Key: " + keyPair.secretKey.toString('hex'));
Expand All @@ -53,9 +53,9 @@ The private key is needed to sign messages, and the public key is stored in the
Save the generated mnemonic seed phrase. If you need deterministic behavior during development, print and reuse the exact phrase so the wallet derives the same key pair on every run.
</Aside>

## Mnemonic validation
## Mnemonic validation

1. Check that all the words are from the list of [BIP-39](https://github.com/ton-org/ton-crypto/blob/c3435833a0da52a96f674c352c4c6f91fcc07f6d/src/mnemonic/wordlist.ts#L9).
1. Check that all the words are from the list of [BIP-39](https://github.com/ton-org/ton-crypto/blob/c3435833a0da52a96f674c352c4c6f91fcc07f6d/src/mnemonic/wordlist.ts#L9).
2. If a password is used: the first byte of the derived `seed` computed with `c = 1` and `salt = 'TON fast seed version'` must equal `0`.
3. If no password is used: the first byte of the derived `seed` computed with `c = floor(100000/256) = 390` and `salt = 'TON seed version'` must equal `1`.

Expand All @@ -66,6 +66,6 @@ Random mnemonic phrases are generated until PBKDF2 yields a seed whose first byt
```ts title="TypeScript"
import { mnemonicNew } from "@ton/crypto";

const mnemonicArray = await mnemonicNew();
console.log(mnemonicArray);
```
const mnemonicArray = await mnemonicNew();
console.log(mnemonicArray);
```
Loading