bp/lib.rs
1// Bitcoin protocol core library.
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5// Written in 2019-2024 by
6// Dr Maxim Orlovsky <orlovsky@lnp-bp.org>
7//
8// Copyright (C) 2019-2024 LNP/BP Standards Association. All rights reserved.
9//
10// Licensed under the Apache License, Version 2.0 (the "License");
11// you may not use this file except in compliance with the License.
12// You may obtain a copy of the License at
13//
14// http://www.apache.org/licenses/LICENSE-2.0
15//
16// Unless required by applicable law or agreed to in writing, software
17// distributed under the License is distributed on an "AS IS" BASIS,
18// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19// See the License for the specific language governing permissions and
20// limitations under the License.
21
22// TODO: Activate no_std once StrictEncoding will support it
23// #![cfg_attr(not(feature = "std"), no_std)]
24#![deny(
25 unsafe_code,
26 dead_code,
27 missing_docs,
28 unused_variables,
29 unused_mut,
30 unused_imports,
31 non_upper_case_globals,
32 non_camel_case_types,
33 non_snake_case
34)]
35#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
36#![cfg_attr(docsrs, feature(doc_auto_cfg))]
37
38//! Core module defines core strict interfaces from informational LNPBP
39//! standards specifying secure and robust practices for function calls
40//! used in main bitcoin protocols:
41//! - consensus-level primitives;
42//! - deterministic bitcoin commitments;
43//! - single-use-seals.
44//!
45//! The goal of this module is to maximally reduce the probability of errors and
46//! mistakes within particular implementations of this paradigms by
47//! standardizing typical workflow processes in a form of interfaces that
48//! will be nearly impossible to use in the wrong form.
49
50/// Re-export of `bp-dbc` crate.
51pub extern crate dbc;
52/// Re-export of `bp-seals` crate.
53pub extern crate seals;
54
55#[macro_use]
56extern crate strict_encoding;
57#[cfg(feature = "serde")]
58#[macro_use]
59extern crate serde;
60
61#[cfg(feature = "stl")]
62pub mod stl;
63mod bp;
64
65pub use ::bc::*;
66#[cfg(feature = "stl")]
67#[allow(missing_docs)]
68pub mod bc {
69 pub use bc::stl;
70}
71pub use bp::Bp;