# `BSV.Wallet`
[🔗](https://github.com/Bittoku/bsv_sdk_elixir/blob/main/lib/bsv/wallet/wallet.ex#L1)

The wallet behaviour — defines the interface for BSV wallet operations.

Core operations (implemented by ProtoWallet):
- Key derivation (get_public_key)
- Encryption/decryption
- Signing/verification
- HMAC creation/verification

Transaction and certificate operations are defined but return
`{:error, "not implemented"}` by default.

# `create_hmac`

```elixir
@callback create_hmac(
  wallet :: struct(),
  enc :: BSV.Wallet.Types.EncryptionArgs.t(),
  data :: binary()
) ::
  {:ok, binary()} | {:error, String.t()}
```

# `create_signature`

```elixir
@callback create_signature(
  wallet :: struct(),
  enc :: BSV.Wallet.Types.EncryptionArgs.t(),
  data :: binary(),
  hash_to_sign :: binary() | nil
) :: {:ok, binary()} | {:error, String.t()}
```

# `decrypt`

```elixir
@callback decrypt(
  wallet :: struct(),
  enc :: BSV.Wallet.Types.EncryptionArgs.t(),
  ciphertext :: binary()
) ::
  {:ok, binary()} | {:error, term()}
```

# `encrypt`

```elixir
@callback encrypt(
  wallet :: struct(),
  enc :: BSV.Wallet.Types.EncryptionArgs.t(),
  plaintext :: binary()
) ::
  {:ok, binary()} | {:error, term()}
```

# `get_public_key`

```elixir
@callback get_public_key(wallet :: struct(), opts :: keyword()) ::
  {:ok, BSV.PublicKey.t()} | {:error, String.t()}
```

# `verify_hmac`

```elixir
@callback verify_hmac(
  wallet :: struct(),
  enc :: BSV.Wallet.Types.EncryptionArgs.t(),
  data :: binary(),
  hmac :: binary()
) :: {:ok, boolean()} | {:error, String.t()}
```

# `verify_signature`

```elixir
@callback verify_signature(
  wallet :: struct(),
  enc :: BSV.Wallet.Types.EncryptionArgs.t(),
  data :: binary() | nil,
  hash_to_verify :: binary() | nil,
  signature :: binary(),
  opts :: keyword()
) :: {:ok, boolean()} | {:error, String.t()}
```

---

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