app-monorepo icon indicating copy to clipboard operation
app-monorepo copied to clipboard

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

Open pi-bitstable opened this issue 1 year ago • 6 comments
trafficstars

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

pi-bitstable avatar Mar 25 '24 10:03 pi-bitstable

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

originalix avatar Mar 25 '24 11:03 originalix

@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.

pi-bitstable avatar Mar 25 '24 11:03 pi-bitstable

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

pi-bitstable avatar Mar 26 '24 07:03 pi-bitstable

Has this problem been resolved?

pi-bitstable avatar Apr 24 '24 09:04 pi-bitstable

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

ByteZhang1024 avatar Apr 25 '24 08:04 ByteZhang1024

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

Is there a date for the next major version?

pi-bitstable avatar May 07 '24 08:05 pi-bitstable