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

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

Open
gits7r opened this issue Jun 28, 2018 · 5 comments
Open

Comments

@gits7r
Copy link

gits7r commented Jun 28, 2018

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.

@SomberNight
Copy link
Member

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.

This is known not to work in past releases (#2897) but should work on master. What version did you use to test?

adds his own inputs (increasing one output created by Alice, and , if change required, adds more outputs as well)

indeed this is currently not supported

@gits7r
Copy link
Author

gits7r commented Jun 28, 2018

I have used the latest version 3.1.3 and it does not recognize own private keys for both standard wallets as well as multisig wallets. For example, I import a transaction that spends from a P2SH multisig 2 out of 2 address. I import it in a wallet that is the first cosigner of the 2 required, and it does not recognize that it can at least partially sign. Standard non multisig wallet will not work and behave the same, the sign button cannot be pressed even the private key is in the wallet.

@SomberNight
Copy link
Member

Yes, as I said this only works on master. There will be a 3.2.0 release soon that has it.

@gits7r
Copy link
Author

gits7r commented Jun 28, 2018

Oh, okay git master -- thought you were referring to latest release tag.

What about adding a feature to add inputs / outputs to created but unsigned / partially signed transaction (that either belongs to our wallet or not). Something like "extend transaction". Like I said, I do know that there is no standard for this yet, but it could be a long time until there will be one - maybe there will never be. Until then, we should at least support it from electrum to electrum, and when / if a standard will show up we will adapt it. We can maintain even backwards compatibility by encoding a 'extend transaction protocol number' so that electrum knows how to interpret it. This will ensure Electrum's leading position in the ecosystem. Simultaneous funding by different people is needed for services that provide liquidity for lightning channels and much more other things.

@SomberNight SomberNight changed the title wallet does not recognize his own private keys when unsigned tx is loaded from file new option to change inputs/outputs of loaded unsigned tx, for coinjoin Jun 30, 2018
@gits7r
Copy link
Author

gits7r commented Jul 7, 2018

As soon as I learn about #4514 I will draft a proposal to implement this -- there is high demand for this feature.

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

2 participants