# serializeHashIdentity

> **serializeHashIdentity**(`identity`): [`SerializedHashIdentity`](/reference/knotkit/hash/wire/interfaces/serializedhashidentity/)

Defined in: [packages/hash/src/serialization.ts:50](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/hash/src/serialization.ts#L50)

Serialize a hash identity to its canonical JSON form, with the fixed key order `kind`, `version`, `seed`.

Returns the parsed value rather than JSON text, so the identity can be embedded in a larger payload; `JSON.stringify` on the result yields the canonical text, because the key order is fixed here.

## Parameters

### identity

[`AnyHashIdentity`](/reference/knotkit/hash/type-aliases/anyhashidentity/)

## Returns

[`SerializedHashIdentity`](/reference/knotkit/hash/wire/interfaces/serializedhashidentity/)
