Skip to main content

Crate fedimint_ln_common

Crate fedimint_ln_common 

Source
Expand description

§Lightning Module

This module allows to atomically and trustlessly (in the federated trust model) interact with the Lightning network through a Lightning gateway.

§Attention: only one operation per contract and round

If this module is active the consensus’ conflict filter must ensure that at most one operation (spend, funding) happens per contract per round

Re-exports§

pub use bitcoin;
pub use lightning_invoice;

Modules§

client
config
contracts
federation_endpoint_constants
gateway_endpoint_constants
route_hints
Hack to get a route hint that implements serde traits.
serde_option_routing_fees
serde_routing_fees

Structs§

ContractAccount
ContractOutput
FederationPublicKey
The federation’s aggregate public key, as committed to by a gateway registration proof. Re-exported so callers can verify proofs without depending on threshold_crypto directly. A public key.
GatewayRegistrationAuth
Proof that a gateway registration was authorized by the holder of the secret key behind LightningGateway::gateway_id.
LightningCommonInit
LightningGateway
Information a gateway registers with a federation
LightningGatewayAnnouncement
Information about a gateway that is shared with other federation members and expires based on a TTL to allow for sharing between nodes with unsynchronized clocks which can each anchor the announcement to their local system time.
LightningGatewayRegistration
Information about a gateway that is stored locally and expires based on local system time
LightningInputV0
LightningModuleTypes
Method
The Request Method (VERB)
PrunedInvoice
Data needed to pay an invoice
RemoveGatewayRequest
Request sent to the federation that requests the removal of a gateway registration. Each peer is expected to check the signatures map for the signature that validates the gateway authorized the removal of this registration.
UnknownLightningInputVariantError
UnknownLightningOutputOutcomeVariantError
UnknownLightningOutputVariantError

Enums§

LightningConsensusItem
LightningInput
LightningInputError
LightningOutput
LightningOutputError
LightningOutputOutcome
LightningOutputOutcomeV0
LightningOutputV0
Represents an output of the Lightning module.

Constants§

CONTRACT_FUNDED_ONCE_MODULE_CONSENSUS_VERSION
From this module consensus version on, a contract account is funded exactly once and no offer can be created for a payment hash whose incoming contract account already exists.
KIND
LNV1_INCOMING_HTLC_ADVERTISED_EXPIRY_DELTA
Route-hint CLTV delta advertised in newly created LNv1 invoices.
LNV1_INCOMING_HTLC_EXPIRY_SAFETY_MARGIN
Exclusive remaining-CLTV safety margin for funding LNv1 incoming contracts.
MAX_GATEWAY_REGISTRATION_TTL
Upper bound guardians place on a registration’s lifetime. Gateways announce a TTL two orders of magnitude below this, so it only ever binds on announcements that are trying to squat a gateway_id indefinitely.
MODULE_CONSENSUS_VERSION

Functions§

create_gateway_registration_message
Creates a message to be signed by the gateway’s private key to prove that a registration was authorized by the holder of info.gateway_id. Message is defined as:
create_gateway_remove_message
Creates a message to be signed by the Gateway’s private key for the purpose of removing the gateway’s registration record. Message is defined as: