<p>You're correct that Gavin has all three private keys available to him at the start, but you're missing that he only uses the <em>public</em> keys to create the P2SH multisig address.  Specifically, this line from the example is listing only public keys,</p>

<pre><code>./bitcoind createmultisig 2 '["0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86","04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8722084861c5c3291ccffef4ec6874","048d2455d2403e08708fc1f556002f1b6cd83f992d085097f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46213"]'
</code></pre>

<p>The <code>createmultisig</code> RPC will let you mix addresses (corresponding to private keys you have in local storage) and public keys (for cases where you don't have the private keys---like when creating a multisig address with your friends).</p>

<p>There's a step-by-step create-and-spend multisig example on the <a href="https://bitcoin.org/en/developer-examples#p2sh-multisig">Bitcoin.org Developer Examples page</a>  (you probably want to start by reading the immediately previous examples, as they build up to P2SH multisig).</p>

CC BY-SA 4.0
2021-12-24T04:26:14.767Z
Follow up question. Yes, the example has the Hex representation of the legacy bitcoin address format, but if I understand correctly we can extract the hex representation of the legacy address if and only if we can query the wallet directly for said information. A third party will probably not know how to do this, and the legacy format (or what we call the "public BTC address") is just a hashed version of the public key, thus we can't use public legacy addresses in multisig directly. Now that we have `bech32` addresses, can we use them without requiring access to the wallet? Thanks!
Jesús Zazueta
CC BY-SA 3.0
2014-12-06T20:34:24.687Z
2014-12-06T20:34:24.687Z
David A. Harding
<p>I'm implementing multisig addresses which is a great solution to a problem, but as far as I can see there's no way to create the multisig address without knowing all the private keys at the start. Isn't that a single point of failure? Whatever system creates the multisig address knows all the private keys.</p>

<p>I was expecting to be able to create a partial multisig address (me) pass the hex result to someone else to add their private key and then off to the escrow to add their private key... kinda like signing of multisig transactions.</p>

<p>You can see in Gavin's example he has all 3 keys at the begining: <a href="https://gist.github.com/gavinandresen/3966071" rel="nofollow">https://gist.github.com/gavinandresen/3966071</a></p>

<p>Thanks.</p>

<multi-signature>
createmultisig single point of failure
mkaj
# createmultisig single point of failure

(Asked by: username_0 on 2014-12-06)

I'm implementing multisig addresses which is a great solution to a problem, but as far as I can see there's no way to create the multisig address without knowing all the private keys at the start. Isn't that a single point of failure? Whatever system creates the multisig address knows all the private keys.

I was expecting to be able to create a partial multisig address (me) pass the hex result to someone else to add their private key and then off to the escrow to add their private key... kinda like signing of multisig transactions.

You can see in Gavin's example he has all 3 keys at the begining: <https://gist.github.com/gavinandresen/3966071>

Thanks.

**Tags:** multi-signature


---

## 1 answers

### Answer by username_1 on 2014-12-06. Score: 5 | Accepted answer

You're correct that Gavin has all three private keys available to him at the start, but you're missing that he only uses the public keys to create the P2SH multisig address.  Specifically, this line from the example is listing only public keys,
./bitcoind createmultisig 2 '["0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86","04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8722084861c5c3291ccffef4ec6874","048d2455d2403e08708fc1f556002f1b6cd83f992d085097f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46213"]'

The createmultisig RPC will let you mix addresses (corresponding to private keys you have in local storage) and public keys (for cases where you don't have the private keys---like when creating a multisig address with your friends).
There's a step-by-step create-and-spend multisig example on the Bitcoin.org Developer Examples page  (you probably want to start by reading the immediately previous examples, as they build up to P2SH multisig).

> **Comments:**
> **username_2**: Follow up question. Yes, the example has the Hex representation of the legacy bitcoin address format, but if I understand correctly we can extract the hex representation of the legacy address if and only if we can query the wallet directly for said information. A third party will probably not know how to do this, and the legacy format (or what we call the "public BTC address") is just a hashed version of the public key, thus we can't use public legacy addresses in multisig directly. Now that we have `bech32` addresses, can we use them without requiring access to the wallet? Thanks!  

---

