@@ -364,7 +364,7 @@ impl_writeable!(OnionMessagePath, { node_id, encrypted_recipient_data });
364
364
type Empty = ( ) ;
365
365
366
366
/// An offer parsed from a bech32-encoded string as a TLV stream and the corresponding bytes. The
367
- /// latter is used for signature verification .
367
+ /// latter is used to compute the offer id .
368
368
struct ParsedOffer ( OfferTlvStream , Vec < u8 > ) ;
369
369
370
370
/// Error when parsing a bech32 encoded message using [`str::parse`].
@@ -399,8 +399,6 @@ pub enum SemanticError {
399
399
MissingPaths ,
400
400
///
401
401
InvalidQuantity ,
402
- ///
403
- InvalidSignature ( secp256k1:: Error ) ,
404
402
}
405
403
406
404
impl From < bech32:: Error > for ParseError {
@@ -421,12 +419,6 @@ impl From<SemanticError> for ParseError {
421
419
}
422
420
}
423
421
424
- impl From < secp256k1:: Error > for SemanticError {
425
- fn from ( error : secp256k1:: Error ) -> Self {
426
- Self :: InvalidSignature ( error)
427
- }
428
- }
429
-
430
422
impl FromStr for Offer {
431
423
type Err = ParseError ;
432
424
@@ -441,7 +433,7 @@ impl TryFrom<ParsedOffer> for Offer {
441
433
fn try_from ( offer : ParsedOffer ) -> Result < Self , Self :: Error > {
442
434
let ParsedOffer ( OfferTlvStream {
443
435
chains, metadata, currency, amount, description, features, absolute_expiry, paths,
444
- issuer, quantity_min, quantity_max, node_id, send_invoice, signature ,
436
+ issuer, quantity_min, quantity_max, node_id, send_invoice,
445
437
} , data) = offer;
446
438
447
439
let supported_chains = [
@@ -508,16 +500,10 @@ impl TryFrom<ParsedOffer> for Offer {
508
500
let send_invoice = send_invoice. map ( |_| SendInvoice ) ;
509
501
510
502
let id = merkle:: root_hash ( & data) ;
511
- if let Some ( signature) = & signature {
512
- let digest = Offer :: message_digest ( id) ;
513
- let secp_ctx = Secp256k1 :: verification_only ( ) ;
514
- let pubkey = Offer :: node_id_from_parts ( node_id, paths. as_ref ( ) ) ;
515
- secp_ctx. verify_schnorr ( signature, & digest, & pubkey. into ( ) ) ?;
516
- }
517
503
518
504
Ok ( Offer {
519
505
id, chains, metadata, amount, description, features, absolute_expiry, issuer, paths,
520
- quantity_min, quantity_max, node_id, send_invoice, signature ,
506
+ quantity_min, quantity_max, node_id, send_invoice,
521
507
} )
522
508
}
523
509
}
0 commit comments