Skip to content

Commit

Permalink
more comment enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Sep 12, 2023
1 parent 6cff3e1 commit 0c8a171
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/lib/Cardano/Address/Style/Byron.hs
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,13 @@ type family DerivationPath (depth :: Depth) :: Type where
--
-- === Deriving child keys
-- === Both accIx and addIx assume values from 0 to 4294967295 (ie. 0xFFFFFFFF)
-- > let Just accIx = indexFromWord32 0x80000000
-- === In case of account one can get this bound via
-- === let accIxMin = minBound @(Index 'WholeDomain 'AccountK)
-- === let accIxMax = maxBound @(Index 'WholeDomain 'AccountK)
-- > let Just accIx = wholeDomainIndex 0x80000000
-- > let acctK = Byron.deriveAccountPrivateKey rootK accIx
-- >
-- > let Just addIx = indexFromWord32 0x80000014
-- > let Just addIx = wholeDomainIndex 0x80000014
-- > let addrK = Byron.deriveAddressPrivateKey acctK addIx
-- >
-- > base58 $ Byron.paymentAddress Byron.byronMainnet (toXPub <$> addrK)
Expand Down
2 changes: 2 additions & 0 deletions core/lib/Cardano/Address/Style/Icarus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ roleToIndex = unsafeMkIndex . \case
-- === 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
-- === this is the same as
-- > let accIx = minBound @(Index 'Hardened 'AccountK)
-- > let acctK = Icarus.deriveAccountPrivateKey rootK accIx
-- >
-- > let Just addIx = indexFromWord32 0x00000014
Expand Down

0 comments on commit 0c8a171

Please sign in to comment.