This section is for engineers integrating an application, a wallet, or a back-office service with Hkchain. It assumes no knowledge of the chain beyond standard blockchain concepts.
Hkchain is a Cosmos SDK chain with an Ethereum-compatible execution layer. Reading state and submitting transactions therefore works in two ways, and both are first-class:
| Path | You use | Typical caller |
|---|---|---|
| Cosmos | REST / gRPC queries, protobuf transaction messages | Back-office services, compliance tooling, wallets built on Cosmos tooling |
| EVM | Ethereum JSON-RPC, an ERC-20 interface at a fixed address per stablecoin | MetaMask, Solidity dApps, anything already speaking Ethereum |
The two paths reach the same balances, and the supported way to move a
stablecoin on each — a Cosmos MsgSend, or the extended ERC-20
transferWithTravelRule — reaches the same compliance gates. A transfer
the chain rejects on one of those is rejected for the same reason on the other:
neither is the permissive path. The practical consequence for an integrator: an
HKD transfer needs Travel Rule data attached whichever path you choose, so the
plain ERC-20 transfer is deliberately not available (see
API Reference).
That parity is a statement about the supported transfer shapes, not about every message the chain will accept. The gates inspect a fixed set of message shapes and do not inspect the rest, which is why building on the supported shapes is part of integrating correctly rather than a stylistic preference. Transaction lifecycle names the set exactly.
The rules are shared; the mechanics are not. The gates run at a different point in each path, so a rejection surfaces in a different place and your error handling has to be written per path. The same page sets the two side by side.
Network endpoints
Every Hkchain node exposes four independent interfaces. Use the localhost endpoints when developing against a node you started yourself; use the hosted endpoints only when you intentionally target the public testnet.
Local development node
These default localhost endpoints remain available on a locally deployed node:
| Interface | Local node | Use for |
|---|---|---|
| Cosmos REST | http://localhost:1317 | Queries over HTTP/JSON, including all Hkchain module queries |
| Cosmos gRPC | localhost:9090 | Typed queries and transaction broadcast from a Go/TS gRPC client |
| CometBFT RPC / WebSocket | http://localhost:26657, ws://localhost:26657/websocket | Blocks, transaction lookup by hash, live event subscription |
| Ethereum JSON-RPC / WebSocket | http://localhost:8545, ws://localhost:8546 | eth_* calls, contract reads, MetaMask |
export CHAIN_ID=hkchain_262144-1
export EVM_CHAIN_ID=262144
export REST=http://localhost:1317
export GRPC=localhost:9090
export RPC=http://localhost:26657
export RPC_WS=ws://localhost:26657/websocket
export EVM_RPC=http://localhost:8545
export EVM_WS=ws://localhost:8546
Hosted public testnet
The currently hosted network is a public testnet. Its assets have no monetary value and the network may be reset as testing requires.
| Interface | Public testnet endpoint |
|---|---|
| Cosmos REST | https://api.hkchains.net |
| CometBFT RPC | https://rpc.hkchains.net |
| CometBFT WebSocket | wss://rpc.hkchains.net/websocket |
| Ethereum JSON-RPC | https://evm.hkchains.net |
| Web homepage | https://hkchains.net |
| Dashboard | https://hkchains.net/dashboard |
| Explorer | https://hkchains.net/explorer |
| Faucet and KYC portal | https://portal.hkchains.net |
| Documentation | https://hkchains.net/docs |
Copy this shell configuration to start against it:
export CHAIN_ID=hkchaintest_2026-1
export EVM_CHAIN_ID=2026
export REST=https://api.hkchains.net
export RPC=https://rpc.hkchains.net
export RPC_WS=wss://rpc.hkchains.net/websocket
export EVM_RPC=https://evm.hkchains.net
export WEB=https://hkchains.net
export DASHBOARD=https://hkchains.net/dashboard
export EXPLORER=https://hkchains.net/explorer
export DOCS=https://hkchains.net/docs
export PORTAL=https://portal.hkchains.net
Public gRPC and EVM WebSocket endpoints are deliberately not exposed. Use
REST for typed Cosmos queries, CometBFT WebSocket for live chain events, and
HTTP Ethereum JSON-RPC for eth_* calls and MetaMask.
Treat all endpoint URLs as per-network configuration rather than application constants. A different hosted network can publish a different subset or use a different hostname layout.
Chain identity
Chain identity is per network. Read it from the network you are connected to rather than compiling it in:
| Property | How to read it |
|---|---|
| Cosmos chain ID | GET {rest}/cosmos/base/tendermint/v1beta1/node_info → default_node_info.network (or CometBFT /status) |
| EIP-155 chain ID | eth_chainId |
The values currently in use:
| Network | Cosmos chain ID | EIP-155 chain ID |
|---|---|---|
| Local node | hkchain_262144-1 | 262144 |
| Hkchain testnet | hkchaintest_2026-1 | 2026 |
The two are consistent by construction: a Cosmos chain ID on this chain always
has the <name>_<eip155>-<epoch> shape the EVM layer requires, so the number in
the middle is the EIP-155 chain ID.
Address encoding, by contrast, is the same on every Hkchain network:
| Property | Value |
|---|---|
| Account address prefix | hkchain1… (Bech32) |
| Ethereum address form | 0x… — the same account, re-encoded; one key controls both forms |
Because a single key has two address encodings, an integrator that indexes addresses should normalise to one form. The public explorer accepts either and redirects to the canonical page.
Denominations
All on-chain amounts are integers in a base unit. Nothing on chain is a decimal; convert at the display edge only.
| Denom | Base unit | Decimals | What it is |
|---|---|---|---|
ahkc | atto-HKC | 18 (display hkc) | The native coin: gas, staking, governance. Not a stablecoin, and not regulated money. |
hkd.<issuer> | fen | 2 (display hkd) | An HKD stablecoin issued by one licensed issuer, e.g. hkd.hsbc. 1 HKD = 100 fen. |
Two consequences worth internalising before writing code:
- There is no single "HKD" token. Each licensed issuer's liability is its
own denom.
100000 hkd.hsbcis HKD 1,000.00 of HSBC-issued stablecoin, and it is not interchangeable with another issuer's denom at the protocol level. - Gas is paid in
ahkc, never in a stablecoin. An account needs a native balance to transact, which is why test networks front a native faucet.
Compliance rules apply to the stablecoin denoms. A native ahkc transfer
carries no compliance obligation and passes no identity gate — that split is
intentional and documented in the
compliance model.
Before your first transaction
Two things reject transactions that look correct in every other respect:
- Identity. The sending and receiving accounts must be enrolled in the chain's identity registry at a level that permits the operation. On a test network the onboarding portal issues that enrolment.
- Travel Rule data. Every stablecoin transfer carries originator and beneficiary information, with a broader field set at or above HKD 8,000. Attach a Travel Rule payload walks the exact shape and the tier boundary.
When a transaction is rejected, the failure names the gate that rejected it and the reason, and the same trace is available afterwards by transaction hash — so a rejection is diagnosable rather than opaque.
The pages in this section
Read in order for a complete path from an endpoint URL to a confirmed transaction, or jump to the one you need.
| Page | Covers |
|---|---|
| Getting started | Confirming which network you reached, first queries, getting a usable account, running a node |
| Accounts and keys | Key type, the two address encodings, account number and sequence, the identity record, delegated keys |
| Transaction lifecycle | Where the compliance gates sit, what they inspect, and what they ignore |
| Building and signing | The transaction envelope, the Travel Rule payload, tier selection, fees |
| Broadcasting and confirmation | Submitting, the two verdicts behind one hash, polling, transaction search |
| Events and indexing | Typed-event shape, subscribing, and where the event set diverges from the message set |
| Errors and rejections | Every failure mode, the gate trace, and the module error tables |
| Worked examples | Four runnable end-to-end examples: REST reads, a signed transfer, inspecting the result, the EVM path |
| Integration patterns | Wallet, merchant, agent, indexer and supervisory integrations |
Related reading
- API Reference — every Hkchain query, message and event, and where the inherited Cosmos, CometBFT and Ethereum APIs are specified.
- Mint HKD into circulation — the first of the protocol workflow guides, each describing what happens on and off chain for one scenario.
- Architecture — how the modules and the execution layer fit together.