Commit 6152304
fix(key-wallet): refuse DIP-14 256-bit children in BLS and SLIP-10 derivation (#1051)
ExtendedBLSPrivKey / ExtendedBLSPubKey and ExtendedEd25519PrivKey hash the child index as u32::from(child), which maps every Normal256 / Hardened256 child to u32::MAX. A path with a 256-bit level therefore derived one key for every identifier at that level, with no error. DIP-14 defines 256-bit children for secp256k1 only, and dashbls / SLIP-10 have 32-bit indices, so these derivers now refuse such a child: InvalidDerivationPath for BLS (private and public), InvalidChildNumberFormat for Ed25519.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>1 parent adca78d commit 6152304
2 files changed
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
227 | 233 | | |
228 | 234 | | |
229 | 235 | | |
| |||
429 | 435 | | |
430 | 436 | | |
431 | 437 | | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
432 | 442 | | |
433 | 443 | | |
434 | 444 | | |
| |||
1743 | 1753 | | |
1744 | 1754 | | |
1745 | 1755 | | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
1746 | 1774 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
153 | 158 | | |
154 | 159 | | |
155 | 160 | | |
| |||
835 | 840 | | |
836 | 841 | | |
837 | 842 | | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
838 | 860 | | |
0 commit comments