Skip to content

Commit be23002

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 be23002

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
@@ -41,7 +41,7 @@ impl TaggedHash {
4141
/// Creates a tagged hash with the given parameters.
4242
///
4343
/// Panics if `bytes` is not a well-formed TLV stream containing at least one TLV record.
44-
pub(super) fn from_valid_tlv_stream_bytes(tag: &'static str, bytes: &[u8]) -> Self {
44+
pub fn from_valid_tlv_stream_bytes(tag: &'static str, bytes: &[u8]) -> Self {
4545
let tlv_stream = TlvStream::new(bytes);
4646
Self::from_tlv_stream(tag, tlv_stream)
4747
}
@@ -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)