Struct BlindedMessagePath
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§
§impl BlindedMessagePath
impl BlindedMessagePath
pub fn one_hop<ES, T>(
recipient_node_id: PublicKey,
context: MessageContext,
entropy_source: ES,
secp_ctx: &Secp256k1<T>,
) -> Result<BlindedMessagePath, ()>
pub fn one_hop<ES, T>( recipient_node_id: PublicKey, context: MessageContext, entropy_source: ES, secp_ctx: &Secp256k1<T>, ) -> Result<BlindedMessagePath, ()>
Create a one-hop blinded path for a message.
pub fn new<ES, T>(
intermediate_nodes: &[MessageForwardNode],
recipient_node_id: PublicKey,
context: MessageContext,
entropy_source: ES,
secp_ctx: &Secp256k1<T>,
) -> Result<BlindedMessagePath, ()>
pub fn new<ES, T>( intermediate_nodes: &[MessageForwardNode], recipient_node_id: PublicKey, context: MessageContext, entropy_source: ES, secp_ctx: &Secp256k1<T>, ) -> Result<BlindedMessagePath, ()>
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.
pub 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.
pub 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).
pub fn introduction_node(&self) -> &IntroductionNode
pub fn introduction_node(&self) -> &IntroductionNode
The IntroductionNode
of the blinded path.
pub fn blinding_point(&self) -> PublicKey
pub fn blinding_point(&self) -> PublicKey
Used by the IntroductionNode
to decrypt its encrypted_payload
to forward the message.
pub fn blinded_hops(&self) -> &[BlindedHop]
pub fn blinded_hops(&self) -> &[BlindedHop]
The BlindedHop
s within the blinded path.
pub fn advance_path_by_one<NS, NL, T>(
&mut self,
node_signer: &NS,
node_id_lookup: &NL,
secp_ctx: &Secp256k1<T>,
) -> Result<(), ()>where
NS: Deref,
NL: Deref,
<NS as Deref>::Target: NodeSigner,
<NL as Deref>::Target: NodeIdLookUp,
T: Signing + Verification,
pub fn advance_path_by_one<NS, NL, T>(
&mut self,
node_signer: &NS,
node_id_lookup: &NL,
secp_ctx: &Secp256k1<T>,
) -> Result<(), ()>where
NS: Deref,
NL: Deref,
<NS as Deref>::Target: NodeSigner,
<NL as Deref>::Target: NodeIdLookUp,
T: Signing + Verification,
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
.
Trait Implementations§
§impl Clone for BlindedMessagePath
impl Clone for BlindedMessagePath
§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§impl Debug for BlindedMessagePath
impl Debug for BlindedMessagePath
§impl Hash for BlindedMessagePath
impl Hash for BlindedMessagePath
§impl PartialEq for BlindedMessagePath
impl PartialEq for BlindedMessagePath
§impl Readable for BlindedMessagePath
impl Readable for BlindedMessagePath
§fn read<R>(r: &mut R) -> Result<BlindedMessagePath, DecodeError>where
R: Read,
fn read<R>(r: &mut R) -> Result<BlindedMessagePath, DecodeError>where
R: Read,
Self
in from the given Read
.§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§
§impl<T> AnyEq for T
impl<T> AnyEq for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request