Crate dlc

Source
Expand description

§Rust DLC Library

Library for creating, signing and verifying transactions for the Discreet Log Contract protocol.

Re-exports§

pub extern crate secp256k1_zkp;

Modules§

channel
Module for working with DLC channels
secp_utils
Crypto utilities providing necessary DLC specific functions not available in rust-secp256k1 or rust-secp256k1-zkp.
util
Utility functions not uniquely related to DLC

Structs§

DlcTransactions
Contains the necessary transactions for establishing a DLC
EnumerationPayout
Representation of a payout for an enumeration outcome.
OracleInfo
Structure containing oracle information for a single event.
PartyParams
Contains the parameters required for creating DLC transactions for a single party. Specifically these are the common fields between Offer and Accept messages.
Payout
Represents the payouts for a unique contract outcome. Offer party represents the initiator of the contract while accept party represents the party accepting the contract.
RangePayout
Representation of a set of contiguous outcomes that share a single payout.
TxInputInfo
Contains info about a utxo used for funding a DLC contract

Enums§

Error
An error code.

Constants§

P2WPKH_WITNESS_SIZE
The witness size of a P2WPKH input See: https://github.com/discreetlogcontracts/dlcspecs/blob/master/Transactions.md#fees

Functions§

create_cet
Create a contract execution transaction
create_cet_adaptor_sig_from_oracle_info
Create an adaptor signature for the given cet using the provided oracle infos.
create_cet_adaptor_sig_from_point
Create an adaptor signature for the given cet using the provided adaptor point.
create_cet_adaptor_sigs_from_oracle_info
Crerate a set of adaptor signatures for the given cet/message pairs.
create_cet_adaptor_sigs_from_points
Crerate a set of adaptor signatures for the given cet/message pairs.
create_cets
Create a set of contract execution transaction for each provided outcome
create_dlc_transactions
Create the transactions for a DLC contract based on the provided parameters
create_funding_transaction
Create a funding transaction
create_refund_transaction
Create a refund transaction
get_adaptor_point_from_oracle_info
Get an adaptor point generated using the given oracle information and messages.
make_funding_redeemscript
Create the multisig redeem script for the funding output
sign_cet
Sign the given cet using own private key, adapt the counter party signature and place both signatures and the funding multi sig script pubkey on the witness stack
verify_cet_adaptor_sig_from_oracle_info
Verify that a given adaptor signature for a given cet is valid with respect to an oracle public key, nonce and a given message.
verify_cet_adaptor_sig_from_point
Verify that a given adaptor signature for a given cet is valid with respect to an adaptor point.
verify_tx_input_sig
Verify a signature for a given transaction input.