/// import { DecryptableNShare, CombinedKey, EncryptedNShare, AShare, CreateUserGammaAndMuShareRT, CreateUserOmicronAndDeltaShareRT, DShare, GShare, KeyShare, NShare, OShare, SendShareType, SignatureShare, SignShare, WShare, XShare, YShare, SendShareToBitgoRT, ReceivedShareType, BShare, Signature } from './types'; import { SignatureShareRecord, SignatureShareType, RequestType } from './../../utils'; import { ShareKeyPosition } from '../types'; import { BitGoBase } from '../../bitgoBase'; import { KShare, MUShare, SShare } from '../../../account-lib/mpc/tss/ecdsa/types'; /** * Combines NShares to combine the final TSS key * This can only be used to create the User or Backup key since it requires the common keychain from BitGo first * * @param keyShare - TSS key share * @param encryptedNShares - encrypted NShares with information on how to decrypt * @param commonKeychain - expected common keychain of the combined key * @returns {CombinedKey} combined TSS key */ export declare function createCombinedKey(keyShare: KeyShare, encryptedNShares: DecryptableNShare[], commonKeychain: string): Promise; /** * Creates the SignShare with User XShare and YShare Corresponding to BitGo * @param {XShare} xShare User secret xShare * @param {YShare} yShare YShare from Bitgo * @returns {Promise} */ export declare function createUserSignShare(xShare: XShare, yShare: YShare): Promise; /** * Creates the Gamma Share and MuShare with User WShare and AShare From BitGo * @param {WShare} wShare User WShare * @param {AShare} aShare AShare from Bitgo * @returns {Promise} */ export declare function createUserGammaAndMuShare(wShare: WShare, aShare: AShare): Promise; /** * Creates the Omicron Share and Delta share with user GShare * @param {GShare} gShare User GShare * @returns {Promise} */ export declare function createUserOmicronAndDeltaShare(gShare: GShare): Promise; /** * Creates the Signature Share with User OShare and DShare From BitGo * @param {OShare} oShare User OShare * @param {DShare} dShare DShare from bitgo * @param {Buffer} message message to perform sign * @returns {Promise} */ export declare function createUserSignatureShare(oShare: OShare, dShare: DShare, message: Buffer): Promise; export declare type MuDShare = { muShare: MUShare; dShare: DShare; i: ShareKeyPosition; }; /** * Sends Share To Bitgo * @param {BitGoBase} bitgo - the bitgo instance * @param {String} walletId - the wallet id * * @param {String} txRequestId - the txRequest Id * @param requestType - the type of request being submitted (either tx or message for signing) * @param shareType * @param share * @param signerShare * @returns {Promise} - a Signature Share */ export declare function sendShareToBitgo(bitgo: BitGoBase, walletId: string, txRequestId: string, requestType: RequestType, shareType: SendShareType, share: SShare | MuDShare | KShare, signerShare?: string): Promise; /** * Gets the latest user's share from bitgo needed to continue signing flow * @param {BitGoBase} bitgo - the bitgo instance * @param {String} walletId - the wallet id * * @param {String} txRequestId - the txRequest Id * @param {ReceivedShareType} shareType - the excpected share type * @returns {Promise} - share from bitgo to user */ export declare function getBitgoToUserLatestShare(bitgo: BitGoBase, walletId: string, txRequestId: string, shareType: ReceivedShareType): Promise; /** * Prepares a NShare to be exchanged with other key holders. * Output is in a format that is usable within BitGo's ecosystem. * * @param keyShare - TSS key share of the party preparing exchange materials * @param recipientIndex - index of the recipient (1, 2, or 3) * @param recipientGpgPublicArmor - recipient's public gpg key in armor format * @param senderGpgPrivateArmor - sender's private gpg key in armor format * @returns encrypted N Share */ export declare function encryptNShare(keyShare: KeyShare, recipientIndex: number, recipientGpgPublicArmor: string, isbs58Encoded?: boolean): Promise; /** * Decrypts encrypted n share * @param encryptedNShare - decryptable n share with recipient private gpg key armor and sender public gpg key * @returns N share */ export declare function decryptNShare(encryptedNShare: DecryptableNShare, isbs58Encoded?: boolean): Promise; /** * Gets public key from common key chain * @param commonKeyChain - common key chain of ecdsa tss * @returns public key */ export declare function getPublicKey(commonKeyChain: string): string; export declare const delimeter = ":"; export declare const secondaryDelimeter = "-"; /** * parses K share from signature share record * @param share - signature share record * @returns K Share */ export declare function parseKShare(share: SignatureShareRecord): KShare; /** * convert K share to signature share record * @param share - K share * @returns signature share record */ export declare function convertKShare(share: KShare): SignatureShareRecord; /** * parses A share from signature share record * @param share - signature share record * @returns A Share */ export declare function parseAShare(share: SignatureShareRecord): AShare; /** * convert A share to signature share record * @param share - A share * @returns signature share record */ export declare function convertAShare(share: AShare): SignatureShareRecord; /** * parses Mu share from signature share record * @param share - signature share record * @returns Mu Share */ export declare function parseMuShare(share: SignatureShareRecord): MUShare; /** * convert Mu share to signature share record * @param share - Mu share * @returns signature share record */ export declare function convertMuShare(share: MUShare): SignatureShareRecord; /** * parses D share from signature share record * @param share - signature share record * @returns D Share */ export declare function parseDShare(share: SignatureShareRecord): DShare; /** * convert D share to signature share record * @param share - D share * @returns signature share record */ export declare function convertDShare(share: DShare): SignatureShareRecord; /** * parses S and D share from signature share record * @param share - signature share record * @returns Object containing S and D Share */ export declare function parseSDShare(share: SignatureShareRecord): { sShare: SignatureShare; dShare: DShare; }; /** * convert S and D share to signature share record * @param share - S and D share in a object * @returns signature share record */ export declare function convertSDShare(share: { sShare: SShare; dShare: DShare; }): SignatureShareRecord; /** * parses signature share from signature share record * @param share - signature share record * @returns Signature Share */ export declare function parseSignatureShare(share: SignatureShareRecord): SignatureShare; /** * convets combined signature to signature share record * @param signature - combined signature share * @param userIndex - user index, either 1 (user) or 2 (backup) * @returns signature share record */ export declare function convertCombinedSignature(signature: Signature, userIndex: number): SignatureShareRecord; export declare function parseCombinedSignature(share: SignatureShareRecord): Signature; /** * convert signature share to signature share record * @param share - Signature share * @returns signature share record */ export declare function convertSignatureShare(share: SignatureShare, senderIndex: number): SignatureShareRecord; /** * converts B share to signature share record * @param share - B share * @returns signature share record */ export declare function convertBShare(share: BShare): SignatureShareRecord; /** * parses B share from signature share record * @param share B share record * @returns B Share */ export declare function parseBShare(share: SignatureShareRecord): BShare; /** * converts O share to signature share record * @param share O share * @returns signature share record */ export declare function convertOShare(share: OShare): SignatureShareRecord; /** * parses O share from signature share record * @param share O share record * @returns O Share */ export declare function parseOShare(share: SignatureShareRecord): OShare; /** * gets participant index * @param participant - participants (user, backup, or bitgo) * @returns index (1, 2, 0r 3) */ export declare function getParticipantIndex(participant: 'user' | 'backup' | 'bitgo'): number; /** * gets participant name by index * @param index participant index * @returns participant name */ export declare function getParticipantFromIndex(index: number): SignatureShareType; //# sourceMappingURL=ecdsa.d.ts.map