# `BSV.Auth.Nonce`
[🔗](https://github.com/Bittoku/bsv_sdk_elixir/blob/main/lib/bsv/auth/nonce.ex#L1)

Cryptographic nonce creation and verification for auth protocols.

A nonce is `base64(random_16_bytes || HMAC(random_16_bytes))`.

# `create`

```elixir
@spec create(BSV.Wallet.ProtoWallet.t(), BSV.Wallet.Types.Counterparty.t()) ::
  {:ok, String.t()} | {:error, String.t()}
```

Create a cryptographic nonce derived from the wallet.

# `verify`

```elixir
@spec verify(
  String.t(),
  BSV.Wallet.ProtoWallet.t(),
  BSV.Wallet.Types.Counterparty.t()
) ::
  {:ok, boolean()} | {:error, String.t()}
```

Verify that a nonce was derived from the given wallet.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
