rust-hdwallet 0.1.0-beta

Hierarchical deterministic wallet library for deriving cryptocurrency keys, addresses, and mnemonics.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::EccsError;
use super::ipoint::IPoint;

pub trait IPublicKey: Sized + Clone {
    type Point: IPoint;

    fn ecc_name() -> &'static str;
    fn from_bytes(bytes: &[u8]) -> Result<Self, EccsError>;
    fn from_point(point: &Self::Point) -> Result<Self, EccsError>;
    fn raw_compressed(&self) -> Vec<u8>;
    fn raw_uncompressed(&self) -> Vec<u8>;
    fn point(&self) -> Self::Point;
    fn compressed_len() -> usize;
    fn uncompressed_len() -> usize;
    fn is_valid_bytes(bytes: &[u8]) -> bool {
        Self::from_bytes(bytes).is_ok()
    }
}