<p>Addresses are not public keys. You cannot give <code>createmultisig</code> addresses because it cannot know what public keys your addresses refer to, if any. To get the public keys, you need to first do <code>getaddressinfo &lt;address&gt;</code>. That will give you a pubkey you can give to <code>createmultisig</code>.</p>

CC BY-SA 4.0
2020-03-03T23:00:08.680Z
2020-03-03T23:00:08.680Z
Ava Chow
<p>The <code>createmultisig</code> RPC takes as input public keys, not addresses. As you created those addresses yourself, their public keys are in your wallet. <code>createmultisig</code> however is a utility RPC (which operates independently of the wallet), so it has no access to that information.</p>

<p>You can call the <code>getaddressinfo</code> wallet RPC on those addresses to obtain their public keys.</p>

CC BY-SA 4.0
2020-03-03T23:00:18.263Z
2020-03-03T23:00:18.263Z
Pieter Wuille
<p>As shown below, I generated 3 new addresses (Legacy I believe) in RegTest. I then try to create a multsig address from exactly these 3 addresses. What am I doing wrong, or is this unavailable in Regtest?</p>

<p>'''<strong>$ bitcoin-cli getnewaddress</strong>
2NFjbToRhpR2Lrx3VyP8rZ86XhZhofqWHBk</p>

<p><strong>$ bitcoin-cli getnewaddress</strong>
2NAqXJMEFzEbhNyy9xRiHHcwWNCyFddFfXH</p>

<p><strong>$ bitcoin-cli getnewaddress</strong>
2NEyDQfb85jRExQUnj4wC7fkFh5T1rt5zFk</p>

<p><strong>$ bitcoin-cli createmultisig 2 "[\"2NFjbToRhpR2Lrx3VyP8rZ86XhZhofqWHBk\", \"2NAqXJMEFzEbhNyy9xRiHHcwWNCyFddFfXH\",\"2NEyDQfb85jRExQUnj4wC7fkFh5T1rt5zFk\"]"</strong></p>

<p>error code: -5</p>

<p>error message:
Invalid public key: 2NFjbToRhpR2Lrx3VyP8rZ86XhZhofqWHBk
.'''</p>

<multi-signature><bitcoin-cli><regtest>
Regtest createmultisig Error: Invalid public Key?
Sachin Meier
# Regtest createmultisig Error: Invalid public Key?

(Asked by: username_0 on 2020-03-03)

As shown below, I generated 3 new addresses (Legacy I believe) in RegTest. I then try to create a multsig address from exactly these 3 addresses. What am I doing wrong, or is this unavailable in Regtest?

'''**$ bitcoin-cli getnewaddress**
2NFjbToRhpR2Lrx3VyP8rZ86XhZhofqWHBk

**$ bitcoin-cli getnewaddress**
2NAqXJMEFzEbhNyy9xRiHHcwWNCyFddFfXH

**$ bitcoin-cli getnewaddress**
2NEyDQfb85jRExQUnj4wC7fkFh5T1rt5zFk

**$ bitcoin-cli createmultisig 2 "[\"2NFjbToRhpR2Lrx3VyP8rZ86XhZhofqWHBk\", \"2NAqXJMEFzEbhNyy9xRiHHcwWNCyFddFfXH\",\"2NEyDQfb85jRExQUnj4wC7fkFh5T1rt5zFk\"]"**

error code: -5

error message:
Invalid public key: 2NFjbToRhpR2Lrx3VyP8rZ86XhZhofqWHBk
.'''

**Tags:** multi-signature, bitcoin-cli, regtest


---

## 2 answers

### Answer by username_1 on 2020-03-03. Score: 2

Addresses are not public keys. You cannot give `createmultisig` addresses because it cannot know what public keys your addresses refer to, if any. To get the public keys, you need to first do `getaddressinfo` . That will give you a pubkey you can give to `createmultisig`.


---

### Answer by username_2 on 2020-03-03. Score: 1

The `createmultisig` RPC takes as input public keys, not addresses. As you created those addresses yourself, their public keys are in your wallet. `createmultisig` however is a utility RPC (which operates independently of the wallet), so it has no access to that information.

You can call the `getaddressinfo` wallet RPC on those addresses to obtain their public keys.


---

