> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Blobs.toCommitments

:::info
`Blobs.toCommitments` is a re-export of ox's [`Blobs.toCommitments`](https://oxlib.sh/api/Blobs/toCommitments). Refer to the ox documentation for the full reference.
:::

Compute commitments from a list of [`Blobs.Blobs`](/docs/utilities/blobs/types#blobs).

## Imports

```ts
import { Blobs } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { Blobs } from 'viem/utils'
import { kzg } from './kzg'

const blobs = Blobs.from('0xdeadbeef')
const commitments = Blobs.toCommitments(blobs, { kzg }) // [!code focus]
```

### Configuring Return Type

It is possible to configure the return type with the `as` option.

```ts twoslash
// @noErrors
import { Blobs } from 'viem/utils'
import { kzg } from './kzg'

const blobs = Blobs.from('0xdeadbeef')
const commitments = Blobs.toCommitments(blobs, {
  as: 'Bytes', // [!code focus]
  kzg
})
// @log: [Uint8Array [ ... ], Uint8Array [ ... ]]
```

## Definition

```ts
function toCommitments<blobs, as>(
  blobs: blobs | Blobs<Bytes.Bytes> | Blobs<Hex.Hex>,
  options: toCommitments.Options<as>,
): toCommitments.ReturnType<as>
```

## Parameters

### blobs

* **Type:** `blobs | Blobs<Bytes.Bytes> | Blobs<Hex.Hex>`

The [`Blobs.Blobs`](/docs/utilities/blobs/types#blobs) to transform to commitments.

### options

* **Type:** `toCommitments.Options<as>`

Options.

#### options.as

* **Type:** `"Bytes" | "Hex" | as`
* **Optional**

Return type.

#### options.kzg

* **Type:** `Pick`

KZG implementation.

## Return Type

The commitments.

`toCommitments.ReturnType<as>`
