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.
Summary
Callbacks
@callback create_hmac( wallet :: struct(), enc :: BSV.Wallet.Types.EncryptionArgs.t(), data :: binary() ) :: {:ok, binary()} | {:error, String.t()}
@callback decrypt( wallet :: struct(), enc :: BSV.Wallet.Types.EncryptionArgs.t(), ciphertext :: binary() ) :: {:ok, binary()} | {:error, term()}
@callback encrypt( wallet :: struct(), enc :: BSV.Wallet.Types.EncryptionArgs.t(), plaintext :: binary() ) :: {:ok, binary()} | {:error, term()}
@callback get_public_key(wallet :: struct(), opts :: keyword()) :: {:ok, BSV.PublicKey.t()} | {:error, String.t()}