Author

Topic: Is "sendmany" skipping multiple signature? (Read 204 times)

newbie
Activity: 4
Merit: 0
createmultisig only creates a new P2SH multisig address
addmultisigaddress creates and stores a new P2SH multisig in the wallet
both should generate the same address if you supply the same public keys or addresses

Thank you a lot. I didn't know the different. For Cold-Walltet, addmultisigaddress shouldn't be used.
I agree both should generate the same address, otherwise those are different as long as I tested.
hero member
Activity: 1232
Merit: 738
Mixing reinvented for your privacy | chipmixer.com
here's some more good readings on the topic
https://en.bitcoin.it/wiki/Multisignature#Creating_a_Multisignature_Address_with_Bitcoin-Qt
https://gist.github.com/gavinandresen/3966071
the one on github gives a good step-by-step example for spending from multisig

That address was generated by "addmultisigaddress". Actually, it was different from generated by "createmultisig".
Not yet understanding the difference but, will use "createmultisig" as well as the original of Bitcoin Developer Examples.
createmultisig only creates a new P2SH multisig address
addmultisigaddress creates and stores a new P2SH multisig in the wallet
both should generate the same address if you supply the same public keys or addresses
newbie
Activity: 4
Merit: 0
bitcoin-cli validateaddress 2N7FBhWJb6JW9RrmhGvCRi7XN3yCD58Nd1j
I think that's not your "P2SH multisig address".
this looks like P2SH segwit address, a P2SH-P2WPKH address perhaps?

Thank you so much for your pointing out as well.

That address was generated by "addmultisigaddress". Actually, it was different from generated by "createmultisig".
Not yet understanding the difference but, will use "createmultisig" as well as the original of Bitcoin Developer Examples.

There were not so particular deep meaning for using "addmultisigaddress". Just consisted getting account for confirming "sendmany".
newbie
Activity: 4
Merit: 0
you are not doing cold storage.

Thank you so much for your pointing out. It's notified me that my recent trials were not for Cold Wallet operation.
I did as blew, and worried wastefully.

1. Get 3 address and the relative pubkey and privkey at an online node.
2. In the same online node, get multig address from above 3 relative pubkey.
3. In the same online node, try "sendmany" by setting account of the multisig address to the from.

At the actual operation, we should remove the node used for generate multisig address and relatives, to be the address Cold.
Thus, because of losing the base node, sendmany cannot be used for spending allocation of the multisig account.

I've tried Bitcoin Developer Examples again, and confirmed the "P2SH Multisig" part does work without online node of multisig.
hero member
Activity: 1232
Merit: 738
Mixing reinvented for your privacy | chipmixer.com
bitcoin-cli validateaddress 2N7FBhWJb6JW9RrmhGvCRi7XN3yCD58Nd1j
I think that's not your "P2SH multisig address".
this looks like P2SH segwit address, a P2SH-P2WPKH address perhaps?
the script shows you signed it as a segwit address not multisig address
if multisig, usually it has Multisig key (your tx shows Witness instead) in the input scripts

ScriptSig: PUSHDATA(34)[0020ff22a320dac7662375c449420bbc9d4a72d3bd5855ed1ba6ff6e0ac2acddba1d]
Witness: 0400483045022100b82d51fd36c31682aa061e94bf5a80c5fe237c7ddb593120e95509e53730797 c02205fd7c2c592c8bf0fa8e244aa0757aa06f2b91f5e9f12f7e284e10afd145418970148304502 2100c5d909aa12514e8ffacd77d1963dc23df3c056efea1ae088d22a5342e612d16202207e55cb2 939d57278547a36315649a98061ee46be237caf2fa1669c49b8f06f4b01695221029e1a7ae1a9c9 23e139a9bc15391ec14cad370e0a3d8e171b50a6614ee8d165ba210368e5bfb5cf02a5468a9e998 f44f7abb6303550e072cf33a5e3ed275752fe30462102f75140c0054f856a1e4f8a553f437a8d42 ecbfc6fa3f48030ce73176ff450b2b53ae

Quote
 "ismine": true,
  "iswatchonly": false,
