# alpen_getBlockStatus

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

POST https://alpen-testnet.g.alchemy.com/v2/{apiKey}

Returns the finalization status of a given Alpen (execution-layer) block hash, abstracting Strata's checkpoint progress on Bitcoin. Alpen state commitments are periodically checkpointed to Bitcoin through Strata, the orchestration layer; a block's reported status reflects how far the Strata checkpoint covering it has advanced.

Status values:

* `pending`: the Alpen block is not yet covered by any confirmed or
  finalized Strata checkpoint.

* `confirmed`: the Alpen block is covered by a confirmed Strata
  checkpoint.

* `finalized`: the Alpen block is covered by a finalized Strata
  checkpoint. A finalized block cannot be reorganized without reorging
  the Bitcoin block its checkpoint was confirmed in.


When `status` is `confirmed` or `finalized`, the response also includes `checkpoint_epoch`, the Strata checkpoint epoch number that covers the block. That value can be passed to Strata RPC methods such as `strata_getCheckpointInfo` to inspect the checkpoint itself. When `status` is `pending`, `checkpoint_epoch` is omitted.

The block hash must resolve to a canonical Alpen block on the serving node. Unknown or non-canonical block hashes return an "invalid params" error with the message `block not found`. The genesis block is always reported as `finalized`.

See the [Alpen RPC endpoints reference](https://docs.alpen.org/build-alpen-apps/rpc-endpoints#alpen_getblockstatus) for upstream documentation.

Reference: https://www.alchemy.com/docs/chains/alpen/alpen-api-endpoints/alpen-get-block-status

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| Block hash | string | Yes | 32-byte hex-encoded hash of a canonical Alpen (EVM execution-layer) block. |

## Result

**Block status** (object): The Strata checkpoint finalization status of the requested Alpen block.

## Example

### Request

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

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "status": "finalized",
    "checkpoint_epoch": 1
  },
  "id": 1
}
```

## Code Examples

### cURL

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

### JavaScript

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

fetch('https://alpen-testnet.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://alpen-testnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "alpen_getBlockStatus",
    "params": ["0xe51973464ec8524d9df2b232ace849a0404a0bc96b9211db9b8daa5a4999a655"]
}
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://alpen-testnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"alpen_getBlockStatus\",\n  \"params\": [\n    \"0xe51973464ec8524d9df2b232ace849a0404a0bc96b9211db9b8daa5a4999a655\"\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://alpen-testnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"alpen_getBlockStatus\",\n  \"params\": [\n    \"0xe51973464ec8524d9df2b232ace849a0404a0bc96b9211db9b8daa5a4999a655\"\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://alpen-testnet.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\": \"alpen_getBlockStatus\",\n  \"params\": [\n    \"0xe51973464ec8524d9df2b232ace849a0404a0bc96b9211db9b8daa5a4999a655\"\n  ]\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: alpen_getBlockStatus
summary: Returns the Strata checkpoint finalization status for an Alpen block hash.
description: |-
  Returns the finalization status of a given Alpen (execution-layer) block hash, abstracting Strata's checkpoint progress on Bitcoin. Alpen state commitments are periodically checkpointed to Bitcoin through Strata, the orchestration layer; a block's reported status reflects how far the Strata checkpoint covering it has advanced.

  Status values:

  * `pending`: the Alpen block is not yet covered by any confirmed or
    finalized Strata checkpoint.

  * `confirmed`: the Alpen block is covered by a confirmed Strata
    checkpoint.

  * `finalized`: the Alpen block is covered by a finalized Strata
    checkpoint. A finalized block cannot be reorganized without reorging
    the Bitcoin block its checkpoint was confirmed in.


  When `status` is `confirmed` or `finalized`, the response also includes `checkpoint_epoch`, the Strata checkpoint epoch number that covers the block. That value can be passed to Strata RPC methods such as `strata_getCheckpointInfo` to inspect the checkpoint itself. When `status` is `pending`, `checkpoint_epoch` is omitted.

  The block hash must resolve to a canonical Alpen block on the serving node. Unknown or non-canonical block hashes return an "invalid params" error with the message `block not found`. The genesis block is always reported as `finalized`.

  See the [Alpen RPC endpoints reference](https://docs.alpen.org/build-alpen-apps/rpc-endpoints#alpen_getblockstatus) for upstream documentation.
x-compute-units: 20
params:
  - name: Block hash
    required: true
    description: 32-byte hex-encoded hash of a canonical Alpen (EVM execution-layer) block.
    schema:
      title: Block hash
      type: string
      pattern: ^0x[0-9a-fA-F]{64}$
result:
  name: Block status
  description: The Strata checkpoint finalization status of the requested Alpen block.
  schema:
    title: Block status
    type: object
    required:
      - status
    properties:
      status:
        title: Finalization status
        description: The block's finalization status with respect to Strata checkpoints on Bitcoin.
        type: string
        enum:
          - pending
          - confirmed
          - finalized
      checkpoint_epoch:
        title: Checkpoint epoch
        description: The Strata checkpoint epoch number that covers this Alpen block. Present only when `status` is `confirmed` or `finalized`; omitted when the status is `pending`.
        type: integer
        minimum: 0
        maximum: 4294967295
examples:
  - name: Finalized block
    params:
      - name: Block hash
        value: '0xe51973464ec8524d9df2b232ace849a0404a0bc96b9211db9b8daa5a4999a655'
    result:
      name: Block status
      value:
        status: finalized
        checkpoint_epoch: 1
  - name: Pending block
    params:
      - name: Block hash
        value: '0x936fe1b255580c33346bcd14be4699c2078165c4302d7b9da9f8e7c86af72f07'
    result:
      name: Block status
      value:
        status: pending
errors:
  - code: -32602
    message: block not found
```
