1

I am learning how to handle multisig. First I created a 2-3 multisig address with all keys from my test wallet (bitcoind on server) and sent money to the new multisig address from another wallet. The transaction shows in the test wallet and I can use the unspent output.

Then I created a 2-2 address with one key from the test wallet and one key from another wallet, and sent money to the new address from another wallet. The transaction shows on blockchain.info:

https://blockchain.info/tx/910298ae8133cc142009539298b6e2127b2c49960facd3b21470e130d07a1701

but it doesn't show in the test wallet, and the new multisig address has zero balance.

Reading this previous Q/A:

Multisig doesn't work unless all keys were generated from the current wallet?

I see that in July 2014 Bitcoin Core only showed transactions to multisig addresses with all keys in its wallet.

Questions:

1) Is that still the case?

2) If so, can I still use the unspent output and how?

1
  1. Addmultisigaddress 2 [{"address/pubkey of Bitcoincore address", "pubkey of other wallet key"}] should return the P2SH address (3MWpeBDwJdk8F7fecZBZ6FHjDJVnGxpnRA) and also add 3MWpeBDwJdk8F7fecZBZ6FHjDJVnGxpnRA to the UTXOs
  2. importaddress 3MWpeBDwJdk8F7fecZBZ6FHjDJVnGxpnRA will add the P2SH address to the wallet as WatchOnly

I'm assuming you're not running a full node, using the txindex=1 flag, so the addmultisigaddress command is what you're going to need to redeem 3MWpeBDwJdk8F7fecZBZ6FHjDJVnGxpnRA in Bitcoincore. FYI, createmultisig has the same parameters as addmultisigaddress (RPC reference) but it's returning the redeem script only; ie it is not adding the P2SH address to the UTXOs.

As mentioned already, for all multisig commands you'll need the full pubkey (hex version, starting with 0x04 or 0x02/03 for compressed). The only reason you can substitute the Base58Check address into Bitcoincore as a public key is because the software retrieves the pubkey from the wallet and substitutes it accordingly.

An alternative way to go about it is by using dumpprivkey/validateaddress to get the Bitcoincore keys required and then import the private key into the other wallet software and sign/redeem with that.

EDIT: I've tested out importing non-wallet.dat pubkeys for a multisig P2SH address and have successfully added the Tx to the UTXOs returned by listunspent, with the only difference being that the JSON return data will have spendable: false. I did it as follows:

  1. addmultisigaddress 2 '["pubkey1", "pubkey2"]'
  2. Take the returned P2SH address ...
  3. importaddress 3MWpeBDwJdk8F7fecZBZ6FHjDJVnGxpnRA "TESTING" true
  4. Wait for scan to complete
  5. Funded 3MWpeBDwJdk8F7fecZBZ6FHjDJVnGxpnRA with createrawtransaction/signrawtransaction/sendrawtransaction (but I'm sure you can do it using the GUI
  6. listunspent 0 will return JSON array (including 0 confirms) with an object showing redeemScript but with spendable: false
  7. You'll need to redeem the Tx using createrawtransaction with the privatekeys passed as parameters to spend this, obviously
  • Thanks for the reply. I successfully tested multisig addresses with keys from different wallets on other platforms (coinb.in) but I haven't managed to do so with my bitcoincore install yet, despite following all your suggestion. A problem is that even after importing the address as watchonly (importaddress) I don't see the transactions to the address. – Giulio Prisco Apr 8 '15 at 7:10
  • I'll take a look ASAP. I'm going from memory. I'm experiencing similar frustration with BIP32/Electrum 2.0.4, although it's a problem for different technical reasons, it's still indicative of how difficult different wallet clients can be with multisig and BIP32/39 – Wizard Of Ozzie Apr 8 '15 at 15:48
  • I think you'll need to rescan your blockchain data, which will take around 5-10 minutes, assuming you're not using a full node with txindex=1. When you use importaddress it'll rescan by default, however you'll need to ensure you've created the redeemscript with addmultisigaddress first. Again, I'll need to confirm this though, as it may be that without both private keys in the wallet, it won't "see" the UTXOs funding the P2SH for the external public key used – Wizard Of Ozzie Apr 8 '15 at 15:52
  • @GiulioPrisco See edit. – Wizard Of Ozzie Apr 9 '15 at 2:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.