use lightning::ln::script::ShutdownScript;
use lightning::ln::types::ChannelId;
use lightning::offers::invoice::UnsignedBolt12Invoice;
-use lightning::offers::invoice_request::UnsignedInvoiceRequest;
use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath};
use lightning::routing::router::{InFlightHtlcs, Path, Route, RouteHop, RouteParameters, Router};
use lightning::sign::{
unreachable!()
}
- fn sign_bolt12_invoice_request(
- &self, _invoice_request: &UnsignedInvoiceRequest,
- ) -> Result<schnorr::Signature, ()> {
- unreachable!()
- }
-
fn sign_bolt12_invoice(
&self, _invoice: &UnsignedBolt12Invoice,
) -> Result<schnorr::Signature, ()> {
use lightning::ln::script::ShutdownScript;
use lightning::ln::types::ChannelId;
use lightning::offers::invoice::UnsignedBolt12Invoice;
-use lightning::offers::invoice_request::UnsignedInvoiceRequest;
use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath};
use lightning::routing::gossip::{NetworkGraph, P2PGossipSync};
use lightning::routing::router::{
unreachable!()
}
- fn sign_bolt12_invoice_request(
- &self, _invoice_request: &UnsignedInvoiceRequest,
- ) -> Result<schnorr::Signature, ()> {
- unreachable!()
- }
-
fn sign_bolt12_invoice(
&self, _invoice: &UnsignedBolt12Invoice,
) -> Result<schnorr::Signature, ()> {
use lightning::ln::peer_handler::IgnoringMessageHandler;
use lightning::ln::script::ShutdownScript;
use lightning::offers::invoice::UnsignedBolt12Invoice;
-use lightning::offers::invoice_request::UnsignedInvoiceRequest;
use lightning::onion_message::async_payments::{
AsyncPaymentsMessageHandler, HeldHtlcAvailable, ReleaseHeldHtlc,
};
unreachable!()
}
- fn sign_bolt12_invoice_request(
- &self, _invoice_request: &UnsignedInvoiceRequest,
- ) -> Result<schnorr::Signature, ()> {
- unreachable!()
- }
-
fn sign_bolt12_invoice(
&self, _invoice: &UnsignedBolt12Invoice,
) -> Result<schnorr::Signature, ()> {
use crate::ln::onion_utils::INVALID_ONION_BLINDING;
use crate::ln::outbound_payment::{Retry, IDEMPOTENCY_TIMEOUT_TICKS};
use crate::offers::invoice::UnsignedBolt12Invoice;
-use crate::offers::invoice_request::UnsignedInvoiceRequest;
use crate::prelude::*;
use crate::routing::router::{BlindedTail, Path, Payee, PaymentParameters, RouteHop, RouteParameters};
use crate::sign::{KeyMaterial, NodeSigner, Recipient};
fn sign_invoice(
&self, _invoice: &RawBolt11Invoice, _recipient: Recipient,
) -> Result<RecoverableSignature, ()> { unreachable!() }
- fn sign_bolt12_invoice_request(
- &self, _invoice_request: &UnsignedInvoiceRequest,
- ) -> Result<schnorr::Signature, ()> { unreachable!() }
fn sign_bolt12_invoice(
&self, _invoice: &UnsignedBolt12Invoice,
) -> Result<schnorr::Signature, ()> { unreachable!() }
use crate::ln::msgs::{UnsignedChannelAnnouncement, UnsignedGossipMessage};
use crate::ln::script::ShutdownScript;
use crate::offers::invoice::UnsignedBolt12Invoice;
-use crate::offers::invoice_request::UnsignedInvoiceRequest;
use crate::types::payment::PaymentPreimage;
use crate::util::ser::{Readable, ReadableArgs, Writeable, Writer};
use crate::util::transaction_utils;
&self, invoice: &RawBolt11Invoice, recipient: Recipient,
) -> Result<RecoverableSignature, ()>;
- /// Signs the [`TaggedHash`] of a BOLT 12 invoice request.
- ///
- /// May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where
- /// `invoice_request` is the callee.
- ///
- /// Implementors may check that the `invoice_request` is expected rather than blindly signing
- /// the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with
- /// the node's signing key or an ephemeral key to preserve privacy, whichever is associated with
- /// [`UnsignedInvoiceRequest::payer_signing_pubkey`].
- ///
- /// [`TaggedHash`]: crate::offers::merkle::TaggedHash
- fn sign_bolt12_invoice_request(
- &self, invoice_request: &UnsignedInvoiceRequest,
- ) -> Result<schnorr::Signature, ()>;
-
/// Signs the [`TaggedHash`] of a BOLT 12 invoice.
///
/// May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the
Ok(self.secp_ctx.sign_ecdsa_recoverable(&hash_to_message!(&hash), secret))
}
- fn sign_bolt12_invoice_request(
- &self, invoice_request: &UnsignedInvoiceRequest,
- ) -> Result<schnorr::Signature, ()> {
- let message = invoice_request.tagged_hash().as_digest();
- let keys = Keypair::from_secret_key(&self.secp_ctx, &self.node_secret);
- let aux_rand = self.get_secure_random_bytes();
- Ok(self.secp_ctx.sign_schnorr_with_aux_rand(message, &keys, &aux_rand))
- }
-
fn sign_bolt12_invoice(
&self, invoice: &UnsignedBolt12Invoice,
) -> Result<schnorr::Signature, ()> {
Ok(self.inner.secp_ctx.sign_ecdsa_recoverable(&hash_to_message!(&hash), secret))
}
- fn sign_bolt12_invoice_request(
- &self, invoice_request: &UnsignedInvoiceRequest,
- ) -> Result<schnorr::Signature, ()> {
- self.inner.sign_bolt12_invoice_request(invoice_request)
- }
-
fn sign_bolt12_invoice(
&self, invoice: &UnsignedBolt12Invoice,
) -> Result<schnorr::Signature, ()> {
use crate::ln::msgs::LightningError;
use crate::ln::script::ShutdownScript;
use crate::offers::invoice::UnsignedBolt12Invoice;
-use crate::offers::invoice_request::UnsignedInvoiceRequest;
use crate::onion_message::messenger::{DefaultMessageRouter, Destination, MessageRouter, OnionMessagePath};
use crate::routing::gossip::{EffectiveCapacity, NetworkGraph, NodeId, RoutingFees};
use crate::routing::utxo::{UtxoLookup, UtxoLookupError, UtxoResult};
unreachable!()
}
- fn sign_bolt12_invoice_request(
- &self, _invoice_request: &UnsignedInvoiceRequest
- ) -> Result<schnorr::Signature, ()> {
- unreachable!()
- }
-
fn sign_bolt12_invoice(
&self, _invoice: &UnsignedBolt12Invoice,
) -> Result<schnorr::Signature, ()> {
self.backing.sign_invoice(invoice, recipient)
}
- fn sign_bolt12_invoice_request(
- &self, invoice_request: &UnsignedInvoiceRequest
- ) -> Result<schnorr::Signature, ()> {
- self.backing.sign_bolt12_invoice_request(invoice_request)
- }
-
fn sign_bolt12_invoice(
&self, invoice: &UnsignedBolt12Invoice,
) -> Result<schnorr::Signature, ()> {