The OKTC blockchain features a robust and flexible accounts system designed to support both Ethereum-compatible tooling and Cosmos SDK-based infrastructure. This guide dives deep into the architecture of OKTC accounts, explaining address formats, public key types, and how different components interact across clients and networks.
Core Concepts of OKTC Accounts
At its foundation, OKTC utilizes a custom Account implementation that leverages the ECDSA secp256k1 elliptic curve for cryptographic operations—aligning with Ethereum’s security model while integrating BIP44 hierarchical deterministic (HD) wallet standards. This design enables full compatibility with Ethereum development tools and Cosmos SDK modules.
👉 Discover how OKTC supports seamless cross-chain interactions through unified account standards.
The root derivation path for HD wallets on OKTC is:
m/44'/60'/0'/0This path adheres to EIP84 guidelines, ensuring interoperability with popular wallet implementations such as Ledger and MetaMask when configured properly.
Address and Public Key Types on OKTC
OKTC supports three primary types of addresses and corresponding public keys, each serving a distinct role in network operations:
1. User Accounts
Used by individuals to send transactions, participate in governance, and manage assets. These are standard user-controlled wallets derived using the eth_secp256k1 curve.
2. Validator Operator Keys
Identify the operators responsible for running validator nodes. These keys are used to sign delegation, undelegation, and commission-related transactions.
3. Consensus Node Keys
Represent validator nodes actively participating in consensus. Unlike the other two types, these use the Ed25519 digital signature algorithm, known for high performance and strong security in distributed systems.
Each type has specific Bech32 prefixes and formatting rules:
- User Account Address:
ex1...| Public Key:expub...| Curve:eth_secp256k1 - Validator Operator Address:
exvaloper1...| Public Key:exvaloperpub...| Curve:eth_secp256k1 - Consensus Node Address:
exvalcons1...| Public Key:exvalconspub...| Curve:ed25519
All address byte lengths are 20 bytes; public keys are either 33 bytes (compressed secp256k1) or 32 bytes (Ed25519).
Dual Address Format Support for Developer Flexibility
One of OKTC’s standout features is its dual-format address system, which bridges the gap between Cosmos and Ethereum ecosystems.
Bech32 vs Hex: What You Need to Know
Bech32 Format (ex...)
The default format used by Cosmos SDK tools like CLI and REST APIs. It's case-insensitive, error-detecting, and widely adopted in Cosmos-based chains.Example:
ex1hcngft7gfkhn8z8fnlajzh7agyt0az0v6ztmmeHex Format (0x...)
Compatible with Ethereum’s Web3 tooling (e.g., MetaMask, Hardhat). This follows EIP55 checksum encoding for improved safety.Example:
0xBE2684Afc84daf3388E99FFB215FdD4116FE89EC
Both formats originate from the same mnemonic seed and represent the same underlying account. This means:
- Balances are shared across both representations.
- Transactions sent from one format affect the balance visible in the other.
- Importing a mnemonic into MetaMask recovers the 0x-prefixed address automatically.
👉 Learn how developers can build dApps that work seamlessly across both formats.
How to Use OKTC Addresses Across Platforms
Understanding where each address format works is crucial for smooth interaction with the network.
Using ex-Prefixed Addresses
These are fully supported across:
- OKTC Web Wallet (DEX interface)
- Mobile applications
- Command-line tools (
exchaincli) - Governance voting
- Staking and delegation
You can perform transfers, deposits, vote on proposals, and manage staking positions.
Using 0x-Prefixed Addresses
Currently limited primarily to:
- MetaMask integration
- Token transfers via Web3 wallets
⚠️ Important Note:
Cross-format transfers are not allowed. An address starting with ex can only send funds to another ex address. Similarly, a 0x address should only transact with other 0x addresses within Ethereum-compatible environments.
Converting Between Address Formats
Since both address types stem from the same private key, conversion between Bech32 (ex) and Hex (0x) is possible using official SDKs.
Supported Conversion Methods
Developers can use the following libraries to convert addresses programmatically:
- Java SDK:
UseconvertAddressFromHexToBech32()andconvertAddressFromBech32ToHex()inAddressUtil.java - JavaScript SDK:
Utilize equivalent functions in thecrypto/index.jsmodule
These utilities allow applications to display both formats dynamically or translate inputs for backend processing.
For example:
import { convertAddressFromHexToBech32 } from '@okx/exchain-javascript-sdk';
const bech32Addr = convertAddressFromHexToBech32('0xBE2684Afc84daf3388E99FFB215FdD4116FE89EC');
// Returns: ex1hcngft7gfkhn8z8fnlajzh7agyt0az0v6ztmmeThis functionality empowers wallets and explorers to provide a unified view of user balances regardless of format.
Frequently Asked Questions (FAQ)
Q: Are ex and 0x addresses the same wallet?
A: Yes. Both derive from the same mnemonic phrase and control the same balance. They are simply different representations for different tooling ecosystems.
Q: Can I transfer OKT from an ex address to a 0x address?
A: No. Direct cross-format transfers are disabled to prevent user errors. Always ensure sender and recipient use the same format.
Q: Why does OKTC support two address formats?
A: To ensure compatibility with both Cosmos SDK tools (Bech32) and Ethereum’s Web3 ecosystem (Hex), enabling broader developer access and user flexibility.
Q: How do I recover my account in MetaMask?
A: Import your 12- or 24-word mnemonic into MetaMask. It will automatically generate the corresponding 0x-prefixed address linked to your OKTC account.
Q: Is there a risk of losing funds if I use the wrong format?
A: While funds aren't lost (since keys are identical), sending to an unsupported format may result in failed transactions or temporary unavailability. Always double-check recipient formats.
Q: Can I see my balance on both formats simultaneously?
A: Yes. Block explorers and multi-chain wallets often display both formats side-by-side, showing the unified balance under one identity.
Final Thoughts
OKTC’s account model exemplifies modern blockchain interoperability—blending best practices from Ethereum and Cosmos to deliver a versatile, secure, and developer-friendly environment. Whether you're building decentralized applications, managing staking operations, or simply transferring assets, understanding the nuances of address formats ensures smoother interactions across platforms.
👉 Get started with OKTC development using unified tools that support both Bech32 and Hex addresses.
By leveraging standardized curves, dual-format compatibility, and clear conversion paths, OKTC lowers entry barriers for developers while maintaining robust security and network integrity.