These are chat archives for Nethereum/Nethereum

10th
Apr 2017
omnissiah
@omnissiah
Apr 10 2017 08:10
@juanfranblanco I checked the code and it generates a keystore file from a previous one. Considering a case where I only have a password, how can I generate an account? EncryptandGenerateDefaultKeyStoreAsJson asks for password, a key and an address. Also, how can I generate addresses? Is it a random string?
@juanfranblanco wait, the last part is what I wanted. Missed that:)
Juan Blanco
@juanfranblanco
Apr 10 2017 10:33
@omnissiah good feedback thanks, yes the sample covers all the scenarios.
no addresses are not a random string
omnissiah
@omnissiah
Apr 10 2017 12:15
@juanfranblanco should I change anything during acc creation for a private chain?
Juan Blanco
@juanfranblanco
Apr 10 2017 12:17
it should not be necessary
if you really want you can generate your own seeds or implementation for SecureRandom
omnissiah
@omnissiah
Apr 10 2017 12:32
@juanfranblanco After creating an account using KeyStoreService or KeyStorePbkdf2Service and then using personal.UnlockAccount gets "panic: interface conversion: interface is nil, not string". When I use KeyStoreScryptService I get "scrypt: N must be > 1 and a power of 2". In both cases geth shuts down.
Juan Blanco
@juanfranblanco
Apr 10 2017 12:34
where are you putting your account
file
why are you using personal.unlock
(you can still )
i assume you are connecting to geth
omnissiah
@omnissiah
Apr 10 2017 12:43
I'm connecting to a local node. Acc files are put under ...chain\keystore folder on one of my nodes. I was trying to use ethereum wallet to send ether back and forth to test the accounts. I got some obscure errors. Wallet is connected to my private network. Tried sending ether directly from geth, got "account is locked". last I tried unlocking the account and got these errors.
Juan Blanco
@juanfranblanco
Apr 10 2017 12:44
ok cool so your account is recognised
so you are putting it in the right folder :)
what version of geth are you using?
omnissiah
@omnissiah
Apr 10 2017 12:46
Geth/v1.4.6-stable
Juan Blanco
@juanfranblanco
Apr 10 2017 12:47
ok that should not have any issues
omnissiah
@omnissiah
Apr 10 2017 13:49
I compared wallet generated acc files and it looks like this is the problem: "..."kdfparams":{"n":262145...". Geth is complaining about this as well during unlock: "scrypt: N must be > 1 and a power of 2". If I change that number to 262144, as it is in the wallet generated files I get: "could not decrypt key with given passphrase". Also privateKey after this line "privateKey = ecKey.GetPrivateKeyAsBytes();" has length 33 sometimes :)
Juan Blanco
@juanfranblanco
Apr 10 2017 14:04
thanks ill have a look now
Juan Blanco
@juanfranblanco
Apr 10 2017 15:36
@omnissiah yes was a typo on the default, corrected on the latest commit
also forcing the 32 bytes :) This was a bug when changing ECKey as I did not used the Unsigned for c# endianism
nevertheless I ensure in case of lower numbers which may lead to unsigned values
Jordan Andrews
@codingupastorm
Apr 10 2017 17:55
hey there, can i use nethereum to develop for eth classic too?
Juan Blanco
@juanfranblanco
Apr 10 2017 18:14
yes you should be able to