Commit a9beff7
committed
Merge #7275: feat: new RPC migratewallet to migrate legacy wallets to backport wallets
d45f5a9 wallet: harden migratewallet backup filename and cover with a test (UdjinM6)
e548fbe fix: return false from AdvanceNextIndexTo when descriptor write fails (UdjinM6)
f8cc9c2 fix: issue with wallet names containings slashes (Konstantin Akimov)
3b28689 perf: speed up migratewallet and harden its error paths (UdjinM6)
355fcbd fix: loosen condition about P2PK / P2PKH scripts for non-hd imported keys (Konstantin Akimov)
3b30bde test: check mnemonic is set correctly for migrated wallet (Konstantin Akimov)
062dce5 fix: protection belt for more than 1 account for legacy wallets (Konstantin Akimov)
928c184 fix: advance active pkh() descriptor past the legacy counters (Konstantin Akimov)
0db21aa Merge bitcoin#28257: test: check backup from `migratewallet` can be successfully restored (fanquake)
ecc9541 Merge bitcoin#26595: wallet: be able to specify a wallet name and passphrase to migratewallet (fanquake)
6be9b71 Merge bitcoin#26594: wallet: Avoid a segfault in migratewallet failure cleanup (fanquake)
b38297c Merge bitcoin#26761: wallet: fully migrate address book entries for watchonly/solvable wallets (Andrew Chow)
fd4f410 Merge bitcoin#26910: wallet: migrate wallet, exit early if no legacy data exist (Andrew Chow)
a00fe15 Merge bitcoin#19602: wallet: Migrate legacy wallets to descriptor wallets (Andrew Chow)
Pull request description:
## Issue being fixed or feature implemented
Legacy wallets is subject to be removed in Bitcoin Core, here's bitcoin's timeline for reference: bitcoin#20160
Descriptor wallets is going to be created by default from Dash Core v24: #7204
## What was done?
Backports:
- bitcoin#19602
- bitcoin#26910
- bitcoin#26761
- bitcoin#26594
- bitcoin#26595
- bitcoin#28257
And more to be done in further PR
There are several key differences with Bitcoin Core:
- bitcoin uses multiple path derivation and paths for legacy bip44 and descriptor bip44 is not matched; while Dash Core always uses the same derivation path for all HD wallets
- combo descriptors can not be used as "active" descriptors so, they added as "inactive" descriptors
- there's added 1 more coinjoin derivation path for compability with mobile. It covers a case if used used the same once on mobile wallet and run coinjoin
- implementation of HD wallet in our legacy wallets and bitcoin's are not exactly same because this code hasn't been backported. Beside lookup of `mapKeys` and `mapCryptedKeys` there should be done extra lookup over `mapHdPubKeys` in migration code
## How Has This Been Tested?
See updates for new functional test wallet_migration.py
Also all my own legacy wallets (mainnet, testnet) has been successfully migrated to descriptor during testing of this PR, including coinjoin-status of mixed coins.
One of my wallet on testnet highlighted existing bug of mainstream. This bug with watch-only addresses has been fixed by bitcoin#28868 and this fix will be included in the next batch of backports.
## Breaking Changes
N/A
## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone
ACKs for top commit:
UdjinM6:
utACK d45f5a9
Tree-SHA512: 7e64bd0142aa0592ab77b69d27e6645adc0efba874f77200cd2999ce56b2ba483719ab5f146396e7bb1f12ba2e9e562b9c6386d53af8e519624861d1d3f79d4617 files changed
Lines changed: 1775 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
596 | 596 | | |
597 | 597 | | |
598 | 598 | | |
599 | | - | |
| 599 | + | |
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
| 689 | + | |
689 | 690 | | |
690 | 691 | | |
691 | 692 | | |
| |||
711 | 712 | | |
712 | 713 | | |
713 | 714 | | |
| 715 | + | |
714 | 716 | | |
715 | 717 | | |
716 | 718 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1058 | 1058 | | |
1059 | 1059 | | |
1060 | 1060 | | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1061 | 1129 | | |
1062 | 1130 | | |
1063 | 1131 | | |
| |||
1179 | 1247 | | |
1180 | 1248 | | |
1181 | 1249 | | |
| 1250 | + | |
1182 | 1251 | | |
1183 | 1252 | | |
1184 | 1253 | | |
| |||
0 commit comments