Skip to main content

Chain endpoints

GET /chain/genesis

Returns the genesis block details.

curl https://api-server.mintlayer.org/api/v2/chain/genesis
{
"block_id": "2cf01f196066bb6f3a4856deb7999294ff520f633fe48e118e8044390e409870",
"genesis_message": "In a free-market economy, every individual should be free to ...",
"timestamp": { "timestamp": 1693504760 }
}

GET /chain/tip

Returns the current chain tip: height and block ID.

curl https://api-server.mintlayer.org/api/v2/chain/tip
{
"block_height": 686593,
"block_id": "7c337ff1a81fea9d2b394d251b7f115abbef53535cfc4ec32b994a63d0f17b77"
}

GET /chain/{height}

Returns the block ID at a given mainchain height. The ID is returned as a bare JSON string.

curl https://api-server.mintlayer.org/api/v2/chain/686593
"7c337ff1a81fea9d2b394d251b7f115abbef53535cfc4ec32b994a63d0f17b77"

Returns null if no block exists at that height (e.g. height above the tip or an orphaned height).

Go SDK

tip, err := client.Indexer.GetTip(ctx)          // GET /chain/tip
id, err := client.Indexer.GetBlockIDAtHeight(ctx, 686593) // GET /chain/:height

See the indexer client reference.