From 4511ba21c3cbdae54e6c35e617f7c2b58f7b3071 Mon Sep 17 00:00:00 2001 From: Harry Law Date: Thu, 9 Mar 2023 17:26:04 +0000 Subject: [PATCH] Fix diagrams to be in the correct order --- shared/CHANGELOG.md | 4 ++++ shared/crypto/README.md | 44 ++++++++++++++++++++--------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/shared/CHANGELOG.md b/shared/CHANGELOG.md index 10fdc0307..5f73fff8f 100644 --- a/shared/CHANGELOG.md +++ b/shared/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.0.0.39] - 2023-03-09 + +- Fix diagrams in SLIP documentation to be in the correct order + ## [0.0.0.38] - 2023-03-03 - Support libp2p module in node diff --git a/shared/crypto/README.md b/shared/crypto/README.md index 5e8bfeddd..6a89f8163 100644 --- a/shared/crypto/README.md +++ b/shared/crypto/README.md @@ -112,6 +112,28 @@ flowchart LR The keys are generated using the BIP-44 path `m/44'/635'/%d'` where `%d` is the index of the child key - this allows for the deterministic generation of up to `2147483647` hardened ed25519 child keys per master key. Master key derivation is done as follows: ```mermaid +flowchart LR + subgraph HMAC + direction TB + A["hmac = hmacNew(sha512, seedModifier)"] + B["hmac.Write(seed)"] + C["convertToBytes(hmac)"] + A-->B + B--hmac-->C + end + subgraph MASTER-KEY + direction LR + D["SecretKey: hmacBytes[:32]"] + E["ChainCode: hmacBytes[32:]"] + D --> KEY + E --> KEY + end + seed-->HMAC + HMAC--hmacBytes-->MASTER-KEY +``` + +Child keys are derived from their parents as follows: +```mermaid flowchart LR subgraph HCHILD["HMAC-CHILD"] direction TB @@ -135,26 +157,4 @@ flowchart LR HCHILD--hmacBytes-->CKEY ``` -Child keys are derived from their parents as follows: -```mermaid -flowchart LR - subgraph HMAC - direction TB - A["hmac = hmacNew(sha512, seedModifier)"] - B["hmac.Write(seed)"] - C["convertToBytes(hmac)"] - A-->B - B--hmac-->C - end - subgraph MASTER-KEY - direction LR - D["SecretKey: hmacBytes[:32]"] - E["ChainCode: hmacBytes[32:]"] - D --> KEY - E --> KEY - end - seed-->HMAC - HMAC--hmacBytes-->MASTER-KEY -``` -