Skip to content

Commit

Permalink
Merge pull request #38 from bloxapp/v3
Browse files Browse the repository at this point in the history
Merge v3 to main
  • Loading branch information
meshin-dev authored May 7, 2023
2 parents f277aaa + eeb5af2 commit 2fbaedf
Show file tree
Hide file tree
Showing 141 changed files with 1,071 additions and 1,784 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ To run you will use the "shares" command

**Input parameters:**

- key-shares-version (ksv) = The version of the tool output, e.g. use "2" for previous version (optional)
- keystore (ks) = The validator keystore file path
- password (ps) = The keystore file encryption password
- operator-ids (oids) = Comma-separated list of operator IDs. The amount must be 3f+1 compatible.
Expand Down Expand Up @@ -197,15 +196,11 @@ Build everything
yarn build-all
```

## TODO

* Make it possible to use a specific number of signers (Currently with a default of 4).
Read: [From Crash to Byzantine Consensus with 2f + 1 Processes](https://www.gsd.inesc-id.pt/~mpc/pubs/bc2f+1.pdf)

## Authors

* [Dmitri Meshin](https://github.com/meshin-blox)
* [Guy Muroch](https://github.com/guym-blox)
* [Wadym C](https://github.com/vadiminc)

## License

Expand Down
76 changes: 76 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Release v0.0.18 - 2023-05-07

This release introduces some significant SDK changes, including a few breaking changes. Please review the notes below and update your code accordingly.

## Breaking Changes

### SSVKeys, KeyShares
- Removed multi-version support.

Old version:
```code
const ssvKeys = new SSVKeys(SSVKeys.VERSION.V3);
```

New format:
```code
import { SSVKeys, KeyShares } from 'ssv-keys';
const ssvKeys = new SSVKeys();
const keyShares = new KeyShares();
```

- Replaced `operatorIds` and `operatorKeys` with a single array of objects:

```code
const operators = [{ id, publicKey },...];
```

- Replaced `getPrivateKeyFromKeystoreData` method by `extractKeys` which returns validator privateKey and publicKey.

```code
const { privateKey, publicKey } = await ssvKeys.extractKeys(keystore, keystorePassword);
```

- Replaced `ssvKeys.keyShares.setData` to `keyShares.update`

Old version:
```code
await ssvKeys.keyShares.setData({ operators });
````
New format:
```code
const keyShares = new KeyShares();
keyShares.update({ operators, publicKey });
```

- Changed `buildShares` function params:

Old version:
```code
const encryptedShares = await ssvKeys.buildShares(privateKey, operatorIds, operators);
```

New format:
```code
const encryptedShares = await ssvKeys.buildShares(privateKey, operators);
```

- Changed `buildPayload` interface and params:

Old version:
```code
const payload = await ssvKeys.buildPayload({ publicKey, operatorIds, encryptedShares });
```

New format:
```code
const payload = keyShares.buildPayload({ publicKey, operators, encryptedShares });
```

- Added `buildSharesFromBytes` to extract shares from a single string:

```code
const shares = keyShares.buildSharesFromBytes(payload.shares, operators.length);
```
4 changes: 2 additions & 2 deletions dist/esbuild/main.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/esbuild/main.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/tsc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ssv-keys",
"version": "0.0.16",
"version": "0.0.18",
"description": "Library to split a validator key into a predefined threshold of shares via Shamir-Secret-Sharing (SSS), and encrypt them to a set of operator keys.",
"author": "SSV.Network",
"repository": "https://github.com/bloxapp/ssv-keys",
Expand Down
38 changes: 17 additions & 21 deletions dist/tsc/src/commands/actions/KeySharesAction.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/tsc/src/commands/actions/KeySharesAction.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions dist/tsc/src/commands/actions/arguments/key-shares-version.d.ts

This file was deleted.

12 changes: 0 additions & 12 deletions dist/tsc/src/commands/actions/arguments/key-shares-version.js

This file was deleted.

This file was deleted.

15 changes: 8 additions & 7 deletions dist/tsc/src/lib/EthereumKeyStore/EthereumKeyStore.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2fbaedf

Please sign in to comment.