0

In the Substrate-UI using the Bonds library (oo7), it shows that "Alice" has zero funds on a development chain. I also notice that some accounts are labeled as ed25519 and other are sr25519.

How can I repair this and gain access to the correct Alice?

Shawn Tabrizi
  • 12,206
  • 1
  • 38
  • 69

1 Answers1

0

Recently, Substrate changed the default cryptography for accounts and transactions signing from ed25519 to sr25519.

Depending on what combination of software you are using (node, UI, etc...) and what local storage items you have stored (like accounts in your UI) you may end up with some incompatible combination of accounts and cryptography.

So first thing to note:

All the accounts initiated in the genesis configuration, like Alice, use sr25519. As you can see in your screenshot, your browser storage has saved Alice as an ed25519 account from your past usage of the UI.

To repair this, you need to delete the version of Alice you have in your UI, and add a new Alice using the seed //Alice. By default, the new UI which supports sr25519 should automatically use that cryptography to generate new accounts.

Otherwise, if you want to generate new ed25519 accounts using this UI, you can do so by prefixing your seed like this: ed25519://Alice.

Shawn Tabrizi
  • 12,206
  • 1
  • 38
  • 69
  • When I try adding Alice using the above method I get an error "Unable to match '//Alice' to a secret URI" – Adam Dossa Oct 12 '19 at 03:23
  • I would say to try and use Subkey to generate the private key data, but maybe you could explain more about your situation – Shawn Tabrizi Oct 12 '19 at 05:12
  • We have a few configs defined in chain_spec.rs - when I run a node, and connect to it via https://polkadot.js.org/apps for some chains I see all of the Alice, Bob,... accounts, and for some I only see accounts that I've created. I was trying to manually add the Alice account using Raw Seed of //Alice, but I get the error "Unable to match '//Alice' to a secret URI" - https://imgur.com/a/VsbU6oV Would love to know how the UI decides whether or not to show Alice, Bob, ... accounts, and whether something changed with the above approach of manually adding them. Will play with subkey as well. – Adam Dossa Oct 12 '19 at 23:21
  • Subkey correctly generates the public key from the //Alice "Secret Key URI": subkey -s inspect "//Alice" Secret Key URI `//Alice` is account: Public key (hex): 0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d Address (SS58): 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY Not sure how this would help add it to the UI though? – Adam Dossa Oct 12 '19 at 23:23
  • 1
    To answer part of my question, whether or not the Alice, Bob,... accounts show up depends on whether the UI thinks your chain is a Dev chain or not, based on the name of the chain: https://github.com/polkadot-js/common/blob/master/packages/util/src/is/testChain.ts To add Alice, on a Dev. chain, you can select "Development Seed" and add "//Alice" to the Secret Derivation Path. – Adam Dossa Oct 14 '19 at 13:48