Pages:
Author

Topic: How to import 2-of-3 multi-sig keys to Electrum wallet? (Read 503 times)

sr. member
Activity: 856
Merit: 422
@100bitcoin
Coding Enthusiast's Feature Request is being discussed in GitHub, give it a month, BCD's price isn't going anywhere record-breaking anyways.
More than a month has gone by since the feature was requested. I dont see anything other than a single comment on the post. Am I missing something?

Things like that are not considered high priority and as a developer you are sometimes busy with other things that may be more important, so sometimes certain requests go at the bottom of your TODO list.

They are probably still discussing it. But, my issue has been resolved through a hack suggested by someone else.

Details: https://bitcointalksearch.org/topic/m.52879552

I'll never use anything other than a legacy address ever again.
legendary
Activity: 1039
Merit: 2783
Bitcoin and C♯ Enthusiast
@100bitcoin
Coding Enthusiast's Feature Request is being discussed in GitHub, give it a month, BCD's price isn't going anywhere record-breaking anyways.
More than a month has gone by since the feature was requested. I dont see anything other than a single comment on the post. Am I missing something?

Things like that are not considered high priority and as a developer you are sometimes busy with other things that may be more important, so sometimes certain requests go at the bottom of your TODO list.
legendary
Activity: 3570
Merit: 1560
It's open source software coded by volunteers and given away for free. If you want to speed things up offer a bounty to the developers or code it yourself.
sr. member
Activity: 856
Merit: 422
@100bitcoin
Coding Enthusiast's Feature Request is being discussed in GitHub, give it a month, BCD's price isn't going anywhere record-breaking anyways.
More than a month has gone by since the feature was requested. I dont see anything other than a single comment on the post. Am I missing something?
legendary
Activity: 2338
Merit: 5297
Self-proclaimed Genius
@100bitcoin
Coding Enthusiast's Feature Request is being discussed in GitHub, give it a month, BCD's price isn't going anywhere record-breaking anyways.
Or find a legitimate BitcoinDiamond Qt/Core wallet and use 'addmultisig' command which will include the redeem script to the wallet and manually create the raw transaction.

What exactly are you trying to achieve here? Private keys from your multi-sig are enough to import it to Electrum BCD and get the fork coin and transfer it to a new multisig wallet.
He previously stated that he only got the Private keys for the consignees not xpub/xprv/seed.
Electrum currently doesn't have any options on importing multisig address using public keys or private keys (including the redeem script) like "addmultisig" of BitcoinCore.
legendary
Activity: 3402
Merit: 10424
as far as i can tell coinb.in only supports single signature transaction signing.
I regularly sign multisig transactions using https://coinb.in/#sign. Only unsigned rawtx in HEX format and any 2 private keys are the requirement. In fact, I have successfully signed BCH, BSV, BTG transactions for this same multisig address using respective Coinb.in fork. Unfortunately, BCD does not have a Coinb.in fork. Hence, the BCD fork of my coins on the multisig wallet have got stuck. Cry
how do you create that raw unsigned transaction hex? specifically does it have anything in its scriptsig or is it empty? you can use https://www.blockchain.com/btc/decode-tx to decode and see if its scriptsig is empty or contains the redeem script already. that may be the reason why you could do it.

Creation of raw unsigned transaction hex using https://coinb.in/#newTransaction requires Redeem Script for MultiSig. I already said it here...

No. You dont need the redeem script to sign. Redeems script is required to create the unsigned tx. You need either xPrv or the private keys to sign.

ok so when you create your raw unsigned tx with coinb.in you are already explicitly giving it your redeem script. you just don't notice it during signing because the transaction already has it inside of its scriptsig. same is true with Electrum but the difference is that the wallet is not designed to recognize the normal inclusion of redeemscript inside the scriptsig, it needs to be a special format.

