Implement Ethereum compatible signatures #13892
Replies: 5 comments
-
Hi, happy to help. For EIP191 anything textual will do. Here's how it currently looks on Secret (on mobile too): |
Beta Was this translation helpful? Give feedback.
-
And here's our signer implementation: https://github.com/scrtlabs/secret.js/blob/master/src/wallet_metamask.ts |
Beta Was this translation helpful? Give feedback.
-
Following ⚛️🦊 and will track for FE tooling here cosmology-tech/cosmos-kit#85 |
Beta Was this translation helpful? Give feedback.
-
Right now we are blocked by #11970 and its implementation on the js side cosmos/cosmjs#1147. |
Beta Was this translation helpful? Give feedback.
-
Context
This would allow users to also use Ethereum wallets (like Metamask) to interact with Cosmos SDK chains.
Related:
#13787
Overview
It would work as follows:
Important: this human readable display is the message that's going to get signed, so we need to make sure to include all necessary details so then we can verify it in the SDK.
Alternatives
EIP 191
See here
It's the simplest form in which an app can request a signature for an arbitrary message. We can use new lines, or any kind of formatted text.
This is how Secret is doing it. They use Amino's StdDoc as the message (pretty JSON).
Pros:
Cons:
EIP 712
See here
It's the latest standard for structured data hashing and signing.
Evmos seems to be using this with Amino (pending research).
Pros:
Cons:
Proposal
Implement a EIP191 signature handling mechanism with a struct containing all the necessary details to make it human readable + machine verifiable. Something like a YAML (or any other readable format) would work in which the readable part is at the beginning and then at the end we can append hashes, tx body bytes, and whatever we might need.
This will also require work on CosmJS. We could borrow some stuff from https://github.com/scrtlabs/secret.js
Questions
Beta Was this translation helpful? Give feedback.
All reactions