Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,652 changes: 1,652 additions & 0 deletions include/bip39/electrum.h

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions include/dogecoin/bip39.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,26 @@ LIBDOGECOIN_API int generateRandomEnglishMnemonic(const ENTROPY_SIZE size, MNEMO
/* return: 0 (success), -1 (fail) */
LIBDOGECOIN_API int generateEnglishMnemonic(const HEX_ENTROPY entropy, const ENTROPY_SIZE size, MNEMONIC mnemonic);

/* Check if mnemonic is an Electrum v2+ seed */
/* mnemonic code words */
/* pointer to receive version number (optional, may be NULL) */
/* returns 0 (success), -1 (fail) */
LIBDOGECOIN_API int dogecoin_mnemonic_is_electrum_seed(const char* mnemonic, uint32_t* out_version);

/* Derive the seed from an Electrum v2+ mnemonic and optional passphrase */
/* mnemonic code words */
/* passphrase (optional) */
/* 512-bit seed */
/* returns 0 (success), -1 (fail) */
LIBDOGECOIN_API int dogecoin_seed_from_electrum_mnemonic(const char* mnemonic, const char* passphrase, SEED seed);

/* Derive the seed from an Electrum v1 mnemonic and optional passphrase */
/* mnemonic code words (12 words from 1626-word list) */
/* passphrase (optional) */
/* 512-bit seed (16 bytes of decoded entropy, zero-padded) */
/* returns 0 (success), -1 (fail) */
LIBDOGECOIN_API int dogecoin_seed_from_electrum_v1_mnemonic(const char* mnemonic, const char* passphrase, SEED seed);

LIBDOGECOIN_END_DECL

#endif // __LIBDOGECOIN_BIP39_H__
7 changes: 7 additions & 0 deletions include/dogecoin/key.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ LIBDOGECOIN_API void getWifEncodedPrivKey(const uint8_t privkey[DOGECOIN_ECKEY_P
// wrapper for wif decoding
LIBDOGECOIN_API int getDecodedPrivKeyWif(const char privkey_wif[PRIVKEYWIFLEN], const dogecoin_bool is_testnet, uint8_t privkey[DOGECOIN_ECKEY_PKEY_LENGTH]);

// Electrum v1 (pre-v2) deterministic key derivation.
// Takes raw 16-byte v1 seed (in first 16 bytes), stretches it, and derives child key.
LIBDOGECOIN_API int electrum_v1_derive_privkey32(const uint8_t v1_seed[32],
uint32_t n,
uint32_t for_change,
uint8_t out_priv32[32]);

LIBDOGECOIN_END_DECL

#endif // __LIBDOGECOIN_KEY_H__
Loading
Loading