-
Notifications
You must be signed in to change notification settings - Fork 353
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
help me~ "Uncaught ReferenceError: global is not defined" when i using unisat wallet to verify sign #168
Comments
i sended it, but haven't received any reply. Maybe someone else knows the solution to this problem I've been working on implementing signature functionality in my application, and I'm currently using the Unisat wallet for signing operations. However, when attempting to verify these signatures on my backend server, I encountered some difficulties. // import { verifyMessage } from "@unisat/wallet-utils"; package main import (
) func main() {
} From my understanding, Bitcoin (BTC) ECDSA signatures should adhere to the DER format, with the first byte being 0x30. However, it seems that the signatures generated by the Unisat wallet may not be in this expected format. |
😂 |
i want to use unisat wallet to sign a msg, that's my code:
import { verifyMessage } from "@unisat/wallet-utils";
const useWallet = async () => {
try {
if (typeof window.unisat !== 'undefined') {
console.log('unisat Wallet is installed!');
const accounts = await window.unisat.requestAccounts();
const publicKey = await window.unisat.getPublicKey()
const signature = await window.unisat.signMessage(accounts[0]);
const result = verifyMessage(pubkey,message,signature);
then i got an error, when start my react project:
chunk-Y5IW5QF7.js?v=45de4bcc:903 Uncaught ReferenceError: global is not defined
at node_modules/bitcore-lib/index.js (@unisat_wallet-utils.js?v=39e9ba3b:28823:27)
at __require (chunk-UV5CTPV7.js?v=45de4bcc:9:50)
at @unisat_wallet-utils.js?v=39e9ba3b:28869:34
The text was updated successfully, but these errors were encountered: