# coinCommitment

> For the complete documentation index, see [llms.txt](https://docs.midnight.network/llms.txt)

[**@midnight/ledger v8.1.3**](https://docs.midnight.network/api-reference/ledger.md)

***

[@midnight/ledger](https://docs.midnight.network/api-reference/ledger/globals.md) / coinCommitment

# Function: coinCommitment()

```
function coinCommitment(coin, coinPublicKey): string;
```

Calculate commitment of a coin owned by a user

## Parameters[​](#parameters "Direct link to Parameters")

### coin[​](#coin "Direct link to coin")

[`ShieldedCoinInfo`](https://docs.midnight.network/api-reference/ledger/type-aliases/ShieldedCoinInfo.md)

### coinPublicKey[​](#coinpublickey "Direct link to coinPublicKey")

`string`

## Returns[​](#returns "Direct link to Returns")

`string`
