- 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
- 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:
addmultisigaddress 2 '["pubkey1", "pubkey2"]'
- Take the returned P2SH address ...
importaddress 3MWpeBDwJdk8F7fecZBZ6FHjDJVnGxpnRA "TESTING" true
- Wait for scan to complete
- Funded 3MWpeBDwJdk8F7fecZBZ6FHjDJVnGxpnRA with
createrawtransaction
/signrawtransaction
/sendrawtransaction
(but I'm sure you can do it using the GUI
listunspent 0
will return JSON array (including 0
confirms) with an object showing redeemScript
but with spendable:
false
- You'll need to redeem the Tx using
createrawtransaction
with the privatekeys passed as parameters to spend this, obviously