for example when you pass an unsigned tx spending a p2pkh output your script sig contains either the address, the public key or the master public key. so it looks like this: 0xfd + 20_bytes_hash160 or 0xff + your_xpub
this special format is also not recognized by any other tool like coinb.in! and there is no special format for redeemscript defined in Electrum AFAIK hence it is not possible to use the `signtransaction` command.
legendary
Activity: 3206
Merit: 2904
Block halving is coming.
Creation of raw unsigned transaction hex using https://coinb.in/#newTransaction requires Redeem Script for MultiSig. I already said it here...

No. You dont need the redeem script to sign. Redeems script is required to create the unsigned tx. You need either xPrv or the private keys to sign.
righ

What exactly are you trying to achieve here? Private keys from your multi-sig are enough to import it to Electrum BCD and get the fork coin and transfer it to a new multisig wallet.

Redeem script can be found in the addresses tab just right-click the address then details it will show the address, Public keys and redeem script.

Take note Coinb.in doesn't support BCD(bitcoin diamond) so you can't use it to get your BCD. Just use the Electrum BCD to import the private keys you get from your multi sig are enough to get your Bitcoin Diamond.

Are you trying to create a new multi-sig wallet in Electrum BCD and you are stuck on xpub/xprv? xpub is generated with the seed you can just find it on electrum>wallet>information it will show you the xpub now copy them and paste it where you stuck when making a multi-sig wallet with electrum.
sr. member
Activity: 856
Merit: 422
as far as i can tell coinb.in only supports single signature transaction signing.
I regularly sign multisig transactions using https://coinb.in/#sign. Only unsigned rawtx in HEX format and any 2 private keys are the requirement. In fact, I have successfully signed BCH, BSV, BTG transactions for this same multisig address using respective Coinb.in fork. Unfortunately, BCD does not have a Coinb.in fork. Hence, the BCD fork of my coins on the multisig wallet have got stuck. Cry
how do you create that raw unsigned transaction hex? specifically does it have anything in its scriptsig or is it empty? you can use https://www.blockchain.com/btc/decode-tx to decode and see if its scriptsig is empty or contains the redeem script already. that may be the reason why you could do it.

Creation of raw unsigned transaction hex using https://coinb.in/#newTransaction requires Redeem Script for MultiSig. I already said it here...

No. You dont need the redeem script to sign. Redeems script is required to create the unsigned tx. You need either xPrv or the private keys to sign.
legendary
Activity: 3402
Merit: 10424
as far as i can tell coinb.in only supports single signature transaction signing.
I regularly sign multisig transactions using https://coinb.in/#sign. Only unsigned rawtx in HEX format and any 2 private keys are the requirement. In fact, I have successfully signed BCH, BSV, BTG transactions for this same multisig address using respective Coinb.in fork. Unfortunately, BCD does not have a Coinb.in fork. Hence, the BCD fork of my coins on the multisig wallet have got stuck. Cry
how do you create that raw unsigned transaction hex? specifically does it have anything in its scriptsig or is it empty? you can use https://www.blockchain.com/btc/decode-tx to decode and see if its scriptsig is empty or contains the redeem script already. that may be the reason why you could do it.
sr. member
Activity: 856
Merit: 422
as far as i can tell coinb.in only supports single signature transaction signing.
I regularly sign multisig transactions using https://coinb.in/#sign. Only unsigned rawtx in HEX format and any 2 private keys are the requirement. In fact, I have successfully signed BCH, BSV, BTG transactions for this same multisig address using respective Coinb.in fork. Unfortunately, BCD does not have a Coinb.in fork. Hence, the BCD fork of my coins on the multisig wallet have got stuck. Cry
legendary
Activity: 3402
Merit: 10424
One last time, try signing the Raw TX using only one key at a time:
Code:
signtransaction('TransactionHEXEncoding', "PrivateKey01")
Including the punctuation and parenthesis.

that option can not work simply because in order to sign a multisignature transaction (unlike the normal single sig ones) you need the redeem script since you can't get it from the previous transaction (tx being spent) so that command needs to explicitly receive the redeem script if it has to be able to sign a multi-sig transaction.

