<p>You can't dump the private key for a multisig address because there are multiple key pairs (thus multiple possible private keys) assigned to the address. You need to specify which key pair you want. First, get the public keys belonging to that address by using:</p>

<p><code>$ bitcoin-cli getaddressinfo &lt;your address&gt;</code></p>

<pre><code>{
  "address": "&lt;your address&gt;",
  ...
  "embedded": {
    ...
    "pubkeys": [
      "&lt;pubkey 1&gt;",
      "&lt;pubkey n&gt;",
      "..."
    ],
   ...
}
</code></pre>

<p>Assuming you want the private key corresponding to <code>&lt;pubkey 1&gt;</code>, you can convert it to a simple <code>P2PKH</code> address and then use <code>dumpprivkey</code>, for example:</p>

<pre><code>$ hash160 &lt;pubkey 1&gt;
  &lt;pubkey 1 hash&gt;
$ echo 00&lt;pubkey 1 hash&gt; | xxd -r -p | base58 -c
  &lt;P2PKH address&gt;
$ bitcoin-cli dumpprivkey &lt;P2PKH address&gt;
  &lt;privkey&gt;
</code></pre>

<p>Where <code>hash160</code> is just a bash script that uses openssl:</p>

<pre><code>#!/bin/bash
## Command Line parsing
#######################

if [[ $# -lt 1 ]]; then
    echo "Usage: $ hash160 &lt;input-hex&gt;"
    exit 1
fi

inputHex=$1

hash1="$(printf $inputHex | xxd -r -p | openssl sha256 | cut -c 10-)"
printf $hash1 | xxd -r -p | openssl ripemd160 | cut -c 10-
</code></pre>

CC BY-SA 4.0
2018-11-27T01:06:35.527Z
very usefull, work on my case
Billy Adelphia
CC BY-SA 4.0
2018-11-26T14:57:50.830Z
2018-11-26T14:57:50.830Z
JBaczuk
<p>how to dump private key from multisig address ?
I tried with <code>dumpprivkey</code> RPC function but return error : <code>Address does not refer to a key</code></p>

<json-rpc><private-key>
how to dump private key from multisig address
Billy Adelphia
# how to dump private key from multisig address

(Asked by: username_0 on 2018-11-26)

how to dump private key from multisig address ?
I tried with `dumpprivkey` RPC function but return error : `Address does not refer to a key`

**Tags:** json-rpc, private-key


---

## 1 answers

### Answer by username_1 on 2018-11-26. Score: 1 | Accepted answer

You can't dump the private key for a multisig address because there are multiple key pairs (thus multiple possible private keys) assigned to the address. You need to specify which key pair you want. First, get the public keys belonging to that address by using:

`$ bitcoin-cli getaddressinfo <your address>`

```
{
  "address": "<your address>",
  ...
  "embedded": {
    ...
    "pubkeys": [
      "<pubkey 1>",
      "<pubkey n>",
      "..."
    ],
   ...
}

```

Assuming you want the private key corresponding to `<pubkey 1>`, you can convert it to a simple `P2PKH` address and then use `dumpprivkey`, for example:

```
$ hash160 <pubkey 1>
  <pubkey 1 hash>
$ echo 00<pubkey 1 hash> | xxd -r -p | base58 -c
  <P2PKH address>
$ bitcoin-cli dumpprivkey <P2PKH address>
  <privkey>

```

Where `hash160` is just a bash script that uses openssl:

```
#!/bin/bash
## Command Line parsing
#######################

if [[ $# -lt 1 ]]; then
    echo "Usage: $ hash160 <input-hex>"
    exit 1
fi

inputHex=$1

hash1="$(printf $inputHex | xxd -r -p | openssl sha256 | cut -c 10-)"
printf $hash1 | xxd -r -p | openssl ripemd160 | cut -c 10-

```

> **Comments:**
> **username_0**: very usefull, work on my case  

---

