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 BlindedHops 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 more