fn main() {
let mnemonic =
"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";
let key = mudra::seed::cosmos_key(mnemonic, "").expect("derive key");
let pubkey = mudra::cosmos::compressed(key.verifying_key());
let address = mudra::cosmos::address(&pubkey, mudra::cosmos::PUSSY).expect("address");
let neuron = mudra::claim::neuron_of(&pubkey);
let claim = mudra::claim::create(&key, mudra::cosmos::PUSSY, neuron).expect("claim");
let ok = mudra::claim::verify(&claim, mudra::cosmos::PUSSY);
println!("spacepussy account : {address}");
println!("pubkey (compressed): {}", hex(&pubkey));
println!("native neuron : {}", hex(&neuron));
println!("signature : {}โฆ", &hex(&claim.signature)[..24]);
println!("claim verifies : {ok}");
assert!(ok);
}
fn hex(bytes: &[u8]) -> String {
bytes.iter().map(|b| format!("{b:02x}")).collect()
}