---
title: "MainChain returns the canonical chain"
method: GET
path: "/babylon/btclightclient/v1/mainchain"
tags: ["Query"]
---

# MainChain returns the canonical chain

`GET /babylon/btclightclient/v1/mainchain`

## Request

- The document declares no server URL.
- Auth: none declared

## Query parameters

- `pagination.key` string, byte
- `pagination.offset` string, uint64
- `pagination.limit` string, uint64
- `pagination.count_total` boolean
- `pagination.reverse` boolean

## Response `200`

A successful response.

- object: QueryMainChainResponse is response type for the Query/MainChain RPC method.
  - `headers` object[]
    - `header_hex` string
    - `hash_hex` string
    - `height` integer
    - `work` string: Work is the sdkmath.Uint as string.
  - `pagination` object: PageResponse is to be embedded in gRPC response messages where the corresponding request message has used PageRequest. message SomeResponse { repeated Bar results = 1; PageResponse page = 2; }
    - `next_key` string, byte: next_key is the key to be passed to PageRequest.key to query the next page most efficiently. It will be empty if there are no more results.
    - `total` string, uint64

## Other responses

- `default`: An unexpected error response.

---

[API](https://skmtc.dev/babylonlabs-io/apis/babylon-grpc-gateway-docs.md) - [All operations](https://skmtc.dev/babylonlabs-io/apis/babylon-grpc-gateway-docs/llms.txt) - [OpenAPI document](https://skmtc.dev/babylonlabs-io/apis/babylon-grpc-gateway-docs/revisions/93a09c641887?raw)
