<p>In short words: yes, if you want to redeem two previous outputs in one transaction - you should sign twice.
The steps for creating such transaction are:</p>

<ol>
<li>create "template" of transaction for redeeming first output </li>
<li>hash it. this will be digest1. </li>
<li>sign the digest1 with your privkey1. this will be signature1 </li>
<li>create "template" of transaction for redeeming second output </li>
<li>hash it. this will be digest2 (not equal to digest1 !) </li>
<li>sign the digest2 with your privkey2. this will be signature2 </li>
<li>create the transaction itself with {pubkey1, signature1, pubkey2, signature2}</li>
</ol>

<p>note: steps 1,2,3 can be made by Alice who has privkey1. steps 4,5,6 can be made by another person, say Bob who holds privkey2. step 7 can be made by everyone</p>

CC BY-SA 3.0
2015-01-22T14:36:22.997Z
2015-01-22T14:36:22.997Z
amaclin
<p><br/>
My question is that, suppose there is a txn <strong>tx(k)</strong> paid from user <em>u</em> to <em>v</em>, that refers two txns <strong>tx(i)</strong> and <strong>tx(j)</strong> as it's inputs. Also, both these inputs are meant for different public keys of <em>u</em>, say, <strong>Pk1(u)</strong> and <strong>Pk2(u)</strong>. </p>

<p>How does <em>u</em> sign <strong>tx(k)</strong> for <em>v</em>, i.e. how does she convince <em>v</em> that she owns both of those public keys? Does she sign <strong>tx(k)</strong> with both <strong>Sk1(u)</strong> and <strong>Sk2(u)</strong>?<br/>
Thank you.</p>

<transactions>
Signature on transactions with multiple inputs
Bitswazsky
# Signature on transactions with multiple inputs

(Asked by: username_0 on 2015-01-22)

My question is that, suppose there is a txn **tx(k)** paid from user *u* to *v*, that refers two txns **tx(i)** and **tx(j)** as it's inputs. Also, both these inputs are meant for different public keys of *u*, say, **Pk1(u)** and **Pk2(u)**.

How does *u* sign **tx(k)** for *v*, i.e. how does she convince *v* that she owns both of those public keys? Does she sign **tx(k)** with both **Sk1(u)** and **Sk2(u)**?  
Thank you.

**Tags:** transactions


---

## 1 answers

### Answer by username_1 on 2015-01-22. Score: 3 | Accepted answer

In short words: yes, if you want to redeem two previous outputs in one transaction - you should sign twice.
The steps for creating such transaction are:

1. create "template" of transaction for redeeming first output
2. hash it. this will be digest1.
3. sign the digest1 with your privkey1. this will be signature1
4. create "template" of transaction for redeeming second output
5. hash it. this will be digest2 (not equal to digest1 !)
6. sign the digest2 with your privkey2. this will be signature2
7. create the transaction itself with {pubkey1, signature1, pubkey2, signature2}

note: steps 1,2,3 can be made by Alice who has privkey1. steps 4,5,6 can be made by another person, say Bob who holds privkey2. step 7 can be made by everyone


---

