You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After looking at the source code of VerifySignedMessage, I realized that they had a fallback which rebuilds the signature (what the fuck) with different recovery flags and keeps trying to verify the message (actual source code is not public, but it looks a lot like this). This signals to me that UniSat doesn't properly create their signatures, because you should never need to change the actual signature for it to work.
The recovery flag that seems to succeed for UniSat signed message is 31 which means that the address is actually compressed. If I compress the address, I do get the proper address back (and the signature is instantly valid). However, the actual signature that UniSat creates gives me the recovery flag 27 which is uncompressed as shown in the table and the validation code.
For P2WPKH-P2SH UniSat uses recovery flag 28, which stands for P2PKH uncompressed, meaning it will never work in any official implementation. The flag used by VerifyBitcoinMessage was 36, which would also work with verify-signed-message (and provide a valid signed message).
For P2WPKH UniSat uses recovery flag 28, which stands for P2PKH uncompressed, meaning it will never work in any official implementation. The flag used by VerifyBitcoinMessage was 40, which would also work with verify-signed-message (and provide a valid signed message).
Since UniSat doesn't create a signature with the recovery flag properly set, it's not adhering to the current standards. Please create an issue with UniSat themselves, as they need to change their code, we will not be adding a non-standard fallback. If it helps, there already exists an issue for the legacy address, so it is not an unknown issue.
Using the P2WPKH/P2SH-P2WPKH/Legacy (P2PKH) formats of the unisat wallet to sign messages cannot be verified.
test website: https://demo.unisat.io/
The text was updated successfully, but these errors were encountered: