This document describes the built-in accounts system of Injective.Pre-requisite Readings:
Account type that uses Ethereum’s ECDSA secp256k1 curve for keys. This satisfies the EIP84 for full BIP44 paths. The root HD path for Injective-based accounts is m/44'/60'/0'/0.
Addresses and Public Keys
There are 3 main types ofAddresses/PubKeys available by default on Injective:
- Addresses and Keys for accounts, that identify users (i.e., the sender of a
message). They are derived using theeth_secp256k1curve. - Addresses and Keys for validator operators, which identify the operators of validators. They are derived using the
eth_secp256k1curve. - Addresses and Keys for consensus nodes, which identify the validator nodes participating in consensus. They are derived using the
ed25519curve.
| Address bech32 Prefix | Pubkey bech32 Prefix | Curve | Address byte length | Pubkey byte length | |
|---|---|---|---|---|---|
| Accounts | inj | injpub | eth_secp256k1 | 20 | 33 (compressed) |
| Validator Operator | injvaloper | injvaloperpub | eth_secp256k1 | 20 | 33 (compressed) |
| Consensus Nodes | injvalcons | injvalconspub | ed25519 | 20 | 32 |
Address formats for clients
EthAccounts can be represented in both Bech32 and hex format for Ethereum’s Web3 tooling compatibility.
The Bech32 format is the default format for Cosmos-SDK queries and transactions through CLI and REST clients. The hex format is the Ethereum common.Address representation of a Cosmos sdk.AccAddress.
- Address (Bech32):
inj14au322k9munkmx5wrchz9q30juf5wjgz2cfqku - Address (EIP55 Hex):
0xAF79152AC5dF276D9A8e1E2E22822f9713474902 - Compressed Public Key:
{"@type":"/injective.crypto.v1beta1.ethsecp256k1.PubKey","key":"ApNNebT58zlZxO2yjHiRTJ7a7ufjIzeq5HhLrbmtg9Y/"}
The Cosmos SDK Keyring output (i.e
injectived keys) only supports addresses in Bech32 format.Derive Injective Account from a private key/mnemonic
Below is an example of how to derive an Injective Account from a private key and/or a mnemonic phrase:Subaccounts
Injective subaccounts allow a single main wallet address to manage multiple, isolated trading accounts. This is useful for power users, especially professional traders and market makers.Key features and explanation
- Programmatic access: This feature is designed to be highly accessible for programmatic trading via Injective’s native APIs, catering to financial application developers.
- Advanced account management: The subaccounts feature provides sophisticated account management capabilities, enabling users (e.g., institutions or algorithmic traders) to segregate funds and trading strategies within a single, primary Injective address.
- Isolation and organization: Funds and orders within one subaccount are isolated from others, which is critical for managing risk, running different trading bots, or applying distinct strategies simultaneously without interference.
- Seamless transfers: Users can easily transfer assets between their main account balance and their various subaccounts, as well as between different subaccounts, using specific messages on the Injective network.
- Integration with exchange modules: The subaccounts functionality is part of Injective’s core exchange module, which includes an on-chain order book and matching engine for spot, perpetual, futures, and options markets.
