2

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 2

4

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

source.

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
2
  • Thank you! Is there any way or function api I can use to get these information from on-chain logic or pallet code?
    – kugool
    Commented Aug 29, 2022 at 6:25
  • 1
    You can import the DEV_PHRASE as use sp_core::crypto::DEV_PHRASE.
    – kianenigma
    Commented Aug 29, 2022 at 6:42
1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.