1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// SPDX-License-Identifier: Apache-2.0
//! # multi-sig
//!
//! Self-describing digital signature implementation following the multisig specification.
//!
//! ## Overview
//!
//! This crate provides multisig functionality for creating and managing self-describing
//! digital signatures with support for multiple signature schemes including Ed25519,
//! Secp256k1, and BLS12-381.
//!
//! ## Supported Signature Schemes
//!
//! - **Ed25519** - Fast, secure elliptic curve signatures
//! - **Secp256k1** - Bitcoin/Ethereum curve signatures
//! - **BLS12-381** - Pairing-based signatures with aggregation support
//!
//! ## Quick Start
//!
//! ### Creating a Signature
//!
//! ```rust
//! use multi_sig::Builder;
//! use multi_codec::Codec;
//!
//! // Create a signature with Ed25519
//! let sig_data = vec![0u8; 64]; // Ed25519 signature (64 bytes)
//! let multisig = Builder::new(Codec::Ed25519Pub)
//! .with_signature_bytes(&sig_data)
//! .try_build()
//! .unwrap();
//! ```
//!
//! ### Encoding and Decoding
//!
//! ```rust
//! use multi_sig::{Builder, Multisig};
//! use multi_codec::Codec;
//!
//! let sig_data = vec![0u8; 64];
//! let ms1 = Builder::new(Codec::Ed25519Pub)
//! .with_signature_bytes(&sig_data)
//! .try_build()
//! .unwrap();
//!
//! // Encode to bytes
//! let bytes: Vec<u8> = ms1.clone().into();
//!
//! // Decode from bytes
//! let ms2 = Multisig::try_from(bytes.as_ref()).unwrap();
//! assert_eq!(ms1, ms2);
//! ```
//!
//! ## Features
//!
//! - **`serde`** (default): Enables serde serialization support
//!
//! ## Thread Safety
//!
//! All types are `Send + Sync` and safe for concurrent use.
/// Errors produced by this library
pub use Error;
/// Attribute Ids
pub use AttrId;
/// Multisig implementation
pub use ;
/// Type-safe wrappers for signature components
pub use ;
/// Views on the multisig
pub use ;
/// Serde serialization
/// Commonly used items
///
/// ```
/// use multi_sig::prelude::*;
///
/// let sig_data = vec![0u8; 64];
/// let ms = Builder::new(Codec::Ed25519Pub)
/// .with_signature_bytes(&sig_data)
/// .try_build()
/// .unwrap();
/// ```