Skip to main content

encrypt_extended_public_key

Function encrypt_extended_public_key 

Source
pub fn encrypt_extended_public_key(
    shared_key: &[u8; 32],
    iv: &[u8; 16],
    xpub: &[u8],
) -> Vec<u8> ⓘ
Expand description

Encrypt an extended public key for DashPay contact requests (DIP-15)

§Arguments

  • shared_key - 32-byte shared secret from ECDH
  • iv - 16-byte initialization vector (must be randomly generated)
  • xpub - Extended public key bytes to encrypt

§Returns

Encrypted extended public key with IV prepended (96 bytes: 16-byte IV + 80-byte encrypted data)