@covenance/dlc
Version:
Crypto and Bitcoin functions for Covenance DLC implementation
26 lines (25 loc) • 1.14 kB
TypeScript
import { Point } from './secp256k1';
import { PrivKey, PubKey, Signature, EventOutcomeHash } from './types';
/**
* Oracle function to create a commitment for an event in the future.
* @param eventOutcomeHashes - Array of event outcome hashes for each potential event outcome
* @param oraclePubKey - Oracle's public key
* @returns Object containing array of event signature points and event nonce
*/
export declare function commitToEvent(eventOutcomeHashes: EventOutcomeHash[], oraclePubKey: PubKey): Promise<{
signaturePoints: Point[];
nonce: bigint;
}>;
/**
* Oracle function to attest to an event outcome.
* @param oraclePrivKey - Oracle's private key
* @param nonce - Event nonce
* @param eventOutcomeHash - Hash of the event outcome
* @returns Oracle's signature for the event outcome
*/
export declare function attestEventOutcome(oraclePrivKey: PrivKey, nonce: bigint, eventOutcomeHash: EventOutcomeHash): Promise<Signature>;
/**
* Function to extract the oracle's private key from two oracle outcome attestations.
* This is to keep the oracle from cheating.
*/
export declare function extractOraclePrivKey(): void;