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
- Enumeration
Payout - Representation of a payout for an enumeration outcome.
- Oracle
Info - Structure containing oracle information for a single event.
- Party
Params - 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.
- Range
Payout - Representation of a set of contiguous outcomes that share a single payout.
- TxInput
Info - 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.