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

Trezor One cannot sign tx that has external pre-signed inputs #8910

Closed
SomberNight opened this issue Feb 23, 2024 · 3 comments
Closed

Trezor One cannot sign tx that has external pre-signed inputs #8910

SomberNight opened this issue Feb 23, 2024 · 3 comments

Comments

@SomberNight
Copy link
Member

Consider two standard (singlesig) wallets trying to do a coinjoin.
If the last signer is a Trezor One, it raises RuntimeError('ProcessError: Unverifiable external input.').

Example steps for manual coinjoin:

  1. wallet1 creates unsigned tx1, paying itself (e.g. 1 input, 2 outputs)
  2. in wallet1, go to tx Preview. Share>"Include SLIP-19 ownership proofs"
    • this step is optional, might be needed depending on the requirements of wallet2 (namely if it is a Trezor)
  3. in wallet1, tx dialog, Share>"Copy to clipboard"
    • let's call the exported tx "psbt1"
  4. wallet2 creates unsigned tx2, paying itself (e.g. 1 input, 2 outputs)
  5. in wallet2, go to tx Preview. Combine>"Join inputs/outputs", paste psbt1.
    • now the tx preview dialog shows a new tx, "tx3", which has 2 inputs and 4 outputs
  6. in wallet2 still, tx dialog, now you can click "Sign"
    • the inputs of tx3 that are owned by wallet2 will be signed now
  7. in wallet2 still, tx dialog, click Share>"Copy to clipboard"
    • let's call the exported tx "psbt2"
  8. in wallet1, menubar>Tools>"Load transaction">"From text". paste psbt2.
  9. in wallet1, tx dialog, now you can click "Sign"
    • the inputs of tx3 that are owned by wallet1 will be signed now
  10. tx3 is now fully signed and you can broadcast it

  • If wallet1 uses a Trezor One (fw 1.12.1), e.g. with p2wpkh scripts, it will raise on step 9: RuntimeError('ProcessError: Unverifiable external input.').
    • wallet2 could be a software wallet with p2wpkh scripts, or a Trezor T, does not matter
  • If wallet1 uses a Trezor T, and wallet2 uses a Trezor One, no errors
  • If wallet1 uses a Trezor Safe 3, and wallet2 uses a Trezor T, no errors
  • If wallet1 uses a Trezor T, and wallet2 uses a Trezor Safe 3, no errors

It looks like the Trezor One is refusing to sign a tx with external pre-signed inputs. The other trezor models work however.
@matejcik any idea?


originally reported at #8871 (comment) by @hynek-jina
related #8324

@matejcik
Copy link
Contributor

Trezor One has limited support for EXTERNAL features. Only ownership proofs are accepted and only for segwit/taproot inputs. Pre-signed inputs are not supported.

cc also @andrewkozlik

@SomberNight
Copy link
Member Author

SomberNight commented Feb 23, 2024

I see. Thanks.
So the trick is that wallet2 needs to also add ownership proofs besides signing their own inputs.
To do this though, 85ea2df is needed. (EDIT: or actually, if you add the proofs before signing, the commit is not needed)


Modified steps from OP:

  1. wallet1 creates unsigned tx1, paying itself (e.g. 1 input, 2 outputs)
  2. in wallet1, go to tx Preview. Share>"Include SLIP-19 ownership proofs"
    • this step is optional, might be needed depending on the requirements of wallet2 (namely if it is a Trezor)
  3. in wallet1, tx dialog, Share>"Copy to clipboard"
    • let's call the exported tx "psbt1"
  4. wallet2 creates unsigned tx2, paying itself (e.g. 1 input, 2 outputs)
  5. in wallet2, go to tx Preview. Combine>"Join inputs/outputs", paste psbt1.
    • now the tx preview dialog shows a new tx, "tx3", which has 2 inputs and 4 outputs
  6. [[[NEW]]] in wallet2 still, tx dialog. Share>"Include SLIP-19 ownership proofs"
    • this step is optional, might be needed depending on the requirements of wallet1 (namely if it is a Trezor model One)
    • note: before 85ea2df, the proofs should be added before signing the tx. After that commit, the order does not matter.
  7. in wallet2 still, tx dialog, now you can click "Sign"
    • the inputs of tx3 that are owned by wallet2 will be signed now
  8. in wallet2 still, tx dialog, click Share>"Copy to clipboard"
    • let's call the exported tx "psbt2"
  9. in wallet1, menubar>Tools>"Load transaction">"From text". paste psbt2.
  10. in wallet1, tx dialog, now you can click "Sign"
    • the inputs of tx3 that are owned by wallet1 will be signed now
  11. tx3 is now fully signed and you can broadcast it

@SomberNight SomberNight added this to the 4.5.4 milestone Feb 23, 2024
@hynek-jina
Copy link

Now it works even for Trezor One, thank you! 🙏

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

No branches or pull requests

4 participants
@matejcik @hynek-jina @SomberNight and others