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

Import signature (qr) hangs at 100%, testnet #48

Open
ghscuuo opened this issue Mar 2, 2024 · 7 comments
Open

Import signature (qr) hangs at 100%, testnet #48

ghscuuo opened this issue Mar 2, 2024 · 7 comments

Comments

@ghscuuo
Copy link

ghscuuo commented Mar 2, 2024

Just practicing, trying to set up an old phone as a completely offline signing device for utxo consolidation.

Testnet

Offline phone: old disposable Pixel 3a, LineageOS 21, Android 14, Samourai 0.99.98i, installed by apk over usb, never online, no transactions, no utxos.

Online phone: old disposable Pixel (1), Nunchuk Version 1.9.40 (223), LineageOS 21, Android 14 (also happens on my daily driver Pixel 7a, Nunchuk Version 1.9.41 (225), Android 14). Pretty much all defaults settings, not trying to be fancy yet.

On offline phone, samourai, testnet, enter my 12 words, export vpub.

On online phone, nunchuk, testnet, import vpub as new wallet, m/84h/1h/0h, Standard wallet, Native segit, Force refresh, see transactions/utxos.

On online phone, nunchuk, pull new tb1q receive address, select couple tb1q utxos, send to receive address, Sign, Export transaction, via QR.

On offline phone, samourai, Sign transaction, scan online qr, Sign transaction, green check.

On online phone, nunchuk, Import signature, scan offline phone qr, nunchuk increments nicely then says 100%, then just hangs there with camera on.

Had enabled debug mode, but custom_log.txt is 0 byte.

How can I help? Is this workflow unsupported?

@ghscuuo
Copy link
Author

ghscuuo commented Mar 2, 2024

Let me add, I love nunchuk, it is the only wallet that has all the features I need (testnet, taproot, apk, my entropy/seed words), and I wish I could use nunchuk for my offline phone as well, but that didn't work either. Nunchuk offline, never online, with no transaction history, no utxos, won’t sign anything. It says green tx imported, but leaves nothing visible to sign. (If I recall correctly, if I connect the offline phone online briefly, for nunchuk to Force refresh sync tx history, it works, but only once per online-tx sync. But I want my offline phone to never be online, much like a traditional hardware wallet signing device.)

I should probably submit that as the main issue (because that would give me better taproot support, I think), but I'm guessing that that is a much more difficult issue to troubleshoot, fix, and maintain--let me know...

@ghscuuo
Copy link
Author

ghscuuo commented Mar 4, 2024

This worked:

Offline phone: old disposable Pixel 3a, LineageOS 21, Android 14. Latest versions of Samourai 0.99.98i and Nunchuk 1.9.40, installed by verified apk over usb, never online, no transactions, no utxos.

Online phone: old disposable Pixel (1), LineageOS 21, Android 14. Latest versions of Sentinel 5.0.1 and Nunchuk Version 1.9.40, installed by verified apk over usb.

Summary workflow: testnet, android

  1. Use offline Samourai to export zpub to online Sentinel
  2. Use offline Nunchuk to export wallet config to online Nunchuk
  3. Use online Nunchuk to build unsigned transaction from utxos
  4. Use offline Samourai to sign tx
  5. Use online Sentinel to broadcast signed tx

Use offline Samourai to export zpub to online Sentinel

On offline phone, install verified Samourai apk, launch, select TESTNET, OK, Yes, no tor. Restoring an existing wallet, external wallet, enter my 12 testnet words. Tap Samourai icon in top left, Settings, Wallet, Show Segwit ZPUB, see Segwit ZPUB static QR code (on testnet, zpubs start with “vpub”).

On online phone, install Sentinel from verified apk, open Sentinel, Choose network, Testnet. Connect to Samourai’s server, Connect through Tor?, No. Requesting notification permission, NO. NEW, Requesting camera permission, YES, While using the app, scan offline phone Samourai Segwit ZPUB static QR code. A funky workflow here: on Select Collection page, tap Create new collection, Public key label, in Label text box, type a name for your wallet, tap SAVE. You’ll see your new watch-only wallet name, with a 0 balance on the left, and “BIP84” on the right. Now above that new wallet that you named, is a “Collection Name” line text field; tap that and type a Collection Name, like “testnet”, then tap the checkmark in the top right. You should now see your app name at the top right, “Sentinel | TestNet” (note the CamelCase capitalization), with your full app balance, with your Collection name “testnet” below with that collection’s balance. Tap that collection name, and see all of your collection transactions, and your watch-only wallet name as a tab. Tap that watch-only wallet name tab, to see the transactions for that specific watch-only wallet. Tap the 3-dot menu at the top right, to View Unspent Outputs (utxos). Sadly, you cannot initiate a spend with those utxos.

