From 6cff3e1afdeae2f0e0f652f3a82ba5e4505de1f8 Mon Sep 17 00:00:00 2001 From: Pawel Jakubas Date: Fri, 8 Sep 2023 17:05:48 +0200 Subject: [PATCH] more adjustments --- core/lib/Cardano/Address/Style/Byron.hs | 5 +++-- core/lib/Cardano/Address/Style/Icarus.hs | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/lib/Cardano/Address/Style/Byron.hs b/core/lib/Cardano/Address/Style/Byron.hs index 3f7d451af..20686d183 100644 --- a/core/lib/Cardano/Address/Style/Byron.hs +++ b/core/lib/Cardano/Address/Style/Byron.hs @@ -153,7 +153,8 @@ import qualified Data.Text.Encoding as T -- but due to the error made prior 2019 in cardano-sl -- implementation WholeDomain was adopted to handle all the keys. Nevertheless, -- it was recommended and enforced to use Hardened for account derivation and Soft for payment --- key derivation from 2019 onwards. +-- key derivation from 2019 onwards. To sum up both account index and payment index can assume +-- values from 0 to 4294967295 (ie. 0xFFFFFFFF) -- == Deprecation Notice -- @@ -222,7 +223,7 @@ type family DerivationPath (depth :: Depth) :: Type where -- > let rootK = Byron.genMasterKeyFromMnemonic mw :: Byron 'RootK XPrv -- -- === Deriving child keys --- +-- === Both accIx and addIx assume values from 0 to 4294967295 (ie. 0xFFFFFFFF) -- > let Just accIx = indexFromWord32 0x80000000 -- > let acctK = Byron.deriveAccountPrivateKey rootK accIx -- > diff --git a/core/lib/Cardano/Address/Style/Icarus.hs b/core/lib/Cardano/Address/Style/Icarus.hs index 857e4d5f5..f4f2f0ee8 100644 --- a/core/lib/Cardano/Address/Style/Icarus.hs +++ b/core/lib/Cardano/Address/Style/Icarus.hs @@ -215,7 +215,8 @@ roleToIndex = unsafeMkIndex . \case -- === Deriving child keys -- -- Let's consider the following 3rd, 4th and 5th derivation paths @0'\/0\/14@ --- +-- === accIx assumes values from 2147483648 (ie. 0x80000000) to 4294967295 (ie. 0xFFFFFFFF) +-- === addIx assume values from 0 to 2147483647 (ie. 7FFFFFFF) -- > let Just accIx = indexFromWord32 0x80000000 -- > let acctK = Icarus.deriveAccountPrivateKey rootK accIx -- >