How imToken’s Token Core Works – Private Key Management and Transaction Signing

日期:2026-08-04 18:59:43

What Is TokenCore?

TokenCore is a collection of open‑source native code for iOS and Android that manages all core wallet operations. It is designed specifically for key storage, derivation, and transaction signing, while networking and blockchain interaction are left to the integration application layer.


The code has been battle‑tested by over 7 million users and has undergone multiple rounds of security audits by firms such as SlowMist and Cure53. By open‑sourcing TokenCore, imToken allows security researchers, developers, and the broader community to inspect and verify the most sensitive cryptographic components of the wallet.


Private Key Management

Generation

Private keys in imToken are generated locally on your device using a true random number generator. For hardware wallets like imKey, a TRNG (True Random Number Generator) inside a secure chip is used to generate the mnemonic phrase and private keys, ensuring uniqueness and unpredictability.


Hierarchical Deterministic (HD) Wallet

imToken follows the BIP39/BIP44 protocol standards. With a Hierarchical Deterministic (HD) wallet architecture, a single mnemonic phrase (12 or more words) generates a root seed, from which an unlimited number of child private keys can be derived for different blockchains.


Each blockchain uses a dedicated HD derivation path:


Ethereum: m/44'/60'/0'/0/0


Bitcoin: follows its own BIP44 path


This means you only need to back up one mnemonic phrase to recover all your assets across multiple chains.


Encrypted Storage

Private keys are never stored in plain text. They are encrypted using AES‑256 and stored in system‑level secure areas:


iOS: stored in the Keychain


Android: stored in the Keystore


Additionally, imToken uses a self‑developed encryption format to store mnemonic phrases. The encrypted Keystore (private key storage file) is kept in the device's sandbox file system.


The private key is only decrypted in memory when needed for signing, and is immediately cleared after the operation completes.


Transaction Signing

The Signing Flow

When you initiate a transaction in imToken, the following sequence occurs:


Construct the transaction – The wallet builds an unsigned transaction locally.


Request user confirmation – The system prompts you to confirm the transaction details. This confirmation can be via password entry, fingerprint, or biometric authentication.


Decrypt the private key – Only after your explicit confirmation, the Keystore is decrypted using your password to obtain the private key.


Generate the signature – The private key is used to sign the transaction hash using the Elliptic Curve Digital Signature Algorithm (ECDSA) with the secp256k1 curve. This proves ownership of the tokens being sent.

image.png

Broadcast the transaction – The signed raw transaction is then broadcast to the corresponding blockchain network via the chain adapter layer.


Offline Signing

The entire signing process happens completely offline on your device. The private key never leaves your device. This "local signing + remote broadcast" separation ensures that no intermediary can tamper with the transaction content.


Multi-Chain Support

TokenCore supports signing for multiple blockchains, each with its own signature format:


Ethereum (ETH): V3 Keystore, transaction signing


Bitcoin (BTC): Traditional and SegWit signing formats


EOS: Transaction signing


Identity: Multi‑chain account derivation system, personal data stored on IPFS


Security Model Summary

Layer Mechanism

Generation True random number generator (TRNG) / hardware secure chip

Derivation HD wallet following BIP39/BIP44

Storage AES‑256 encryption, stored in iOS Keychain / Android Keystore

Signing ECDSA (secp256k1), offline, user‑confirmed

Network HTTPS/WSS encrypted communication

Auditability Open‑source code on GitHub, publicly reviewable

Why Open Source Matters

The open‑sourcing of TokenCore is significant for security. As the imToken team stated: "Given enough eyeballs, all bugs are shallow" (Linus's Law). While open source does not guarantee that code is vulnerability‑free, it provides a crucial foundation: security researchers, developers, and the community can inspect the code, reproduce issues, and continuously test it.


This is particularly important because wallet security depends not only on keeping your mnemonic phrase safe, but also on whether private keys are generated correctly and signatures are performed strictly according to cryptographic standards. A flawed signature implementation—as seen in other wallet incidents—can allow attackers to derive private keys from publicly visible signature data. TokenCore's open‑source model helps mitigate this risk through public scrutiny.


TAG: imToken TokenCore PrivateKey TransactionSigning Web3Security