Crates.io | hdwallet-filecoin |
lib.rs | hdwallet-filecoin |
version | 0.2.1 |
source | src |
created_at | 2023-10-30 13:56:50.722295 |
updated_at | 2023-11-03 16:26:04.955528 |
description | HD Wallet for Filecoin, including key generation, derivation and signing |
homepage | |
repository | https://github.com/Aloxaf/hdwallet-filecoin |
max_upload_size | |
id | 1018505 |
size | 35,433 |
Hierarchical Deterministic Wallet for filecoin.
This implemention follows:
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());
}