Skip to content

Generating Deterministic Polkadot Addresses #11

@farukterzioglu

Description

@farukterzioglu

This issue is not related about this repo, rather is a discussion about another project that generates Polkadot addresses.

I developed an HD Wallet for Ed25519 based currencies (like Cardano) and also one for Polkadot.
With my implementation, one can generate 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.

I wonder what is your opinion about my implementation.

https://github.com/farukterzioglu/HDWallet/blob/master/test/HDWallet.Polkadot.Tests/GeneratePolkadotHDWallet.cs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions