-
Notifications
You must be signed in to change notification settings - Fork 62
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
Hexadecimal representation of SigningType.RAW is incorrect. #736
Comments
Hi, thanks for the report. |
code/env to reproducehttps://docs.walletbeacon.io/guides/request-permissions/ import { DAppClient, PermissionScope, SigningType } from "@airgap/beacon-sdk";
const dAppClient = new DAppClient({ name: "Beacon Docs" });
// You can request specific permissions if you want
const scopes: PermissionScope[] = [
PermissionScope.OPERATION_REQUEST,
PermissionScope.SIGN,
];
try {
console.log("Requesting permissions...");
const permissions = await dAppClient.requestPermissions({ scopes });
console.log("Got permissions:", permissions.address);
} catch (error) {
console.log("Got error:", error);
}
const response = await dAppClient.requestSignPayload({
signingType: SigningType.RAW,
payload: "any string that will be signed",
});
console.log(`Signature: ${response.signature}`); possible fix in #742 but it violates validation of custom RAW messages from beacon and does breaking changes to Ledger's sign messages |
@gsebil08 , we can't fix this issue due to braking compatibility support of ledger transactions and multisig functionality, that is using RAW payloads. But you can contact Beacon to implement SigningType.DEKU messages or contact Ledger to fix issue with RAW payloads on their side. As a temporary solution for continue developing L2 Deku sidechains, you can use Templewallet Mobile - there are no support for ledger and multisig messages and thus there are no bug with RAW payloads |
Hi @letier3110 I tried to sign a |
Here is how I do the call to const seed = await latestState.current.wallet.client.requestSignPayload({
signingType: SigningType.RAW, payload: nickName
}).then(val => val.signature); I did some more tests on my side, signing
I don't understand the pattern which makes it fail, but I guess you have enough examples to try on your side 😄 |
mobile app just passing payload to taquito.InMemorySigner.sign() (from @taquit/signer) for RAW, and looks like it wont work with payloads that different from hex/b58 |
Seems to be ok with hexadecimal representation of any string. Thanks for your time. |
Describe the bug (current behavior)
The hexadecimal representation of a RAW payload is missing the first character.
For example, if I submit:
The hexadecimal displayed in the Temple popup is:
16e7920737472696e6720746861742077696c6c206265207369676e6564
If I decode this hexadecimal to a string, I obtain:
�ç��7G&�ær�F��B�v�ÆÂ�&R�6�væV�
which is not at all the one I provided.The correct hexadecimal representation of
any string that will be signed
is:616e7920737472696e6720746861742077696c6c206265207369676e6564
yours is:
16e7920737472696e6720746861742077696c6c206265207369676e6564
We can see the first
6
is missing in your hexadecimal representation.To Reproduce
You can reproduce this behavior within beacon SDK documentation about signing
![image](https://user-images.githubusercontent.com/45454460/186629580-0505089c-7359-492a-8669-fc629ed42ad8.png)
Expected (correct) behavior
Do not truncate the first character on the hexadecimal representation of the given payload.
We need this fix, in order to be able to sign layer 2 operations, such as Deku
The text was updated successfully, but these errors were encountered: