OneKeyHQ / app-monorepo

Secure, open source and community driven crypto wallet runs on all platforms and trusted by millions.

Home Page:https://onekey.so

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG]: Bitcoin chain cannot be signed using the 'signature' function.

pi-bitstable opened this issue · comments

image

import React from 'react'

export default function Test() {
  async function signMessage() {
    const provider = getProvider()
    if (!provider) return

    try {
      const [account] = await provider.requestAccounts()
      const message = '010203'
      const result = await provider.signMessage(message)
      alert(JSON.stringify([account, result]))
    } catch (error) {
      alert('An error occurred during the signMessage() call.')
    }
  }

  function getProvider() {
    const provider = (window.$onekey && window.$onekey.btc) || window.unisat

    if (!provider) {
      alert('No BTC provider.')
      return undefined
    }
    return provider
  }
  return <button onClick={signMessage}>Test</button>
}
  • Errror Content
{"name":"Error","message":"Sign message is not supported on hardware.","stack":"Error: Sign message is not supported on hardware.\n    at Object.custom (file:///81172.bundle.js:2:636267)\n    at r.<anonymous> (file:///main.43dd7041.bundle.js:1:28721)\n    at Generator.next (<anonymous>)\n    at n (file:///48751.bundle.js:2:1502161)\n    at s (file:///48751.bundle.js:2:1502364)\n    at file:///48751.bundle.js:2:1502423\n    at new Promise (<anonymous>)\n    at r.<anonymous> (file:///48751.bundle.js:2:1502304)\n    at r.<anonymous> (file:///main.43dd7041.bundle.js:1:29224)\n    at r.<anonymous> (file:///main.43dd7041.bundle.js:1:926)","code":4003}
  • API Docs
    https://developer.onekey.so/connect-to-software/webapp-connect-onekey/btc/api-reference/signmessage
commented

Unfortunately, the hardware doesn't currently support psbt signing, but support for this is in the works.

@originalix I think the status shouldn't be closed? Wait for completion before closing.

When can I use the signature feature? Is there an exact time?
Currently, many customers report that it cannot be used normally.

hi, @originalix .
Is there a schedule to fix this issue?
Many users in the community use OneKey to transfer funds. If they cannot sign, they cannot verify that the wallet belongs to the user.

https://docs.unisat.io/dev/unisat-developer-service/unisat-wallet#signmessage

It's just the signature message, not signPsbt

Has this problem been resolved?

At present, there is not much effort in this major version, and this issue will be fixed in the next major version.

目前这个大版本还没有做太多的努力,这个问题会在下一个大版本中修复。

Is there a date for the next major version?