hdwallet-filecoin

Crates.iohdwallet-filecoin
lib.rshdwallet-filecoin
version0.2.1
sourcesrc
created_at2023-10-30 13:56:50.722295
updated_at2023-11-03 16:26:04.955528
descriptionHD Wallet for Filecoin, including key generation, derivation and signing
homepage
repositoryhttps://github.com/Aloxaf/hdwallet-filecoin
max_upload_size
id1018505
size35,433
Aloxaf (Aloxaf)

documentation

README

hdwallet-filecoin

Hierarchical Deterministic Wallet for filecoin.

This implemention follows:

Usage

use hdwallet_filecoin::{new_mnemonic, SecretKey};

fn main() {
    let mnemonic = new_mnemonic().unwrap();
    println!("{}", mnemonic);
    let seed = mnemonic.to_seed("");

    let sk = SecretKey::from_seed_bls(&seed).unwrap();
    // You can also use SecretKey::from_seed_secp256k1 to generate a secp256k1 key
    let pk = sk.public_key();
    println!("{}", pk.address());

    let msg = b"hello world";
    let sig = sk.sign(msg).unwrap();

    assert!(sig.verify(msg, &pk).is_ok());
}

Thanks to these projects for reference

Commit count: 25

cargo fmt