Skip to content

Members key share retrieval, decryption and submission #932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Mar 11, 2020

Conversation

jumaffre
Copy link
Contributor

@jumaffre jumaffre commented Mar 9, 2020

Addresses 5. and most of 6. and 6'. in #51

This PR adds two new member RPC getEncryptedRecoveryShare and submitRecoveryShare for members to easily retrieve their encrypted shares and submit the then-decrypted share.

To achieve this, cchost now outputs the network public encryption key on startup for members to easily decrypt their shares (using cryptobox). This was slightly painful since mbedtls does not yet support x25519 keys and we have to construct the PEM public key manually (see 25519.h).

For now, decrypted shares are stored in the node's memory on submitRecoveryShare and once the number of submit shares matches the threshold (for now, the number of active members), CCF combines the shares, reconstruct k_z and decrypt the ledger secrets in ccf.shares.

There is a new variant of the recovery_test e2e test to test the retrieval, decryption (using pynacl) and submission of shares.

Next:

  • Plug the share combination into our existing recovery scheme (i.e. members can only submit their shares once the recovery proposal is passed and once the shares have been assembled, the recovery of the private ledger can start).

@jumaffre jumaffre requested a review from a team as a code owner March 9, 2020 12:05
@codecov-io
Copy link

codecov-io commented Mar 9, 2020

Codecov Report

Merging #932 into master will decrease coverage by 0.42%.
The diff coverage is 53.01%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #932      +/-   ##
==========================================
- Coverage   68.96%   68.54%   -0.42%     
==========================================
  Files         100      101       +1     
  Lines        7802     7939     +137     
==========================================
+ Hits         5380     5441      +61     
- Misses       2422     2498      +76
Flag Coverage Δ
#unit_BFT 68.54% <53.01%> (-0.41%) ⬇️
#unit_CFT 68.54% <53.01%> (-0.42%) ⬇️
Impacted Files Coverage Δ
src/node/values.h 80% <ø> (ø) ⬆️
src/node/networkstate.h 100% <ø> (ø) ⬆️
src/node/ledgersecrets.h 14.67% <0%> (-0.4%) ⬇️
src/node/genesisgen.h 48.06% <0%> (-2.76%) ⬇️
src/node/rpc/nodecalltypes.h 100% <100%> (ø) ⬆️
src/node/secretshare.h 81.82% <100%> (ø) ⬆️
src/node/rpc/nodefrontend.h 77.25% <100%> (ø) ⬆️
src/node/rpc/memberfrontend.h 61.92% <18.46%> (-6.21%) ⬇️
src/node/networkencryption.h 28.57% <28.57%> (ø)
src/tls/25519.h 84.62% <84.62%> (+7.69%) ⬆️
... and 2 more

@ghost
Copy link

ghost commented Mar 9, 2020

retrieve_encrypted_share@5875 aka 20200310.25 vs master ewma over 30 builds from 5516 to 5855
images

@jumaffre
Copy link
Contributor Author

I'll merge this PR now as all the comments have been addressed. The key shares feature is very much work in progress and I expect that most of the code written so far will be reworked, or at least refactored.

@jumaffre jumaffre merged commit 7cb881b into microsoft:master Mar 11, 2020
eddyashton pushed a commit to eddyashton/CCF that referenced this pull request Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants