pub struct BlindedMessagePath(/* private fields */);Expand description
A blinded path to be used for sending or receiving a message, hiding the identity of the recipient.
Implementations§
Source§impl BlindedMessagePath
impl BlindedMessagePath
Sourcepub fn one_hop<ES: Deref, T: Signing + Verification>(
recipient_node_id: PublicKey,
local_node_receive_key: ReceiveAuthKey,
context: MessageContext,
entropy_source: ES,
secp_ctx: &Secp256k1<T>,
) -> Selfwhere
ES::Target: EntropySource,
pub fn one_hop<ES: Deref, T: Signing + Verification>(
recipient_node_id: PublicKey,
local_node_receive_key: ReceiveAuthKey,
context: MessageContext,
entropy_source: ES,
secp_ctx: &Secp256k1<T>,
) -> Selfwhere
ES::Target: EntropySource,
Create a one-hop blinded path for a message.
Sourcepub fn new<ES: Deref, T: Signing + Verification>(
intermediate_nodes: &[MessageForwardNode],
recipient_node_id: PublicKey,
local_node_receive_key: ReceiveAuthKey,
context: MessageContext,
entropy_source: ES,
secp_ctx: &Secp256k1<T>,
) -> Selfwhere
ES::Target: EntropySource,
pub fn new<ES: Deref, T: Signing + Verification>(
intermediate_nodes: &[MessageForwardNode],
recipient_node_id: PublicKey,
local_node_receive_key: ReceiveAuthKey,
context: MessageContext,
entropy_source: ES,
secp_ctx: &Secp256k1<T>,
) -> Selfwhere
ES::Target: EntropySource,
Create a path for an onion message, to be forwarded along node_pks.
Sourcepub fn new_with_dummy_hops<ES: Deref, T: Signing + Verification>(
intermediate_nodes: &[MessageForwardNode],
recipient_node_id: PublicKey,
dummy_hop_count: usize,
local_node_receive_key: ReceiveAuthKey,
context: MessageContext,
entropy_source: ES,
secp_ctx: &Secp256k1<T>,
) -> Selfwhere
ES::Target: EntropySource,
pub fn new_with_dummy_hops<ES: Deref, T: Signing + Verification>(
intermediate_nodes: &[MessageForwardNode],
recipient_node_id: PublicKey,
dummy_hop_count: usize,
local_node_receive_key: ReceiveAuthKey,
context: MessageContext,
entropy_source: ES,
secp_ctx: &Secp256k1<T>,
) -> Selfwhere
ES::Target: EntropySource,
Same as BlindedMessagePath::new, but allows specifying a number of dummy hops.
Note:
At most MAX_DUMMY_HOPS_COUNT dummy hops can be added to the blinded path.
Sourcepub fn use_compact_introduction_node(
&mut self,
network_graph: &ReadOnlyNetworkGraph<'_>,
)
pub fn use_compact_introduction_node( &mut self, network_graph: &ReadOnlyNetworkGraph<'_>, )
Attempts to a use a compact representation for the IntroductionNode by using a directed
short channel id from a channel in network_graph leading to the introduction node.
While this may result in a smaller encoding, there is a trade off in that the path may become invalid if the channel is closed or hasn’t been propagated via gossip. Therefore, calling this may not be suitable for long-lived blinded paths.
Sourcepub fn public_introduction_node_id<'a>(
&self,
network_graph: &'a ReadOnlyNetworkGraph<'_>,
) -> Option<&'a NodeId>
pub fn public_introduction_node_id<'a>( &self, network_graph: &'a ReadOnlyNetworkGraph<'_>, ) -> Option<&'a NodeId>
Returns the introduction NodeId of the blinded path, if it is publicly reachable (i.e.,
it is found in the network graph).
Sourcepub fn introduction_node(&self) -> &IntroductionNode
pub fn introduction_node(&self) -> &IntroductionNode
The IntroductionNode of the blinded path.
Sourcepub fn blinding_point(&self) -> PublicKey
pub fn blinding_point(&self) -> PublicKey
Used by the IntroductionNode to decrypt its encrypted_payload to forward the message.
Sourcepub fn blinded_hops(&self) -> &[BlindedHop]
pub fn blinded_hops(&self) -> &[BlindedHop]
The BlindedHops within the blinded path.
Sourcepub fn advance_path_by_one<NS: Deref, NL: Deref, T>(
&mut self,
node_signer: &NS,
node_id_lookup: &NL,
secp_ctx: &Secp256k1<T>,
) -> Result<(), ()>
pub fn advance_path_by_one<NS: Deref, NL: Deref, T>( &mut self, node_signer: &NS, node_id_lookup: &NL, secp_ctx: &Secp256k1<T>, ) -> Result<(), ()>
Advance the blinded onion message path by one hop, making the second hop into the new introduction node.
Will only modify self when returning Ok.
Sourcepub fn from_blinded_path(
introduction_node_id: PublicKey,
blinding_point: PublicKey,
blinded_hops: Vec<BlindedHop>,
) -> Self
pub fn from_blinded_path( introduction_node_id: PublicKey, blinding_point: PublicKey, blinded_hops: Vec<BlindedHop>, ) -> Self
Creates a new BlindedMessagePath from its constituent parts.
Useful when you need to reconstruct a blinded path from previously serialized components.
Parameters:
introduction_node_id: The public key of the introduction node in the pathblinding_point: The public key used for blinding the pathblinded_hops: The encrypted routing information for each hop in the path
Trait Implementations§
Source§impl Clone for BlindedMessagePath
impl Clone for BlindedMessagePath
Source§fn clone(&self) -> BlindedMessagePath
fn clone(&self) -> BlindedMessagePath
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BlindedMessagePath
impl Debug for BlindedMessagePath
Source§impl Hash for BlindedMessagePath
impl Hash for BlindedMessagePath
Source§impl PartialEq for BlindedMessagePath
impl PartialEq for BlindedMessagePath
Source§impl Readable for BlindedMessagePath
impl Readable for BlindedMessagePath
Source§impl Writeable for BlindedMessagePath
impl Writeable for BlindedMessagePath
impl Eq for BlindedMessagePath
impl StructuralPartialEq for BlindedMessagePath
Auto Trait Implementations§
impl Freeze for BlindedMessagePath
impl RefUnwindSafe for BlindedMessagePath
impl Send for BlindedMessagePath
impl Sync for BlindedMessagePath
impl Unpin for BlindedMessagePath
impl UnwindSafe for BlindedMessagePath
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LengthReadable for Twhere
T: Readable,
impl<T> LengthReadable for Twhere
T: Readable,
Source§fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
Self in from the given LengthLimitedRead.