0

I added 2-2 MultiSig address into wallet via bitcoin cli (Testnet)

addmultisigaddress <'["key","key"]'> [account]

1 key of current wallet and other public key from different node wallet.

Account is showing

0.000000

Although more than six confirmations on the transaction: https://live.blockcypher.com/btc-testnet/tx/297b6f6c14486e9eda1b2a04e20e3bd161758afeafa7d4b0109fa7fca11154ae/

Most importantly listaccounts not listing the account associated with the MultiSig address.

getaddressesbyaccount [MultiSigAccount] shows the MultiSig address created above.

How can I get the balance of MultiSig address via bitcoin-cli?

Edit 1:

What does this command return: $ bitcoin-cli -testnet validateaddress <your-multisig-address>?

{
  "isvalid": true,
  "address": "2Mv4iYeyQtVV1M7rqzgUc68QzQ21vy1o36Z",
  "scriptPubKey": "a9141eeba411eae41a1a3dc7456ec4d599aef84afd7687",
  "ismine": false,
  "iswatchonly": true,
  "isscript": true,
  "iswitness": false,
  "script": "witness_v0_scripthash",
  "hex": "00206e908e1cca44b136fbf666f356114ca6a84c1fbed0327a155c204580310a7a11",
  "embedded": {
    "isscript": true,
    "iswitness": true,
    "witness_version": 0,
    "witness_program": "6e908e1cca44b136fbf666f356114ca6a84c1fbed0327a155c204580310a7a11",
    "script": "multisig",
    "hex": "52210240d4ae4819e35e346560efe665f79453210a0b26184e08705964c5eb89e885ca2103fcc7e4690f7bd3a51db7ed438ef9a7ffb0bf316467f39b384935befee4eb208552ae",
    "sigsrequired": 2,
    "pubkeys": [
      "0240d4ae4819e35e346560efe665f79453210a0b26184e08705964c5eb89e885ca",
      "03fcc7e4690f7bd3a51db7ed438ef9a7ffb0bf316467f39b384935befee4eb2085"
    ],
    "address": "tb1qd6ggu8x2gjcnd7lkvme4vy2v565yc8a76qe8592uypzcqvg20ggslwnwl8",
    "scriptPubKey": "00206e908e1cca44b136fbf666f356114ca6a84c1fbed0327a155c204580310a7a11"
  },
  "addresses": [
    "tb1qd6ggu8x2gjcnd7lkvme4vy2v565yc8a76qe8592uypzcqvg20ggslwnwl8"
  ],
  "account": "multisig22",
  "timestamp": 0
}
0

2 Answers 2

2

The documentation on addmultisigaddress states:

This functionality is only intended for use with non-watchonly addresses. See importaddress for watchonly p2sh address support.

Since the wallet does not have both private keys, it won't show a balance unless you use importaddress. Note the ismine: false property in validateaddress, that means your wallet doesn't have ability to spend (doesn't have private keys).

addmultisigaddress nrequired ["key",...] ( "account" "address_type" )

Add a nrequired-to-sign multisignature address to the wallet. Requires
a new wallet backup. Each key is a Bitcoin address or hex-encoded
public key. This functionality is only intended for use with
non-watchonly addresses. See `importaddress` for watchonly p2sh
address support. If 'account' is specified (DEPRECATED), assign
address to that account.

To watch a multisig address (get it's balance), you should use importaddress:

importaddress "address" ( "label" rescan p2sh )

Adds a script (in hex) or address that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.

Arguments:
1. "script"           (string, required) The hex-encoded script (or address)
2. "label"            (string, optional, default="") An optional label
3. rescan               (boolean, optional, default=true) Rescan the wallet for transactions
4. p2sh                 (boolean, optional, default=false) Add the P2SH version of the script as well

Note: This call can take minutes to complete if rescan is true, during that time, other rpc calls may report that the imported address exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes. If you have the full public key, you should call importpubkey instead of this.

Note: If you import a non-standard raw script in hex form, outputs sending to it will be treated as change, and not show up in many RPCs.

Examples:

Import a script with rescan
> bitcoin-cli importaddress "myscript"

Import using a label without rescan
> bitcoin-cli importaddress "myscript" "testing" false

As a JSON-RPC call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importaddress", "params": ["myscript", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
0

After calling importaddress account balance was still showing 0.00000 by getbalance [MultiSigAccount]

To check the balance of the MultiSig address this one worked and showing the balance of the MultiSig address after importaddress call:

bitcoin-cli -testnet getreceivedbyaddress [MultiSigAddress]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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