Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keys and certificates #19

Closed
stackBlock opened this issue Feb 7, 2021 · 37 comments
Closed

Keys and certificates #19

stackBlock opened this issue Feb 7, 2021 · 37 comments

Comments

@stackBlock
Copy link

Hi, this really great. Thanks for spending the time to create all of this.

I am trying to convert my pool from cli to hardwallet but I did not use your commands to build my pool originally so I am having to figure out how to make things work with my original configuration and I have gotten pretty far but I need to know what keys and certs the following commands use so that I can change their names so that your commands will recognize them. The commands I need the information from are: 05a_genStakepoolCert.sh, 05b_genDelegationCert.sh and, 05c_regStakepoolCert.sh
FYI, I originally followed the coin cashew guide (https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node)..

Thank you for your help,
Anthony

@gitmachtl
Copy link
Owner

gitmachtl commented Feb 7, 2021

Please take a look at the readme here: https://github.com/gitmachtl/scripts/tree/master/cardano/mainnet#filenames-used

Basically its choosenname.xxx.key

05a will generate the pool-(re)registration-certificat after you have updated the name.pool.json file an ran 05a... name again.

I am working on a small import script to convert over from cli keys made via coincashew.com tutorial... 😃

But please, make the conversion first with your existing cli keys before you try to also bring in the hw-wallet at the same time.

Also please run 05c with the additional parameter REREG at the end, because at this point the scripts (via the name.pool.json) does not know that the pool already exists.

@gitmachtl
Copy link
Owner

Also please checkout: https://github.com/gitmachtl/scripts/blob/master/cardano/mainnet/README.md#pool-configuration-file-poolnamepooljson---config-file-for-each-pool

There is a example mypool.pool.json file with the description of each entry.

@stackBlock
Copy link
Author

Thank you, I am going to match these with my certs, keys... I may have some additional questions because just off the top of my head I don't remember having the quantity of files that you have listed. But I very well could be (and usually am) wrong so I will let you know if there is any confusion..

@gitmachtl
Copy link
Owner

hey, i have made a little import script. do you wanna test it?

@stackBlock
Copy link
Author

Sure, I have a pool set up just for testing purposes before I do anything on my main one... I would love to give it go. I will have to do it tonight or tomorrow morning though.

thanks

@gitmachtl
Copy link
Owner

Is this a MainnetPool? Because the datafetching will only work on Mainnet and not on the Testnet.

@stackBlock
Copy link
Author

Yep, It's mainnet.

@gitmachtl
Copy link
Owner

Ok, the script can be found here: https://github.com/gitmachtl/scripts/blob/master/cardano/testnet/0x_importHelper.sh

Basically you just have to run it and give it a name as parameter like "mypool" and your pool-id in bech or hex format. It will create a subdirectory with the same name "mypool". It will ask about the node(cold) key and the vrf key. After that about the owner keys. What the script is doing is just making a copy of them in the right naming scheme in this subdirectory. And also the pool.json file will be automatically filed out and build up with the informations.

@stackBlock
Copy link
Author

I got up to where it is trying to find my payment.skey and it is giving me an error saying:

image

I do have my payment.skey in the same file... It's been the same since the inception of my pool - I have never edited it or even opened it until today to look at it and make sure there were no glaring errors. Other then that, everything worked up until then. It created, I think, five files so far.

@stackBlock
Copy link
Author

maybe this will help.
the type on my payment.skey is: 'PaymentExtendedSigningKeyShelley_ed25519_bip32'
looks like your program is verifying for type: 'PaymentSigningKeyShelley_ed25519'

@stackBlock
Copy link
Author

also, I was looking ahead a little in your program. my staking key is 'stake.skey'. It looks like you are looking for 'staking.skey' in the program...
I don't know bash that well so if It is suppose to be like that, sorry... lol. Just trying to help.

@gitmachtl
Copy link
Owner

gitmachtl commented Feb 11, 2021

maybe this will help.
the type on my payment.skey is: 'PaymentExtendedSigningKeyShelley_ed25519_bip32'
looks like your program is verifying for type: 'PaymentSigningKeyShelley_ed25519'

hmm... i have to check my early keys about that. yes i do a filtering on "PaymentSigningKeyShelley_ed25519" to check about a valid keyfile here so users can't mix it up. i have to check if my early ones are also that kind of type.
how did you create your skey for that one back in the days? was this via a ITN key conversion or so?

about the "stake.skey", this is only the default one. you have to specify your real one. "stake.skey" is used in the coincashew tutorial and other ones so i set the default to this name. but you have to set it to your real one of course. it will be copied to a new one with the xxx.staking.skey naming scheme.

@gitmachtl
Copy link
Owner

so you imported that key via the mnemonic method?

@stackBlock
Copy link
Author

Yes, I did use the mnemonic method. I have full control over my pledge in my daedalus wallet.

@stackBlock
Copy link
Author

I did not run a pool in the ITN. I did not do any kind o conversion,,,

@stackBlock
Copy link
Author

This is where you can find the coincashew instructions I used:
https://github.com/coincashew/coincashew/blob/dcbd6c354600231bb19794b7e1f7b5d97a5928f7/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node/README.md

