Skip to content

Verification and Signing Keys Bug #184

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

Closed
bluekapo opened this issue Mar 19, 2023 · 3 comments
Closed

Verification and Signing Keys Bug #184

bluekapo opened this issue Mar 19, 2023 · 3 comments

Comments

@bluekapo
Copy link

bluekapo commented Mar 19, 2023

Greetings!

I'm trying to sign a transaction with keys I got from an HDWallet. I need to sign it with stake and spend (payment) keys. So I get vkeys like (wallet is HDWallet object):
Stake:

hdwallet_stake = wallet.derive_from_path("m/1852'/1815'/0'/2/0")
stake_public_key = hdwallet_stake.public_key
stake_vk = StakeVerificationKey.from_primitive(stake_public_key)

Spend:

hdwallet_spend = wallet.derive_from_path("m/1852'/1815'/0'/0/0")
spend_public_key = hdwallet_spend.public_key
spend_vk = PaymentVerificationKey.from_primitive(spend_public_key)

The vkeys I got above are exactly the ones I need (their hashes are the same hashes that can be found in the RequiredSigners of a transaction)

After that I get signing keys:
spend_sk = SigningKey.from_primitive(spend_public_key)
stake_sk = SigningKey.from_primitive(stake_public_key)

Signing transaction with this set of keys results in InvalidWitnessUTXOW error on submit.

I tried to get back vkeys from skeys to compare it:

spend_vk_2 = PaymentVerificationKey.from_signing_key(spend_sk)
stake_vk_2 = StakeVerificationKey.from_signing_key(stake_sk)

spend_vk and spend_vk_2 as well as stake_vk and stake_vk_2 hashes are completely different.

I've tried to change Signing key to extended version or to StakeSigningKey/PaymentSigningKey and to me it didn't make any changes.

I would also like to get in touch with Jerry, if it's possible, to ask a few questions about cardano and this library as well as kindly ask for a helping hand with one of my projects.

I can give all the needed information.

Thanks in advance!

@cffls
Copy link
Collaborator

cffls commented Mar 20, 2023

Hi @bluekapo , have you tried creating your vkeys from ExtendedVkey classes?

spend_vk_2 = PaymentExtendedVerificationKey.from_signing_key(spend_sk)
stake_vk_2 = StakeExtendedVerificationKey.from_signing_key(stake_sk)

If a signing key is extended, its vkey has to been created from extended vkey class.

@bluekapo
Copy link
Author

Thanks for help and sorry for the late response, I was a bit busy. @cffls I tried this before posting the bug, but it didn't help. Just had to restart the whole system. I have no clue what that was. For everyone that will happen to have the same bug: just use extended keys.

@cffls
Copy link
Collaborator

cffls commented Mar 29, 2023

Thanks for the update @bluekapo. Extended keys are supposed to work. Will try to create a test case for it.

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