bitcoin/
lib.rs

1// Rust Bitcoin Library
2// Written in 2014 by
3//   Andrew Poelstra <apoelstra@wpsoftware.net>
4//
5// To the extent possible under law, the author(s) have dedicated all
6// copyright and related and neighboring rights to this software to
7// the public domain worldwide. This software is distributed without
8// any warranty.
9//
10// You should have received a copy of the CC0 Public Domain Dedication
11// along with this software.
12// If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
13//
14
15//! # Rust Bitcoin Library
16//!
17//! This is a library for which supports the Bitcoin network protocol and associated
18//! primitives. It is designed for Rust programs built to work with the Bitcoin
19//! network.
20//!
21//! It is also written entirely in Rust to illustrate the benefits of strong type
22//! safety, including ownership and lifetime, for financial and/or cryptographic
23//! software.
24//!
25
26#![crate_name = "bitcoin"]
27#![crate_type = "dylib"]
28#![crate_type = "rlib"]
29
30// Experimental features we need
31#![cfg_attr(all(test, feature = "unstable"), feature(test))]
32
33// Clippy whitelist
34#![cfg_attr(feature = "clippy", allow(needless_range_loop))] // suggests making a big mess of array newtypes
35#![cfg_attr(feature = "clippy", allow(extend_from_slice))]   // `extend_from_slice` only available since 1.6
36
37// Coding conventions
38#![deny(non_upper_case_globals)]
39#![deny(non_camel_case_types)]
40#![deny(non_snake_case)]
41#![deny(unused_mut)]
42#![deny(missing_docs)]
43
44extern crate bitcoin_bech32;
45extern crate bitcoin_hashes;
46extern crate byteorder;
47extern crate hex;
48extern crate rand;
49extern crate secp256k1;
50#[cfg(feature = "serde")] extern crate serde;
51#[cfg(feature = "strason")] extern crate strason;
52#[cfg(all(test, feature = "unstable"))] extern crate test;
53#[cfg(feature="bitcoinconsensus")] extern crate bitcoinconsensus;
54
55#[cfg(test)]
56#[macro_use]
57mod test_macros;
58#[macro_use]
59mod internal_macros;
60#[macro_use]
61pub mod network;
62pub mod blockdata;
63pub mod util;
64pub mod consensus;
65
66pub use blockdata::block::Block;
67pub use blockdata::block::BlockHeader;
68pub use blockdata::script::Script;
69pub use blockdata::transaction::Transaction;
70pub use blockdata::transaction::TxIn;
71pub use blockdata::transaction::TxOut;
72pub use blockdata::transaction::OutPoint;
73pub use blockdata::transaction::SigHashType;
74pub use consensus::encode::VarInt;
75pub use network::constants::Network;
76pub use util::Error;
77pub use util::address::Address;
78pub use util::hash::BitcoinHash;
79pub use util::privkey::Privkey;
80pub use util::decimal::Decimal;
81pub use util::decimal::UDecimal;