they are a little different from the new instructions, the main difference was that these instructions had you building the relays on the same system as the BP node and I had to separate them after setup... but sometimes I have to tweek the commands in the new version to work with my node otherwise they are pretty similar.

@gitmachtl
Copy link
Owner

Hi, ok i lowered the check so that "SigningKey" must be included... please download the script again and try again. 😃

@stackBlock
Copy link
Author

stackBlock commented Feb 12, 2021 via email

@stackBlock
Copy link
Author

stackBlock commented Feb 12, 2021 via email

@gitmachtl
Copy link
Owner

Congrats, you found a bug in cardano-cli 😃

I will report this back to the developers.

@gitmachtl
Copy link
Owner

gitmachtl commented Feb 12, 2021

i received this error: Generating file 'savvy/owner.payment.addr' ... Shelley command failed: address build Error: savvy/owner.staking.vkey: TextEnvelope type error: Expected: StakeVerificationKeyShelley_ed25519 Actual: StakeExtendedVerificationKeyShelley_ed25519_bip32 I am going to try and edit the code so that it will match and go forward... let me know if that is going to mess anything up.. I will let you know what happens..

hi, can you look into your stake.skey please and tell me exact type that is specified in there?

@stackBlock
Copy link
Author

stackBlock commented Feb 12, 2021 via email

@gitmachtl
Copy link
Owner

ok, and when you input that stake.skey into the script it fails with the error you sent me?

this is also from the same mnemonics method you used back in the days?

@gitmachtl
Copy link
Owner

could you please run the following command for me:
cardanocli key verification-key --signing-key-file stake.skey --verification-key-file /dev/stdout

@stackBlock
Copy link
Author

here you go:

anthony@anthony-XPS-2720:~/cardanoSavvy$ cardano-cli key verification-key --signing-key-file stake.skey --verification-key-file /dev/stdout
{
"type": "StakeExtendedVerificationKeyShelley_ed25519_bip32",
"description": "",
"cborHex": "5840..."
}

@stackBlock
Copy link
Author

And, yes. I used the mnemonics method (from the older instructions I sent you).

@gitmachtl
Copy link
Owner

ah ok, now it worked... strange. i am using the same command within the script. hmm. can you try to run the 0x_importHelper.sh script again to see if it again fails when you provide the stake.skey at the owner keys stage? Thx!

@gitmachtl
Copy link
Owner

ahhh... wait. i have totally overlooked the error about the address build. ok, let me check something.

@gitmachtl
Copy link
Owner

would it be possible that you send me the payment.vkey and the stake.vkey to check the cardanocli against the issue? there is nothing i could do to harm your payment/staking keys with the vkeys.

Repository owner deleted a comment from stackBlock Feb 12, 2021
@gitmachtl
Copy link
Owner

thx, i removed the post also... hmm... so your normal vkeys are not extended ones, but the skeys are extended ones. thats interesting. can you also copy&paste the copied ones in your savvy subdirectory. there should be a owner.payment.vkey and a owner.staking.vkey now. the importHelper script has created them there. theses should be extended ones, right?

@gitmachtl
Copy link
Owner

I have updated the 0x_importHelper.sh script, please retry. 😃

It should now convert extended keys automatically into non-extended "normal" ones on the fly.

@stackBlock
Copy link
Author

still running into the type error:

Path to the 'stake.skey' of 'owner', blank to abort: stake.skey

Copying the file 'stake.skey' to new destination 'savvy/owner.staking.skey' ... OK
Generating file 'savvy/owner.staking.vkey' ... OK

Generating file 'savvy/owner.payment.addr' ... Shelley command failed: address build Error: savvy/owner.staking.vkey: TextEnvelope type error: Expected: StakeVerificationKeyShelley_ed25519 Actual: StakeExtendedVerificationKeyShelley_ed25519_bip32

ERROR (Code 1) !

@gitmachtl
Copy link
Owner

ok, please retry. there was a bug in the if statement... sorry, i am doing this between other stuff right now... but i should work now.

Repository owner deleted a comment from stackBlock Feb 12, 2021
@stackBlock
Copy link
Author

no problem, me to. i will try now.

@stackBlock
Copy link
Author

looks good. worked all the way through and created all the files.. One questions, the last question about the second owner:
It says to leave blank if there is no second owner but the answer is pre-populated. I backspaced over the pre-populated answer in order to make it blank. Was that correct or did you mean to just hit enter? I ask because with the question about payment key , it says the same thing but in that case I left the prepopulated answer and it worked as if I had changed it to being blank..
Does that make sense?
Otherwise, worked perfect... I will try to finish up the hard-key conversion either tonight or tomorrow and let you know how it goes.. thanks again.

@gitmachtl
Copy link
Owner

gitmachtl commented Feb 12, 2021

yep just delete the prepopulted one and hit enter. maybe i should put a question in here to ask if the user wants to add another user or rewards account.

@gitmachtl
Copy link
Owner

hardware wallet conversion with the .hwsfile is currently not supported. it is targeted currently on the beginners with normal cli keys. but of course you can now use the generated files to add the hw wallet and use the scripts as intended. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants