Creating new agents, identity owners, etc


#1

I’ve setup a small cluster of machines running nodes and can reproduce the Getting Started script. Now I’d like to be able to create my own scenario, therefore my own entities and generate keys for them. It appears that Faber, ACME, Steward1, et al. have hard coded keys. Are there tools I can use for generating keys, registering stewards, managing wallets, etc? If no tools, is there a document describing the Sovrin API?


#2

There are some rules, like only Stewards can create Stewards and only Stewards can create new Sponsor (Trust anchor) in the code in the release, though we have some more entities in the code under development. Creating new keypairs is done through code today, although i have put the ticket to create a keypair using a script in our backlog. This is how you create a keypair in code

from plenum.common.signer_simple import *
s = SimpleSigner()       # You can pass a 32 byte seed as `s = SimpleSigner(seed=<32 byte seed>)`
s.verkey         # this is verification key of the signer in base58 encoding
s.seed        # this shows the seed in raw bytes
s.seedHex       # this show the seed in hex format

Now you can use the CLI to register a new Sponsor or Steward by sending a transaction. Run the CLI and use the Steward1’s key to send txns
sovrin> new key with seed <the seed for an existing Steward like Steward1's>
# Registering a new Steward
sovrin> send NYM dest=<here put the base58 of the verkey generated above by s.verkey> role=STEWARD
# Registering a new Sponsor
sovrin> send NYM dest=<here put the base58 of the verkey generated above by s.verkey> role=SPONSOR


#3

Thanks @lovesh. This has been helpful but now I’m stuck with the following issue when using the Faber example. If I run a sample program that registers the Faber’s NYM derived from the default seed (Faber000000000000000000000000000), all goes fine. But if I give a different seed, things go wrong. What is the relationship between the seed and the p and q numbers provided at the beginning of the faber.py code? I thought that, in your examples, seeds used to generate NYM and key pairs. But it seems that keys are also generated using p and q.


#4

A bit of news first: We had migrated our Sovrin code to different repos, see announcement here: https://github.com/sovrin-foundation/sovrin. Also from what you describe the code has been upgraded so in the current code there is no p and q for Faber, so you should upgrade your code. Now to your question as why different seed does not work, because the seed Faber000000000000000000000000000 is used to generate the verification keys for Faber (FuN98eH2eZybECWkofW6A9BKJxxnTatBCopfUiNxo6ZB) which is written to ledger and mentioned in the invitation files too. So if you change the seed you have to change the occurrence of FuN98eH2eZybECWkofW6A9BKJxxnTatBCopfUiNxo6ZB accordingly, the seed is not related to p and q