@@ -12,16 +12,15 @@ use bitcoin::secp256k1::{self, Keypair, Parity, PublicKey, Secp256k1, SecretKey}
1212use core:: convert:: TryFrom ;
1313use lightning:: blinded_path:: payment:: {
1414 BlindedPaymentPath , Bolt12OfferContext , ForwardTlvs , PaymentConstraints , PaymentContext ,
15- PaymentForwardNode , PaymentRelay , UnauthenticatedReceiveTlvs ,
15+ PaymentForwardNode , PaymentRelay , ReceiveTlvs ,
1616} ;
1717use lightning:: ln:: channelmanager:: MIN_FINAL_CLTV_EXPIRY_DELTA ;
1818use lightning:: ln:: inbound_payment:: ExpandedKey ;
1919use lightning:: offers:: invoice:: UnsignedBolt12Invoice ;
2020use lightning:: offers:: invoice_request:: { InvoiceRequest , InvoiceRequestFields } ;
21- use lightning:: offers:: nonce:: Nonce ;
2221use lightning:: offers:: offer:: OfferId ;
2322use lightning:: offers:: parse:: Bolt12SemanticError ;
24- use lightning:: sign:: EntropySource ;
23+ use lightning:: sign:: { EntropySource , ReceiveAuthKey } ;
2524use lightning:: types:: features:: BlindedHopFeatures ;
2625use lightning:: types:: payment:: { PaymentHash , PaymentSecret } ;
2726use lightning:: types:: string:: UntrustedString ;
@@ -84,7 +83,7 @@ fn build_response<T: secp256k1::Signing + secp256k1::Verification>(
8483) -> Result < UnsignedBolt12Invoice , Bolt12SemanticError > {
8584 let expanded_key = ExpandedKey :: new ( [ 42 ; 32 ] ) ;
8685 let entropy_source = Randomness { } ;
87- let nonce = Nonce :: from_entropy_source ( & entropy_source ) ;
86+ let receive_auth_key = ReceiveAuthKey ( [ 41 ; 32 ] ) ;
8887
8988 let invoice_request_fields =
9089 if let Ok ( ver) = invoice_request. clone ( ) . verify_using_metadata ( & expanded_key, secp_ctx) {
@@ -106,15 +105,14 @@ fn build_response<T: secp256k1::Signing + secp256k1::Verification>(
106105 offer_id : OfferId ( [ 42 ; 32 ] ) ,
107106 invoice_request : invoice_request_fields,
108107 } ) ;
109- let payee_tlvs = UnauthenticatedReceiveTlvs {
108+ let payee_tlvs = ReceiveTlvs {
110109 payment_secret : PaymentSecret ( [ 42 ; 32 ] ) ,
111110 payment_constraints : PaymentConstraints {
112111 max_cltv_expiry : 1_000_000 ,
113112 htlc_minimum_msat : 1 ,
114113 } ,
115114 payment_context,
116115 } ;
117- let payee_tlvs = payee_tlvs. authenticate ( nonce, & expanded_key) ;
118116 let intermediate_nodes = [ PaymentForwardNode {
119117 tlvs : ForwardTlvs {
120118 short_channel_id : 43 ,
@@ -124,7 +122,7 @@ fn build_response<T: secp256k1::Signing + secp256k1::Verification>(
124122 fee_base_msat : 1 ,
125123 } ,
126124 payment_constraints : PaymentConstraints {
127- max_cltv_expiry : payee_tlvs. tlvs ( ) . payment_constraints . max_cltv_expiry + 40 ,
125+ max_cltv_expiry : payee_tlvs. payment_constraints . max_cltv_expiry + 40 ,
128126 htlc_minimum_msat : 100 ,
129127 } ,
130128 features : BlindedHopFeatures :: empty ( ) ,
@@ -136,6 +134,7 @@ fn build_response<T: secp256k1::Signing + secp256k1::Verification>(
136134 let payment_path = BlindedPaymentPath :: new (
137135 & intermediate_nodes,
138136 pubkey ( 42 ) ,
137+ receive_auth_key,
139138 payee_tlvs,
140139 u64:: MAX ,
141140 MIN_FINAL_CLTV_EXPIRY_DELTA ,
0 commit comments