derive_keypair_from_signature

Function derive_keypair_from_signature 

Source
pub fn derive_keypair_from_signature(
    signature: &[u8],
) -> Result<Vec<u8>, JsValue>
Expand description

Encryption key derivation (X25519). Used for off-chain note encryption/decryption Derive X25519 encryption keypair deterministically from a Freighter signature.

This keypair is used for encrypting note data (amount, blinding) so that only the recipient can decrypt it. The encryption scheme is X25519-XSalsa20-Poly1305.

§Derivation

signature (64 bytes) → SHA-256 → 32-byte seed → X25519 keypair

§Arguments

  • signature - Stellar Ed25519 signature from signing “Sign to access Privacy Pool [v1]”

§Returns

64 bytes: [public_key (32), private_key (32)]