pub struct SolanaSigner { /* private fields */ }Expand description
Solana Ed25519 signer.
Implementations§
Source§impl SolanaSigner
impl SolanaSigner
Source§impl SolanaSigner
impl SolanaSigner
Sourcepub fn scalar_bytes(&self) -> Zeroizing<Vec<u8>>
pub fn scalar_bytes(&self) -> Zeroizing<Vec<u8>>
Export the clamped Ed25519 scalar (first 32 bytes of SHA-512(seed), clamped).
⚠️ Advanced use only — for MPC, threshold signing, or key derivation. The scalar is the actual private scalar used in Ed25519 signing.
Trait Implementations§
Source§impl Drop for SolanaSigner
impl Drop for SolanaSigner
Source§impl KeyPair for SolanaSigner
impl KeyPair for SolanaSigner
Source§fn from_keypair_bytes(keypair: &[u8]) -> Result<Self, SignerError>
fn from_keypair_bytes(keypair: &[u8]) -> Result<Self, SignerError>
Import from Solana’s 64-byte keypair format (seed ∥ pubkey). Validates that the derived public key matches bytes[32..64] using constant-time comparison to prevent timing side-channels.
Source§fn keypair_bytes(&self) -> Zeroizing<Vec<u8>>
fn keypair_bytes(&self) -> Zeroizing<Vec<u8>>
Export as Solana’s 64-byte keypair (seed ∥ pubkey).
Source§fn generate() -> Result<Self, SignerError>
fn generate() -> Result<Self, SignerError>
Generate a new random key pair using OS entropy (CSPRNG).
Source§fn from_bytes(private_key: &[u8]) -> Result<Self, SignerError>
fn from_bytes(private_key: &[u8]) -> Result<Self, SignerError>
Reconstruct a key pair from raw private key bytes (32 bytes).
Source§impl Signer for SolanaSigner
impl Signer for SolanaSigner
Source§fn sign_prehashed(&self, digest: &[u8]) -> Result<SolanaSignature, SignerError>
fn sign_prehashed(&self, digest: &[u8]) -> Result<SolanaSignature, SignerError>
Note: Ed25519 hashes internally per RFC 8032. This method is identical to
sign() — the digest parameter is treated as a raw message, not a
pre-computed hash. For consistency with the Signer trait, this is provided as-is.
Source§type Signature = SolanaSignature
type Signature = SolanaSignature
The signature type produced by this signer.
Source§type Error = SignerError
type Error = SignerError
The error type returned on failure.
Source§fn sign(&self, message: &[u8]) -> Result<SolanaSignature, SignerError>
fn sign(&self, message: &[u8]) -> Result<SolanaSignature, SignerError>
Sign a raw message. The implementation applies chain-specific hashing internally
(e.g., Keccak-256 for Ethereum, double-SHA-256 for Bitcoin).
Auto Trait Implementations§
impl Freeze for SolanaSigner
impl RefUnwindSafe for SolanaSigner
impl Send for SolanaSigner
impl Sync for SolanaSigner
impl Unpin for SolanaSigner
impl UnsafeUnpin for SolanaSigner
impl UnwindSafe for SolanaSigner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more