BTCPayServer.Vault icon indicating copy to clipboard operation
BTCPayServer.Vault copied to clipboard

I cant sign with my bitbox02

Open ElSadhu opened this issue 4 years ago • 37 comments

Describe the bug

Sign the transaction with BTCPay Server Vault

Your BTCPay Environment (please complete the following information):

  • BTCPay Server Version: V1.2.1.0
  • BTCPay Server Vault app version: V2.0.1
  • Deployment Method: Manual

Your local environment (please complete the following information):

  • Your operating system Ubuntu 20.04.3 LTS
  • Browser: Firefoy y Brave

Your hardware wallet details (please complete the following information):

  • Hardware wallet name: Bitbox02
  • Hardware wallet version: Bitcoin only
  • Hardware wallet firmware, bootloader, microcontroller verisons (where applicable): latest

Additional context

Device found: Unknown

An unexpected error happened. (Input error: error code: 103, message: generic error. A keypath might be invalid. Supported keypaths are: m/49'/0'/ for p2wpkh-p2sh; m/84'/0'/ for p2wpkh; m/48'/0'//2' for p2wsh multisig; m/48'/0'//1' for p2wsh-p2sh multisig; m/48'/0'/' for any supported multisig; account can be between 0' and 99'; For address keypaths, append /0/ for a receive and /1/ for a change address.)

I think these is part of the issue, i find it in the report: 3-9:1.0: Failed to open report descriptor at '/sys/devices/pci0000:00/0000:00:14.0/usb3/3-9/3-9:1.0/report_descriptor': No such file or directory

I can receive but I cant spent. Ićant understand that becouse I can do that with Specter. Iḿ running the btcpayserver in a testnet node.

Screenshots / Video / GIf (if applicable)

ElSadhu avatar Sep 05 '21 15:09 ElSadhu

@elchula76 when trying to spend, can you make sure that in the advanced tab Always include non-witness UTXO if available is selected?

Also since this is testned, can you provide PSBT (when signing, instead of the hardware wallet, select PSBT and at the bottom of the next page paste PSBT content)

pavlenex avatar Sep 05 '21 15:09 pavlenex

Right now I was messaging with the bitbox02 support because i have the same issue with wasabi and they found these:

https://github.com/zkSNACKs/WalletWasabi/issues/6303

May be it helps you. Sorry my poor english.

ElSadhu avatar Sep 05 '21 18:09 ElSadhu

I don't believe this is the case, on testnet we are using 84'/1'

ping @benma any issue with hwi-2.0.1 ?

NicolasDorier avatar Sep 07 '21 05:09 NicolasDorier

@elchula76 which kind of wallet is it? Segwit or Segwit P2SH? (if you don't know, share an address with us)

NicolasDorier avatar Sep 07 '21 05:09 NicolasDorier

Also in your wallet's settings, can you share us this

image

And how did you imported your wallet?

NicolasDorier avatar Sep 07 '21 06:09 NicolasDorier

The error message also indicate about 0', but we are normally using 1' as it should on testnet...

NicolasDorier avatar Sep 07 '21 06:09 NicolasDorier

@NicolasDorier there is no known issue with the BitBox02 in HWI 2.0.1.

The error message is a generic message and does not necessarily mean the keypath is wrong. @elchula76 please answer the questions above so we can get more hints.

@elchula76

If there is a way to export and post a PSBT that you can't sign, please do so (can also be from a new test wallet for privacy, but it would help a lot with debugging).

benma avatar Sep 07 '21 08:09 benma

@elchula76 which kind of wallet is it? Segwit or Segwit P2SH? (if you don't know, share an address with us)

Good morning, The wallet may be single sign segwit, there u have an adress: tb1qhejfmq3mfzgfncwdne7fwpyqx8rqxjw7dyf7j6 I am just a newby technical user (since DOS) with a lot experiences working with a lot kind of software but i never be a developer and I really dont know what kind of info I can share without compromise my privacy and security,

ElSadhu avatar Sep 07 '21 09:09 ElSadhu

@elchula76 as I mentioned, you could make a new wallet (seed) to share the seed and a PSBT with us that does not work, so we can take a look.

Also please provide this: https://github.com/btcpayserver/BTCPayServer.Vault/issues/39#issuecomment-914017622

benma avatar Sep 07 '21 09:09 benma

Can you export PSBT by doing this:

image

Then scroll down the page and copy paste here this data

image

NicolasDorier avatar Sep 07 '21 09:09 NicolasDorier

Also in your wallet's settings, can you share us this

image

And how did you imported your wallet?

Account key path: m/84'/1'/0' And how did you imported your wallet? Iḿ running a testnet core working fine with specter and my bitbox02, I do a normal import from my bitbox02, two times becouse the first time I think that i done something wrong. My specter key path with the same HW and the same procedure is m/84h/1h/0h and it work perfect.

ElSadhu avatar Sep 07 '21 09:09 ElSadhu

@elchula76 I do a normal import from my bitbox02,: You mean with the BTCPay Server Vault?

What you did seem right to me.

If you can share us https://github.com/btcpayserver/BTCPayServer.Vault/issues/39#issuecomment-914132811 I can take a look.

NicolasDorier avatar Sep 07 '21 09:09 NicolasDorier

@elchula76 as I mentioned, you could make a new wallet (seed) to share the seed and a PSBT with us that does not work, so we can take a look.

Also please provide this: #39 (comment)

Can I use the same wallet? It just a test, i m trying to learn how to create and use a store with btcpay

ElSadhu avatar Sep 07 '21 09:09 ElSadhu

yes, you can use same wallet

NicolasDorier avatar Sep 07 '21 09:09 NicolasDorier

Tell me if this is what u need

{ "fee": "0.00000178 BTC", "feeRate": "1 Sat/B", "tx": { "hash": "22488e26cc62d7d384bdff6bef747e9b11af96d1aa59799061aef27dbe9e9b86", "ver": 1, "vin_sz": 2, "vout_sz": 1, "lock_time": 0, "size": 123, "in": [ { "prev_out": { "hash": "d1e641a8c950f7aa5a6e23b2d8bff7d679668faec1ba70e5d3e35035640407c7", "n": 0 }, "scriptSig": "" }, { "prev_out": { "hash": "5e6a3aaaff6912a5199fcf7973dfe0000c6a6d10cfd3e7fb3b0bffb943ccbf7d", "n": 0 }, "scriptSig": "" } ], "out": [ { "value": "0.00012822", "scriptPubKey": "0 e9e457f78f09091f5f902d02cb5e4f5c9161ad5c" } ] }, "inputs": [ { "index": 0, "partial_signatures": {}, "non_witness_utxo": { "hash": "d1e641a8c950f7aa5a6e23b2d8bff7d679668faec1ba70e5d3e35035640407c7", "ver": 2, "vin_sz": 1, "vout_sz": 2, "lock_time": 0, "size": 223, "in": [ { "prev_out": { "hash": "2e7596e8199024e28c25da767c2002be3cae76474bb7405fdfc7b762bb7e649e", "n": 0 }, "scriptSig": "", "witness": "3045022100cf47299cd3ffbb1ac297bf3a08bef685e03deb20474a020366660e928e255a9c0220116a43f538c0d57b27da9c4f2d7608ee43b59377b7f2e70c0694484f86de627d01 02702db99130400bc4b8ebb0f90bf51a9a911a3223e280287d7b4cab945fa4c2fe", "sequence": 4294967293 } ], "out": [ { "value": "0.00003000", "scriptPubKey": "0 5e30629b00f8a75edc0b140599441c498bf97e64" }, { "value": "0.00010580", "scriptPubKey": "0 b904bc0bd17dbbdcffa3487d040becfe22452871" } ] }, "witness_utxo": { "value": "0.00003000", "scriptPubKey": "0 5e30629b00f8a75edc0b140599441c498bf97e64" }, "bip32_derivs": [ { "pubkey": "03d81090273d60898169bfb5449d45c3ceff03d4e6901ae3dabed4dde76e052a7d", "master_fingerprint": "7b8460bc", "path": "84'/1'/0'/0/0" } ], "bip32_taproot_derivs": [] }, { "index": 1, "partial_signatures": {}, "non_witness_utxo": { "hash": "5e6a3aaaff6912a5199fcf7973dfe0000c6a6d10cfd3e7fb3b0bffb943ccbf7d", "ver": 1, "vin_sz": 1, "vout_sz": 2, "lock_time": 0, "size": 223, "in": [ { "prev_out": { "hash": "6459414eaa7e3921284adcd5f99b5a6d15eb00f4c8ca0f399d8fec57386f7554", "n": 3 }, "scriptSig": "", "witness": "3045022100f0ab90aa6270397b62f8ec526bfdc047681295f746b2d869c7cafce2c14fd84602201c93d6b6770ae26d81a64c5ffc9309073f55bed56e06217937b668dc5acce2a001 03b6f33d2e61601adde985e69aee070b85ee39894e7dd4647728c2d382d8dd5c12" } ], "out": [ { "value": "0.00010000", "scriptPubKey": "0 7e654ae46f4bf0a8f409593e360d432700be242a" }, { "value": "0.00031205", "scriptPubKey": "0 3d04c0219f77693d21016c756611a6a531121fe3" } ] }, "witness_utxo": { "value": "0.00010000", "scriptPubKey": "0 7e654ae46f4bf0a8f409593e360d432700be242a" }, "bip32_derivs": [ { "pubkey": "026c4e3df013624a41640f3cdb07892a63acba802162c7862016f9a24e011bb3cb", "master_fingerprint": "7b8460bc", "path": "84'/1'/0'/0/5" } ], "bip32_taproot_derivs": [] } ], "outputs": [ { "bip32_derivs": [], "bip32_taproot_derivs": [] } ] }

ElSadhu avatar Sep 07 '21 09:09 ElSadhu

@elchula76 I do a normal import from my bitbox02,: You mean with the BTCPay Server Vault?

What you did seem right to me.

If you can share us #39 (comment) I can take a look.

You mean with the BTCPay Server Vault? Yes, with the latest version of btcpayserver vault

ElSadhu avatar Sep 07 '21 09:09 ElSadhu

@elchula76 can you copy paste not this, but scroll down and there is some base64 string that you can copy. Look the screen I show you above.

NicolasDorier avatar Sep 07 '21 09:09 NicolasDorier

These one?

cHNidP8BAHsBAAAAAscHBGQ1UOPT5XC6wa6PZnnW97/YsiNuWqr3UMmoQebRAAAAAAD/////fb/MQ7n/Czv759PPEG1qDADg33N5z58ZpRJp/6o6al4AAAAAAP////8BFjIAAAAAAAAWABQdJ+2osLpTc+uzhqEDUmQGsXYdNgAAAAAAAQEfuAsAAAAAAAAWABReMGKbAPinXtwLFAWZRBxJi/l+ZAEA3wIAAAAAAQGeZH67YrfH319At0tHdq48vgIgfHbaJYziJJAZ6JZ1LgAAAAAA/f///wK4CwAAAAAAABYAFF4wYpsA+Kde3AsUBZlEHEmL+X5kVCkAAAAAAAAWABS5BLwL0X273P+jSH0EC+z+IkUocQJIMEUCIQDPRymc0/+7GsKXvzoIvvaF4D3rIEdKAgNmZg6SjiVanAIgEWpD9TjA1Xsn2pxPLXYI7kO1k3e38ucMBpRIT4beYn0BIQJwLbmRMEALxLjrsPkL9RqakRoyI+KAKH17TKuUX6TC/gAAAAAiBgPYEJAnPWCJgWm/tUSdRcPO/wPU5pAa49q+1N3nbgUqfRh7hGC8VAAAgAEAAIAAAACAAAAAAAAAAAAAAQEfECcAAAAAAAAWABR+ZUrkb0vwqPQJWT42DUMnAL4kKgEA3wEAAAAAAQFUdW84V+yPnTkPysj0AOsVbVqb+dXcSighOX6qTkFZZAMAAAAA/////wIQJwAAAAAAABYAFH5lSuRvS/Co9AlZPjYNQycAviQq5XkAAAAAAAAWABQ9BMAhn3dpPSEBbHVmEaalMRIf4wJIMEUCIQDwq5CqYnA5e2L47FJr/cBHaBKV90ay2GnHyvziwU/YRgIgHJPWtncK4m2Bpkxf/JMJBz9VvtVuBiF5N7Zo3FrM4qABIQO28z0uYWAa3emF5pruBwuF7jmJTn3UZHcowtOC2N1cEgAAAAAiBgJsTj3wE2JKQWQPPNsHiSpjrLqAIWLHhiAW+aJOARuzyxh7hGC8VAAAgAEAAIAAAACAAAAAAAUAAAAAAA==

ElSadhu avatar Sep 07 '21 09:09 ElSadhu

yes thanks one moment please

NicolasDorier avatar Sep 07 '21 09:09 NicolasDorier

it seems to me correct PSBT. I will try to sign with another hardware wallet on btcpay, to make sure that this is not a bug from our end. If it works, then maybe some issue on bitbox2.

NicolasDorier avatar Sep 07 '21 09:09 NicolasDorier

I dont know if helps u but with specter I have these: Test | Single (Segwit) | m/84h/1h/0h; the same key path and i can send and receive transaction with the same bitbox02.

ElSadhu avatar Sep 07 '21 09:09 ElSadhu

@benma it seems his PSBT is correct. I tried to replicate the bug with a coldcard on https://testnet.demo.btcpayserver.org/ but it worked properly.

Can you take a look at it? (if you use Brave, think of removing the shield) You can probably reproduce easily.

NicolasDorier avatar Sep 07 '21 09:09 NicolasDorier

I try it with firefox to

ElSadhu avatar Sep 07 '21 09:09 ElSadhu

I try the same removing the shield and againg-.

Device found: Unknown An unexpected error happened. (Input error: error code: 103, message: generic error. A keypath might be invalid. Supported keypaths are: m/49'/0'/ for p2wpkh-p2sh; m/84'/0'/ for p2wpkh; m/48'/0'//2' for p2wsh multisig; m/48'/0'//1' for p2wsh-p2sh multisig; m/48'/0'/' for any supported multisig; account can be between 0' and 99'; For address keypaths, append /0/ for a receive and /1/ for a change address.)

ElSadhu avatar Sep 07 '21 10:09 ElSadhu

@benma it seems his PSBT is correct. I tried to replicate the bug with a coldcard on https://testnet.demo.btcpayserver.org/ but it worked properly.

Can you take a look at it? (if you use Brave, think of removing the shield) You can probably reproduce easily.

I try to test the bitbox02 at the same link but it doesnt work because the server vault dont work at these link

ElSadhu avatar Sep 07 '21 10:09 ElSadhu

@elchula76 I think this is something wrong with the bitbox02 at this point. Let's wait if @benma can repro.

NicolasDorier avatar Sep 07 '21 10:09 NicolasDorier

ok thanks, If i can help u, iḿ here working with your great work.

ElSadhu avatar Sep 07 '21 10:09 ElSadhu

@NicolasDorier I ran dotnet run -p BTCPayServer.Vault.csproj and used the test site you mentioned, but I can't get past this after accepting the connection in Vault:

Any other quick ways to test signing here?

@elchula76 can you share your mnemonic seed (if only used for testing purposes)? If not, it would be very helpful if you could make a new seed to share here, and another PSBT that fails, so I can try to figure out what is going on.

benma avatar Sep 07 '21 16:09 benma

I don't know if helps you but I use the same seed with electrum with mi bitbox02 HWW and it works fine signing the transaction. Two software signing fine at the same node with the same seed in bitbox02 (specter and electrum) and two (wasabi and btcpayserver) with exactly the same issue. If u want the seed i can send you but i dont want to do that here, i dont feel comfortably.

ElSadhu avatar Sep 07 '21 22:09 ElSadhu

@benma that's strange error, I never saw this. Do you have a stacktrace in the javascript console? You should have, if so, please copy/paste here.

I will push a new commit that at least fix the device type unknown that @elchula76 is seeing. The error you show me seems different reason so I'll fix that at same time.

btw, is it possible the problem of @elchula76 come from the PSBT not having hte non_witness_utxo filled in?

NicolasDorier avatar Sep 08 '21 02:09 NicolasDorier