Hkchain

Developers

Connect to a network, read chain state, and submit transactions that clear the compliance gates.

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:

PathYou useTypical caller
CosmosREST / gRPC queries, protobuf transaction messagesBack-office services, compliance tooling, wallets built on Cosmos tooling
EVMEthereum JSON-RPC, an ERC-20 interface at a fixed address per stablecoinMetaMask, 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:

InterfaceLocal nodeUse for
Cosmos RESThttp://localhost:1317Queries over HTTP/JSON, including all Hkchain module queries
Cosmos gRPClocalhost:9090Typed queries and transaction broadcast from a Go/TS gRPC client
CometBFT RPC / WebSockethttp://localhost:26657, ws://localhost:26657/websocketBlocks, transaction lookup by hash, live event subscription
Ethereum JSON-RPC / WebSockethttp://localhost:8545, ws://localhost:8546eth_* 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.

InterfacePublic testnet endpoint
Cosmos RESThttps://api.hkchains.net
CometBFT RPChttps://rpc.hkchains.net
CometBFT WebSocketwss://rpc.hkchains.net/websocket
Ethereum JSON-RPChttps://evm.hkchains.net
Web homepagehttps://hkchains.net
Dashboardhttps://hkchains.net/dashboard
Explorerhttps://hkchains.net/explorer
Faucet and KYC portalhttps://portal.hkchains.net
Documentationhttps://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:

PropertyHow to read it
Cosmos chain IDGET {rest}/cosmos/base/tendermint/v1beta1/node_info → default_node_info.network (or CometBFT /status)
EIP-155 chain IDeth_chainId

The values currently in use:

NetworkCosmos chain IDEIP-155 chain ID
Local nodehkchain_262144-1262144
Hkchain testnethkchaintest_2026-12026

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:

PropertyValue
Account address prefixhkchain1… (Bech32)
Ethereum address form0x… — 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.

DenomBase unitDecimalsWhat it is
ahkcatto-HKC18 (display hkc)The native coin: gas, staking, governance. Not a stablecoin, and not regulated money.
hkd.<issuer>fen2 (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.hsbc is 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:

  1. 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.
  2. 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.

PageCovers
Getting startedConfirming which network you reached, first queries, getting a usable account, running a node
Accounts and keysKey type, the two address encodings, account number and sequence, the identity record, delegated keys
Transaction lifecycleWhere the compliance gates sit, what they inspect, and what they ignore
Building and signingThe transaction envelope, the Travel Rule payload, tier selection, fees
Broadcasting and confirmationSubmitting, the two verdicts behind one hash, polling, transaction search
Events and indexingTyped-event shape, subscribing, and where the event set diverges from the message set
Errors and rejectionsEvery failure mode, the gate trace, and the module error tables
Worked examplesFour runnable end-to-end examples: REST reads, a signed transfer, inspecting the result, the EVM path
Integration patternsWallet, 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.

Start here

Sending a transaction

Reading what happened

Putting it together