Skip to content
Open
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
20 changes: 19 additions & 1 deletion src/Bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ using std::string;
#define String std::string
#endif

const Network Dogecoin = {
0x1e, // p2pkh
0x16, // p2sh
"bc", // DOESNT USE BECH32
0x9e, // wif
{ 0x02, 0xfa, 0xc3, 0x98 }, // xprv
{ 0x01, 0x01, 0x01, 0x01 }, // yprv
{ 0x01, 0x01, 0x01, 0x01 }, // zprv
{ 0x01, 0x01, 0x01, 0x01 }, // Yprv
{ 0x01, 0x01, 0x01, 0x01 }, // Zprv
{ 0x02, 0xfa, 0xca, 0xfd }, // xpub
{ 0x01, 0x01, 0x01, 0x01 }, // ypub
{ 0x01, 0x01, 0x01, 0x01 }, // zpub
{ 0x01, 0x01, 0x01, 0x01 }, // Ypub
{ 0x01, 0x01, 0x01, 0x01 }, // Zpub
3 // bip32 coin type (actually slip44?) https://github.com/satoshilabs/slips/blob/master/slip-0044.md
};

const Network Mainnet = {
0x00, // p2pkh
0x05, // p2sh
Expand Down Expand Up @@ -88,7 +106,7 @@ const Network Signet = {
1 // bip32 coin type
};

const Network * networks[4] = { &Mainnet, &Testnet, &Regtest, &Signet };
const Network * networks[5] = { &Mainnet, &Testnet, &Regtest, &Signet, &Dogecoin };

const char * generateMnemonic(uint8_t numWords){
if(numWords<12 || numWords > 24 || numWords % 3 != 0){
Expand Down
5 changes: 3 additions & 2 deletions src/Bitcoin.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ typedef struct {
uint32_t bip32;
} Network;

extern const Network Dogecoin;
extern const Network Mainnet;
extern const Network Testnet;
extern const Network Regtest;
extern const Network Signet;

extern const Network * networks[4];
const uint8_t networks_len = 4;
extern const Network * networks[5];
const uint8_t networks_len = 5;

// number of rounds for mnemonic to seed conversion
#define PBKDF2_ROUNDS 2048
Expand Down