cardano-wallet-core-2022.7.1: The Wallet Backend for a Cardano node.
Copyright © 2018-2021 IOHK
License Apache-2.0
Safe Haskell None
Language Haskell2010

Cardano.Wallet.Primitive.AddressDerivation.MintBurn

Description

Derivation of policy keys which are used to create scripts for the purposes of minting and burning. Derived according to CIP-1855 (https:/ github.com cardano-foundation CIPs blob b2e9d02cb9a71ba9e754a432c78197428abf7e4c CIP-1855/CIP-1855.md).

The policy keys are derived from the following path:

m purpose' coin_type' / policy_ix' m 1855' 1815' / [2^31 .. 2^32-1]'

Where purpose' and coin_type' are fixed, and each new policy_ix' represents a different policy key.

Synopsis

Constants

purposeCIP1855 :: Index ' Hardened ' PurposeK Source #

Purpose for forged policy keys is a constant set to 1855' (or 0x8000073F) following the original CIP-1855: "Forging policy keys for HD Wallets".

It indicates that the subtree of this node is used according to this specification.

Hardened derivation is used at this level.

Helpers

derivePolicyKeyAndHash Source #

Arguments

:: WalletKey key
=> Passphrase "encryption"

Passphrase for wallet

-> key ' RootK XPrv

Root private key to derive policy private key from

-> Index ' Hardened ' PolicyK

Index of policy script

-> (key ' PolicyK XPrv , KeyHash )

Policy private key

Derive the policy private key that should be used to create mint/burn scripts, as well as the key hash of the policy public key.

derivePolicyPrivateKey Source #

Arguments

:: Passphrase purpose

Passphrase for wallet

-> XPrv

Root private key to derive policy private key from

-> Index ' Hardened ' PolicyK

Index of policy script

-> XPrv

Policy private key

Derive the policy private key that should be used to create mint/burn scripts.