UncertaintyNetwork Class

class UncertaintyNetwork.UncertaintyNetwork(channel_graph: pickhardtpayments.ChannelGraph.ChannelGraph, base_threshold: int = 0)

Bases: pickhardtpayments.ChannelGraph.ChannelGraph

The UncertaintyNetwork is the main data structure to store our belief about the Liquidity in the channels of the ChannelGraph.

Most of its functionality comes from the UncertaintyChannel. Most notably the ability to assign a linearized integer uncertainty unit cost to its channels and do this even piecewise.

Paths cannot be probed against the UncertaintyNetwork as it lacks an Oracle

activate_foaf_uncertainty_reduction(src, dest)
activate_network_wide_uncertainty_reduction(n, oracle: pickhardtpayments.OracleLightningNetwork.OracleLightningNetwork)

With the help of an OracleLightningNetwork probes all channels n times to reduce uncertainty.

While one can do this on mainnet by probing we can do this very quickly in simulation at virtually no cost. Thus, this API call needs to be taken with caution when using a different oracle.

allocate_amount_on_path(path: List[pickhardtpayments.UncertaintyChannel.UncertaintyChannel], amt: int)

allocates amt to all channels of the path of UncertaintyChannels


computes to total uncertainty in the network summing the entropy of all channels

get_features_of_candidate_path(path: typing.List[pickhardtpayments.UncertaintyChannel.UncertaintyChannel], amt: int) -> (<class 'float'>, <class 'float'>)

returns the routing fees and probability of a candidate path :rtype: object

property network

resets our belief about the liquidity & inflight information of all channels on the UncertaintyNetwork