Skip to content
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

I cant sign with my bitbox02 #39

Open
ElSadhu opened this issue Sep 5, 2021 · 37 comments
Open

I cant sign with my bitbox02 #39

ElSadhu opened this issue Sep 5, 2021 · 37 comments

Comments

@ElSadhu
Copy link

ElSadhu commented Sep 5, 2021

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)

@pavlenex
Copy link
Contributor

pavlenex commented Sep 5, 2021

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

@ElSadhu
Copy link
Author

ElSadhu commented Sep 5, 2021

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

WalletWasabi/WalletWasabi#6303

May be it helps you. Sorry my poor english.

@NicolasDorier
Copy link
Member

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
Copy link
Member

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

@NicolasDorier
Copy link
Member

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

image

And how did you imported your wallet?

@NicolasDorier
Copy link
Member

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

@benma
Copy link

benma commented Sep 7, 2021

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

@ElSadhu
Copy link
Author

ElSadhu commented Sep 7, 2021

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

@benma
Copy link

benma commented Sep 7, 2021

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

@NicolasDorier
Copy link
Member

NicolasDorier commented Sep 7, 2021

Can you export PSBT by doing this:

image

Then scroll down the page and copy paste here this data

image

@ElSadhu
Copy link
Author

ElSadhu commented Sep 7, 2021

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.

@NicolasDorier
Copy link
Member

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

@ElSadhu
Copy link
Author

ElSadhu commented Sep 7, 2021

@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

@NicolasDorier
Copy link
Member

yes, you can use same wallet

@ElSadhu
Copy link
Author

ElSadhu commented Sep 7, 2021

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
Copy link
Author

ElSadhu commented Sep 7, 2021

@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

@NicolasDorier
Copy link
Member

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

@ElSadhu
Copy link
Author

ElSadhu commented Sep 7, 2021

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==

@NicolasDorier
Copy link
Member

yes thanks one moment please

@NicolasDorier
Copy link
Member

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.

@ElSadhu
Copy link
Author

ElSadhu commented Sep 7, 2021

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.

@NicolasDorier
Copy link
Member

NicolasDorier commented Sep 7, 2021

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

@ElSadhu
Copy link
Author

ElSadhu commented Sep 7, 2021

I try it with firefox to

@ElSadhu
Copy link
Author

ElSadhu commented Sep 7, 2021

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
Copy link
Author

ElSadhu commented Sep 7, 2021

@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

@NicolasDorier
Copy link
Member

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

@ElSadhu
Copy link
Author

ElSadhu commented Sep 7, 2021

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

@benma
Copy link

benma commented Sep 7, 2021

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

@ElSadhu
Copy link
Author

ElSadhu commented Sep 7, 2021

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.

@NicolasDorier
Copy link
Member

NicolasDorier commented Sep 8, 2021

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

@ElSadhu
Copy link
Author

ElSadhu commented Sep 8, 2021

Good morning, I was trying to get my wasabi wallet with electrum thats work fine doing the same to get the btcpar wallet, but when i try I have these diference with the key path and if I try to change it it doesnt work and I have these error... may be it helps to undestand what happend... If some one of you give me an email adress I send u the seed. thanks.
photo_2021-09-08_10-38-12
photo_2021-09-08_10-38-20

@ElSadhu
Copy link
Author

ElSadhu commented Sep 8, 2021

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

I always filled the box of non_witness_utxo, but i never try to sign the transaction with PSBT, I really dont know how it works and I dont know if bitbox02 can... I will try.

@benma
Copy link

benma commented Sep 10, 2021

@NicolasDorier I added a testnet bitbox02 wallet, received some coins, made a tx, and I can reproduce the same error.

However, when I copy the generated PSBT and run it on the command line like this:

hwi --chain test -t bitbox02 signtx <PSBT>

The transaction is displayed on the device and can be signed normally.

This means that somehow BTCPayServer.Vault is invoking HWI in the wrong way (maybe missing the --chain test param or something like that?), or that the PSBT created for the HW wallet is different from the one when choosing to export the PSBT. Unfortunately the log output does not show the exact HWI command invoked when signing.

@benma
Copy link

benma commented Sep 16, 2021

@NicolasDorier did you get a chance to take a look? As mentioned, the exported PSBT and everything on the HWI side seems okay.

@NicolasDorier
Copy link
Member

sorry about this, I forgot this. I'll need to try, but my bitbox2 is at the office. I'll try to get it monday and repro.

@NicolasDorier
Copy link
Member

NicolasDorier commented Oct 1, 2021

@elchula76 if can you DM me on https://chat.btcpayserver.org/ so I don't drop the ball?

@ElSadhu
Copy link
Author

ElSadhu commented Oct 12, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants