Skip to main content

Crate siwx_svm

Crate siwx_svm 

Source
Expand description

§siwx-svm — Solana verification for Sign-In with X

Implements the CAIP-122 namespace profile for Solana:

  • Ed25519 signature verification

§Quick start

use siwx::{SiwxMessage, Verifier};
use siwx_svm::Ed25519Verifier;

let message = SiwxMessage::new(
    "example.com",
    "GwAF45zjfyGzUbd3i3hXxzGeuchzEZXwpRYHZM5912F1",
    "https://example.com/login",
    "1",
    "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d",
)?;
let _text = Ed25519Verifier::format_message(&message);
// let pubkey: [u8; 32] = ...; // Ed25519 public key
// let sig_bytes: [u8; 64] = ...; // Ed25519 signature
// Ed25519Verifier::new(pubkey).verify(&message, &sig_bytes).await?;

Structs§

Ed25519Verifier
Ed25519 signature verifier for Solana.

Constants§

CHAIN_NAME
Human-readable chain label embedded in the CAIP-122 preamble.

Functions§

validate_address
Validate that address is a valid base58-encoded Solana public key (32 bytes decoded).