-
Notifications
You must be signed in to change notification settings - Fork 24
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
Signing registration certificate examples incorrect. #163
Comments
Looks like a bug in the documentation yes. I am using the single witness output for a long time now: |
Even though only providing a single witness output, that feels a bit wierd when providing two keys to witness tx with, it still throws the warning with For now my solution in CNTools for my general purpose witness function for all types (registration, deregistration, delegation etc.) is to provide as many outputs as keys needed to witness with. So for wallet registration using own utxo this means payment and stake key of HW device + 2 witness outputs. This will throw two warnings as mentioned and one of the witness outputs will be an empty file. I then check for this when assembling tx to ignore any empty file. Sort of a hacky solution and I would prefer not to have the warnings displayed in the first place as this might scare the user that something is wrong. |
@davidmisiak @DavidTranDucVL As the committers to the delegation example documentation do either of you have any input to contribute on the topic of this issue? Thanks |
Hi, we apologize for a late reply.
I believe the example should be correct - when signing a delegation certificate, both the payment and the staking signing file are needed and both witnesses should be created. However, you are correct that when signing a stake registration certificate (which is not described in the documentation), the staking signing file is always required (because the HW wallet needs to display the derivation path in the certificate), but no staking witness is generated (because this is not needed to register a staking key according to the Cardano blockchain specification). Therefore in cardano-hw-cli v1.14.0, we removed the "superfluous signing file" warning. The intended usage when signing a registration certificate - providing both signing files and a single witness output file - should now work without any warnings. Let us know if there is still an issue.
We believe this is just a mistake in cardano developer documentation, the registration certificate should be valid even without the staking witness (as registering a staking key poses no security risk to its owner). We tried to notify the documentation maintainers about this inaccuracy in the past. |
The example for signing a registration certificate is no longer accurate and leads to failure to delegate (register the staking certificate more accurately).
Incorrect Example Documentation
This link to witness the transaction from the delegation page is incorrect as it shows 2 output files being created. However
cardano-hw-cli
will only generate a single output and error messages about the second.Dropping the second output leads to still seeing warnings about superfluous signing files, but every file is required which will be covered in Real World Examples
This link to assemble the trasaction from the witness files leads to a failure because
cardano-hw-cli
did not actually produce both witness files and states that it did not.Real World Examples
The transaction cannot be signed with only the
payment.hwsfile
or thestake.hwsfile
. Below we can see that both files are required orcardano-hw-cli
refuses to create ANY signed transactions.Signing with only payment.hwsfile
Signing with only stake.hwsfile
Trying to sign with only the
stake.hwsfile
is not valid as the signature to spend the uTXO does not exist. Notx.witness
file is created. So the transaction cannot be signed with only thepayment.hwsfile
or thestake.hwsfile
, yet when signing with both there are still warnings regardless of using a single output file or two separate output files:Compared to Cardano CLI
cardano-cli
as it can sign a transaction individually with thestake.skey
and produce a signed transaction.cardano-cli
can sign a transaction individually with thepayment.skey
and produce a signed transaction.Both keys are not required in combination to sign, both result in a unique signature file and then are combined with
cardano-cli transaction assemble
.Using both keys but a single output file:
cardano-hw-cli
refuses to sign the registration cert with only one hwsfile at a time.hwsfile
produces a single signed transaction but complains that one hwsfile is superfluous.The warning seems inaccurate as today both the stake and payment hwsfile are required by
cardano-hw-cli
to sign a staking registration transaction. If the warning is going to exist in every instance of signing a staking certificate registration transaction it feels like this should be clearly described in examples of the documentation. Otherwise it seems like it was incorrectly implemented and should be removed as it causes confusion.Separately examining a De Registration w/
cardano-hw-cli
it is clear it:--out-file
witness signatures, one for the stake and one for the payment.The text was updated successfully, but these errors were encountered: