Closed avive closed 3 years ago
Just to be clear, it's also possible to restore a wallet from a private key, right?
A mnemonic can be derived from a private key or vice-versa the private key can be derived from the mnemonic. So if we have the private key for the tap accounts whose public keys are used today - we can derive a mnemonic for them. Have we lost the private keys? We should store them in 1Password if we aren't already.
Also, I'm not sure what change should be made to the code based on this issue... Setting the config for testnet is currently done manually and I'm not sure how the config for the devnet is generated, but it's not in this repo's code AFAIK. Maybe @narayanprusty can help direct you to the right repository.
the pub keys for genesis accounts are currently hard coded in go-sm for both dev and testnets. It would be nice to have the testnet genesis public account keys come from the config file.
regarding mnemonic - it is derived from entropy - not from ec key pairs following bip39 and friends but in the node we only need to include pub keys of derived accounts.
So this request is just to replace the currently hard-coded public keys with keys that we can easily restore in spacemesh wallets given the seed entropy / mnemonic.
Related: #2004
I think we can agree that ideally:
@avive @noamnelke is there a case when we want to configure a nonce for an initial account? I am working on this issue, and considering if I can simplify config a bit
I'm not 100% sure what you mean. The nonce in genesis accounts should always be 0 as these accounts didn't execute any transactions - similar to you sending some coins to an account that was not on the mesh - it is created with a balance and a zero nonce.
Thats what i thought as well, GenesisConfig allowed setting account nonce to a non-zero value. I removed it
One thing to check - the non-zero nonce might have been used in some tests so they might need to be updated.
So to summarize, what we need to do is to add support to a node config file which will have user node settings such as post and an immutable network config file that has the network params which are on consensus on genesis. The genesis accounts should be part of the network config file.
Next step on this task is to publish a config file for 0.2 devnets that has the requested tap account as part of a devnet release flow. @moshababo
i think we can add it to all configs that are used in go-spacraft.
@avive what balance is enough? 10^5 SMH is good?
yes and to be clear devnet accounts should be the same as testnet accounts.
@avive i will use 4 public keys that you provided in the issue, both for testnets and devnet. but where is can find:
Account 3 - use the public tap account public address already used in recent testnet builds.
Did you mean keys that we have in internal default config?
Please use this community tap public address: 0xafed9a1c17ca7eaa7a6795dbc7bee1b1d992c7ba
From Yael - this is the address fo the testnet's community tap.
Motivation
We'd like to easily enable devs to have accounts with funds to test transactions before one of their accounts got coins view rewards. This will make it easier to work with transactions on devnets and on testnets.
We have recently added features to smrepl to restore a wallet from a mnemonic so we can use this to empower dev to quickly create a wallet with the genesis accounts in a localnet / devnet. The public keys below are accounts from wallets we have the mnemonic for.
Current genesis account were generated ad-hoc and we don't have the mnemonic for them to be able to restore a wallet for them.
So the workflow for testing transactions on a localnet becomes:
We can also provide a pre-configured wallet file and share its password, so the alt flow will be top open this wallet in smrepl from file.
For public testnets, this change will enable testing of transactions more quickly as soon as epoch 2 starts without having to wait for a coinbase address to get rewards in order to transact.
So the flow for interactive transaction testing on epoch 2 or later becomes:
Requested Changes
Testnet Builds
Config node to use the following public keys for genesis accounts:
Localnet and dev builds:
Config node to use the following public keys for genesis accounts: