# serializeSortedBlock

> **serializeSortedBlock**(`block`, `options?`): `Uint8Array`

Defined in: [packages/sorted-block/src/serialization.ts:64](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/sorted-block/src/serialization.ts#L64)

Serialize a block into binary bytes that restore the same entries and layout.

The block payload is written unchanged — prefix-compressed entries, the restart table, and the trailer — inside a `knotkit/wire` envelope with a producer version. Runs in O(byteLength).

## Parameters

### block

[`SortedBlock`](/reference/knotkit/sorted-block/interfaces/sortedblock/)

### options?

[`SerializeSortedBlockOptions`](/reference/knotkit/sorted-block/wire/interfaces/serializesortedblockoptions/)

## Returns

`Uint8Array`

## Throws

With `FOREIGN_SORTED_BLOCK` when `block` was not produced by this package, or `MAX_CAPACITY_EXCEEDED` when the runtime cannot allocate the artifact.
