Cryptographic Utils

Derive an address from a Private Key

use onemoney_protocol::crypto;

// Derive address from private key
let address = crypto::private_key_to_address(private_key)?;

Sign a message

// Sign a message
let signature = crypto::sign_message(&payload, private_key)?;

Verify a message

// Verify signature
let is_valid = crypto::verify_signature(&payload, &signature, signer_address)?;

Last updated