keypair-rs

Crates.iokeypair-rs
lib.rskeypair-rs
version0.1.1
sourcesrc
created_at2023-04-08 15:04:11.63571
updated_at2023-04-08 15:08:56.30599
descriptionKeypair secp256k1 with blake2b hashing, keypairs similar to ethereum
homepage
repository
max_upload_size
id833627
size6,133
toni-dev (Toni-d-e-v)

documentation

README

KeyPair-rs

Keypair-rs is simple rust library for generating keypairs like used in ethreum. It is based on the sec256k1 library. For hashing it uses the blake2b algorithm.

Usage

use keypair::Keypair;

fn main() {
    let keypair = Keypair::generate();
    println!("public_key: {:?}", keypair.public_key);
    println!("private_key: {:?}", keypair.private_key);
    println!("address: {:?}", keypair.address());
    let message = "hello world".to_string();
    let signature = keypair.sign(message.clone()).unwrap();
    println!("signature: {:?}", signature);
    assert!(keypair.verify(&message, &signature).unwrap());
    
}
Commit count: 0

cargo fmt