Expand description
Casper Network wallet utilities for Kobe.
Offline HD derivation for CSPR (SLIP-44 coin type 506) with dual
signature algorithms:
| Algorithm | Default path | Curve | Kobe primitive |
|---|---|---|---|
KeyAlgo::Secp256k1 (default) | m/44'/506'/0'/0/{i} | secp256k1 | BIP-32 |
KeyAlgo::Ed25519 | m/44'/506'/0'/0'/{i}' | Ed25519 | SLIP-10 |
§Address encoding
The primary DerivedAccount::address is the Casper AccountHash
display form account-hash- + 64 lowercase hex digits.
Per casper-types
AccountHash::from_public_key, the BLAKE2b-256 preimage is not the
tag-prefixed public-key serialization. It is:
algorithm_name_ascii || 0x00 || raw_public_key_byteswhere algorithm_name is the lowercase ASCII string "secp256k1" or
"ed25519", and raw_public_key_bytes is the 33-byte compressed SEC1
secp256k1 key or the 32-byte Ed25519 key (no algorithm tag byte).
The algorithm-tagged public-key hex used in Casper serialization /
CEP-57 contexts (0x01 ‖ ed25519 or 0x02 ‖ secp compressed) is
exposed separately on CasperAccount::tagged_public_key_hex.
§Example
use kobe_casper::{Deriver, KeyAlgo};
use kobe_primitives::{Derive, Wallet};
let wallet = Wallet::from_mnemonic(
"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
None,
)?;
let account = Deriver::new(&wallet).derive(0)?;
assert!(account.address().starts_with("account-hash-"));
assert_eq!(account.algo(), KeyAlgo::Secp256k1);Structs§
- Casper
Account - A Casper-specific derived account.
- Derived
Account - A derived HD account — unified across all chains.
- Deriver
- Casper address deriver from a unified wallet seed.
- Parse
Derivation Style Error - Error returned when
FromStrfails on a chain’sDerivationStyle.
Enums§
- Derive
Error - Errors produced by HD derivation, mnemonic handling, and address encoding.
- Derived
Public Key - Strongly typed public key emitted by an HD derivation.
- KeyAlgo
- Signature algorithm and matching HD path layout for Casper.
Constants§
- ACCOUNT_
HASH_ PREFIX - Prefix applied to the hex-encoded
AccountHashfor display. - ED25519_
TAG - Casper serialization tag for Ed25519 public keys (
PublicKey::Ed25519). - SECP256
K1_ TAG - Casper serialization tag for secp256k1 public keys (
PublicKey::Secp256k1).
Functions§
- account_
hash_ ed25519 - Compute the Casper
AccountHashfor an Ed25519 public key. - account_
hash_ secp256k1 - Compute the Casper
AccountHashfor a compressed secp256k1 public key. - format_
account_ hash - Format a 32-byte
AccountHashdigest asaccount-hash-+ lowercase hex. - tagged_
public_ key_ hex - Tagged public-key hex (no
0xprefix):01 ‖ ed25519or02 ‖ secp.