<p>A "multisig address" is actually a <strong>Pay to script hash</strong> (P2SH) address. Unlike normal bitcoin addresses that start with 1, P2SH addresses start with 3 (on the main network, 2 on the testnet). How this works is explained by the P2SH BIP16 <a href="https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki" rel="nofollow noreferrer">wiki page</a>. Essentially, you pay coins to a special address that is a hash of the redeem script. To claim the transaction, one must provide a redeem script that hashes to the correct address, and also provide conditions that make the redeem script evaluate to True.</p>

<p>In your example, paying the multisig is  really easy: Just copy-paste whatever value you got in the address field into your wallet and pay it just like you would a regular transaction.</p>

<p>Claiming the funds in a multisig is a little tricky. First, you must know the redeem script. Hopefully, you saved it, and you also gave it to the other key owners so they could verify the P2SH address is fair (their key is in it). If you lost the redeem script, reenter the <code>createmultisig</code> command with the same parameters and the same public keys <em>in the same order</em>. You're guaranteed to get the same redeem script and the same address.</p>

<p>Then you need to generate and sign the transaction, which is <a href="https://bitcoin.org/en/developer-examples#p2sh-multisig" rel="nofollow noreferrer">pretty difficult</a> with the core client. You're going to find it simpler if you use a <a href="http://www.soroushjp.com/2014/12/20/bitcoin-multisig-the-hard-way-understanding-raw-multisignature-bitcoin-transactions/" rel="nofollow noreferrer">ready-made program</a>.</p>

<p>Essentially, your transaction that paid your multisig address had an output that looked like this:</p>

<pre><code>&lt;hash&gt; OP_EQUAL
</code></pre>

<p>and the transaction that spends from the multisig will sign that input with the signature script:</p>

<pre><code>OP_FALSE &lt;Signature1&gt; &lt;Signature2&gt; &lt;redeemScript&gt;
</code></pre>

<p>where the redeemScript is what you got when generating the address, serialized and pushed onto the stack. The redeemScript must hash to the value specified by the output. Note that <code>&lt;Signature1&gt; &lt;Signature3&gt;</code> and <code>&lt;Signature2&gt; &lt;Signature3&gt;</code> would also validate, but not any other order. You also can't have more signatures than required: if it's a 2-of-3 multisig, you need exactly 2 signatures, not at least 2, so <code>&lt;Signature1&gt; &lt;Signature2&gt; &lt;Signature3&gt;</code> won't work.</p>

CC BY-SA 3.0
2016-11-22T13:47:30.027Z
2016-11-22T13:47:30.027Z
maservant
<p>I'm trying to figure out multisigs and have just created a 2 of 3 multisig as follows:</p>

<p>createmultisig 2 '["public_key_1","public_key_2","public_key_3"]'</p>

<p>This returns 2 values</p>

<p>Value 1: Address</p>

<p>Value 2: redeemScript</p>

<p>Now, if I want to fund this multisig, where do I send the funds?  I typed in Value 1 into blockr.io, and it said that is an invalid key.  So how do I get the public key for that multisig?</p>

<p>I am trying to learn the hard way, using bitcoin-core.</p>

<p>So basically, for the next step in my learning, I want to send that multisig some funds using the testnet, but I don't know where to get the public key for that multisig.</p>

<bitcoin-core><testnet><multi-signature>
MultiSig Learning On TestNet
oshirowanen
# MultiSig Learning On TestNet

(Asked by: username_0 on 2016-11-22)

I'm trying to figure out multisigs and have just created a 2 of 3 multisig as follows:

createmultisig 2 '["public\_key\_1","public\_key\_2","public\_key\_3"]'

This returns 2 values

Value 1: Address

Value 2: redeemScript

Now, if I want to fund this multisig, where do I send the funds? I typed in Value 1 into blockr.io, and it said that is an invalid key. So how do I get the public key for that multisig?

I am trying to learn the hard way, using bitcoin-core.

So basically, for the next step in my learning, I want to send that multisig some funds using the testnet, but I don't know where to get the public key for that multisig.

**Tags:** bitcoin-core, testnet, multi-signature


---

## 1 answers

### Answer by username_1 on 2016-11-22. Score: 1 | Accepted answer

A "multisig address" is actually a **Pay to script hash** (P2SH) address. Unlike normal bitcoin addresses that start with 1, P2SH addresses start with 3 (on the main network, 2 on the testnet). How this works is explained by the P2SH BIP16 [wiki page](https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki). Essentially, you pay coins to a special address that is a hash of the redeem script. To claim the transaction, one must provide a redeem script that hashes to the correct address, and also provide conditions that make the redeem script evaluate to True.

In your example, paying the multisig is really easy: Just copy-paste whatever value you got in the address field into your wallet and pay it just like you would a regular transaction.

Claiming the funds in a multisig is a little tricky. First, you must know the redeem script. Hopefully, you saved it, and you also gave it to the other key owners so they could verify the P2SH address is fair (their key is in it). If you lost the redeem script, reenter the `createmultisig` command with the same parameters and the same public keys *in the same order*. You're guaranteed to get the same redeem script and the same address.

Then you need to generate and sign the transaction, which is [pretty difficult](https://bitcoin.org/en/developer-examples#p2sh-multisig) with the core client. You're going to find it simpler if you use a [ready-made program](http://www.soroushjp.com/2014/12/20/bitcoin-multisig-the-hard-way-understanding-raw-multisignature-bitcoin-transactions/).

Essentially, your transaction that paid your multisig address had an output that looked like this:

```
<hash> OP_EQUAL

```

and the transaction that spends from the multisig will sign that input with the signature script:

```
OP_FALSE <Signature1> <Signature2> <redeemScript>

```

where the redeemScript is what you got when generating the address, serialized and pushed onto the stack. The redeemScript must hash to the value specified by the output. Note that `<Signature1> <Signature3>` and `<Signature2> <Signature3>` would also validate, but not any other order. You also can't have more signatures than required: if it's a 2-of-3 multisig, you need exactly 2 signatures, not at least 2, so `<Signature1> <Signature2> <Signature3>` won't work.


---

