Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bitgo/sdk-lib-mpc

Package Overview
Dependencies
Maintainers
14
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bitgo/sdk-lib-mpc - npm Package Compare versions

Comparing version 9.9.0 to 9.10.0

6

CHANGELOG.md

@@ -6,2 +6,8 @@ # Change Log

# [9.10.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-lib-mpc@9.9.0...@bitgo/sdk-lib-mpc@9.10.0) (2024-07-16)
### Features
- **sdk-lib-mpc:** implement session get and restore for dsg ([19a41ce](https://github.com/BitGo/BitGoJS/commit/19a41ceaae2c5117648260d192e9b41c5fcd12a7))
# [9.9.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-lib-mpc@9.8.1...@bitgo/sdk-lib-mpc@9.9.0) (2024-06-26)

@@ -8,0 +14,0 @@

@@ -16,2 +16,12 @@ /// <reference types="node" />

private _deserializeState;
/**
* Returns the current DSG session as a base64 string.
* @returns {string} - base64 string of the current DSG session
*/
getSession(): string;
/**
* Sets the DSG session from a base64 string.
* @param {string} session - base64 string of the DSG session
*/
setSession(session: string): void;
init(): Promise<DeserializedBroadcastMessage>;

@@ -18,0 +28,0 @@ get signature(): DeserializedDklsSignature;

37

dist/src/tss/ecdsa-dkls/dsg.js

@@ -43,2 +43,35 @@ "use strict";

}
/**
* Returns the current DSG session as a base64 string.
* @returns {string} - base64 string of the current DSG session
*/
getSession() {
return Buffer.from(this.dsgSessionBytes).toString('base64');
}
/**
* Sets the DSG session from a base64 string.
* @param {string} session - base64 string of the DSG session
*/
setSession(session) {
this.dsgSession = undefined;
const sessionBytes = new Uint8Array(Buffer.from(session, 'base64'));
const round = (0, cbor_x_1.decode)(sessionBytes).round;
switch (true) {
case round === 'WaitMsg1':
this.dsgState = types_1.DsgState.Round1;
break;
case round === 'WaitMsg2':
this.dsgState = types_1.DsgState.Round2;
break;
case round === 'WaitMsg3':
this.dsgState = types_1.DsgState.Round3;
break;
case 'WaitMsg4' in round:
this.dsgState = types_1.DsgState.Round4;
break;
default:
throw Error(`Invalid State: ${round}`);
}
this.dsgSessionBytes = sessionBytes;
}
async init() {

@@ -60,2 +93,4 @@ if (this.dsgState !== types_1.DsgState.Uninitialized) {

this._deserializeState();
this.dsgSessionBytes = this.dsgSession.toBytes();
this.dsgSession = undefined;
return {

@@ -176,2 +211,2 @@ payload: payload,

exports.Dsg = Dsg;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHNnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3Rzcy9lY2RzYS1ka2xzL2RzZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw4RUFBd0Y7QUFDeEYsbUNBQWtIO0FBQ2xILG1DQUFnQztBQUVoQyxNQUFhLEdBQUc7SUFVZCxZQUFZLFFBQWdCLEVBQUUsUUFBZ0IsRUFBRSxjQUFzQixFQUFFLFdBQW1CO1FBRmpGLGFBQVEsR0FBYSxnQkFBUSxDQUFDLGFBQWEsQ0FBQztRQUdwRCxJQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztRQUN6QixJQUFJLENBQUMsYUFBYSxHQUFHLFFBQVEsQ0FBQztRQUM5QixJQUFJLENBQUMsY0FBYyxHQUFHLGNBQWMsQ0FBQztRQUNyQyxJQUFJLENBQUMsV0FBVyxHQUFHLFdBQVcsQ0FBQztJQUNqQyxDQUFDO0lBRU8sZUFBZTtRQUNyQixJQUFJLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRTtZQUNwQixJQUFJLENBQUMsVUFBVSxHQUFHLCtCQUFXLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxlQUFlLENBQUMsQ0FBQztTQUMvRDtJQUNILENBQUM7SUFFTyxpQkFBaUI7UUFDd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FJvdW5kTWVzc2FnZXNbMF0uZnJvbV9pZCxcbiAgICAgICAgICAgICAgc2lnbmF0dXJlUjogZGVjb2RlKHRoaXMuZHNnU2Vzc2lvbi50b0J5dGVzKCkpLnJvdW5kLldhaXRNc2c0LnIsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgIF0sXG4gICAgICAgICAgcDJwTWVzc2FnZXM6IFtdLFxuICAgICAgICB9O1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgLy8gVXBkYXRlIHJvdW5kIGRhdGEuXG4gICAgICAgIHRoaXMuX2Rlc2VyaWFsaXplU3RhdGUoKTtcbiAgICAgIH1cbiAgICAgIG5leHRSb3VuZERlc2VyaWFsaXplZE1lc3NhZ2VzID0ge1xuICAgICAgICBwMnBNZXNzYWdlczogbmV4dFJvdW5kTWVzc2FnZXNcbiAgICAgICAgICAuZmlsdGVyKChtKSA9PiBtLnRvX2lkICE9PSB1bmRlZmluZWQpXG4gICAgICAgICAgLm1hcCgobSkgPT4ge1xuICAgICAgICAgICAgaWYgKG0udG9faWQgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICB0aHJvdyBFcnJvcignSW52YWxpZCBQMlAgbWVzc2FnZSwgbWlzc2luZyB0b19pZC4nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvbnN0IHAycFJldHVybiA9IHtcbiAgICAgICAgICAgICAgcGF5bG9hZDogbS5wYXlsb2FkLFxuICAgICAgICAgICAgICBmcm9tOiBtLmZyb21faWQsXG4gICAgICAgICAgICAgIHRvOiBtLnRvX2lkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJldHVybiBwMnBSZXR1cm47XG4gICAgICAgICAgfSksXG4gICAgICAgIGJyb2FkY2FzdE1lc3NhZ2VzOiBuZXh0Um91bmRNZXNzYWdlc1xuICAgICAgICAgIC5maWx0ZXIoKG0pID0+IG0udG9faWQgPT09IHVuZGVmaW5lZClcbiAgICAgICAgICAubWFwKChtKSA9PiB7XG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mcgdG9faWQuJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb25zdCBwMnBSZXR1cm4gPSB7XG4gICAgICAgICAgICAgIHBheWxvYWQ6IG0ucGF5bG9hZCxcbiAgICAgICAgICAgICAgZnJvbTogbS5mcm9tX2lkLFxuICAgICAgICAgICAgICB0bzogbS50b19pZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXR1cm4gcDJwUmV0dXJuO1xuICAgICAgICAgIH0pLFxuICAgICAgICBicm9hZGNhc3RNZXNzYWdlczogbmV4dFJvdW5kTWVzc2FnZXNcbiAgICAgICAgICAuZmlsdGVyKChtKSA9PiBtLnRvX2lkID09PSB1bmRlZmluZWQpXG4gICAgICAgICAgLm1hcCgobSkgPT4ge1xuICAgICAgICAgICAgY29uc3QgYnJvYWRjYXN0UmV0dXJuID0ge1xuICAgICAgICAgICAgICBwYXlsb2FkOiBtLnBheWxvYWQsXG4gICAgICAgICAgICAgIGZyb206IG0uZnJvbV9pZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXR1cm4gYnJvYWRjYXN0UmV0dXJuO1xuICAgICAgICAgIH0pLFxuICAgICAgfTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICBpZiAoZS5tZXNzYWdlLnN0YXJ0c1dpdGgoJ0Fib3J0IHRoZSBwcm90b2NvbCBhbmQgYmFuJykpIHtcbiAgICAgICAgdGhyb3cgRXJyb3IoXG4gICAgICAgICAgJ1NpZ25pbmcgYWJvcnRlZC4gUGxlYXNlIHN0b3AgYWxsIHRyYW5zYWN0aW9uIHNpZ25pbmcgZnJvbSB0aGlzIHdhbGxldCBhbmQgY29udGFjdCBzdXBwb3J0QGJpdGdvLmNvbS4nXG4gICAgICAgICk7XG4gICAgICB9XG4gICAgICB0aHJvdyBFcnJvcihgRXJyb3Igd2hpbGUgY3JlYXRpbmcgbWVzc2FnZXMgZnJvbSBwYXJ0eSAke3RoaXMucGFydHlJZHh9LCByb3VuZCAke3RoaXMuZHNnU3RhdGV9OiAke2V9YCk7XG4gICAgfSBmaW5hbGx5IHtcbiAgICAgIG5leHRSb3VuZE1lc3NhZ2VzLmZvckVhY2goKG0pID0+IG0uZnJlZSgpKTtcbiAgICAgIC8vIFNlc3Npb24gaXMgZnJlZWQgd2hlbiBjb21iaW5lIGlzIGNhbGxlZC5cbiAgICAgIGlmICh0aGlzLmRzZ1N0YXRlICE9PSBEc2dTdGF0ZS5Db21wbGV0ZSkge1xuICAgICAgICB0aGlzLmRzZ1Nlc3Npb25CeXRlcyA9IHRoaXMuZHNnU2Vzc2lvbi50b0J5dGVzKCk7XG4gICAgICAgIHRoaXMuZHNnU2Vzc2lvbiA9IHVuZGVmaW5lZDtcbiAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIG5leHRSb3VuZERlc2VyaWFsaXplZE1lc3NhZ2VzO1xuICB9XG59XG4iXX0=

26

dist/src/tss/ecdsa-dkls/util.js

@@ -155,5 +155,12 @@ "use strict";

const bitgo = new dkg_1.Dkg(3, 2, 2, seedBitgo, retrofitDataC);
// #region round 1
const userRound1Message = await user.initDkg();
const backupRound1Message = await backup.initDkg();
const bitgoRound1Message = await bitgo.initDkg();
const bitgoRound2Messages = bitgo.handleIncomingMessages({
p2pMessages: [],
broadcastMessages: [userRound1Message, backupRound1Message],
});
// #endregion
// #region round 2
const userRound2Messages = user.handleIncomingMessages({

@@ -167,6 +174,10 @@ p2pMessages: [],

});
const bitgoRound2Messages = bitgo.handleIncomingMessages({
p2pMessages: [],
broadcastMessages: [userRound1Message, backupRound1Message],
const bitgoRound3Messages = bitgo.handleIncomingMessages({
p2pMessages: backupRound2Messages.p2pMessages
.filter((m) => m.to === 2)
.concat(userRound2Messages.p2pMessages.filter((m) => m.to === 2)),
broadcastMessages: [],
});
// #endregion
// #region round 3
const userRound3Messages = user.handleIncomingMessages({

@@ -184,8 +195,2 @@ p2pMessages: backupRound2Messages.p2pMessages

});
const bitgoRound3Messages = bitgo.handleIncomingMessages({
p2pMessages: backupRound2Messages.p2pMessages
.filter((m) => m.to === 2)
.concat(userRound2Messages.p2pMessages.filter((m) => m.to === 2)),
broadcastMessages: [],
});
const userRound4Messages = user.handleIncomingMessages({

@@ -209,2 +214,3 @@ p2pMessages: backupRound3Messages.p2pMessages

});
// #endregion
user.handleIncomingMessages({

@@ -265,2 +271,2 @@ p2pMessages: [],

exports.generate2of2KeyShares = generate2of2KeyShares;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy90c3MvZWNkc2EtZGtscy91dGlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsdURBQTREO0FBQzVELHlDQUE0RTtBQUM1RSxxQ0FBa0U7QUFFbEUsbUNBQWdDO0FBQ2hDLHFEQUF1QztBQUN2QyxtQ0FBMEM7QUFFMUMsK0JBQTRCO0FBQzVCLG9EQUE0QjtBQUU1QixNQUFNLFNBQVMsR0FBRyxHQUFHLENBQUM7QUFFdEI7Ozs7O0dBS0c7QUFDSCxTQUFnQix3QkFBd0IsQ0FBQyxxQkFBbUMsRUFBRSxJQUFZO0lBQ3hGLE1BQU0sQ0FBQyxHQUFHLElBQUEseUJBQWtCLEVBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsS0FBSyxDQUFDLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDbkUsTUFBTSxLQUFLLEdBQUcscUJBQXFCLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxJQUFBLGVBQU0sRUFBQyxDQUFDLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUM5RCxNQUFNLEtBQUssR0FBRyxxQkFBcUI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b2FkY2FzdE1lc3NhZ2VzOiBwYXJ0eUFSb3VuZDRNZXNzYWdlcy5icm9hZGNhc3RNZXNzYWdlcyxcbiAgfSk7XG4gIHJldHVybiBbcGFydHlBLCBwYXJ0eUJdO1xufVxuIl19
{
"name": "@bitgo/sdk-lib-mpc",
"version": "9.9.0",
"version": "9.10.0",
"description": "library functions for BitGo's MPC solution",

@@ -61,3 +61,3 @@ "main": "./dist/src/index.js",

},
"gitHead": "4ebf57c316e7673faba2ccdef2a6f098dbf225bc"
"gitHead": "6df006e0e8faf8bfc0a42e1344b9a96c0d39e4ea"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc