Closed VargSupercolony closed 2 years ago
Thank you for your contribution.
But the HDAccounts one is an ethereum specification, not a polkadot one.
https://polkadot.js.org/docs/keyring/start/suri
In general the derivation format is specified as
[//hard-derivation][/soft-derivation][///password] where
Well, I doubt it's Ethereum specific. Check this out:
https://wiki.polkadot.network/docs/learn-accounts#derivation-paths
Polkadot.js, in fact, has .derive(suri, meta)
method on KeyringPair
, implying there is a way to derive one account from another using a derivation path. To me that is a kind of HD wallet implementation, just the derivation path format is different.
This change will allow users to manage a group of accounts (master, deployer, other deployment-related stuff) using a single mnemonic and a known derivation path, so as long as it makes sense - I think it's ok that Substrate does not explicitly implement this standard.
Well, I doubt it's Ethereum specific. Check this out: https://wiki.polkadot.network/docs/learn-accounts#derivation-paths Polkadot.js, in fact, has
.derive(suri, meta)
method onKeyringPair
, implying there is a way to derive one account from another using a derivation path. To me that is a kind of HD wallet implementation, just the derivation path format is different.This change will allow users to manage a group of accounts (master, deployer, other deployment-related stuff) using a single mnemonic and a known derivation path, so as long as it makes sense - I think it's ok that Substrate does not explicitly implement this standard.
Okay, whatever the spec is, I'd like to know what's the benefit of writing it like this. Why not use suri instead of object. Like:
"bottom drive obey lake curtain smoke basket hold race lonely fit walk//123/456"
The benefit is that with HDAccounts support, we can automatically derive child accounts from one master pair. This is useful because we always append the next child number to a derivation path, instead of coming up with our derivation path variants.
For me, three points:
suri
s would be stored in the .env
file.Maybe I should add some docs?
Maybe I should add some docs?
Yes, feel free to submit pr to improve the documentation. https://github.com/patractlabs/substrate-contracts-book
This PR aims to provide support for HDAccountsUserConfig, so that the user can derive multiple accounts from one seed (via provided
derivation path
).