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-export PSBT transactions #175

Merged
merged 8 commits into from Jun 28, 2020
Merged

Import-export PSBT transactions #175

merged 8 commits into from Jun 28, 2020

Conversation

stepansnigirev
Copy link
Collaborator

@stepansnigirev stepansnigirev commented Jun 27, 2020

This PR makes possible cooperative multisig signing.

Now if multiple people are holding the keys and using their own specters they can share partially signed transactions with each other.

Changes:

  • adds a new "Import" tab in send menu where user can enter PSBT transaction received from someone else
    • parses and automatically detects the destination address and amount
    • checks what device already signed this transaction based on partial signatures present in the psbt
    • saves psbt transaction as pending
  • updates raw psbt textarea field in the transaction details when a new signature is acquired
  • checks the checkbox of the device that added the last signature
  • fixes "delete transaction" action from the pending transaction screen
  • detects signed devices from psbt itself, so correctly calculates signed devices and number of signatures now

The flow then is:

  • Creator makes a transaction, optionally signs it and sends to all participants of the multisig setup
  • Everybody signs and sends back signed transactions
  • Creator or anyone else can use "Paste signed PSBT" button to finalize transaction

@stepansnigirev stepansnigirev changed the title update raw psbt values for export Import-export PSBT transactions Jun 27, 2020
@stepansnigirev
Copy link
Collaborator Author

Added import of the external PSBTs, updated the description above.

Copy link
Contributor

@ben-kaufman ben-kaufman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it a bit, works great, just needs to make sure if an error arises there should be flashed an error message instead of the error screen (I marked this in comment).

@@ -582,6 +588,12 @@ def wallet_send(wallet_alias):
return render_template("wallet/send/sign/wallet_send_sign_psbt.jinja", psbt=psbt, label=label,
wallet_alias=wallet_alias, wallet=wallet,
specter=app.specter, rand=rand)
elif action == "importpsbt":
b64psbt = request.form["rawpsbt"]
psbt = wallet.importpsbt(b64psbt)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add try/ except to catch errors...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated!

@stepansnigirev stepansnigirev merged commit f9fdec5 into cryptoadvance:master Jun 28, 2020
@stepansnigirev stepansnigirev deleted the export-psbt branch July 2, 2020 10:16
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

Successfully merging this pull request may close these issues.

None yet

2 participants