Use offline Nunchuk to export wallet config to online Nunchuk

On offline phone, install verified Nunchuk apk, launch, Profile, Network settings, Testnet, restart app. Keys, +, Add software key, Recover existing seed, type in 12 words. Wallets, +, Create new wallet, enter name, leave defaults, Continue. Configure wallet, Assign key to the wallet, tap the checkbox, leave defaults, Continue. Review wallet, Single-sig, Standard wallet, Native segwit, Member keys, note XFP 8-digit hexadecimal fingerprint, note BIP32 path: m/84h/1h/0h. Continue. Please save your BSMS file…I’ll do this later, when it’s real. Home, see Wallet and Key. Wallet, tap View wallet config, 3 dot menu, Export wallet configuration, QR code, see animated QR code.

On online phone, Nunchuk, testnet (restart), Wallets, +, Recover existing wallet, Recover via QR code, scan offline phone animated QR. See very quick yellow “Invalid QR” warning; and then a green notice, I think. Enter Wallet name, tap Continue. See Wallet config, Single-sig, Standard waller, Native segwit, Member keys, “import”, “Unknown”, XFP hex code, should match your offline wallet, BIP32 path should also be m/84h/1h/0h. Tap Done, X to close. On Home page, see your wallet, You have no keys yet. In a few seconds, you’ll see your online balance. Tap your wallet, see your balance and Recent transactions.

Use online Nunchuk to build unsigned transaction from utxos

On online phone, Nunchuk, Tap Receive, Copy address, X to close. Tap View coins, tap Select, Select coins to consolidate (or just to test), in lower left of Select coins page, tap “B->” icon. Tap “Send all selected” (or enter a few sats to test), Continue. In Enter or scan the recipient’s address, paste the receiving address you copied earlier, tap Create transaction. See Transaction details, pink Pending signatures. Tap Sign, Export transaction, Export via QR, see animated QR code.

Use offline Samourai to sign tx

On offline phone, still in Nunchuck, was still showing animated QR code from before, tap Done scanning, Done; I wish I could get it to sign, but I couldn’t. Instead, open Samourai, tap Samourai icon at the top left, Tools, Sign transaction, scan online Nunchuk animated qr code, Sign transaction, see green check, see Sign transaction animated qr code.

Use online Sentinel to broadcast signed tx

Sadly, on online phone, Nunchuk fails to complete the Import signature step; the QR code import hangs at “100%" with camera on. So, instead, open Sentinel, main Sentinel | TestNet page, 3-dot menu, Broadcast transaction, SCAN. Scan offline phone Samourai animated QR. On online phone, Sentinel, tap green BROADCAST TRANSACTION, see Broadcast Successful, big green circle with white checkmark; tap above that to clear. On Sentinel | TestNet page, tap your “testnet” collection. Pull down on the Sentinel screen to refresh. In a minute or two, see the yellow “Pending” indicator. See your new transaction with current timestamp and up “sent” arrow, with small negative amount (a well-known oddity of sending to your same wallet, only the miner fees are reported; you can tap that transaction, see Transaction Details, can top the compass at the top right or the “OPEN IN EXPLORER” button at the very bottom to see your transaction on testnet chain. In Sentinel, tap into your wallet, tap 3-dot menu, View Unspent Outputs, see your new utxo at the new wallet address. Eventually, after a seemingly very long time, Sentinel eventually moves out of Pending state. Confirm: on online phone, open Nunchuk, in your wallet, Recent transactions, see purple “Pending confirmation”; after a few minutes, that changes to 1 confirmations and so on.

“It's Only Weird if it Doesn't Work”

Details available upon request. /jk

@hugohn
Copy link
Contributor

hugohn commented Mar 5, 2024

Are you exporting the (signed) PSBT QR from Samourai to Nunchuk?

If so, import PSBT probably failed because it doesn't understand the QR encoding used by Samourai. We use standard QR encoding supported by wallets such as SeedSigner, Jade, Passport, etc.

