Skip to content
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

feat/bls-key-separation #3

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Conversation

wnjoon
Copy link
Collaborator

@wnjoon wnjoon commented Jan 7, 2025

Description

This PR separates the BLS key and FilePV key that were previously merged into one in WrappedFilePV. Specifically:

  • In WrappedFilePV, two separated structures for ed25519 and bls are included.
  • CometPV, wrapping FilePV in cometbft, is used for handling DelegatorAddress.
  • BlsPV is used for handling BLS key and encrypting its data to ERC2335 type using password and vice versa.
  • Since separation, WrappedFilePV methods are changed or removed. Most of all, a password is needed for handling BLS to convert ERC2355 type. When initializing the network, BLS password is required and it is also saved to a file lik other key files.

@wnjoon
Copy link
Collaborator Author

wnjoon commented Jan 7, 2025

@dongsam
Both fixing related codes and processing unit tests are still ongoing. It will be completed by other commits.

@wnjoon wnjoon requested a review from dongsam January 7, 2025 02:29
@wnjoon
Copy link
Collaborator Author

wnjoon commented Jan 7, 2025

@dongsam

Here is what I've changed until commit b31a889

  • Separation WrappedFilePV structure including CometPvKey and BlsPvKey
  • Encrypt BlsPvKey to ERC2335 standard when saving it to the file
  • Save password to file when initializing network using babylond init
  • Create random password when there is no file including password
  • Decrypt ERC2335 to BlsPVKey with password
  • Add custom InitCmd including BLS related codes

When running babylond init, check if bls-key and bls-password files are created inside ~/.babylond/config

privval/bls.go Outdated Show resolved Hide resolved
cmd/babylond/cmd/init_test.go Outdated Show resolved Hide resolved
client/flags/flags.go Outdated Show resolved Hide resolved
privval/bls.go Outdated Show resolved Hide resolved
cmd/babylond/cmd/root.go Outdated Show resolved Hide resolved
privval/bls_test.go Outdated Show resolved Hide resolved
@wnjoon wnjoon requested a review from dongsam January 9, 2025 05:35
@wnjoon wnjoon requested a review from dongsam January 9, 2025 06:36
privval/file.go Outdated Show resolved Hide resolved
privval/file.go Outdated Show resolved Hide resolved
privval/bls.go Outdated Show resolved Hide resolved
privval/file.go Outdated Show resolved Hide resolved
test/replay/driver.go Outdated Show resolved Hide resolved
@dongsam
Copy link
Member

dongsam commented Jan 10, 2025

Please prepare a PR ensuring all the following contribution docs and below bullet points are satisfied:

  1. Update changelog.
  2. Sync with the main branch and rebase.
  3. Clean up the commit history to keep it concise, ideally under 5 commits.
  4. Enhance the description to include:
    • Details about the changes introduced in this PR.
    • features that will be addressed in the subsequent PR.
    • Provide reproduction scripts and example key files applicable after the changes are implemented.
  5. Ensure CI passes successfully.
  6. Resolve all review comments

@wnjoon wnjoon force-pushed the b-harvest/bls-key-separation branch from 43431dd to f6dd2c1 Compare January 10, 2025 11:18
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.

2 participants