Skip to content

Commit bc7c5f0

Browse files
committed
Implementation of mnemonic generation and key derivation
1 parent 6181867 commit bc7c5f0

File tree

5 files changed

+520
-3
lines changed

5 files changed

+520
-3
lines changed

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repository cardano-haskell-packages
1313
-- See CONTRIBUTING for information about these, including some Nix commands
1414
-- you need to run if you change them
1515
index-state:
16-
, hackage.haskell.org 2025-03-03T01:12:46Z
16+
, hackage.haskell.org 2025-03-17T12:01:29Z
1717
, cardano-haskell-packages 2025-03-03T04:46:42Z
1818

1919
packages:

cardano-api/cardano-api.cabal

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ library
110110
base16-bytestring >=1.0,
111111
base58-bytestring,
112112
base64-bytestring,
113+
basement,
113114
bech32 >=1.1.0,
114115
bytestring,
116+
bytestring-trie,
117+
cardano-addresses ^>=4.0.0,
115118
cardano-binary,
116119
cardano-crypto,
117120
cardano-crypto-class ^>=2.1.2,
@@ -139,6 +142,7 @@ library
139142
directory,
140143
either,
141144
errors,
145+
extra,
142146
filepath,
143147
formatting,
144148
groups,
@@ -160,7 +164,7 @@ library
160164
ouroboros-network-framework,
161165
ouroboros-network-protocols,
162166
parsec,
163-
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.37,
167+
plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.40,
164168
prettyprinter,
165169
prettyprinter-ansi-terminal,
166170
prettyprinter-configurable ^>=1.36,
@@ -221,6 +225,7 @@ library
221225
Cardano.Api.Internal.Json
222226
Cardano.Api.Internal.Keys.Byron
223227
Cardano.Api.Internal.Keys.Class
228+
Cardano.Api.Internal.Keys.Mnemonics
224229
Cardano.Api.Internal.Keys.Praos
225230
Cardano.Api.Internal.Keys.Read
226231
Cardano.Api.Internal.Keys.Shelley
@@ -403,7 +408,7 @@ test-suite cardano-api-golden
403408
hedgehog-extras ^>=0.7,
404409
microlens,
405410
parsec,
406-
plutus-core ^>=1.37,
411+
plutus-core ^>=1.40,
407412
plutus-ledger-api,
408413
tasty,
409414
tasty-hedgehog,

cardano-api/src/Cardano/Api.hs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,22 @@ module Cardano.Api
179179
, castHash
180180
, renderSafeHashAsHex
181181

182+
-- * Mnemonics
183+
184+
-- | Functions for working with mnemonics
185+
-- ** Mnemonics generation
186+
, MnemonicSize (..)
187+
, generateMnemonic
188+
189+
-- ** Key derivation from mnemonics
190+
, MnemonicToSigningKeyError (..)
191+
, signingKeyFromMnemonic
192+
, signingKeyFromMnemonicWithPaymentKeyIndex
193+
194+
-- ** Mnemonic word queries
195+
, findMnemonicWordsWithPrefix
196+
, autocompleteMnemonicPrefix
197+
182198
-- * Payment addresses
183199

184200
-- | Constructing and inspecting normal payment addresses
@@ -1119,6 +1135,7 @@ import Cardano.Api.Internal.IPC.Monad
11191135
import Cardano.Api.Internal.InMode
11201136
import Cardano.Api.Internal.Keys.Byron
11211137
import Cardano.Api.Internal.Keys.Class
1138+
import Cardano.Api.Internal.Keys.Mnemonics
11221139
import Cardano.Api.Internal.Keys.Read
11231140
import Cardano.Api.Internal.Keys.Shelley
11241141
import Cardano.Api.Internal.LedgerState

0 commit comments

Comments
 (0)