sparrowwallet / sparrow

Desktop Bitcoin Wallet focused on security and privacy. Free and open source.
https://sparrowwallet.com/
Apache License 2.0
1.32k stars 188 forks source link

Unable to sign transaction on Taproot wallet #311

Closed maxtannahill closed 2 years ago

maxtannahill commented 2 years ago

Wallet type: Single signature Script Type: Taproot (P2TR) Script Policy: BIP39 Derivation: m/86'/0'/0' Passphrase: Yes OS: macOS (Monterey)

Steps to reproduce:

1) New wallet created and funded 2) Selected confirmed UTXO from UTXOs tab. 3) Tried spending to bech32 and bech32m address 4) Transaction created 5) Signing prompt for password displayed, password entered, tx remains in unsigned state.

Log here:

2021-11-14 15:22:45,957 ERROR [JavaFX Application Thread] c.s.s.MainApp [null:-1] Exception in thread "JavaFX Application Thread"
java.lang.NoClassDefFoundError: Could not initialize class org.bitcoin.Secp256k1Context
    at com.sparrowwallet.drongo/com.sparrowwallet.drongo.crypto.ECKey.signSchnorr(Unknown Source)
    at com.sparrowwallet.drongo/com.sparrowwallet.drongo.psbt.PSBTInput.sign(Unknown Source)
    at com.sparrowwallet.drongo/com.sparrowwallet.drongo.wallet.Wallet.sign(Unknown Source)
    at com.sparrowwallet.sparrow/com.sparrowwallet.sparrow.transaction.HeadersController.signUnencryptedKeystores(Unknown Source)
    at com.sparrowwallet.sparrow/com.sparrowwallet.sparrow.transaction.HeadersController.lambda$signSoftwareKeystores$18(Unknown Source)
    at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(Unknown Source)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
    at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(Unknown Source)
    at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(Unknown Source)
    at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(Unknown Source)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(Unknown Source)
    at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(Unknown Source)
    at javafx.base/javafx.event.Event.fireEvent(Unknown Source)
    at javafx.graphics/javafx.concurrent.EventHelper.fireEvent(Unknown Source)
    at javafx.graphics/javafx.concurrent.Service.fireEvent(Unknown Source)
    at javafx.graphics/javafx.concurrent.Service.lambda$new$4(Unknown Source)
    at javafx.base/com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(Unknown Source)
    at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
    at javafx.base/javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(Unknown Source)
    at javafx.base/javafx.beans.property.ObjectPropertyBase.markInvalid(Unknown Source)
    at javafx.base/javafx.beans.property.ObjectPropertyBase$Listener.invalidated(Unknown Source)
    at javafx.base/com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(Unknown Source)
    at javafx.base/com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(Unknown Source)
    at javafx.base/javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(Unknown Source)
    at javafx.base/javafx.beans.property.ObjectPropertyBase.markInvalid(Unknown Source)
    at javafx.base/javafx.beans.property.ObjectPropertyBase.set(Unknown Source)
    at javafx.graphics/javafx.concurrent.Task.setState(Unknown Source)
    at javafx.graphics/javafx.concurrent.Task$TaskCallable.lambda$call$1(Unknown Source)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknown Source)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
maxtannahill commented 2 years ago

Works on PopOS

craigraw commented 2 years ago

Thanks Max. Could you try running Sparrow in debug mode? On OSX this is easiest with

open /Applications/Sparrow.app --args -l DEBUG

There will be a lot of logging, but the particular log line I'm looking for is Error loading libsecp256k1 library - particularly the stacktraces and causes beneath it. You may get it when you try to sign a Taproot transaction. Alternatively, keep an eye out for an UnsatisfiedLinkError - my hypothesis is that the libsecp256k1.dylib library is not linking correctly on Monterey and thus failing to load.

craigraw commented 2 years ago

The libsecp256k1 libraries for OSX and Linux have been updated in https://github.com/sparrowwallet/drongo/commit/3a061cb73ae318fcbe7ea1dcb0b670e78803d9fa

It is possible to run Sparrow from source (see the project README for instructions) to check if it resolves the issue?

maxtannahill commented 2 years ago

This is now fixed in 1.5.3-beta1

Thank you!