this means you've imported the address into your wallet, correct?
did you import the address using both private keys?
legendary
Activity: 3122
Merit: 2178
Playgram - The Telegram Casino
Maybe I misunderstand what you are trying to do, but when the wallet that is holding the private keys and signing the transactions (via createrawtransaction and signrawtransaction) is also the one publishing the transaction on the network (via sendrawtransaction) you are not doing cold storage.

If the wallet that is holding the private keys is a different one from the wallet sending the transaction, it is technically impossible for sendmany to create a valid transaction, for lack of an available balance. If you are able to send a transaction using sendmany, your hot wallet is holding the keys to your supposed cold storage balances which is... not good.
newbie
Activity: 4
Merit: 0
My team is going to make Multisig type Cold Wallet, which needs more than 2 offline individual signature at spending from.

We referred the following page for it, and found the rough step will be 1."createrawtransaction", 2.(multiple)"signrawtransaction", and 3."sendrawtransaction".

Bitcoin Developer Examples
https://bitcoin.org/en/developer-examples

However, this multiple signature process could be skipped by using "sendmany" on bitcoin-cli.
The following history is what I tested on testnet-3 today. "multisig" is our P2SH multisig address account for test.

---
bitcoin-cli getbalance multisig
0.87023010
---
bitcoin-cli sendmany "multisig" '''{"2N6ptYtQDBQXCM4xKAFbWHo5ZZkT1PJTaEe":0.1,"2MwZKfMuSNbe4i1TxTYAdGFshvZoMg1bmo5":0.2}'''
6b1a1b4ab4db30023ae7d38e221e3a6addfb669d33c9db36d7b671ebfa320d07
(https://live.blockcypher.com/btc-testnet/tx/6b1a1b4ab4db30023ae7d38e221e3a6addfb669d33c9db36d7b671ebfa320d07/)
---
bitcoin-cli getbalance multisig
0.57018090
---
bitcoin-cli validateaddress 2N7FBhWJb6JW9RrmhGvCRi7XN3yCD58Nd1j
{
  "isvalid": true,
  "address": "2N7FBhWJb6JW9RrmhGvCRi7XN3yCD58Nd1j",
  "scriptPubKey": "a914998fd9987bd33c512c8466e44e12b745586803f387",
  "ismine": true,
  "iswatchonly": false,
  "isscript": true,
  "iswitness": false,
  "script": "witness_v0_scripthash",
  "hex": "0020ff22a320dac7662375c449420bbc9d4a72d3bd5855ed1ba6ff6e0ac2acddba1d",
  "embedded": {
    "isscript": true,
    "iswitness": true,
    "witness_version": 0,
    "witness_program": "ff22a320dac7662375c449420bbc9d4a72d3bd5855ed1ba6ff6e0ac2acddba1d",
    "script": "multisig",
    "hex": "5221029e1a7ae1a9c923e139a9bc15391ec14cad370e0a3d8e171b50a6614ee8d165ba210368e5b fb5cf02a5468a9e998f44f7abb6303550e072cf33a5e3ed275752fe30462102f75140c0054f856a 1e4f8a553f437a8d42ecbfc6fa3f48030ce73176ff450b2b53ae",
    "sigsrequired": 2,
    "pubkeys": [
      "029e1a7ae1a9c923e139a9bc15391ec14cad370e0a3d8e171b50a6614ee8d165ba",
      "0368e5bfb5cf02a5468a9e998f44f7abb6303550e072cf33a5e3ed275752fe3046",
      "02f75140c0054f856a1e4f8a553f437a8d42ecbfc6fa3f48030ce73176ff450b2b"
    ],
    "address": "tb1qlu32xgx6canzxawyf9pqh0yaffed802c2hk3hfhldc9v9txahgwssuemns",
    "scriptPubKey": "0020ff22a320dac7662375c449420bbc9d4a72d3bd5855ed1ba6ff6e0ac2acddba1d"
  },
  "addresses": [
    "tb1qlu32xgx6canzxawyf9pqh0yaffed802c2hk3hfhldc9v9txahgwssuemns"
  ],
  "account": "multisig"
}
---

If my current understanding is correct, Multisig type Cold Wallet, which needs more than 2 offline individual signature at spending from, cannot be made, because the multiple signature process could be skipped by "sendmany" (or "sendfrom").

So, I'd like to get your pointing out if any misunderstanding. We need to make Multisig type Cold Wallet at any risk.
Jump to: