service block groups related methods, and each rpc inside it declares one method with exactly one request message and one response message.
google.api.http option on the method is what produces the REST route on port 1317. Methods without that option are reachable over gRPC only.
Modules define Query services and Msg services:
Queryservices are registered into the gRPC query router and served on port 9090.Msgservices are registered into the message service router, which is consulted only while a transaction is being delivered.
Scalar encodings
Some fields use SDK encoding conventions layered on protobufstring or bytes types.
Account, operator, and consensus addresses belong to separate address spaces. Using the wrong type fails with
hrp does not match bech32 prefix. Prefixes are chain-specific; query cosmos.auth.v1beta1.Query/Bech32Prefix to find them.
cosmos.Dec encodings
The value 0.05 appears differently depending on where it is read or written:
Field tables identify each field’s read encoding. When writing, transaction JSON uses decimal strings and protobuf JSON uses scaled integers.
The wrong encoding may produce a valid but incorrect value. For example,
"50000000000000000" in transaction JSON means fifty quadrillion, while the same value returned by staking as a scaled integer means 5%.
Other encodings
JSON encodesbytes fields as base64. Hex input may decode successfully as base64 and produce the wrong value.
A response’s pagination.next_key is already base64. Pass it back unchanged over gRPC. In a REST query string, percent-encode it so + is not interpreted as a space.
An Any field contains an @type discriminator and the concrete message’s fields. For example, cosmos.auth.v1beta1.Query/Account may return a BaseAccount, ModuleAccount, or vesting account.
Protobuf JSON usually omits fields with default values. A successful query with no matches may therefore return {} instead of an empty list.
List available services
These pages cover the standard modules for one SDK version. Each chain registers its own services. When enabled, gRPC reflection gives the authoritative list:-import-path and -proto.
Call a method
Pass the request as JSON with-d. Fields accept either protobuf names such as resolve_denom or JSON names such as resolveDenom.
Pagination
List queries accept and return apagination field. Use either an offset or a key:
pagination.next_key as pagination.key to request the next page. Key-based pagination is more efficient for large result sets.