upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/db.cpp6
-rw-r--r--src/gui.cpp2
-rw-r--r--src/main.cpp6
-rw-r--r--src/main.h8
-rw-r--r--src/selftest.cpp12
-rw-r--r--src/walletcmd.cpp2
6 files changed, 18 insertions, 18 deletions
diff --git a/src/db.cpp b/src/db.cpp
index 244d5a7..9f62964 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -880,9 +880,9 @@ bool CWalletDB::LoadWallet(vector<unsigned char>& vchDefaultKeyRet)
880 } 880 }
881 if (!fHaveStoredHDCoinType) 881 if (!fHaveStoredHDCoinType)
882 { 882 {
883 nHDCoinType = HD_BIP44_COIN_TYPE_BITFLASH_PROVISIONAL; 883 nHDCoinType = HD_BIP44_COIN_TYPE_BITFLASH;
884 printf("LoadWallet: deterministic seed has no BIP44 coin type metadata; " 884 printf("LoadWallet: deterministic seed has no BIP44 coin type metadata; "
885 "using provisional Bitflash coin type %u\n", nHDCoinType); 885 "using Bitflash coin type %u\n", nHDCoinType);
886 } 886 }
887 } 887 }
888 else 888 else
@@ -891,7 +891,7 @@ bool CWalletDB::LoadWallet(vector<unsigned char>& vchDefaultKeyRet)
891 nHDNext = 0; 891 nHDNext = 0;
892 nHDReceiveNext = 0; 892 nHDReceiveNext = 0;
893 nHDChangeNext = 0; 893 nHDChangeNext = 0;
894 nHDCoinType = HD_BIP44_COIN_TYPE_BITFLASH_PROVISIONAL; 894 nHDCoinType = HD_BIP44_COIN_TYPE_BITFLASH;
895 } 895 }
896 896
897 // fGenerateBitcoins and nMineMode only mean anything together, and a 897 // fGenerateBitcoins and nMineMode only mean anything together, and a
diff --git a/src/gui.cpp b/src/gui.cpp
index 8f1d204..8dcb854 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -1250,7 +1250,7 @@ static void DrawWalletSafetyDialog()
1250 if (g_recoveryAudit.fHaveSeed) 1250 if (g_recoveryAudit.fHaveSeed)
1251 { 1251 {
1252 ImGui::Text("Derivation schema: %s", HDKeySchemaName(g_recoveryAudit.nSchema).c_str()); 1252 ImGui::Text("Derivation schema: %s", HDKeySchemaName(g_recoveryAudit.nSchema).c_str());
1253 ImGui::Text("BIP44 coin type: %u (provisional BITFLASH)", g_recoveryAudit.nCoinType); 1253 ImGui::Text("BIP44 coin type: %u (SLIP-0044 BITFLASH)", g_recoveryAudit.nCoinType);
1254 } 1254 }
1255 ImGui::Text("Phrase-backed spendable balance: %s BTF", 1255 ImGui::Text("Phrase-backed spendable balance: %s BTF",
1256 FmtMoney(g_recoveryAudit.nRecoverableCredit).c_str()); 1256 FmtMoney(g_recoveryAudit.nRecoverableCredit).c_str());
diff --git a/src/main.cpp b/src/main.cpp
index 2eb0e3a..f83164f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -642,7 +642,7 @@ unsigned int nHDNext = 0;
642int nHDKeySchema = HD_SCHEMA_NONE; 642int nHDKeySchema = HD_SCHEMA_NONE;
643unsigned int nHDReceiveNext = 0; 643unsigned int nHDReceiveNext = 0;
644unsigned int nHDChangeNext = 0; 644unsigned int nHDChangeNext = 0;
645unsigned int nHDCoinType = HD_BIP44_COIN_TYPE_BITFLASH_PROVISIONAL; 645unsigned int nHDCoinType = HD_BIP44_COIN_TYPE_BITFLASH;
646 646
647string HDKeySchemaName(int nSchema) 647string HDKeySchemaName(int nSchema)
648{ 648{
@@ -798,7 +798,7 @@ bool SetHDSeedFromMnemonic(const string& strMnemonic, string& strErrorRet)
798 798
799 if (!CWalletDB().WriteHDMaster(master.privateKey, master.chainCode) || 799 if (!CWalletDB().WriteHDMaster(master.privateKey, master.chainCode) ||
800 !CWalletDB().WriteHDSchema(HD_SCHEMA_BIP44) || 800 !CWalletDB().WriteHDSchema(HD_SCHEMA_BIP44) ||
801 !CWalletDB().WriteHDCoinType(HD_BIP44_COIN_TYPE_BITFLASH_PROVISIONAL) || 801 !CWalletDB().WriteHDCoinType(HD_BIP44_COIN_TYPE_BITFLASH) ||
802 !CWalletDB().WriteHDNext(0) || 802 !CWalletDB().WriteHDNext(0) ||
803 !CWalletDB().WriteHDReceiveNext(1) || 803 !CWalletDB().WriteHDReceiveNext(1) ||
804 !CWalletDB().WriteHDChangeNext(0)) 804 !CWalletDB().WriteHDChangeNext(0))
@@ -811,7 +811,7 @@ bool SetHDSeedFromMnemonic(const string& strMnemonic, string& strErrorRet)
811 nHDKeySchema = HD_SCHEMA_BIP44; 811 nHDKeySchema = HD_SCHEMA_BIP44;
812 nHDReceiveNext = 1; 812 nHDReceiveNext = 1;
813 nHDChangeNext = 0; 813 nHDChangeNext = 0;
814 nHDCoinType = HD_BIP44_COIN_TYPE_BITFLASH_PROVISIONAL; 814 nHDCoinType = HD_BIP44_COIN_TYPE_BITFLASH;
815 815
816 // Index 0 is spoken for before it is derived, so a failure below cannot 816 // Index 0 is spoken for before it is derived, so a failure below cannot
817 // leave the pool free to hand it out as an ordinary key. The cost of 817 // leave the pool free to hand it out as an ordinary key. The cost of
diff --git a/src/main.h b/src/main.h
index eafbf16..b389f1d 100644
--- a/src/main.h
+++ b/src/main.h
@@ -216,9 +216,9 @@ static const unsigned int HD_BIP44_PURPOSE = 44;
216static const unsigned int HD_BIP44_ACCOUNT = 0; 216static const unsigned int HD_BIP44_ACCOUNT = 0;
217static const unsigned int HD_BIP44_CHAIN_RECEIVE = 0; 217static const unsigned int HD_BIP44_CHAIN_RECEIVE = 0;
218static const unsigned int HD_BIP44_CHAIN_CHANGE = 1; 218static const unsigned int HD_BIP44_CHAIN_CHANGE = 1;
219// Provisional until Bitflash has an official SLIP-0044 assignment. 219// Official SLIP-0044 assignment (registered 2026-08-07):
220// Proposed registry row: 4346950 | BITFLASH | Bitflash. 220// 4346950 | BITFLASH | Bitflash (4346950 == 0x425446 == "BTF")
221static const unsigned int HD_BIP44_COIN_TYPE_BITFLASH_PROVISIONAL = 4346950; 221static const unsigned int HD_BIP44_COIN_TYPE_BITFLASH = 4346950;
222extern int nHDKeySchema; 222extern int nHDKeySchema;
223extern unsigned int nHDReceiveNext; // BIP44 external chain 223extern unsigned int nHDReceiveNext; // BIP44 external chain
224extern unsigned int nHDChangeNext; // BIP44 internal chain 224extern unsigned int nHDChangeNext; // BIP44 internal chain
@@ -316,7 +316,7 @@ struct WalletRecoveryAudit
316 nDerivedKnown = 0; 316 nDerivedKnown = 0;
317 nReceiveNext = 0; 317 nReceiveNext = 0;
318 nChangeNext = 0; 318 nChangeNext = 0;
319 nCoinType = HD_BIP44_COIN_TYPE_BITFLASH_PROVISIONAL; 319 nCoinType = HD_BIP44_COIN_TYPE_BITFLASH;
320 nRecoverableTx = 0; 320 nRecoverableTx = 0;
321 nLegacyTx = 0; 321 nLegacyTx = 0;
322 nRecoverableImmatureTx = 0; 322 nRecoverableImmatureTx = 0;
diff --git a/src/selftest.cpp b/src/selftest.cpp
index fadc959..69a3596 100644
--- a/src/selftest.cpp
+++ b/src/selftest.cpp
@@ -350,17 +350,17 @@ static int RunWalletHDSelfTest()
350 nFail += Check(HaveHDSeed(), "the wallet reports having a seed") ? 0 : 1; 350 nFail += Check(HaveHDSeed(), "the wallet reports having a seed") ? 0 : 1;
351 nFail += Check(nHDKeySchema == HD_SCHEMA_BIP44, 351 nFail += Check(nHDKeySchema == HD_SCHEMA_BIP44,
352 "a new recovery phrase records the BIP44 HD schema") ? 0 : 1; 352 "a new recovery phrase records the BIP44 HD schema") ? 0 : 1;
353 nFail += Check(nHDCoinType == HD_BIP44_COIN_TYPE_BITFLASH_PROVISIONAL, 353 nFail += Check(nHDCoinType == HD_BIP44_COIN_TYPE_BITFLASH,
354 "a new recovery phrase records the provisional BIP44 coin type") ? 0 : 1; 354 "a new recovery phrase records the SLIP-0044 BIP44 coin type") ? 0 : 1;
355 nFail += Check(nHDReceiveNext == 1 && nHDChangeNext == 0, 355 nFail += Check(nHDReceiveNext == 1 && nHDChangeNext == 0,
356 "BIP44 receive/change counters reserve the default receive key") ? 0 : 1; 356 "BIP44 receive/change counters reserve the default receive key") ? 0 : 1;
357 std::vector<unsigned int> vBIP44Path = HDBIP44Path(HD_BIP44_COIN_TYPE_BITFLASH_PROVISIONAL, 357 std::vector<unsigned int> vBIP44Path = HDBIP44Path(HD_BIP44_COIN_TYPE_BITFLASH,
358 HD_BIP44_ACCOUNT, 358 HD_BIP44_ACCOUNT,
359 HD_BIP44_CHAIN_RECEIVE, 359 HD_BIP44_CHAIN_RECEIVE,
360 0); 360 0);
361 nFail += Check(vBIP44Path.size() == 5 && 361 nFail += Check(vBIP44Path.size() == 5 &&
362 vBIP44Path[0] == (HD_BIP44_PURPOSE | bitflash::BIP32_HARDENED) && 362 vBIP44Path[0] == (HD_BIP44_PURPOSE | bitflash::BIP32_HARDENED) &&
363 vBIP44Path[1] == (HD_BIP44_COIN_TYPE_BITFLASH_PROVISIONAL | bitflash::BIP32_HARDENED) && 363 vBIP44Path[1] == (HD_BIP44_COIN_TYPE_BITFLASH | bitflash::BIP32_HARDENED) &&
364 vBIP44Path[2] == (HD_BIP44_ACCOUNT | bitflash::BIP32_HARDENED) && 364 vBIP44Path[2] == (HD_BIP44_ACCOUNT | bitflash::BIP32_HARDENED) &&
365 vBIP44Path[3] == HD_BIP44_CHAIN_RECEIVE && 365 vBIP44Path[3] == HD_BIP44_CHAIN_RECEIVE &&
366 vBIP44Path[4] == 0, 366 vBIP44Path[4] == 0,
@@ -382,7 +382,7 @@ static int RunWalletHDSelfTest()
382 hdParent.chainCode = vchHDChainCode; 382 hdParent.chainCode = vchHDChainCode;
383 bitflash::BIP32PrivateNode hdBIP44ReceiveChild; 383 bitflash::BIP32PrivateNode hdBIP44ReceiveChild;
384 if (!bitflash::BIP32DerivePath(hdParent, 384 if (!bitflash::BIP32DerivePath(hdParent,
385 HDBIP44Path(HD_BIP44_COIN_TYPE_BITFLASH_PROVISIONAL, 385 HDBIP44Path(HD_BIP44_COIN_TYPE_BITFLASH,
386 HD_BIP44_ACCOUNT, 386 HD_BIP44_ACCOUNT,
387 HD_BIP44_CHAIN_RECEIVE, 387 HD_BIP44_CHAIN_RECEIVE,
388 0), 388 0),
@@ -570,7 +570,7 @@ static int RunWalletHDSelfTest()
570 nFail += Check(audit.fHaveSeed, "the recovery audit reports the phrase") ? 0 : 1; 570 nFail += Check(audit.fHaveSeed, "the recovery audit reports the phrase") ? 0 : 1;
571 nFail += Check(audit.nSchema == HD_SCHEMA_BIP44, 571 nFail += Check(audit.nSchema == HD_SCHEMA_BIP44,
572 "the recovery audit reports the derivation schema") ? 0 : 1; 572 "the recovery audit reports the derivation schema") ? 0 : 1;
573 nFail += Check(audit.nCoinType == HD_BIP44_COIN_TYPE_BITFLASH_PROVISIONAL, 573 nFail += Check(audit.nCoinType == HD_BIP44_COIN_TYPE_BITFLASH,
574 "the recovery audit reports the BIP44 coin type") ? 0 : 1; 574 "the recovery audit reports the BIP44 coin type") ? 0 : 1;
575 nFail += Check(audit.nReceiveNext == nHDReceiveNext && audit.nChangeNext == 1, 575 nFail += Check(audit.nReceiveNext == nHDReceiveNext && audit.nChangeNext == 1,
576 "the recovery audit reports receive/change counters") ? 0 : 1; 576 "the recovery audit reports receive/change counters") ? 0 : 1;
diff --git a/src/walletcmd.cpp b/src/walletcmd.cpp
index 06f35a5..0ea2251 100644
--- a/src/walletcmd.cpp
+++ b/src/walletcmd.cpp
@@ -354,7 +354,7 @@ int CmdRecoveryAudit()
354 if (audit.fHaveSeed) 354 if (audit.fHaveSeed)
355 { 355 {
356 printf(" derivation schema: %s\n", HDKeySchemaName(audit.nSchema).c_str()); 356 printf(" derivation schema: %s\n", HDKeySchemaName(audit.nSchema).c_str());
357 printf(" BIP44 coin type: %u (provisional BITFLASH)\n", audit.nCoinType); 357 printf(" BIP44 coin type: %u (SLIP-0044 BITFLASH)\n", audit.nCoinType);
358 printf(" derived keys known to this wallet: %u\n", audit.nDerivedKnown); 358 printf(" derived keys known to this wallet: %u\n", audit.nDerivedKnown);
359 printf(" receive/change counters: %u/%u\n", 359 printf(" receive/change counters: %u/%u\n",
360 audit.nReceiveNext, audit.nChangeNext); 360 audit.nReceiveNext, audit.nChangeNext);