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

Signing and verifying messages #18

Open
lannocc opened this issue Jul 31, 2018 · 3 comments
Open

Signing and verifying messages #18

lannocc opened this issue Jul 31, 2018 · 3 comments

Comments

@lannocc
Copy link
Contributor

lannocc commented Jul 31, 2018

I spent most of today trying to implement message signing in a portable manner so that bitcoind or Electron-Cash can be used to verify the message, without success.

I've made it as far as constructing the message in the same manner and double-hashing it so the exact same hash is sent to the underlying wallet._pk signing function (and passing hash=None since it's already been hashed manually) and verified this is the same hash generated by bitcoind before it calls secp256k1_ecdsa_sign_recoverable, but that's as far as I get. I am simply unable to produce the same signature or one that bitcoind can verify.

My hunch is that either BitCash does not generate a recoverable signature or the nonce functions are different. This is where things start to go over my head.

If this is not possible, I am wondering if we could at least support a recoverable signing mechanism so that the person verifying does not need the full public key, but simply the cash address (hashed key) like bitcoind and the wallets support. If that were possible then I don't necessarily need it to be verifiable outside of this library.

Anybody have any insight to this? As a last resort I'll keep searching for an alternative library that can do this and I'll have to use that for this purpose, but I would prefer to have it incorporated in here.

@ghost
Copy link

ghost commented Aug 2, 2018

That would be really cool. Too much for me to look into now, but definitely like the idea of having that functionality.

The low level bits can get very tricky, or at least time consuming to debug.

@AustEcon
Copy link
Contributor

AustEcon commented Aug 2, 2018

Would be awesome to have but I can't help you on it. A part of me would like to try for the challenge but would be irresponsible wrt other commitments and you're far more qualified than I. Out of my scope.

@devalbo
Copy link

devalbo commented Aug 14, 2018

I'm glad it's not just me having this issue. I've been able to verify generated messages within the library, but not with another (bitcoincashjs). I've spent a night trying to verify signed messages with https://bitcoincashjs.github.io/#Examples and not having any success. Unfortunately, I don't have anything to add other than additional insight would be very helpful.

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

No branches or pull requests

3 participants