@ghscuuo
Copy link
Author

ghscuuo commented Mar 5, 2024

Yes, I tried exporting the (signed) PSBT QR from Samourai to Nunchuk, only out of desperation. (But that failed, so I instead successfully exported the offline-Samourai-signed transaction to online Sentinel to broadcast, which works fine.)

Yes, I wish I could just send Nunchuk-standard QR codes back-and-forth between offline signing wallet Nunchuk and online watch-only transaction-building Nunchuk.

I wish I could get offline Nunchuk, with key, with no transaction history/utxos, to Import transaction, Import via QR code from online watch-only Nunchuk, offline-sign the imported transaction, then export the signed transaction back to online watch-only Nunchuk to broadcast. Samourai+Sentinel handles that fine, not sure why Nunchuk doesn't.

As I was typing that last sentence, and replicating it on my offline phone, I notice, in offline Nunchuk, tap wallet, 3-dot menu, Import transaction, Import via QR, the scanner camera page says at the top, "Import signature" -- importing a signature at that point seems pre-mature? Shouldn't it be requesting to import the unsigned transaction?

@ghscuuo
Copy link
Author

ghscuuo commented Mar 5, 2024

Additional info:

Can send to taproot

Sending from Native segwit (m/84h/1h/0h) (tb1q addresses) to Taproot (m/86h/1h/0h) tb1p addresses works with the above workflow, but only if I export the offline Nunchuk taproot wallet config via BSMS file over usb, not QR, to the online watch-only Nunchuk. See #49 "testnet taproot Export wallet configuration via QR is incorrect, via BSMS file works fine"

Cannot send from taproot to taproot

...with Nunchuk as it is currently structured, sadly :(

@ghscuuo
Copy link
Author

ghscuuo commented Mar 6, 2024

This worked:

Offline signing device: old disposable Chromebook reflashed, converted to regular laptop, Tails 6.0 via sd card, Sparrow 1.8.2 from deb over sd card, never online, no transactions, no utxos.

Online watch-only phone: old disposable Pixel (1), LineageOS 21, Android 14. Nunchuk 1.9.40 (223), installed by verified apk over usb, no keys.

Summary workflow: testnet, tails/android, all by QR codes

  1. Use offline Sparrow to export Native Segwit (P2WPKH), or Taproot (P2TR), xpub to watch-only online Nunchuk.
  2. Use online Nunchuk to build unsigned transaction from utxos.
  3. Use offline Sparrow to sign transaction.
  4. Use online Nunchuk to broadcast signed tx.

Shame I can't use Nunchuk as my fully offline, never online, signing device on my old phone :( That would be much more convenient than using the Chromebook.

@ghscuuo
Copy link
Author

ghscuuo commented Mar 19, 2024

Another set of bugs here, I think, let me know if I should open a new issue(s) for this:

Nunchuk 1.9.40 (223) on LineageOS 21, Android 14 "March 3, 2024", on old Google Pixel (1).

On offline mainnet Sparrow, generate taproot wallet , Single sig, m/86'/0'/0', Taproot (P2TR). On Settings tab, Script Policy, incorrectly (see below) click Descriptor qr code button, export qr code, see displayed qr code.

On online mainnet Nunchuk, tap Wallet +, Recover existing wallet, scan the incorrect offline Sparrow "Script Polcy: Descriptor" qr code. The qr import seems to work properly, no human-visible warnings or errors apparent (but messages on the bottom flash quickly and step on each other, so maybe something was shown down there). Wallet seems to be fine, no indication of any problem, but I notice the first transaction is bc1q, should be bc1p. So the qr import was flawed in some way, the wallet should never have been created at all. (See elsewhere in other Nunchuk issue my comments that the BSMS file works fine.)

Another bug: So now I want to delete that bad wallet, but I can't. When I tap View wallet config, nunchuk crashes.

For the record, the correct way to export xpub from Sparrow to Nunchuk, is to, on Sparrow, in the taproot mainnet wallet, click File, Export wallet, Specter Desktop, Show..., and import that qr code in Nunchuk. That creates an apparently good functioning Nunchuk watch-only wallet, but I haven't yet proved that by sending funds into and out of that wallet.

Let me know how I can help. "Go away" is acceptable. :)

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

2 participants