I want to use the predefined built-in account's key pair to sign extrinsic from ocw, but I can not get the key/Secret seed/Secret phrase from polkadotjs app. How can I get these items? Shall I use subkey on the node?
2 Answers
All of the default substrate accounts such as Alice
are derived from this seed:
bottom drive obey lake curtain smoke basket hold race lonely fit walk
To get Alice
, you derive a key with a single hard junction from this key. In other words:
bottom drive obey lake curtain smoke basket hold race lonely fit walk//Alice
-
Thank you! Is there any way or function api I can use to get these information from on-chain logic or pallet code?– kugoolCommented Aug 29, 2022 at 6:25
-
1You can import the
DEV_PHRASE
asuse sp_core::crypto::DEV_PHRASE
. Commented Aug 29, 2022 at 6:42
You can always use Subkey to print the Secret Key and such:
$ subkey inspect "//Alice"
Secret Key URI `//Alice` is account:
Network ID: substrate
Secret seed: 0xe5be9a5092b81bca64be81d212e7f2f9eba183bb7a90954f7b76361f6edb5c0a
Public key (hex): 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
Account ID: 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
Public key (SS58): 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
SS58 Address: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY