Sjors / libwally-swift

Swift wrapper for LibWally, a collection of useful primitives for cryptocurrency wallets
MIT License
40 stars 18 forks source link

`PSBT.sign(privKey)` seems to only work on multisig transactions #30

Closed Fonta1n3 closed 4 years ago

Fonta1n3 commented 4 years ago

I may be doing it wrong but I am using the PSBT.sign(privKey) function for multi-sig transactions and it works every time. However for single sig transactions I have to fall back to the the traditional way of signing raw transactions. I would very much like to enable users to be able to scan any PSBT and have the app sign it if it can.

Just curious if this is by design or if I am doing something wrong here?

EDIT: To clarify when I say it does not work what I mean is the PSBT will never be finalized or complete, it may actually be signing but the finalization/completion never returns true. I have confirmed with certainty the private key I am trying to use to sign is the correct private key and that there is only one input to sign.

Sjors commented 4 years ago

I haven't tried to use PSBT with a single signature, so this could very well be a bug. First step would be to add a test case.

Sjors commented 4 years ago

See #31 for a demonstration of the problem, thanks @Fonta1n3

Fonta1n3 commented 4 years ago

I can confirm this is not happening anymore.