cosmjs
cosmjs copied to clipboard
Implement ADR-036
ADR-036 was merged as a draft spec for signing arbitrary data using a Cosmos SDK keypair. We should try to implement it.
There is a draft implementation in #847 but looking at https://github.com/cosmos/cosmos-sdk/pull/7727#issuecomment-884261972 the spec seems to be work in progress. So not much more we can do here at this point.
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.
Hey guys, how are we looking on this? Possible to implement something now?
🤔
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.
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.
Currently freezes the Keplr mobile app currently when using .signAmino with sign/MsgSignData type
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
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
How can I do this on keplr mobile?Authentication/signing a messageOn 15 Mar 2023, at 13:51, J Garcia @.***> wrote:
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
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
@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