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,
context: MessageContext,
entropy_source: ES,
secp_ctx: &Secp256k1<T>,
) -> Result<Self, ()>where
ES::Target: EntropySource,
pub fn one_hop<ES: Deref, T: Signing + Verification>(
recipient_node_id: PublicKey,
context: MessageContext,
entropy_source: ES,
secp_ctx: &Secp256k1<T>,
) -> Result<Self, ()>where
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,
context: MessageContext,
entropy_source: ES,
secp_ctx: &Secp256k1<T>,
) -> Result<Self, ()>where
ES::Target: EntropySource,
pub fn new<ES: Deref, T: Signing + Verification>(
intermediate_nodes: &[MessageForwardNode],
recipient_node_id: PublicKey,
context: MessageContext,
entropy_source: ES,
secp_ctx: &Secp256k1<T>,
) -> Result<Self, ()>where
ES::Target: EntropySource,
Create a path for an onion message, to be forwarded along node_pks
. The last node
pubkey in node_pks
will be the destination node.
Errors if no hops are provided or if node_pk
(s) are invalid.
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 BlindedHop
s within the blinded 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)