Emurgo/yoroi-frontend

CIP-0030 - signData and getNetworkId implementation

gerciljunio opened this issue · 8 comments

Hey, do you have a deadline to implement these two methods, especially signData?

signData is very important to create message signatures to log in as well as used in the Metamask wallet and other wallets from other networks, which are used for "login with wallet", in addition to of course, several other functions such as identity verification, voting in surveys without the need for transactions and payment of fees and several other authentication models.

Yes, key feature here, also what is the version that will be implemented : CIP-0030 v0.1.0 as CCvault, or latest version as Nami ?

@gerciljunio @pierre-andre-long , what message format you are using to implement log-in?

The format I'm using is the same as the CIP-0030, I've already integrated it with Nami, CCVault and Flint, you can see it here app.adanize.com

For me, when trying to use the signData method in yoroi, it throws an exception with the error "Not implemented yet". I went to analyze Yoroi's code and really, in the signData method it contains the following:

signData(address, sigStructure) {
    // TODO
    throw new Error('Not implemented yet');
}

My version is 4.10.0, I've already tested it in Chrome and Edge (using the Chrome extension and both return the same information)!

If you need more detailed information let me know!

The format I'm using is the same as the CIP-0030, I've already integrated it with Nami, CCVault and Flint, you can see it here app.adanize.com

@gerciljunio , I mean, what sigStructure are you constructing to implement the log-in functionality?

Got it @vsubhuman I'm sorry! In sigStructure I pass a message encoded in hex as below:

Buffer.from(message, 'ascii').toString('hex')

That is, as I use getRewardAddresses to sign the message, it looks like this:

let message = "Login with Wallet"
let stakeAddr = await wallet.getRewardAddresses()
wallet.signData(stakeAddr, Buffer.from(message, 'ascii').toString('hex'))

Sorry I didn't understand the question the first time, English is not my native language, so I suffer a little when interpreting! 😄

This lib works fine with signData: web3-cardano-token

Any news on when signData function should be implemented?

Any news on when signData function should be implemented?

In the next planned version 4.12 , expected around next week

signData is now implemented since 4.13.0