<p>You are right in how your transaction should look like. However, you are getting confused since you are looking for the wrong concept. </p>

<p>You are not sending funds to a multisig address, that is an address shared by multiple users in which some of them need to sign a transaction or order to spend funds from the address. You are (if I've got it right) willing to spend funds from two different addresses (<code>A</code> and <code>B</code>) in order to send funds to a third address: <code>C</code>. </p>

<p>Therefore, what you should build is a transaction with inputs from both addresses <code>A</code> and <code>B</code>, in which each input may be sign by the corresponding address from the latter two. </p>

CC BY-SA 3.0
2017-03-25T01:06:20.467Z
In my example the `.from` function takes two inputs. I wrote output_A,output_B as the inputs because I was thinking of them being the outputs of the previous transaction... we are both correct; thank you!
Ben Muircroft
CC BY-SA 3.0
2017-03-24T21:26:48.990Z
2017-03-24T21:26:48.990Z
sr_gi
<p>Related: <a href="https://bitcoin.stackexchange.com/questions/37609/using-bitcore-to-create-a-transaction-with-two-addresses-and-change-address">Using bitcore to create a transaction with two addresses and change address</a></p>

<p>I would like to create a transaction from addresses <strong>A</strong> and <strong>B</strong> sending to address <strong>C</strong></p>

<p>In the above question I get a little confused (it looks like hes doing one transaction that sends from addresses <strong>A</strong> and <strong>B</strong> to addresses <strong>C</strong> and <strong>D</strong> receiving change at address <strong>E</strong>) because it looks like he is signing it with the two receiving addresses!</p>

<p>Usually when I create and sign a tx with <a href="https://bitcore.io/api/lib/transaction" rel="nofollow noreferrer">Bitcore</a> I sign it with the sending address's private key not the receiving address (in my case the receiving address would be a user I do not personally know)</p>

<p>The bitcore docs say:</p>

<blockquote>
  <p>To send a transaction to a multisig address, the API is the same as <s>in the above example</s>. To spend outputs that require multiple signatures, the process needs extra information: the public keys of the signers that can unlock that output.</p>
</blockquote>

<pre><code>var multiSigTx = new Transaction()
.from(utxo, publicKeys, threshold)
.change(address)
.sign(myKeys);

var serialized = multiSigTx.toObject();
</code></pre>

<p>The two parts to this that confuse me are:</p>

<ul>
<li>Bitcore quote - To send a transaction to a multisig address...</li>
</ul>

<p>Is this different from a regular address? I notice that the example is lacking <code>.to(address, amount)</code></p>

<ul>
<li>Why is Richard from the related question signing with the receiving address's private keys?</li>
</ul>

<hr>

<p>Logically shouldn't my desired action look something like this?:</p>

<pre><code>var transaction=new Bitcore.Transaction()
.fee(fee)
.from([output_A,output_B])
.to(pubkey_C,satoshis-fee)
.change(address_A)                    //don't loose the change
.sign([privatekey_A,privatekey_B]);
</code></pre>

<p><em>output_A is from address A and output_B is from address B (both my addresses)</em></p>

<transactions><bitcore>
Create a transaction from addresses A and B sending to address C
Ben Muircroft
# Create a transaction from addresses A and B sending to address C

(Asked by: username_0 on 2017-03-24)

Related: [Using bitcore to create a transaction with two addresses and change address](https://bitcoin.stackexchange.com/questions/37609/using-bitcore-to-create-a-transaction-with-two-addresses-and-change-address)

I would like to create a transaction from addresses **A** and **B** sending to address **C**

In the above question I get a little confused (it looks like hes doing one transaction that sends from addresses **A** and **B** to addresses **C** and **D** receiving change at address **E**) because it looks like he is signing it with the two receiving addresses!

Usually when I create and sign a tx with [Bitcore](https://bitcore.io/api/lib/transaction) I sign it with the sending address's private key not the receiving address (in my case the receiving address would be a user I do not personally know)

The bitcore docs say:

> To send a transaction to a multisig address, the API is the same as ~~in the above example~~. To spend outputs that require multiple signatures, the process needs extra information: the public keys of the signers that can unlock that output.

```
var multiSigTx = new Transaction()
.from(utxo, publicKeys, threshold)
.change(address)
.sign(myKeys);

var serialized = multiSigTx.toObject();

```

The two parts to this that confuse me are:

* Bitcore quote - To send a transaction to a multisig address...

Is this different from a regular address? I notice that the example is lacking `.to(address, amount)`

* Why is Richard from the related question signing with the receiving address's private keys?

---

Logically shouldn't my desired action look something like this?:

```
var transaction=new Bitcore.Transaction()
.fee(fee)
.from([output_A,output_B])
.to(pubkey_C,satoshis-fee)
.change(address_A)                    //don't loose the change
.sign([privatekey_A,privatekey_B]);

```

*output\_A is from address A and output\_B is from address B (both my addresses)*

**Tags:** transactions, bitcore


---

## 1 answers

### Answer by username_1 on 2017-03-24. Score: 1 | Accepted answer

You are right in how your transaction should look like. However, you are getting confused since you are looking for the wrong concept.

You are not sending funds to a multisig address, that is an address shared by multiple users in which some of them need to sign a transaction or order to spend funds from the address. You are (if I've got it right) willing to spend funds from two different addresses (`A` and `B`) in order to send funds to a third address: `C`.

Therefore, what you should build is a transaction with inputs from both addresses `A` and `B`, in which each input may be sign by the corresponding address from the latter two.

> **Comments:**
> **username_0**: In my example the `.from` function takes two inputs. I wrote output_A,output_B as the inputs because I was thinking of them being the outputs of the previous transaction... we are both correct; thank you!  

---

