---
title: getBlockCommitment
description: >-
  Returns the stake-weighted commitment information recorded for a slot.
url: /docs/rpc/http/getblockcommitment
type: reference
hideTableOfContents: true
---

Returns the stake-weighted commitment information recorded for a slot.

<Callout type="info" title="Source">
  [`get_block_commitment`](https://github.com/anza-xyz/agave/blob/v3.1.8/rpc/src/rpc.rs#L940)
</Callout>

<APIMethod>

```jsonc !!request curl
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getBlockCommitment",
  "params": [
    // !hover slot number
    5
  ]
}
```

```ts !!request title="Kit"
import { createSolanaRpc } from "@solana/kit";

const rpc_url = "https://api.devnet.solana.com";
const rpc = createSolanaRpc(rpc_url);

// !hover slot number
const slot_number = BigInt(5);

let blockCommitment = await rpc.getBlockCommitment(slot_number).send();

console.log("block commitment:", blockCommitment);
```

### !params

#### !! slot number

!type u64  
!required

Slot to query.

### !!result

```jsonc !response
{
  "jsonrpc": "2.0",
  // !hover(1:7) result
  "result": {
    // !hover(1:4) commitment
    "commitment": [
      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
      0, 0, 0, 0, 0, 10, 32
    ],
    // !hover totalStake
    "totalStake": 42
  },
  "id": 1
}
```

!type object

Commitment response object containing:

##### !! commitment

!type array | null

Array of stake totals, in lamports, that voted on the block at each lockout
depth from `0` through
[`MAX_LOCKOUT_HISTORY`](https://github.com/anza-xyz/solana-sdk/blob/clock%40v2.2.3/vote-interface/src/state/mod.rs#L33).

##### !! totalStake

!type u64

Total active stake, in lamports, of the current epoch.

</APIMethod>
