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
When using AppKit's Bitcoin message signing functionality, the signature verification is failing with various errors including:
"Point is not on curve: Cannot find square root"
"recovery id 2 or 3 invalid"
Despite attempts to normalize the signature format, the verification process consistently fails.
Current Implementation
We've attempted to normalize the signature by:
Ensuring 65-byte signature length
Restricting recovery IDs to 0 or 1
Adding proper compression flags
Following Bitcoin message signing standards
Steps to Reproduce
Connect to a Bitcoin wallet using AppKit
Attempt to sign a message using provider.signMessage()
Try to verify the signature using standard Bitcoin message verification
Current Workarounds Attempted
constsignature=awaitprovider.signMessage({
address,
message
});// Attempted to normalize signature formatletsigBytes=Buffer.from(signature,'base64');letrecoveryId=sigBytes[0]&1;// Force recovery ID to 0 or 1constfinalSigBytes=newUint8Array(65);finalSigBytes[0]=recoveryId+27+4;// Set proper flag bytefinalSigBytes.set(compactSig,1);
Expected Behavior
The signature should be returned in a format compatible with Bitcoin message verification:
First byte: 27 + recoveryId (0/1) + 4 (compressed flag)
Following 64 bytes: signature data (r,s values)
Actual Behavior
The signature returned by AppKit's Bitcoin provider is not in a format that can be properly verified, leading to cryptographic verification failures.
Questions
What is the expected format of signatures returned by AppKit's Bitcoin provider?
Is there documentation on the exact signature format being used?
Are there any specific requirements or transformations needed for Bitcoin message signatures?
Environment
AppKit Version: 1.6.5
Bitcoin Adapter Version: 1.6.8
Additional Context
This is blocking the implementation of Bitcoin signature verification in our application. Any guidance on the correct way to handle Bitcoin message signatures with AppKit would be greatly appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Description
When using AppKit's Bitcoin message signing functionality, the signature verification is failing with various errors including:
Despite attempts to normalize the signature format, the verification process consistently fails.
Current Implementation
We've attempted to normalize the signature by:
Steps to Reproduce
provider.signMessage()
Current Workarounds Attempted
Expected Behavior
The signature should be returned in a format compatible with Bitcoin message verification:
Actual Behavior
The signature returned by AppKit's Bitcoin provider is not in a format that can be properly verified, leading to cryptographic verification failures.
Questions
Environment
Additional Context
This is blocking the implementation of Bitcoin signature verification in our application. Any guidance on the correct way to handle Bitcoin message signatures with AppKit would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions