Crate dlctix

Crate dlctix 

Source
Expand description

Crate documentation is TODO.

See the Github README.

Re-exports§

pub use bitcoin;
pub use musig2;
pub use secp;

Modules§

hashlock
This module contains utilities for constructing LN-compatible preimages and SHA256 hashes.

Structs§

ContractParameters
Represents the parameters which all players and the market maker must agree on to construct a ticketed DLC.
ContractSignatures
A set of signatures produced by running a cooperative SigningSession on a TicketedDLC. These are only the signatures needed for enforcing outcomes which multiple members of the group must agree on.
ContributorPartialSignatureSharingRound
A SigningSessionState state for the second signature-sharing round of communication used by individual signing contributors. Usually this would be used by a player.
CoordinatorPartialSignatureSharingRound
A SigningSessionState state for the second signature-sharing round of communication used by the signing coordinator (usually this would be the market maker).
EventLockingConditions
The locking points derived from the oracle’s announcement of a future event.
MarketMaker
The agent who provides the on-chain capital to facilitate the ticketed DLC. Could be one of the players in the DLC, or could be a neutral 3rd party who wishes to profit by leveraging their capital.
NonceSharingRound
A SigningSessionState state for the initial nonce-sharing round of communication.
Player
A player in a ticketed DLC. Each player is identified by a public key, but also by their ticket hash. If a player can learn the preimage of their ticket hash (usually by purchasing it via Lightning), they can claim winnings from DLC outcomes.
SigMap
Represents a mapping of different signature requirements to some arbitrary type T. This can be used to efficiently look up signatures, nonces, etc, for each outcome transaction, and for different WinConditions within each split transaction.
SignedContract
Represents a fully signed and enforceable TicketedDLC, created by running a SigningSession.
SigningSession
This is a state machine to manage signing the various transactions in a TicketedDLC. The generic parameter S determines which of the two stages of the signing session we are in.
TicketedDLC
Represents the combined output of building all transactions and precomputing all necessary data for a ticketed DLC.
WinCondition
Points to a situation where a player wins a payout from the DLC.

Enums§

Outcome
Represents one possible outcome branch of the DLC. This includes both outcomes attested-to by the Oracle, and expiry.

Traits§

SigningSessionState
A marker trait used to constrain the API of SigningSession.

Functions§

attestation_locking_point
Computes the attestation locking point given an oracle pubkey, nonce, and message.
attestation_secret
Computes the oracle’s attestation secret scalar - the discrete log of the locking point - for the given outcome message.
convert_point
Used to convert secp point into bitcoin xonly key only needed until crate bitcoin updates secp256k1 to v0.30 will be removed/deprecated once the dependency has upgraded
convert_xonly_key
Used to convert musig2 xonly key into bitcoin xonly key only needed until crate bitcoin updates secp256k1 to v0.30 will be removed/deprecated once the dependency has upgraded

Type Aliases§

OutcomeIndex
A type alias for clarity. DLC outcomes are sometimes referred to by their index in the set of possible outcome messages.
PayoutWeights
Represents a mapping of player to payout weight for a given outcome.
PlayerIndex
A type alias for clarity. Players in the DLC are often referred to by their index in the sorted set of players.