# deserializeScalarSketch

> **deserializeScalarSketch**(`value`): [`ScalarSketch`](/reference/knotkit/scalar-sketch/type-aliases/scalarsketch/)

Defined in: [packages/scalar-sketch/src/serialization/binary.ts:124](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/scalar-sketch/src/serialization/binary.ts#L124)

Deserialize exact state from untrusted canonical binary bytes. Shared envelope geometry, family dimensions, and state invariants are checked before mutable typed state is allocated.

## Parameters

### value

`unknown`

## Returns

[`ScalarSketch`](/reference/knotkit/scalar-sketch/type-aliases/scalarsketch/)

## Throws

For malformed envelopes, unsupported scalar-sketch versions, unknown discriminants, or invalid family state.

## Throws

From `knotkit/hash` for invalid hash identities.
