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
Adding ability to signMessage with Ledger adapter #712
base: master
Are you sure you want to change the base?
Adding ability to signMessage with Ledger adapter #712
Conversation
🦋 Changeset detectedLatest commit: 3d84674 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@elbywan any possibility of getting the new Solana app released with the off-chain signing?Thank you. |
Hey @martincik, sorry but I am not working in the Ledger firmware team and my work is not related to the nano apps at all. |
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.
Thanks for this! We want to avoid breaking changes, so please limit the scope to just the signMessage
change. The default derivation path is fine, but can also be provided arbitrarily if the caller doesn't want to start with 44'/501'/
.
/** @internal */ | ||
export async function signMessage(transport: Transport, message: Buffer, derivationPath: Buffer): Promise<Buffer> { | ||
const paths = Buffer.alloc(1); | ||
paths.writeUInt8(1, 0); | ||
|
||
const data = Buffer.concat([paths, derivationPath, message]); | ||
|
||
return await send(transport, INS_SIGN_MESSAGE_OFFCHAIN, P1_CONFIRM, data); | ||
} |
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.
Thanks, this looks great. I think we'll need to add some things to the adapter/utils to help apps prepare the right message format to sign, but this is a good start.
@jordansexton Thanks for the review and feedback. I've applied all the input and reverted all the new derivative path codes. Feel free to let me know if there's anything else I can do to move it forward. |
This looks good. I think we need to wait to merge until the Ledger app actually supports the full message preamble: https://edge.docs.solana.com/proposals/off-chain-message-signing#message-preamble The current (1.3.1) release does support But the addition to the Ledger app was done before the spec was finalized, and some of the message headers have changed. |
pinging you on this @jordansexton, when do you expect to merge this? |
hey @jordansexton , are there any plans to merge this anytime soon? |
This is still in development for the Ledger app. While the app was updated to include message signing support, it doesn't implement the final version of the Solana offline signing spec yet. Apps shouldn't start to use until it's implemented correctly (the message preamble has changed, so the input and signatures won't match). I'll merge this when it's released. |
so ledger is still working on this I assume? |
hey jordan was there any update on this? |
Hey any update on this? |
For this patch to work, we would need a new Solana App released with supporting off-chain message signing. The code is done here: LedgerHQ/app-solana#37 not yet been released.