No. You dont need the redeem script to sign. Redeems script is required to create the unsigned tx. You need either xPrv or the private keys to sign. For example, in https://coinb.in/#sign, we can just provide the unsigned rawtx and sign it twice separately by 2 private keys of a 2-of-3 multisig address.

But, this wont work in Electrum, because Electrum itself decides which key it'll allow to sign with. If it finds an unsigned rawtx is being signed by an address not directly related to the transaction, it'll just disable the sign button or throw error in console. What I have understood that, for anything related to multisig, Electrum looks for xPrv.

when you are signing a transaction (under the hood) you strip all the inputs from their signatures and put empty scriptsig in their place, then you place a specific scriptsig in the input you are signing. for normal 1 sig transactions (spending P2PKH outputs) the scriptsig is the previous transaction's pubscript (OP_DUP OP_HASH160,...) this is already fetched from the previous tx that you are spending. so all you need to do in a wallet or any online tool is to give it the rawtx and your private key and it does the rest as long as it has access to the previous tx.

but for multi signatures (the P2SH outputs) that specific scriptsig that you use is the redeemscript which is not on the blockchain so you have to explicitly provide it to the wallet to be able to sign. what we have on the blockchain in your previous tx that you are spending is the hash of redeem script which is not used for signing.

as far as i can tell coinb.in only supports single signature transaction signing.
sr. member
Activity: 856
Merit: 422
One last time, try signing the Raw TX using only one key at a time:
Code:
signtransaction('TransactionHEXEncoding', "PrivateKey01")
Including the punctuation and parenthesis.

that option can not work simply because in order to sign a multisignature transaction (unlike the normal single sig ones) you need the redeem script since you can't get it from the previous transaction (tx being spent) so that command needs to explicitly receive the redeem script if it has to be able to sign a multi-sig transaction.

No. You dont need the redeem script to sign. Redeems script is required to create the unsigned tx. You need either xPrv or the private keys to sign. For example, in https://coinb.in/#sign, we can just provide the unsigned rawtx and sign it twice separately by 2 private keys of a 2-of-3 multisig address.

But, this wont work in Electrum, because Electrum itself decides which key it'll allow to sign with. If it finds an unsigned rawtx is being signed by an address not directly related to the transaction, it'll just disable the sign button or throw error in console. What I have understood that, for anything related to multisig, Electrum looks for xPrv.
legendary
Activity: 3402
Merit: 10424
One last time, try signing the Raw TX using only one key at a time:
Code:
signtransaction('TransactionHEXEncoding', "PrivateKey01")
Including the punctuation and parenthesis.

that option can not work simply because in order to sign a multisignature transaction (unlike the normal single sig ones) you need the redeem script since you can't get it from the previous transaction (tx being spent) so that command needs to explicitly receive the redeem script if it has to be able to sign a multi-sig transaction.
legendary
Activity: 2338
Merit: 5297
Self-proclaimed Genius
So it didn't work, there's no other way but use Bitcoin Core equivalent software for BCD then.

That command was designed to sign the transaction using one of the wallet's private key (The one required by the Tx).
Or using the given private key, I guess adding multiple keys wasn't supported.

One last time, try signing the Raw TX using only one key at a time:
Code:
signtransaction('TransactionHEXEncoding', "PrivateKey01")
Including the punctuation and parenthesis.
sr. member
Activity: 856
Merit: 422
-snip-
there is however a command that you could possibly use in your Electrum console called `createmultisig()`, it might help although i couldn't figure out how it works:
https://github.com/spesmilo/electrum/blob/f60f690ca944b9611a6cbf7b29a8a8aab5f13b21/electrum/commands.py#L297-L303
It will just create and display the multisig address and its redeem script which he already have.
Wish Electrum had the "addmultisig()" command for spendable [imported] wallets.

@100bitcoin I don't know if "signtransaction()" will work but you'll lose nothing if you try.

Test [1] First create a watch-only wallet by importing your multisig address and create a (send-all) raw transaction - copy the Transaction HEX.
Next, go to the console tab (View->Show Console) and type the command:
Code:
signtransaction('TransactionHEXEncoding', ["PrivateKey01", "PrivateKey02", "PrivateKey03"])

