UNPKG

lotus-sdk

Version:

Central repository for several classes of tools for integrating with, and building for, the Lotusia ecosystem

40 lines 2.15 kB
import { PublicKey } from '../publickey.js'; import { PrivateKey } from '../privatekey.js'; import { Point } from './point.js'; import { BN } from './bn.js'; import { Signature } from './signature.js'; export interface MuSigKeyAggContext { pubkeys: PublicKey[]; keyAggCoeff: Map<number, BN>; aggregatedPubKey: PublicKey; } export interface MuSigNonce { secretNonces: [BN, BN]; publicNonces: [Point, Point]; } export interface MuSigAggregatedNonce { R1: Point; R2: Point; } export declare const MUSIG_TAG_KEYSORT = "KeyAgg list"; export declare const MUSIG_TAG_KEYAGG_COEFF = "KeyAgg coefficient"; export declare const MUSIG_TAG_NONCE_COEFF = "MuSig/noncecoef"; export declare const MUSIG_TAG_NONCE = "MuSig/nonce"; export declare function musigTaggedHash(tag: string, data: Buffer): Buffer; export declare function musigKeyAgg(pubkeys: PublicKey[]): MuSigKeyAggContext; export declare function musigNonceGen(privateKey: PrivateKey, aggregatedPubKey: PublicKey, message?: Buffer, extraInput?: Buffer): MuSigNonce; export declare function musigNonceAgg(publicNonces: Array<[Point, Point]>): MuSigAggregatedNonce; export declare function musigPartialSign(secretNonce: MuSigNonce, privateKey: PrivateKey, keyAggContext: MuSigKeyAggContext, signerIndex: number, aggregatedNonce: MuSigAggregatedNonce, message: Buffer): BN; export declare function musigPartialSigVerify(partialSig: BN, publicNonce: [Point, Point], publicKey: PublicKey, keyAggContext: MuSigKeyAggContext, signerIndex: number, aggregatedNonce: MuSigAggregatedNonce, message: Buffer): boolean; export declare function musigSigAgg(partialSigs: BN[], aggregatedNonce: MuSigAggregatedNonce, message: Buffer, aggregatedPubKey: PublicKey, sighashType?: number): Signature; declare const _default: { musigKeyAgg: typeof musigKeyAgg; musigNonceGen: typeof musigNonceGen; musigNonceAgg: typeof musigNonceAgg; musigPartialSign: typeof musigPartialSign; musigPartialSigVerify: typeof musigPartialSigVerify; musigSigAgg: typeof musigSigAgg; musigTaggedHash: typeof musigTaggedHash; }; export default _default; //# sourceMappingURL=musig2.d.ts.map