UNPKG

@covenance/dlc

Version:

Crypto and Bitcoin functions for Covenance DLC implementation

22 lines (21 loc) 1.08 kB
import { Transaction, Script } from '../btc'; import { Point } from '../crypto/secp256k1'; import { PrivKey, AdaptorSignature } from '../crypto/types'; export declare function sighashForAdaptorSig(transaction: Transaction, inputIndex: number, tapleafHash: Buffer): Buffer; /** * Creates and applies an adaptor signature to a CET * @param cet - The CET transaction to sign * @param inputIndex - The index of the input to sign * @param privKey - The private key to sign with * @param oracleSigPoint - The oracle's signature point for the event outcome * @param tapleafHash - The hash of the tapleaf * @returns The adaptor signature */ export declare function createCetAdaptorSig(cet: Transaction, inputIndex: number, privKey: PrivKey, oracleSigPoint: Point, tapleafHash: Buffer): Promise<AdaptorSignature>; /** * Creates a tapleaf hash for a given script * @param script - The script to create a tapleaf hash for * @param leafVersion - The version of the leaf * @returns The tapleaf hash */ export declare function tapleafHash(script: Script, leafVersion?: number): Buffer;