File tree Expand file tree Collapse file tree
test/unit/bitgo/utils/tss/ecdsa Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7676 "@openpgp/web-stream-tools" : " 0.0.14" ,
7777 "@types/keccak" : " ^3.0.5" ,
7878 "@types/lodash" : " ^4.14.151" ,
79+ "bitgo" : " ^50.32.0" ,
7980 "nyc" : " ^15.0.0"
8081 },
8182 "gitHead" : " 18e460ddf02de2dbf13c2aa243478188fb539f0c"
Original file line number Diff line number Diff line change 1+ import * as assert from 'assert' ;
2+ import { DklsUtils } from '@bitgo/sdk-lib-mpc' ;
3+ import { BitGo } from 'bitgo' ;
4+ import { EcdsaMPCv2Utils } from 'modules/sdk-core/src' ;
5+
6+ describe ( 'ECDSA MPC v2' , ( ) => {
7+ it ( 'should sign a message hash using ECDSA MPC v2 offline rounds' , async ( ) => {
8+ const [ userShare , backupShare , bitgoShare ] = await DklsUtils . generateDKGKeyShares ( ) ;
9+
10+ assert . ok ( userShare ) ;
11+ assert . ok ( backupShare ) ;
12+ assert . ok ( bitgoShare ) ;
13+
14+ const bg = new BitGo ( { env : 'test' } ) ;
15+ const coin = bg . coin ( 'hteth' ) ;
16+ const ecdsaMPCv2Utils = new EcdsaMPCv2Utils ( bg , coin ) ;
17+
18+ const walletID = '62fe536a6b4cf70007acb48c0e7bb0b0' ;
19+ const tMessage = 'testMessage' ;
20+ const derivationPath = 'm/0' ;
21+ const walletPassphrase = 'testPass' ;
22+
23+ const reqMPCv2SigningRound1 = {
24+ txRequest : {
25+ txRequestId : '123456' ,
26+ apiVersion : 'full' ,
27+ walletId : walletID ,
28+ transactions : [
29+ {
30+ unsignedTx : {
31+ derivationPath,
32+ signableHex : tMessage ,
33+ } ,
34+ signatureShares : [ ] ,
35+ } ,
36+ ] ,
37+ } ,
38+ prv : userShare . getKeyShare ( ) . toString ( 'base64' ) ,
39+ walletPassphrase,
40+ } ;
41+
42+ const resMPCv2SigningRound1 = await ecdsaMPCv2Utils . createOfflineRound1Share ( reqMPCv2SigningRound1 ) ;
43+ assert . ok ( resMPCv2SigningRound1 . signatureShareRound1 ) ;
44+ } ) ;
45+ } ) ;
You can’t perform that action at this time.
0 commit comments