# pieceMetadata

> **pieceMetadata**(`ref`, `options`): [`PieceMetadataV2`](/reference/filoz/keysmith/type-aliases/piecemetadatav2/)

Defined in: [derive.ts:539](https://github.com/FilOzone/synapse-sdk/blob/840d7b2c6263846ac51b7558000e62dd68d33a44/packages/keysmith/src/derive.ts#L539)

Piece FEE envelope metadata entries. Read them back with [readPieceMetadata](/reference/filoz/keysmith/functions/readpiecemetadata/).

A piece grant covers whatever piece carries its salt, so a salt must be unique to one piece:
always take it from [newSalt](/reference/filoz/keysmith/functions/newsalt/), and never reuse one.

Everything a reader needs travels with the piece, so a copy opens wherever
replication or repair puts it.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `ref` | [`GroupKeyRef`](/reference/filoz/keysmith/interfaces/groupkeyref/) |
| `options` | \{ `group?`: `string`; `salt`: `` `0x${string}` ``; \} |
| `options.group?` | `string` |
| `options.salt` | `` `0x${string}` `` |

## Returns

[`PieceMetadataV2`](/reference/filoz/keysmith/type-aliases/piecemetadatav2/)