Test [2] Create an imported wallet using the three private keys which will create a wallet with three separate standard addresses.
Go to Console tab, and type the command without the optional private keys.
Code:
signtransaction('TransactionHEXEncoding')

If successful, broadcast the signed transaction hex.
Once again, I only tried it using standard address/wallet, there's a high chance that it wont work for multisig.

Created the unsigned Tx. But, unable to sign as of yet. It is throwing various types of error. Is not there any easy way to sign an unsigned Tx through Electrum by directly using private key instead of xPriv?

Interestingly, no other BCD wallet supports this either (I have not tried their QT though).

I thought multisig is safe. Never thought my coins will be locked in multisig in a way, that I'll never be able to recover instead of having private keys.
HCP
legendary
Activity: 2086
Merit: 4314
how can I sweep BCD from the multi-sig address using Electrum for BCD wallet?
I don't believe this is actually possible. As already stated, Electrum will only create multisigs using xpubs/xprvs or seeds.

You'd need to download and sync the BCD "QT" wallet... You can then either create the multisig address inside the QT wallet by using the private keys that you have (will possibly need to rescan the blockchain so the appropriate UTXOs are found) or you can simply create the transactions manually to send the coins.

I've had to do this for people previously who were trying to get fork coins out of "Electrum" for BTG, BCH and BCD etc.
legendary
Activity: 1039
Merit: 2783
Bitcoin and C♯ Enthusiast
legendary
Activity: 2338
Merit: 5297
Self-proclaimed Genius
-snip-
there is however a command that you could possibly use in your Electrum console called `createmultisig()`, it might help although i couldn't figure out how it works:
https://github.com/spesmilo/electrum/blob/f60f690ca944b9611a6cbf7b29a8a8aab5f13b21/electrum/commands.py#L297-L303
It will just create and display the multisig address and its redeem script which he already have.
Wish Electrum had the "addmultisig()" command for spendable [imported] wallets.

@100bitcoin I don't know if "signtransaction()" will work but you'll lose nothing if you try.

Test [1] First create a watch-only wallet by importing your multisig address and create a (send-all) raw transaction - copy the Transaction HEX.
Next, go to the console tab (View->Show Console) and type the command:
Code:
signtransaction('TransactionHEXEncoding', ["PrivateKey01", "PrivateKey02", "PrivateKey03"])

Test [2] Create an imported wallet using the three private keys which will create a wallet with three separate standard addresses.
Go to Console tab, and type the command without the optional private keys.
Code:
signtransaction('TransactionHEXEncoding')

If successful, broadcast the signed transaction hex.
Once again, I only tried it using standard address/wallet, there's a high chance that it wont work for multisig.
legendary
Activity: 3402
Merit: 10424
Okay seems like a problem that I might face in the future. I have my coins in a 2/2 MultiSig wallet (Electrum). In the future, if there is a fork coin available and if they worth claiming then how do I claim them?

I have the seed and master public key of the both cosigners but since in a multisig address I can not export a private key of an address then how am I going to get those forked coin.

I apologize in advance if this turns out to be another stupid question :-P

you can always use your seed or master keys to import the whole thing in the new wallet which will give you all of your private keys in the past and in the future so you can claim any forkcoins you want. obviously you have to empty that wallet and create a new bitcoin wallet to send your bitcoin balance to first.

OP's problem is with a single address while having its private keys. and you can always open an issue on Electrum's github repository asking them to add this feature. https://github.com/spesmilo/electrum/issues
legendary
Activity: 2422
Merit: 3847
Visit: r7promotions.com
Okay seems like a problem that I might face in the future. I have my coins in a 2/2 MultiSig wallet (Electrum). In the future, if there is a fork coin available and if they worth claiming then how do I claim them?

I have the seed and master public key of the both cosigners but since in a multisig address I can not export a private key of an address then how am I going to get those forked coin.

I apologize in advance if this turns out to be another stupid question :-P
Pages:
Jump to: