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

A foundational wallet capable of cryptographic operations (key derivation,
encrypt/decrypt, sign/verify, HMAC) but not transaction management or
blockchain interaction.

Implements the `BSV.Wallet` behaviour for crypto-only operations.

# `t`

```elixir
@type t() :: %BSV.Wallet.ProtoWallet{key_deriver: BSV.Wallet.KeyDeriver.t()}
```

# `anyone`

```elixir
@spec anyone() :: t()
```

Create an 'anyone' ProtoWallet (scalar=1).

# `create_hmac`

Create an HMAC-SHA256 using a derived symmetric key.

# `create_signature`

Create a DER-encoded signature using a derived private key.

# `decrypt`

Decrypt ciphertext using a derived symmetric key.

Automatically falls back to legacy key derivation (raw ECDH x-coordinate)
if decryption with the current KDF (SHA-256) fails, for backward compatibility.

# `encrypt`

Encrypt plaintext using a derived symmetric key.

# `from_key_deriver`

```elixir
@spec from_key_deriver(BSV.Wallet.KeyDeriver.t()) :: t()
```

Create a ProtoWallet from a KeyDeriver.

# `from_private_key`

```elixir
@spec from_private_key(BSV.PrivateKey.t()) :: t()
```

Create a ProtoWallet from a private key.

# `get_public_key`

Derive a public key based on encryption args, or return the identity key.

# `identity_key`

```elixir
@spec identity_key(t()) :: BSV.PublicKey.t()
```

The identity public key.

# `verify_hmac`

Verify an HMAC-SHA256 using a derived symmetric key.

Falls back to legacy key derivation if the current key doesn't match,
for backward compatibility with HMACs created by v0.1.

# `verify_signature`

Verify a DER-encoded signature using a derived public key.

---

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