0

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 .'''

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 <address>. That will give you a pubkey you can give to createmultisig.

| improve this answer | |
  • Thank you very much! – Pillagr Mar 5 at 6:26
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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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