# `X402.Extensions.SIWX.Verifier.Ed25519`
[🔗](https://github.com/cardotrejos/x402/blob/v0.9.0/lib/x402/extensions/siwx/verifier/ed25519.ex#L1)

SIWX signature verifier for Solana (`solana:*`) wallets.

Verifies the Ed25519 signature over the Sign-In-With-Solana message text
through OTP's `:crypto` — no extra dependencies. The signature and the
address are the Base58 encodings Solana wallets produce: a 64-byte
signature and a 32-byte public key.

# `verify_signature`
*since 0.9.0* 

```elixir
@spec verify_signature(String.t(), String.t(), String.t()) ::
  {:ok, boolean()}
  | {:error, :malformed_signature | :invalid_address | :invalid_arguments}
```

Verifies a Base58 Ed25519 signature over `message` for a Base58 address.

Returns `{:ok, true}` when the signature verifies under the public key the
address encodes, `{:ok, false}` when it does not, and
`{:error, :malformed_signature}` / `{:error, :invalid_address}` when the
Base58 encodings or byte lengths are wrong.

## Examples

    iex> X402.Extensions.SIWX.Verifier.Ed25519.verify_signature("hello", "not base58 0", "AKnL4NNf3DGWZJS6cPknBuEGnVsV4A4m5tgebLHaRSZ9")
    {:error, :malformed_signature}

    iex> X402.Extensions.SIWX.Verifier.Ed25519.verify_signature("hello", "1111", "too-short")
    {:error, :invalid_address}

---

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