<p>The call to <code>receiver.getTypeSpecificBytes()</code> strips off the version byte (the '3'), and <code>ScriptOutputStandard()</code> always creates a <a href="https://bitcoin.org/en/glossary/p2pkh-address" rel="nofollow">P2PKH</a> script from this raw (with no version byte) 20-byte hash. The bitcoin that was sent to the P2PKH address is probably irretrievable.</p>

<p>You probably meant to do this to create a <a href="https://bitcoin.org/en/glossary/p2sh-address" rel="nofollow">P2SH</a> script:</p>

<pre><code>val so = new com.bccapi.bitlib.model.ScriptOutputMultisig(receiver.getTypeSpecificBytes())
</code></pre>

<p>Also, just FYI I don't think BCCAPI is being supported any longer. I don't see any updates to it since late 2012, and the then maintainer has since moved on to create Mycelium. You may want to consider an alternative Java Bitcoin library such as <a href="https://bitcoinj.github.io/" rel="nofollow">bitcoinj</a>.</p>

CC BY-SA 3.0
2015-06-19T03:16:50.230Z
*The bitcoin that was sent to the P2PKH address is probably irretrievable* is the part I'm interested in confirming. Its a small amount so if its futile, I won't waste my time. I used this exact method to create ordinary transactions without problems. It only happened with multi-sig. I'm hoping that the public key in the output **might** be one of the public keys of the multi-sig.. But thats probably not true.
Jus12
CC BY-SA 3.0
2015-06-19T04:44:09.900Z
If your "3..." **M** address is in fact a valid P2SH address created by a working wallet or library, then there is no way to recover any funds sent to the **A** address created by your code above. The private keys for the **A** address cannot be determined even if you have the keys for the **M** address. Sorry.... :(
Christopher Gurnee
CC BY-SA 3.0
2015-06-19T05:43:28.007Z
In that case I should consider myself lucky that the amount lost is small. A lessen well learnt.
Jus12
CC BY-SA 3.0
2015-06-18T21:43:23.137Z
2015-06-18T22:46:44.080Z
2015-06-18T22:46:44.080Z
Christopher Gurnee
<p>I had a multi-sig address <strong>M</strong> (starting with 3) that I was trying to send a small amount of coins to. I was playing around with <a href="https://code.google.com/p/bccapi/" rel="nofollow">BCCAPI</a> and the coins got sent to an "ordinary" address <strong>A</strong> (starting with 1)</p>

<p>I had supplied <strong>M</strong> to the library but somehow the signed tx had the address <strong>A</strong></p>

<p>I know who controls <strong>M</strong> but no one seems to control <strong>A</strong>. I am trying to see if the funds can be recovered by someone controlling <strong>M</strong>. </p>

<p>Is there any relation between the two addresses? I'd prefer not to post the actual addresses yet. However, the fact that I used BCCAPI might give some clue.</p>

<p>Here is the code (in Scala) that I used:</p>

<pre><code>val M = "3..." // multi-sig address
val receiver = com.bccapi.bitlib.model.Address.fromString(M, netParams)
val so = new com.bccapi.bitlib.model.ScriptOutputStandard(receiver.getTypeSpecificBytes())
...
</code></pre>

<address><multi-signature>
Relation between multi-sig and single-sig addresses (in BCCAPI library)?
Jus12
# Relation between multi-sig and single-sig addresses (in BCCAPI library)?

(Asked by: username_0 on 2015-06-18)

I had a multi-sig address **M** (starting with 3) that I was trying to send a small amount of coins to. I was playing around with [BCCAPI](https://code.google.com/p/bccapi/) and the coins got sent to an "ordinary" address **A** (starting with 1)

I had supplied **M** to the library but somehow the signed tx had the address **A**

I know who controls **M** but no one seems to control **A**. I am trying to see if the funds can be recovered by someone controlling **M**.

Is there any relation between the two addresses? I'd prefer not to post the actual addresses yet. However, the fact that I used BCCAPI might give some clue.

Here is the code (in Scala) that I used:

```
val M = "3..." // multi-sig address
val receiver = com.bccapi.bitlib.model.Address.fromString(M, netParams)
val so = new com.bccapi.bitlib.model.ScriptOutputStandard(receiver.getTypeSpecificBytes())
...

```

**Tags:** address, multi-signature


---

## 1 answers

### Answer by username_1 on 2015-06-18. Score: 1 | Accepted answer

The call to `receiver.getTypeSpecificBytes()` strips off the version byte (the '3'), and `ScriptOutputStandard()` always creates a [P2PKH](https://bitcoin.org/en/glossary/p2pkh-address) script from this raw (with no version byte) 20-byte hash. The bitcoin that was sent to the P2PKH address is probably irretrievable.

You probably meant to do this to create a [P2SH](https://bitcoin.org/en/glossary/p2sh-address) script:

```
val so = new com.bccapi.bitlib.model.ScriptOutputMultisig(receiver.getTypeSpecificBytes())

```

Also, just FYI I don't think BCCAPI is being supported any longer. I don't see any updates to it since late 2012, and the then maintainer has since moved on to create Mycelium. You may want to consider an alternative Java Bitcoin library such as [bitcoinj](https://bitcoinj.github.io/).

> **Comments:**
> **username_0**: *The bitcoin that was sent to the P2PKH address is probably irretrievable* is the part I'm interested in confirming. Its a small amount so if its futile, I won't waste my time. I used this exact method to create ordinary transactions without problems. It only happened with multi-sig. I'm hoping that the public key in the output **might** be one of the public keys of the multi-sig.. But thats probably not true.  
> **username_1**: If your "3..." **M** address is in fact a valid P2SH address created by a working wallet or library, then there is no way to recover any funds sent to the **A** address created by your code above. The private keys for the **A** address cannot be determined even if you have the keys for the **M** address. Sorry.... :(  
> **username_0**: In that case I should consider myself lucky that the amount lost is small. A lessen well learnt.  

---

