# arc_getCertificate

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://arc-mainnet.g.alchemy.com/v2/{apiKey}

Returns the Malachite BFT commit certificate for a finalized block on Arc. The certificate contains the consensus round, the finalized block hash, and the base64-encoded validator signatures that decided the block. It is produced by Arc's Malachite consensus layer and is only available for blocks that have already been finalized.

Because Arc has deterministic finality on inclusion, once a certificate exists for a given height it is immutable and safe to cache indefinitely.

See the [Arc node RPC reference](https://docs.arc.io/arc/tutorials/run-an-arc-node) for background on the `arc` namespace.

Reference: https://www.alchemy.com/docs/chains/arc/arc-api-endpoints/arc-get-certificate

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| Block height | integer or string | Yes | The block height to fetch the certificate for. Accepts either a decimal integer (for example `7`) or a hex-encoded quantity string (for example `"0x7"`). Must be greater than or equal to `1`. |

## Result

**Commit certificate** (object): The commit certificate for the requested block height.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "arc_getCertificate",
  "params": [
    "0x7"
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "height": 7,
    "round": 0,
    "block_hash": "0x751ccaee8df96f648c9ab00121a4ac1a1bcafc0c8e8cb0d205c67346edb37af2",
    "signatures": [
      {
        "address": "0x602930d1ab44f1744f42e842b701c2b149c5da4f",
        "signature": "K3SKb2xKYGWLZ9eMIXtXYckACgU6AaOVwmymD4nIVT6GXvQ9UylllQpSWhTZfuV7oDjo75ynruLh4xHv++jQBA=="
      },
      {
        "address": "0x6791e002c8419e8a2fa5266e2951ed1780bc2295",
        "signature": "uNmquXJkx+4NyNnkLUnnRY+1ZZygb5drQbh9ya50oW0z0H9HS21R7PyueayfHoADnJT9DqbDF+D8KECLmy3+Cw=="
      },
      {
        "address": "0x2e78053671f707844a631bc907d4855894848fe3",
        "signature": "2/52ncq8uRzHMiBiVxTFk10BzEq9InHfHckBu/qK9fomDNmgOPSuwWURu49EGPDti7Q60If4n7/Qt3dLa2N7CQ=="
      }
    ]
  },
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://arc-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "arc_getCertificate",
  "params": [
    "0x7"
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'arc_getCertificate', params: ['0x7']})
};

fetch('https://arc-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://arc-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "arc_getCertificate",
    "params": ["0x7"]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://arc-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"arc_getCertificate\",\n  \"params\": [\n    \"0x7\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://arc-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"arc_getCertificate\",\n  \"params\": [\n    \"0x7\"\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://arc-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"arc_getCertificate\",\n  \"params\": [\n    \"0x7\"\n  ]\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: arc_getCertificate
summary: Returns the Malachite BFT commit certificate for a finalized Arc block at the given height.
description: |-
  Returns the Malachite BFT commit certificate for a finalized block on Arc. The certificate contains the consensus round, the finalized block hash, and the base64-encoded validator signatures that decided the block. It is produced by Arc's Malachite consensus layer and is only available for blocks that have already been finalized.

  Because Arc has deterministic finality on inclusion, once a certificate exists for a given height it is immutable and safe to cache indefinitely.

  See the [Arc node RPC reference](https://docs.arc.io/arc/tutorials/run-an-arc-node) for background on the `arc` namespace.
x-compute-units: 20
params:
  - name: Block height
    required: true
    description: The block height to fetch the certificate for. Accepts either a decimal integer (for example `7`) or a hex-encoded quantity string (for example `"0x7"`). Must be greater than or equal to `1`.
    schema:
      oneOf:
        - title: Block height (decimal)
          type: integer
          minimum: 1
        - title: Block height (hex quantity)
          type: string
          pattern: ^0[xX][0-9a-fA-F]+$
result:
  name: Commit certificate
  description: The commit certificate for the requested block height.
  schema:
    title: Commit certificate
    type: object
    required:
      - height
      - round
      - block_hash
      - signatures
    properties:
      height:
        title: Block height
        description: The block height this certificate finalizes.
        type: integer
        minimum: 1
      round:
        title: Consensus round
        description: The Malachite consensus round in which the block was decided.
        type: integer
        minimum: 0
      block_hash:
        title: Block hash
        description: The 32-byte hash of the block finalized at this height.
        type: string
        pattern: ^0x[0-9a-fA-F]{64}$
      signatures:
        title: Validator signatures
        description: One entry per validator that signed the commit certificate.
        type: array
        items:
          title: Validator signature
          type: object
          required:
            - address
            - signature
          properties:
            address:
              title: Validator address
              description: The 20-byte validator address.
              type: string
              pattern: ^0x[0-9a-fA-F]{40}$
            signature:
              title: Signature
              description: Standard padded Base64 encoding of the 64-byte validator signature.
              type: string
examples:
  - name: arc_getCertificate example
    params:
      - name: Block height
        value: '0x7'
    result:
      name: Commit certificate
      value:
        height: 7
        round: 0
        block_hash: '0x751ccaee8df96f648c9ab00121a4ac1a1bcafc0c8e8cb0d205c67346edb37af2'
        signatures:
          - address: '0x602930d1ab44f1744f42e842b701c2b149c5da4f'
            signature: K3SKb2xKYGWLZ9eMIXtXYckACgU6AaOVwmymD4nIVT6GXvQ9UylllQpSWhTZfuV7oDjo75ynruLh4xHv++jQBA==
          - address: '0x6791e002c8419e8a2fa5266e2951ed1780bc2295'
            signature: uNmquXJkx+4NyNnkLUnnRY+1ZZygb5drQbh9ya50oW0z0H9HS21R7PyueayfHoADnJT9DqbDF+D8KECLmy3+Cw==
          - address: '0x2e78053671f707844a631bc907d4855894848fe3'
            signature: 2/52ncq8uRzHMiBiVxTFk10BzEq9InHfHckBu/qK9fomDNmgOPSuwWURu49EGPDti7Q60If4n7/Qt3dLa2N7CQ==
errors:
  - code: -32004
    message: Certificate not found
  - code: -32602
    message: Invalid params (height must be >= 1)
```
