-
Notifications
You must be signed in to change notification settings - Fork 42
Description
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.