LedgerHQ/app-boilerplate

'curve' parameter not affecting generated pub key

Closed this issue · 4 comments

In Makefile if I change line 24 to: APP_LOAD_PARAMS = --curve ed25519 and run the python unit test suite via pytest -s tests/speculos/ and print out the pub_key variable in tests/speculos/test_pubkey_cmd.py, I get the same thing as when the secp256k1 curve is selected. I would expect a different pub key given a different curve param. Am I doing something wrong?

Bonus question: where is the mnemonic phrase set and how can I change it?

Bonus question: where is the mnemonic phrase set and how can I change it?

It is set as an argument to Speculos : https://github.com/LedgerHQ/speculos/blob/master/speculos/main.py#L193

Hello @tim-eucalyptus ,

In Makefile if I change line 24 to: APP_LOAD_PARAMS = --curve ed25519 and run the python unit test suite via pytest -s tests/speculos/ and print out the pub_key variable in tests/speculos/test_pubkey_cmd.py, I get the same thing as when the secp256k1 curve is selected. I would expect a different pub key given a different curve param. Am I doing something wrong?

There are two things that controls the derivation curve:

So eventually if you want to cleanly change the derivation curve, and you want it to work on Speculos and on real devices, you should change both parts.

Bonus question: where is the mnemonic phrase set and how can I change it?

It is set as an argument to Speculos : https://github.com/LedgerHQ/speculos/blob/master/speculos/main.py#L193

And you can change it by using the --seed parameter when launching speculos: https://github.com/LedgerHQ/speculos/blob/master/speculos/main.py#L193
You can see that the default value is the one pointed by @apaillier-ledger .

Hello @tim-eucalyptus
I'll close the issue as I think your question is answered, please feel free to comment or create a new issue if you feel that this is not the case