spesmilo / spesmilo/electrum

new option to change inputs/outputs of loaded unsigned tx, for coinjoin

Open
#4,471 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement ✨
Dominant language
Python
Stars
8.6k
Forks
3.5k
Avg merge
2d 8h
Merged PRs (30d)
61

Description

I am trying to achieve coinjoin functionality in electrum in order to simultaneously fund a contract with a counterparty. However, it does not work and this is unfortunate, it's a very useful feature and will become much more requested with lightning channels. I have received requests for such an use case from a journalistic investigation org that uses electrum with tails:

Currently Electrum provides no way to load an unsigned transaction from file and only add inputs / outputs to it and partially sign own added inputs, while leaving the transaction not final and non-broadcastable. I know there is no standard for unsigned transactions, but at least transactions created with Electrum and loaded in Electrum should work.

I have tried a work-around for this, and added one of my addresses from a standard electrum wallet as watch only in an imported wallet, created the transaction and saved it to a file. After that, I tried to load it in the initial wallet that holds the private key of that address but the "Sign" button is disabled, I cannot sign / broadcast it.

Can we improve our transaction format so that such an use case can work? For example:

a) Alice has a standard wallet and creates a transaction in Electrum but does not sign it. She hands it over to Bob, so Bob can also fund a contract with her at the same time.

b) Bob uses Electrum but has a multisig wallet 2-of-2 with Carol. Bob loads the unsigned transaction sent by Alice, adds his own inputs (increasing one output created by Alice, and , if change required, adds more outputs as well) and signs the transaction.

b.1) Bob sends to his cosigner Carol so that his inputs become spendable. Carol signs, and sends back to Bob.

c) Bob sends the half-signed transaction back to Alice, which appends her signature for her initial inputs, making the transaction final and broadcastable.

Step b.1 may not be required din all cases, if Bob would be using a standard wallet too, but it should be supported.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the described flow: load an unsigned transaction, add inputs and outputs, and check why the Sign action is disabled. Use the issue's Alice/Bob/Carol scenario as the acceptance case; done means Electrum-created unsigned transactions can be extended, partially signed, returned for remaining signatures, and left non-broadcastable until final.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
blockchain
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.