Skip to content

Commit bed3812

Browse files
offer: make the merkle tree signature public
This is helpfull for the users that want to use the merkle tree signature in their own code, for example to verify the signature of bolt12 invoices or recreate it. Very useful for people that are building command line tools for the bolt12 offers. Signed-off-by: Vincenzo Palazzo <[email protected]>
1 parent 0fe51c5 commit bed3812

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lightning/src/offers/merkle.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub enum SignError {
9494
}
9595

9696
/// A function for signing a [`TaggedHash`].
97-
pub(super) trait SignFn<T: AsRef<TaggedHash>> {
97+
pub trait SignFn<T: AsRef<TaggedHash>> {
9898
/// Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream.
9999
fn sign(&self, message: &T) -> Result<Signature, ()>;
100100
}
@@ -117,7 +117,7 @@ where
117117
///
118118
/// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
119119
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
120-
pub(super) fn sign_message<F, T>(
120+
pub fn sign_message<F, T>(
121121
f: F, message: &T, pubkey: PublicKey,
122122
) -> Result<Signature, SignError>
123123
where
@@ -136,7 +136,7 @@ where
136136

137137
/// Verifies the signature with a pubkey over the given message using a tagged hash as the message
138138
/// digest.
139-
pub(super) fn verify_signature(
139+
pub fn verify_signature(
140140
signature: &Signature, message: &TaggedHash, pubkey: PublicKey,
141141
) -> Result<(), secp256k1::Error> {
142142
let digest = message.as_digest();

0 commit comments

Comments
 (0)