Relation between multi-sig and single-sig addresses (in BCCAPI library)? 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 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())
...
The call to receiver.getTypeSpecificBytes() strips off the version byte (the '3'), and ScriptOutputStandard() always creates a P2PKH 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 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.