You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can also confirm that addresses I generated is same with generate from subkey with private key if I investigate it.
Results from my code;
Address: 5G6tXDeie2KaUgGrwkBfzApKSCm9sE5QvBm1bi1vmBZ4gcCN
Public key: b29b533725c02f6e69d8774c92d8a5a98506c2f09e13a1adbe4db367fbfa512a
Private key: 8bd78fe8b30abf91d3e9474c8927d9874fabc7e31ce2d866cf795378161f954a
Expanded private key: 8bd78fe8b30abf91d3e9474c8927d9874fabc7e31ce2d866cf795378161f954ab29b533725c02f6e69d8774c92d8a5a98506c2f09e13a1adbe4db367fbfa512a
Result from Subkey
subkey inspect 0x8bd78fe8b30abf91d3e9474c8927d9874fabc7e31ce2d866cf795378161f954a --scheme Ed25519
Secret Key URI 0x8bd78fe8b30abf91d3e9474c8927d9874fabc7e31ce2d866cf795378161f954a is account:
Secret seed: 0x8bd78fe8b30abf91d3e9474c8927d9874fabc7e31ce2d866cf795378161f954a
Public key (hex): 0xb29b533725c02f6e69d8774c92d8a5a98506c2f09e13a1adbe4db367fbfa512a
Account ID: 0xb29b533725c02f6e69d8774c92d8a5a98506c2f09e13a1adbe4db367fbfa512a
SS58 Address: 5G6tXDeie2KaUgGrwkBfzApKSCm9sE5QvBm1bi1vmBZ4gcCN
When I investigate the private key from my hd wallet implementation, Subkey prints the same address as I generated.
The problem here that, my implementation is not suitable with official hd wallet implementation which uses path like P//hard//soft (where P is mnemonic)
I rather use a path as m/44/354/0/0/0, to define 0. account's 0. deposit wallet.
The gotcha here is that, from same mnemonic I can't produce the same set of addresses with other available wallets.
The text was updated successfully, but these errors were encountered:
If you are using the standard mnemonic -> seed as per eg. ETH/BTC it won’t match.
Substrate goes from mnemonic-> entropy and then does pdkdf2 rounds (with the ///password and a known prefix) to get the private key (mini secret in Substrate terminology)
The outputs are vastly different between the 2 approaches so even something with no derivation will not match.
Trivia tidbits -
Around poc-1 the first approach was still taken in Polkadot, it was changed in poc-2 for better use of the available material
Ledger keys are derived like yours, so non-Substrate-matching, but obviously still works since the crypto is ed25519 and supported
With my implementation, anyone can generate Polkadot addresses based on Bip32-Ed25519.
My implementation has the same results with test vectors here;
https://github.com/satoshilabs/slips/blob/master/slip-0010.md#test-vector-1-for-ed25519
I can also confirm that addresses I generated is same with generate from subkey with private key if I investigate it.
Results from my code;
Address: 5G6tXDeie2KaUgGrwkBfzApKSCm9sE5QvBm1bi1vmBZ4gcCN
Public key: b29b533725c02f6e69d8774c92d8a5a98506c2f09e13a1adbe4db367fbfa512a
Private key: 8bd78fe8b30abf91d3e9474c8927d9874fabc7e31ce2d866cf795378161f954a
Expanded private key: 8bd78fe8b30abf91d3e9474c8927d9874fabc7e31ce2d866cf795378161f954ab29b533725c02f6e69d8774c92d8a5a98506c2f09e13a1adbe4db367fbfa512a
Result from Subkey
subkey inspect 0x8bd78fe8b30abf91d3e9474c8927d9874fabc7e31ce2d866cf795378161f954a --scheme Ed25519
Secret Key URI
0x8bd78fe8b30abf91d3e9474c8927d9874fabc7e31ce2d866cf795378161f954a
is account:Secret seed: 0x8bd78fe8b30abf91d3e9474c8927d9874fabc7e31ce2d866cf795378161f954a
Public key (hex): 0xb29b533725c02f6e69d8774c92d8a5a98506c2f09e13a1adbe4db367fbfa512a
Account ID: 0xb29b533725c02f6e69d8774c92d8a5a98506c2f09e13a1adbe4db367fbfa512a
SS58 Address: 5G6tXDeie2KaUgGrwkBfzApKSCm9sE5QvBm1bi1vmBZ4gcCN
When I investigate the private key from my hd wallet implementation, Subkey prints the same address as I generated.
The problem here that, my implementation is not suitable with official hd wallet implementation which uses path like P//hard//soft (where P is mnemonic)
I rather use a path as m/44/354/0/0/0, to define 0. account's 0. deposit wallet.
The gotcha here is that, from same mnemonic I can't produce the same set of addresses with other available wallets.
The text was updated successfully, but these errors were encountered: