rgbcore/lib.rs
1// RGB Core Library: consensus layer for RGB smart contracts.
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5// Designed in 2019-2025 by Dr Maxim Orlovsky <orlovsky@lnp-bp.org>
6// Written in 2024-2025 by Dr Maxim Orlovsky <orlovsky@lnp-bp.org>
7//
8// Copyright (C) 2019-2024 LNP/BP Standards Association, Switzerland.
9// Copyright (C) 2024-2025 LNP/BP Laboratories,
10// Institute for Distributed and Cognitive Systems (InDCS), Switzerland.
11// Copyright (C) 2025 RGB Consortium, Switzerland.
12// Copyright (C) 2019-2025 Dr Maxim Orlovsky.
13// All rights under the above copyrights are reserved.
14//
15// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
16// in compliance with the License. You may obtain a copy of the License at
17//
18// http://www.apache.org/licenses/LICENSE-2.0
19//
20// Unless required by applicable law or agreed to in writing, software distributed under the License
21// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
22// or implied. See the License for the specific language governing permissions and limitations under
23// the License.
24
25// TODO: Activate no_std once StrictEncoding will support it
26// #![cfg_attr(not(feature = "std"), no_std)]
27#![deny(
28 unsafe_code,
29 dead_code,
30 missing_docs,
31 unused_variables,
32 unused_mut,
33 unused_imports,
34 non_upper_case_globals,
35 non_camel_case_types,
36 non_snake_case
37)]
38#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
39#![cfg_attr(docsrs, feature(doc_auto_cfg))]
40
41//! RGB is confidential and scalable client-validated smart contracts for Bitcoin & Lightning.
42//! To learn more about the RGB please check [RGB website][Site].
43//!
44//! RGB Core library provides consensus-critical and validation code for RGB. It is a standard
45//! implementation, jointly with [LNP/BP Standards][LNPBPs] defining RGB consensus and validation
46//! rules.
47
48extern crate alloc;
49#[macro_use]
50extern crate amplify;
51#[macro_use]
52extern crate strict_encoding;
53#[cfg(feature = "serde")]
54#[macro_use]
55extern crate serde;
56extern crate core;
57
58mod verify;
59mod seals;
60
61pub use seals::{RgbSeal, RgbSealDef};
62pub use single_use_seals::*;
63pub use verify::{ContractApi, ContractVerify, OperationSeals, ReadOperation, VerificationError};
64
65/// Strict type library name for all RGB-related types.
66pub const LIB_NAME_RGB: &str = "RGB";