<p>I answer my question for the benefit of future generations of readers.</p>

<p>If you have only one 33-byte-long public key, you obtain an address by applying a standard technique that consists of 5-7 steps, depending on how you view the technique.</p>

<p>If you have more than one 33-byte-long public keys, you have to construct a so-called redemption script or, in bitcoin parlance, redeemscript. After you’ve constructed the redemption script, you apply the standard technique to the entire redemption script.</p>

<p>Technically, a redemption script is a byte array. Suppose you have two public keys. Conceptually, your byte array should look like this:</p>

<p><code>[OP_1][length of public key 1][public key 1][length of public key 2][public key 2][OP_2][OP_CHECKMULTISIG]</code></p>

<p>In my question, I said that I had parsed the input script of a transaction. Therefore, I didn’t have to construct the array. The redemption-script array was already in the input script. I made a “mistake” of extracting the public keys from the redemption script, believing I should massage only the public keys. I should have taken all the bytes of the redemption-script array.</p>

CC BY-SA 3.0
2014-11-17T12:34:11.423Z
2014-11-18T12:21:46.423Z
2014-11-18T12:21:46.423Z
u2843
<p>Parsing an input script of a transaction, I’ve come across two public keys in the script. Either public key is 33 byte long.</p>

<p>I know how to transform a single 33 byte long public into an address.</p>

<p>What is the mechanism of obtaining an address from two or more public keys?</p>

<p>Note I’m not interested in the bitcoind technique via the createmultisig command.</p>

CC BY-SA 3.0
2014-11-16T12:47:34.197Z
See this answer which describes how to create a multisig script with multiple addresses and then turn that script into a redeem script hash, which is further converted into a P2SH address: http://bitcoin.stackexchange.com/a/26878/21052
David A. Harding
<blockchain><script><multi-signature>
how to get one address from two public keys?
u2843
# how to get one address from two public keys?

(Asked by: username_0 on 2014-11-16)

Parsing an input script of a transaction, I’ve come across two public keys in the script. Either public key is 33 byte long.

I know how to transform a single 33 byte long public into an address.

What is the mechanism of obtaining an address from two or more public keys?

Note I’m not interested in the bitcoind technique via the createmultisig command.

**Tags:** blockchain, script, multi-signature

> **Comments:**
> **username_1**: See this answer which describes how to create a multisig script with multiple addresses and then turn that script into a redeem script hash, which is further converted into a P2SH address: http://bitcoin.stackexchange.com/a/26878/21052  

---

## 1 answers

### Answer by username_0 on 2014-11-17. Score: 2 | Accepted answer

I answer my question for the benefit of future generations of readers.

If you have only one 33-byte-long public key, you obtain an address by applying a standard technique that consists of 5-7 steps, depending on how you view the technique.

If you have more than one 33-byte-long public keys, you have to construct a so-called redemption script or, in bitcoin parlance, redeemscript. After you’ve constructed the redemption script, you apply the standard technique to the entire redemption script.

Technically, a redemption script is a byte array. Suppose you have two public keys. Conceptually, your byte array should look like this:

`[OP_1][length of public key 1][public key 1][length of public key 2][public key 2][OP_2][OP_CHECKMULTISIG]`

In my question, I said that I had parsed the input script of a transaction. Therefore, I didn’t have to construct the array. The redemption-script array was already in the input script. I made a “mistake” of extracting the public keys from the redemption script, believing I should massage only the public keys. I should have taken all the bytes of the redemption-script array.


---

