From 1ca9192db670d55cc5b6ab037ebe63094e66ef0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Rib=C3=B3?= Date: Thu, 6 Jun 2024 13:47:44 +0200 Subject: [PATCH 1/4] =?UTF-8?q?docs:=20updating=20the=20hdkey=20ADR=20Sign?= =?UTF-8?q?ed-off-by:=20Javier=20Rib=C3=B3=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-deterministic-key-generation-algorithm.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md b/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md index e94aefaab4..819d7e373c 100644 --- a/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md +++ b/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md @@ -2,7 +2,7 @@ - Status: accepted - Deciders: Jesus Diaz Vico, Ezequiel Postan, Pat Losoponkul, Yurii Shynbuiev -- Date: 2023-05-16 +- Date: 2024-06-06 - Tags: key management, hierarchical deterministic, key derivation Technical Story: @@ -14,6 +14,13 @@ Current ADR is based on the Research Spike [Evaluation of Using a Single Mnemoni - Ezequiel Postan (Atala Semantics team) - Tony Rose (Atala Head of Product) +Updated in 2024 by: +- Jesus Diaz Vico +- Ezequiel Postan +- Pat Losoponkul +- Gonçalo Frade +- Yurii Shynbuiev + The document covers motivation, the overview of BIP32-based HD wallets, and the main concept and implementation details. ## Context and Problem Statement @@ -26,6 +33,8 @@ In the case of a `managed` solution, the keys are created by the `Agent` or `SDK In the case of an `unmanaged` solution, the key material is created by the tools (for instance, `identus-cli`) following similar rules, and is stored on the client side in the `secret storage` managed by the client. +We are going to be using different derivation implementations for secp256k1 and ed25519. + ## Out of the Scope ### `did:peer` @@ -56,6 +65,7 @@ The current decision doesn't have backward compatibility with the PRISM v1.4, bu - Compliance with BIP32 specification - Key material migration between the wallets - Key material recovery in case of disaster +- We must use different derivation standards bip32 with secp256k1 and ed25519-bip32 ## Considered Option @@ -86,7 +96,10 @@ m/wallet-purpose`/did-method`/did-index`/key-purpose`/key-index` `key-index` - the index of the key pair -Secp256k1 elliptic curve is used to generate the key material (private and public keys) +In order to generate key material (private and public keys): +- Secp256k1 ellipstic curve will be used with standard bip32 derivation +- Curve25519 (Ed25519) will be used with the standard bip32 implementation for [ed25519](https://ieeexplore.ieee.org/document/7966967) +- Future implementations will require their own implementations of the derive function, and very potentially at some point we may want to rework bip32 implementation to make it more agnostic, because a high percentage of the code is going to be the same. `Seed` entropy must be used for the HD algorithm is 256 bits which corresponds to 24 words mnemonic @@ -97,7 +110,7 @@ The PRIMS platform uses HD key derivation algorithm for `managed` and `unmanaged ### Positive Consequences - deterministic key material derivation among all components of the Identus platform -- BIP32 compliance +- BIP32 compliance (for both secp256k1 and ed25519 with their corresponding implementations) - key material migration capability - key material recovery capability From ec7d3d687ae474461816a3815b1bbd5d051e4971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Rib=C3=B3?= Date: Thu, 6 Jun 2024 13:48:08 +0200 Subject: [PATCH 2/4] =?UTF-8?q?docs:=20fix=20linter=20and=20apply=20sugges?= =?UTF-8?q?tions=20Signed-off-by:=20Javier=20Rib=C3=B3=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...-hierarchical-deterministic-key-generation-algorithm.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md b/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md index 819d7e373c..d52e0af16b 100644 --- a/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md +++ b/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md @@ -2,7 +2,8 @@ - Status: accepted - Deciders: Jesus Diaz Vico, Ezequiel Postan, Pat Losoponkul, Yurii Shynbuiev -- Date: 2024-06-06 +- Date: 2023-05-16 +- Revision-date: 2024-06-06 - Tags: key management, hierarchical deterministic, key derivation Technical Story: @@ -14,7 +15,7 @@ Current ADR is based on the Research Spike [Evaluation of Using a Single Mnemoni - Ezequiel Postan (Atala Semantics team) - Tony Rose (Atala Head of Product) -Updated in 2024 by: +Reviewed in 2024 by Atala engineers: - Jesus Diaz Vico - Ezequiel Postan - Pat Losoponkul @@ -73,7 +74,7 @@ Implement the HD key derivation algorithm according to the research spike for al The derivation path contains the following segments/layers: ``` -m/wallet-purpose`/did-method`/did-index`/key-purpose`/key-index` +m/wallet-purpose'/did-method'/did-index'/key-purpose'/key-index' ``` `wallet purpose` is used to distinguish the wallet purpose for the identity wallet and is a constant for the Identus platform `0x1D`, which looks like ID From a6983f9f6338b2fe4ad9d55adb49989b357481bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Rib=C3=B3?= Date: Thu, 6 Jun 2024 13:48:23 +0200 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20linter=20Signed-off-by:=20Javier=20R?= =?UTF-8?q?ib=C3=B3=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...30516-hierarchical-deterministic-key-generation-algorithm.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md b/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md index d52e0af16b..3ce5543a00 100644 --- a/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md +++ b/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md @@ -73,9 +73,7 @@ The current decision doesn't have backward compatibility with the PRISM v1.4, bu Implement the HD key derivation algorithm according to the research spike for all the components of the Identus Platform. The derivation path contains the following segments/layers: -``` m/wallet-purpose'/did-method'/did-index'/key-purpose'/key-index' -``` `wallet purpose` is used to distinguish the wallet purpose for the identity wallet and is a constant for the Identus platform `0x1D`, which looks like ID From 693bb8e11a89eee77b59b5de225cad1ae41a80a5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:58:05 +0200 Subject: [PATCH 4/4] style: apply linters automatic fixes (#1153) Signed-off-by: Hyperledger Bot Co-authored-by: Hyperledger Bot --- ...516-hierarchical-deterministic-key-generation-algorithm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md b/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md index 3ce5543a00..44c0375d67 100644 --- a/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md +++ b/docs/decisions/20230516-hierarchical-deterministic-key-generation-algorithm.md @@ -16,8 +16,8 @@ Current ADR is based on the Research Spike [Evaluation of Using a Single Mnemoni - Tony Rose (Atala Head of Product) Reviewed in 2024 by Atala engineers: -- Jesus Diaz Vico -- Ezequiel Postan +- Jesus Diaz Vico +- Ezequiel Postan - Pat Losoponkul - Gonçalo Frade - Yurii Shynbuiev