Skip to content
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

Implement ADR-036 #844

Open
webmaster128 opened this issue Jul 20, 2021 · 11 comments · May be fixed by #847
Open

Implement ADR-036 #844

webmaster128 opened this issue Jul 20, 2021 · 11 comments · May be fixed by #847

Comments

@webmaster128
Copy link
Member

ADR-036 was merged as a draft spec for signing arbitrary data using a Cosmos SDK keypair. We should try to implement it.

@webmaster128
Copy link
Member Author

webmaster128 commented Jul 21, 2021

There is a draft implementation in #847 but looking at cosmos/cosmos-sdk#7727 (comment) the spec seems to be work in progress. So not much more we can do here at this point.

@ethanfrey
Copy link
Contributor

It would be cool feature for dApps when it is stabilised, but yeah... seems like we are waiting for a spec here. Since wintertime I believe.

@JGJP
Copy link

JGJP commented Mar 29, 2022

Hey guys, how are we looking on this? Possible to implement something now?

@blake-regalia
Copy link

🤔

@ethanfrey
Copy link
Contributor

This would be a nice addition. I don't think a standard will be ratified, but if there is a library that is compatible with ledger and Keplr and gets adopted, it will become the standard.

Such a library could easily be built on top of CosmJS, but I think it doesn't really belong as a part of that. Maybe in some sort of tooling library.

Does anyone commenting here want to implement it with support from Confio? Or rather requesting that we implement it?

If you wish us to implement it, a few concrete use cases would be great to ensure it covers them all.

@JGJP
Copy link

JGJP commented May 23, 2022

It's a while since I implemented arbitrary message signing with Keplr, but I was able to use keplr.signAmino. The thinking regarding adding it to cosmjs is that SigningStargateClient is already in the business of requesting signatures, and also has a signAmino but for some reason was not able to request the signature in this instance. Showing my working example with Keplr here for reference, as I think it shows something that's already very close to what Stargate offers (AFAICR):

await window.keplr!.signAmino(chainId, account.address, {
    chain_id: "",
    account_number: "0",
    sequence: "0",
    fee: {
        gas: "0",
        amount: [],
    },
    msgs: [
        {
            type: "sign/MsgSignData",
            value: {
                signer: account.address,
                data: btoa(message.toLowerCase()),
            },
        },
    ],
    memo: "",
})

MsgSignData is also already mentioned in cosmjs-types. If its presence there is warranted then maybe implementation in cosmjs is warranted.

@ThomasDEVio
Copy link

Currently freezes the Keplr mobile app currently when using .signAmino with sign/MsgSignData type

@williamchong
Copy link

This would be a nice addition. I don't think a standard will be ratified, but if there is a library that is compatible with ledger and Keplr and gets adopted, it will become the standard.

Such a library could easily be built on top of CosmJS, but I think it doesn't really belong as a part of that. Maybe in some sort of tooling library.

Does anyone commenting here want to implement it with support from Confio? Or rather requesting that we implement it?

If you wish us to implement it, a few concrete use cases would be great to ensure it covers them all.

A very simple and useful use case would be to authenticate/sign-in with cosmos wallets by signing a challenge, or proving account ownership

@JGJP
Copy link

JGJP commented Mar 15, 2023

A very simple and useful use case would be to authenticate/sign-in with cosmos wallets by signing a challenge, or proving account ownership

Yes, that's exactly what I was using it for

@ThomasDEVio
Copy link

ThomasDEVio commented Mar 15, 2023 via email

@JGJP
Copy link

JGJP commented Mar 24, 2023

@ThomasDEVio I'm not familiar with the Keplr mobile interface. If my above code snippet doesn't work for you then it may not be doable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants