-
Notifications
You must be signed in to change notification settings - Fork 29
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
Embit doesn't sign a PSBT input without fingerprint #41
Comments
@stepansnigirev what is your opinion on this? There is any workaround to sign a PSBT input without fingerprint? |
One option would be to go through all bip32 derivations in psbt and replace 00000000 fingerprint with the root fingerprint you want to sign with. Then it should sign. But generally I think it's better if you set master fingerprint to sparrow. |
And this is not a "bad behavior of embit code". It is invalid use of psbt fields. |
Thx for the response! I will investigate further, but I don't think that going to all bip32 derivations is really necessary, I don't know how Sparrow and BlueWallet does this, but both can sign a PSBT that has input(s) without a fingerprint. If this is what is expected from Embit code I will close the issue. |
I've created a Sparrow Watch Only Wallet on the
testnet
with the default Master fingerprint =00000000
(8 zeros)Then created a simple transaction and copied the PSBT as Base64 (you can use https://bip174.org/ to see the Inputs, Outputs and values in a human readable way 😄) :
Finally I tried to sign the PSBT input with the fingerprint
00000000
, but because fingerprint doesn't match, Embit didn't try to sign, even if the key can sign. As seen onpsbt.py
: https://github.com/diybitcoinhardware/embit/blob/master/src/embit/psbt.py#L898Then I place the Master fingerprint accordingly
e0c595c5
, and now Embit sign the PSBT:Why this is bad? It is important because the Master fingerprint information is not relevant for the signing process, I know lots of tutorials that only teach to stores the XPUB and derivation path info for a Watch Only wallet. Electrum on Android doesn't even show to the user the Master fingerprint of the wallet.
BlueWallet also uses the
00000000
fingerprint as default to Watch Only wallets, and you only see this info if you enable theAdvanced Mode
in Settings > General (and you can't change the master fingerprint value, even if it is00000000
):Here is what Sparrow says about the Master fingerprint
![image](https://user-images.githubusercontent.com/5518496/218555398-27c7c3a3-a38f-4c8a-aa2d-d186e3668177.png)
The master fingerprint uniquely identifies this keystore using first 4 bytes of the master public key hash. It is safe to use any valid value (00000000) for Watch Only Wallets
:And here is the sequence that shows this bad behavior on Embit code:
The text was updated successfully, but these errors were encountered: