2016-08-18 05:53:24 -07:00
|
|
|
//! Bitcoin keys.
|
|
|
|
//!
|
|
|
|
//! `Secret` - 32 bytes
|
|
|
|
//! `Public` - 65 bytes (TODO: make it optionally compressed)
|
|
|
|
//! `Private` - secret with additional network identifier (and compressed flag?)
|
|
|
|
//! `AddressHash` - 20 bytes derived from public
|
|
|
|
//! `Address` - address_hash with network identifier and format type
|
|
|
|
|
2016-08-18 03:56:18 -07:00
|
|
|
mod address;
|
|
|
|
mod checksum;
|
|
|
|
pub mod display;
|
2016-08-16 09:00:26 -07:00
|
|
|
pub mod generator;
|
|
|
|
pub mod keypair;
|
|
|
|
mod error;
|
2016-08-18 03:56:18 -07:00
|
|
|
mod private;
|
2016-08-20 09:06:04 -07:00
|
|
|
mod public;
|
2016-08-16 09:00:26 -07:00
|
|
|
|
2016-08-18 03:56:18 -07:00
|
|
|
pub use self::address::{Type, Address};
|
|
|
|
pub use self::checksum::checksum;
|
|
|
|
pub use self::display::DisplayLayout;
|
2016-08-16 09:00:26 -07:00
|
|
|
pub use self::keypair::KeyPair;
|
|
|
|
pub use self::error::Error;
|
2016-08-18 03:56:18 -07:00
|
|
|
pub use self::private::Private;
|
2016-08-20 09:06:04 -07:00
|
|
|
pub use self::public::Public;
|
2016-08-16 09:00:26 -07:00
|
|
|
|
2016-08-18 05:53:24 -07:00
|
|
|
use hash::{H160, H256, H520};
|
2016-08-18 05:39:00 -07:00
|
|
|
pub type AddressHash = H160;
|
2016-08-16 09:00:26 -07:00
|
|
|
pub type Secret = H256;
|
|
|
|
|
2016-08-18 05:53:24 -07:00
|
|
|
use secp256k1;
|
2016-08-16 09:00:26 -07:00
|
|
|
lazy_static! {
|
|
|
|
pub static ref SECP256K1: secp256k1::Secp256k1 = secp256k1::Secp256k1::new();
|
|
|
|
}
|
|
|
|
|