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

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

Giulio Prisco

Posted 2015-04-04T09:08:39.443

Reputation: 357

Answers

1

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

Anonymous

Posted 2015-04-04T09:08:39.443

Reputation: 10 054

So? OP_CHECKSIG only supports pubkeys, too.Nick ODell 2015-04-04T18:11:32.400

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.

George Kimionis

Posted 2015-04-04T09:08:39.443

Reputation: 2 824

I don't think this works for addresses that aren't in your wallet.Nick ODell 2015-04-04T18:15:37.527

@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.George Kimionis 2015-04-05T03:48:27.083

Oh, I see. Good point.Nick ODell 2015-04-05T04:45:05.403

Yes, this only works for your addresses.Giulio Prisco 2015-04-05T07:30:19.940

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.Giulio Prisco 2015-04-05T08:26:44.687

Circle is a shared wallet so users don't have their own addresses to begin with.Anonymous 2015-04-05T14:41:21.307

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.

Nick ODell

Posted 2015-04-04T09:08:39.443

Reputation: 26 536

Thanks Nick, could you point me to George Kimionis's method to decode addresse?Giulio Prisco 2015-04-05T08:19:08.677

That's just the answer below.Nick ODell 2015-04-05T08:20:23.680

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.Giulio Prisco 2015-04-05T08:20:47.597

oops sorry I didn't see thatGiulio Prisco 2015-04-05T08:22:33.690

@NickODell Wow! Have you actually run this script? I'll give it a shot on testnet, bc as you know I love script stuffWizard Of Ozzie 2015-04-06T03:24:13.677

@WizardOfOzzie I have not tested this. You should be able to spend it with a scripSig of 0 &lt;sig&gt; &lt;sig&gt; &lt;key&gt; &lt;key &lt;key&gt;, though.Nick ODell 2015-04-06T03:26:28.780