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

Leverage sharded origin key #288

Merged
6 commits merged into from
May 3, 2022

Conversation

Neylix
Copy link
Member

@Neylix Neylix commented Apr 26, 2022

Description

First software origin key is no more hardcoded but randomly generated during network init and encrypted with the hardcoded public key in secret transaction.
Hardcoded key is now able to read and decrypt first software origin key

Fixes #275

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Implement file test to ensure that an origin key is generated during network init
  • Used GraphiQL to get first origin_shared_secret transaction and decypt it using libjs. Resulted private key is the same that the one generated during network init

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Neylix Neylix requested a review from a user April 26, 2022 11:14
@Neylix
Copy link
Member Author

Neylix commented Apr 26, 2022

As this PR change the way to interact with blockchain from client software, we have to provide them the way to get the origin private key before merging this PR.
We have to implement #158 and add this API in all librairies (i.e. libjs and libdart actually)

@Neylix Neylix added shared secrets Involve SharedSecrets core team Assigned to the core team breaking change Identify a change with a breaking API labels Apr 26, 2022
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
I would suggest as well to add a content formatter for the origin_shared_secrets transaction in the explorer to be able to see the public keys by parsing them.

lib/archethic/bootstrap/network_init.ex Outdated Show resolved Hide resolved
@spec get_origin_family_seed(supported_origin()) :: binary()
def get_origin_family_seed(origin_id) do
storage_nonce() <>
case origin_id do
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of putting this in the crypto.ex, you should move it to shared_secrets.ex, to avoid confusion with origin_id for public keys

@Neylix Neylix mentioned this pull request Apr 29, 2022
@ghost ghost merged commit 3e73e36 into archethic-foundation:develop May 3, 2022
@ghost ghost added the feature New feature request label May 3, 2022
@Neylix Neylix deleted the Leverage-sharded-origin-keys branch May 4, 2022 06:43
ghost pushed a commit that referenced this pull request May 6, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Identify a change with a breaking API core team Assigned to the core team feature New feature request shared secrets Involve SharedSecrets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant