HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulecardano-addresses-4.0.2Haskell2010

Cardano.Address.Style.Byron

  • 3 types
  • 20 values

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

5 declarations
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, …
valuegetKey :: Byron depth key -> key
#

Deprecated. see Icarus

The raw private or public key.

Key Derivation

4 declarations

Addresses

7 declarations
datadata AddressInfo
#

The result of eitherInspectAddress for Byron addresses.

Instances5Eq, Show, Generic, ToJSON, Rep
datadata ErrInspectAddress
#

Possible errors from inspecting a Byron address

Instances6Eq, Show, Generic, Exception, ToJSON, Rep

Network Discrimination

5 declarations

Unsafe

3 declarations
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
valueliftXPub
  1. :: XPub

    A root public key

  2. -> DerivationPath depth
  3. -> XPub
  4. -> Byron depth XPub
#

Deprecated. see Icarus

Backdoor for generating a new key from a raw XPub.

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

see also liftXPrv