HORIZON HASKELLDocslts/ghc-9.14.x99ffbb82026-10-19Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 99ffbb8 · 2026-10-19

This module provides an implementation of:

We call Byron addresses the old address type used by Daedalus in the early days of Cardano. Using this type of addresses and underlying key scheme is now considered deprecated because of some security implications.

The internals of the Byron does not matter for the reader, but basically contains what is necessary to perform key derivation and generate addresses from a Byron type.

Byron uses WholeDomain (meaning Soft+Hardened) for account key and payment key derivation. It should use Hardened for account and Soft for payment as design, 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. To sum up both account index and payment index can assume values from 0 to 4294967295 (ie. 0xFFFFFFFF)

Deprecation Notice

Unless you have good reason to do so (like writing backward-compatible code with an existing piece), any new implementation should use the Icarus style for key and addresses.

Byron

datadata Byron (depth :: Depth) key

Deprecated. see Icarus

Material for deriving HD random scheme keys, which can be used for making addresses.

Instances15HasNetworkDiscriminant, PaymentAddress, GenMasterKey, HardDerivation, Functor, Eq, …

Key Derivation

Addresses

datadata AddressInfo

The result of eitherInspectAddress for Byron addresses.

Instances5Eq, Show, Generic, ToJSON, Rep

Possible errors from inspecting a Byron address

Instances6Eq, Show, Generic, Exception, ToJSON, Rep

Network Discrimination

Unsafe

valueliftXPrv
  1. :: XPub

    A root public key

  2. -> DerivationPath depth
  3. -> XPrv
  4. -> Byron depth XPrv

Deprecated. see Icarus

Backdoor for generating a new key from a raw XPrv.

Note that the depth is left open so that the caller gets to decide what type of key this is. This is mostly for testing, in practice, seeds are used to represent root keys, and one should genMasterKeyFromXPrv

The first argument is a type-family DerivationPath and its type depends on the depth of the key.

examples:

Example1 expression
liftXPrv rootPrv () prv_ :: Byron RootK XPrv
Example1 expression
liftXPrv rootPrv minBound prv_ :: Byron AccountK XPrv
Example1 expression
liftXPrv rootPrv (minBound, minBound) prv_ :: Byron PaymentK XPrv