# Kzg.create

Creates an independently owned WASM implementation of [`Kzg.Kzg`](/api/Kzg).

The factory compiles the c-kzg artifact once per JavaScript realm. Every call instantiates separate WASM memory and trusted-setup state. Call `dispose` when the instance is no longer needed.

Operations on an instance are synchronous and run to completion. JavaScript workers do not share an instance, so create one in each worker that needs KZG.

## Imports

:::code-group
```ts [Named]
import { Kzg } from 'ox/wasm'
```

```ts [Entrypoint]
import * as Kzg from 'ox/wasm/Kzg'
```
:::

## Examples

```ts twoslash
// @noErrors
import { Setups } from 'ox/trusted-setups'
import { Kzg } from 'ox/wasm'

const kzg = await Kzg.create({
  trustedSetup: Setups.mainnet
})
// Pass `kzg` anywhere that accepts `Kzg.Kzg`.

kzg.dispose()
```

## Definition

```ts
function create(
  options: create.Options,
): Promise<create.ReturnType>
```

**Source:** [src/wasm/Kzg.ts](https://github.com/wevm/ox/blob/main/src/wasm/Kzg.ts#L59)

## Parameters

### options

* **Type:** `create.Options`

Trusted setup and precomputation options.

#### options.precompute

* **Type:** `number`
* **Optional**

Fixed-base MSM window from 0 through 8.

`0` performs no fixed-base precomputation and uses the least memory.
Larger values improve proof generation at an exponential memory cost.

#### options.trustedSetup

* **Type:** `TrustedSetup`

Ethereum trusted-setup points.

## Return Type

An initialized KZG implementation with explicit disposal.

`Promise<create.ReturnType>`
