-
Notifications
You must be signed in to change notification settings - Fork 16
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
Operational certificate + pool cold key derivation #48
Conversation
e1af750
to
bc4bd40
Compare
6e06ad8
to
99bb0fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I quite like it.
The only major problem is displaying uint64_t, again.
Perhaps we should push ledger to fix it and support it properly in snprintf.
@@ -29,7 +29,7 @@ PIN = 5555 | |||
APPNAME = "Cardano ADA" | |||
APPVERSION = "2.1.0" | |||
|
|||
APP_LOAD_PARAMS =--appFlags 0x240 --curve ed25519 --path "44'/1815'" --path "1852'/1815'" | |||
APP_LOAD_PARAMS =--appFlags 0x240 --curve ed25519 --path "44'/1815'" --path "1852'/1815'" --path "1853'/1815'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be allowed only for the operator app.
See 8ff1652 on branch operatorapp. All the code should be included only under the flag, too. (That is not a definitive solution, just a first attempt, so feel free to improve it.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not introduce the flagging of features here as the solution is not final yet, so it is likely to result in unnecessary conflicts (and once finalized, should be easy to apply). Maybe I would call the flag HAVE_OPERATOR_FEATURES
to be consistent with similar flags for U2F (HAVE_U2F
) and WebUSB (HAVE_WEBUSB
)
the current version of the getPoolColdPublicKey call is returning the non-extended public key - I realized that even though it should technically be enough, it's likely to cause "pain" with the hw cli which internally deals with extended public key (especially in the hw signing file) and existing wallet implementations also likely use extended public keys in their internal logic, so this would only force them to introduce special code for cold keys. TLDR - TODO rework getPoolColdPublicKey call to return the extended public key |
b3042a5
to
32032a8
Compare
dd4533e
to
5feefae
Compare
TODO - update cold key derivation to comply with CIP-1853: cardano-foundation/CIPs#56 (i.e. change cold key usecase index to hardened) |
Will be included as part of another PR. |
Motivation: Add instructions for derivation of pool cold keys and operational certificate signing.
Changes:
getExtendedPoolColdPublicKey(coldKeyPath)
call - the expected derivation path structure ism/1853'/1815'/0/<cold key index>'
signOperationalCertificate(kesPublicKeyHex, kesPeriod, counter, coldKeyPath)
which assembles the operational certificate and returns its signature - as the OpCert structure has no variable length fields and is well under 255 bytes, it's done in a single APDUbip44_hasValidCardanoPrefix()
intobip44_hasValidCardanoWalletPrefix()
to introduce equivalent function for pool cold keys namedbip44_hasValidCardanoPoolColdKeyPrefix()
- which is technically not required to have but I see it as good for readability and consistency, making it clear to a casual reader of the codebase that pool cold keys and wallet keys are logically separatestr_formatUint64()
helper function which prints uint64 integers in decimal representationTesting:
TODO: add docs (to be added once high-level idea is validated)
TODO2: missing flag in makefile to separate operator functionality (IMHO worth doing after we merge the with the rest of functionality)