@@ -12,44 +12,43 @@ use bitcoin::{
12
12
13
13
use { MiniscriptKey , ToPublicKey } ;
14
14
15
- /// The MiniscriptKey corresponding to Descriptors. This can
16
- /// either be Single public key or a Xpub
15
+ /// The descriptor pubkey, either a single pubkey or an xpub.
17
16
#[ derive( Debug , Eq , PartialEq , Clone , Ord , PartialOrd , Hash ) ]
18
17
pub enum DescriptorPublicKey {
19
- /// Single Public Key
18
+ /// Single public key.
20
19
SinglePub ( DescriptorSinglePub ) ,
21
- /// Xpub
20
+ /// Extended public key (xpub).
22
21
XPub ( DescriptorXKey < bip32:: ExtendedPubKey > ) ,
23
22
}
24
23
25
- /// A Secret Key that can be either a single key or an Xprv
24
+ /// The descriptor secret key, either a single private key or an xprv.
26
25
#[ derive( Debug ) ]
27
26
pub enum DescriptorSecretKey {
28
- /// Single Secret Key
27
+ /// Single private key.
29
28
SinglePriv ( DescriptorSinglePriv ) ,
30
- /// Xprv
29
+ /// Extended private key (xpriv).
31
30
XPrv ( DescriptorXKey < bip32:: ExtendedPrivKey > ) ,
32
31
}
33
32
34
- /// A Single Descriptor Key with optional origin information
33
+ /// A descriptor [`SinglePubKey`] with optional origin information.
35
34
#[ derive( Debug , Eq , PartialEq , Clone , Ord , PartialOrd , Hash ) ]
36
35
pub struct DescriptorSinglePub {
37
- /// Origin information
36
+ /// Origin information (fingerprint and derivation path).
38
37
pub origin : Option < ( bip32:: Fingerprint , bip32:: DerivationPath ) > ,
39
- /// The key
38
+ /// The public key.
40
39
pub key : SinglePubKey ,
41
40
}
42
41
43
- /// A Single Descriptor Secret Key with optional origin information
42
+ /// A descriptor [`bitcoin::PrivateKey`] with optional origin information.
44
43
#[ derive( Debug ) ]
45
44
pub struct DescriptorSinglePriv {
46
- /// Origin information
45
+ /// Origin information (fingerprint and derivation path).
47
46
pub origin : Option < bip32:: KeySource > ,
48
- /// The key
47
+ /// The private key.
49
48
pub key : bitcoin:: PrivateKey ,
50
49
}
51
50
52
- /// Instance of an extended key with origin and derivation path
51
+ /// An extended key with origin, derivation path, and wildcard.
53
52
#[ derive( Debug , Eq , PartialEq , Clone , Ord , PartialOrd , Hash ) ]
54
53
pub struct DescriptorXKey < K : InnerXKey > {
55
54
/// Origin information
@@ -62,12 +61,12 @@ pub struct DescriptorXKey<K: InnerXKey> {
62
61
pub wildcard : Wildcard ,
63
62
}
64
63
65
- /// Single public key without any origin or range information
64
+ /// Single public key without any origin or range information.
66
65
#[ derive( Debug , Eq , PartialEq , Clone , Ord , PartialOrd , Hash ) ]
67
66
pub enum SinglePubKey {
68
- /// FullKey (compressed or uncompressed)
67
+ /// A bitcoin public key (compressed or uncompressed).
69
68
FullKey ( bitcoin:: PublicKey ) ,
70
- /// XOnlyPublicKey
69
+ /// An xonly public key.
71
70
XOnly ( XOnlyPublicKey ) ,
72
71
}
73
72
0 commit comments