1

Any way to create a multisig address from Bitcoin addresses (instead of public keys)?

If not, why not? What would the problem be?

EDITED - Thanks for the answers. This is for an application that generates multisig transactions with escrow for external users. Of course anyone who controls an address can find the public key, but that's probably beyond many casual users (or too much of an hassle).

3 Answers 3

1

No. OP_CHECKMULTISIG only supports multiple pubkey not pubkeyhash (addresses).

1
  • So? OP_CHECKSIG only supports pubkeys, too.
    – Nick ODell
    Commented Apr 4, 2015 at 18:11
2

While you can't generate a multisig address directly from a number of non-multisig addresses, you can easily get their public key on a single call. In bitcoin-core you have to call validateaddress and then retrieve the pubkey field from the response, which is the hex value of the raw public key that you can then use to generate your multisig.

6
  • I don't think this works for addresses that aren't in your wallet.
    – Nick ODell
    Commented Apr 4, 2015 at 18:15
  • @NickODell it doesn't but each party can get their public keys using their own wallets and then combine them to create a multisig address.
    – user11221
    Commented Apr 5, 2015 at 3:48
  • Oh, I see. Good point.
    – Nick ODell
    Commented Apr 5, 2015 at 4:45
  • Yes, this only works for your addresses. Commented Apr 5, 2015 at 7:30
  • OK, so each party can find their public keys and send them to the party that creates the multisig address. Bu1 1. Finding the public key may be too complex for casual users, 2. I don't see how users of services like Circle (the majority of new users) can find their public keys. Commented Apr 5, 2015 at 8:26
2

This is possible, but there isn't really any code to do it automatically.

Instead of creating a scriptPubKey like

<pubkey 1> <pubkey 2> <pubkey 3> 2 OP_CHECKSIG

you'd make one like

OP_DUP OP_HASH160 <pubkeyhash 1> OP_EQUALVERIFY OP_ROT
OP_DUP OP_HASH160 <pubkeyhash 2> OP_EQUALVERIFY OP_ROT 
OP_DUP OP_HASH160 <pubkeyhash 3> OP_EQUALVERIFY OP_ROT 2 OP_CHECKSIG

Also, the code of the receiver would need to change, in order to recognize the output as spendable.

It's probably much easier to get their public keys. If they've used their addresses on the network, you can look it up using https://blockchain.info/q/pubkeyaddr/<addr>

Example: https://blockchain.info/q/pubkeyaddr/1snowqQP5VmZgU47i5AWwz9fsgHQg94Fa

Or, you can use George Kimionis's method to decode addresses.

6
  • Thanks Nick, could you point me to George Kimionis's method to decode addresse? Commented Apr 5, 2015 at 8:19
  • That's just the answer below.
    – Nick ODell
    Commented Apr 5, 2015 at 8:20
  • A problem is that many casual users don't know their public keys and are unable to find them, and others (e.g. Circle etc.) can't know them at all. Commented Apr 5, 2015 at 8:20
  • oops sorry I didn't see that Commented Apr 5, 2015 at 8:22
  • @NickODell Wow! Have you actually run this script? I'll give it a shot on testnet, bc as you know I love script stuff Commented Apr 6, 2015 at 3:24

Your Answer

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

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