<p>1.Sign the Raw_Transaction above with private key1.</p>

<p>The output would be</p>

<pre><code>01000000018ba2a19585a515c82a002b7c900c4b1f4ba413434798cc720f36289e812c70c300000000d200473044022028302ac2842f56c7b77c93e508fdd2ddaae73891a59ffcd00a225761e2f4097c02200b5002b74c2ba90bb70774d0bd449a13ff4d94d267004ad4d04d9e0672d6f33d014c8752410401e52f885e02000e7ec5f410f2e680cfd0ca8be75d5425c75934499fc17e24152e1f9a391764b858ac276877b56253a7a1beafe8f7574f572461c3780a3778c141044bd79509fea54fc8118eed193a295a34b8dcbd030a09c7fcf815c785846dca56b3d6ddfd96e582a96e6e13e90569dbf8ee52c2517bfbed22f8ad17d850d283b452aeffffffff01e0083000000000001976a91490b5f4fc981ff94df22a1f845c0b7074623042d588ac00000000
</code></pre>

<p>2.Sign the partially signed transaction above with priavate key2.</p>

<p>The output would be</p>

<pre><code>01000000018ba2a19585a515c82a002b7c900c4b1f4ba413434798cc720f36289e812c70c300000000fd1a0100473044022028302ac2842f56c7b77c93e508fdd2ddaae73891a59ffcd00a225761e2f4097c02200b5002b74c2ba90bb70774d0bd449a13ff4d94d267004ad4d04d9e0672d6f33d0147304402203262e78af66954397c190cdcd69e2cdbc8957d4280caf61e8be15012c4a981d102207d4fc48692d30bdb054f739c8138c2c10901c4edf44bf7f2ff607d5134973ae9014c8752410401e52f885e02000e7ec5f410f2e680cfd0ca8be75d5425c75934499fc17e24152e1f9a391764b858ac276877b56253a7a1beafe8f7574f572461c3780a3778c141044bd79509fea54fc8118eed193a295a34b8dcbd030a09c7fcf815c785846dca56b3d6ddfd96e582a96e6e13e90569dbf8ee52c2517bfbed22f8ad17d850d283b452aeffffffff01e0083000000000001976a91490b5f4fc981ff94df22a1f845c0b7074623042d588ac00000000
</code></pre>

<p>3.Now you can broadcast the transaction signed with two keys</p>

CC BY-SA 4.0
2019-11-07T12:32:01.890Z
2019-11-07T13:06:58.937Z
2019-11-07T13:06:58.937Z
ogw_yuya
<p>I created 2-2 Multisig Account <code>2NECouPA4UVNMzX1K7kekc4W3VudDhMdFkM</code> from <code>msrFNhKwLu9GrT3hFoizz21xEwJ61xMsym</code> and <code>n1NPFEJHBA8j63B5dgJ3aQcufA8VmrN27U</code>, I tried spending UTXO from this account but got an error, I was successful in spending UTXO form 2-3 MultiSig Account.</p>

<p>Could someone please help me.</p>

<p><strong>Address_1:</strong>
Private Key: <code>89fcbf126a2d78f4055ff4eb4e44642504d2bea1fea248627ca75eaa35dc56eb</code> </p>

<p>Public Key: <code>0401e52f885e02000e7ec5f410f2e680cfd0ca8be75d5425c75934499fc17e24152e1f9a391764b858ac276877b56253a7a1beafe8f7574f572461c3780a3778c1</code> </p>

<p>Testnet Address: msrFNhKwLu9GrT3hFoizz21xEwJ61xMsym</p>

<p><strong>Address_2:</strong>
Private Key: <code>b74b1862b7e5e92c4fa9ce79826e1579df1b6b09f1f3bf312918f9e6e32f39de</code> </p>

<p>Public Key: <code>044bd79509fea54fc8118eed193a295a34b8dcbd030a09c7fcf815c785846dca56b3d6ddfd96e582a96e6e13e90569dbf8ee52c2517bfbed22f8ad17d850d283b4</code> </p>

<p>Testnet Address: <em>n1NPFEJHBA8j63B5dgJ3aQcufA8VmrN27U</em></p>

<p><strong>MultiSig 2-2 Testnet Address</strong>:  <code>2NECouPA4UVNMzX1K7kekc4W3VudDhMdFkM</code></p>

<p>Raw_Script:
<code>52410401e52f885e02000e7ec5f410f2e680cfd0ca8be75d5425c75934499fc17e24152e1f9a391764b858ac276877b56253a7a1beafe8f7574f572461c3780a3778c141044bd79509fea54fc8118eed193a295a34b8dcbd030a09c7fcf815c785846dca56b3d6ddfd96e582a96e6e13e90569dbf8ee52c2517bfbed22f8ad17d850d283b452ae60f72cc98474313a44b1f4b0c907c2b002ac815a58595a1a28b</code></p>

<p>Raw_Transaction:</p>

<pre><code>01000000018ba2a19585a515c82a002b7c900c4b1f4ba413434798cc720f36289e812c70c3000000008752410401e52f885e02000e7ec5f410f2e680cfd0ca8be75d5425c75934499fc17e24152e1f9a391764b858ac276877b56253a7a1beafe8f7574f572461c3780a3778c141044bd79509fea54fc8118eed193a295a34b8dcbd030a09c7fcf815c785846dca56b3d6ddfd96e582a96e6e13e90569dbf8ee52c2517bfbed22f8ad17d850d283b452aeffffffff01e0083000000000001976a91490b5f4fc981ff94df22a1f845c0b7074623042d588ac0000000001000000
</code></pre>

<p>Taking Signature_1 and then Signature_2:
Sig_1: <code>3044022044ebf0dd5ffe267771987e02a763c3721d4e872931a5b9ec7d05fca0e952dec002205a5315dd4920175ed36d32be7d8011b2d429120bc996408d47e15d4d246982f0</code></p>

<p>Sig_2: <code>304402206574c1e54144268079120ab996d84209edf6bde8620108aab5b1e8ba0a0e7b5b022006b02e6d31459f732d16bf39ea488485c3a7c2d1106c4a9210916df1a9900b73</code></p>

<p>Transaction_to_Broadcast:</p>

<pre><code>01000000018ba2a19585a515c82a002b7c900c4b1f4ba413434798cc720f36289e812c70c300000000fd190100473044022044ebf0dd5ffe267771987e02a763c3721d4e872931a5b9ec7d05fca0e952dec002205a5315dd4920175ed36d32be7d8011b2d429120bc996408d47e15d4d246982f00147304402206574c1e54144268079120ab996d84209edf6bde8620108aab5b1e8ba0a0e7b5b022006b02e6d31459f732d16bf39ea488485c3a7c2d1106c4a9210916df1a9900b73018752410401e52f885e02000e7ec5f410f2e680cfd0ca8be75d5425c75934499fc17e24152e1f9a391764b858ac276877b56253a7a1beafe8f7574f572461c3780a3778c141044bd79509fea54fc8118eed193a295a34b8dcbd030a09c7fcf815c785846dca56b3d6ddfd96e582a96e6e13e90569dbf8ee52c2517bfbed22f8ad17d850d283b452aeffffffff01e0083000000000001976a91490b5f4fc981ff94df22a1f845c0b7074623042d588ac00000000
</code></pre>

CC BY-SA 4.0
2019-11-06T12:05:22.600Z
What error did you get?
Raghav Sood
CC BY-SA 4.0
2019-11-06T12:17:42.180Z
https://tbtc.bitaps.com/broadcast: mandatory-script-verify-flag-failed (Operation not valid with the current stack size) (code 16)

https://live.blockcypher.com/btc-testnet/pushtx/: Error validating transaction: Rejected script for input 0 referencing c3702c819e28360f72cc98474313a44b1f4b0c907c2b002ac815a58595a1a28b at 0
Yash Madhwal
CC BY-SA 4.0
2019-11-06T20:59:36.117Z
What is the value of bitcoin you want to unlock with the transaction described inside the post?
vincenzopalazzo
CC BY-SA 4.0
2019-11-06T21:41:42.717Z
UTXO value is 0.03148581 and in this transaction, I want to unlock 0.03148. Earlier I have tried 2-3 MultiSig Transaction and faced no problem. I have always encountered a problem when trying to spend from 2-2 MultiSig Address.
Yash Madhwal
CC BY-SA 4.0
2019-11-07T09:05:48.557Z
@YashMadhwal can you add the code of the scriptSig, please?
vincenzopalazzo
CC BY-SA 4.0
2019-11-07T12:55:20.080Z
@vincenzopalazzo I am manually making the transaction from self-created python Programs. I was able to verify 1-1 P2SH, 2-3 P2SH Transaction. I am getting same error for 1-2 P2SH Script.
Yash Madhwal
<transactions><multi-signature><transaction-verification>
Not able to Spend 2-2 MultiSig UTXO
Yash Madhwal
# Not able to Spend 2-2 MultiSig UTXO

(Asked by: username_0 on 2019-11-06)

I created 2-2 Multisig Account 2NECouPA4UVNMzX1K7kekc4W3VudDhMdFkM from msrFNhKwLu9GrT3hFoizz21xEwJ61xMsym and n1NPFEJHBA8j63B5dgJ3aQcufA8VmrN27U, I tried spending UTXO from this account but got an error, I was successful in spending UTXO form 2-3 MultiSig Account.
Could someone please help me.
Address_1:
Private Key: 89fcbf126a2d78f4055ff4eb4e44642504d2bea1fea248627ca75eaa35dc56eb 
Public Key: 0401e52f885e02000e7ec5f410f2e680cfd0ca8be75d5425c75934499fc17e24152e1f9a391764b858ac276877b56253a7a1beafe8f7574f572461c3780a3778c1 
Testnet Address: msrFNhKwLu9GrT3hFoizz21xEwJ61xMsym
Address_2:
Private Key: b74b1862b7e5e92c4fa9ce79826e1579df1b6b09f1f3bf312918f9e6e32f39de 
Public Key: 044bd79509fea54fc8118eed193a295a34b8dcbd030a09c7fcf815c785846dca56b3d6ddfd96e582a96e6e13e90569dbf8ee52c2517bfbed22f8ad17d850d283b4 
Testnet Address: n1NPFEJHBA8j63B5dgJ3aQcufA8VmrN27U
MultiSig 2-2 Testnet Address:  2NECouPA4UVNMzX1K7kekc4W3VudDhMdFkM
Raw_Script:
52410401e52f885e02000e7ec5f410f2e680cfd0ca8be75d5425c75934499fc17e24152e1f9a391764b858ac276877b56253a7a1beafe8f7574f572461c3780a3778c141044bd79509fea54fc8118eed193a295a34b8dcbd030a09c7fcf815c785846dca56b3d6ddfd96e582a96e6e13e90569dbf8ee52c2517bfbed22f8ad17d850d283b452ae60f72cc98474313a44b1f4b0c907c2b002ac815a58595a1a28b
Raw_Transaction:
01000000018ba2a19585a515c82a002b7c900c4b1f4ba413434798cc720f36289e812c70c3000000008752410401e52f885e02000e7ec5f410f2e680cfd0ca8be75d5425c75934499fc17e24152e1f9a391764b858ac276877b56253a7a1beafe8f7574f572461c3780a3778c141044bd79509fea54fc8118eed193a295a34b8dcbd030a09c7fcf815c785846dca56b3d6ddfd96e582a96e6e13e90569dbf8ee52c2517bfbed22f8ad17d850d283b452aeffffffff01e0083000000000001976a91490b5f4fc981ff94df22a1f845c0b7074623042d588ac0000000001000000

Taking Signature_1 and then Signature_2:
Sig_1: 3044022044ebf0dd5ffe267771987e02a763c3721d4e872931a5b9ec7d05fca0e952dec002205a5315dd4920175ed36d32be7d8011b2d429120bc996408d47e15d4d246982f0
Sig_2: 304402206574c1e54144268079120ab996d84209edf6bde8620108aab5b1e8ba0a0e7b5b022006b02e6d31459f732d16bf39ea488485c3a7c2d1106c4a9210916df1a9900b73
Transaction_to_Broadcast:
01000000018ba2a19585a515c82a002b7c900c4b1f4ba413434798cc720f36289e812c70c300000000fd190100473044022044ebf0dd5ffe267771987e02a763c3721d4e872931a5b9ec7d05fca0e952dec002205a5315dd4920175ed36d32be7d8011b2d429120bc996408d47e15d4d246982f00147304402206574c1e54144268079120ab996d84209edf6bde8620108aab5b1e8ba0a0e7b5b022006b02e6d31459f732d16bf39ea488485c3a7c2d1106c4a9210916df1a9900b73018752410401e52f885e02000e7ec5f410f2e680cfd0ca8be75d5425c75934499fc17e24152e1f9a391764b858ac276877b56253a7a1beafe8f7574f572461c3780a3778c141044bd79509fea54fc8118eed193a295a34b8dcbd030a09c7fcf815c785846dca56b3d6ddfd96e582a96e6e13e90569dbf8ee52c2517bfbed22f8ad17d850d283b452aeffffffff01e0083000000000001976a91490b5f4fc981ff94df22a1f845c0b7074623042d588ac00000000

**Tags:** transactions, multi-signature, transaction-verification

> **Comments:**
> **username_1**: What error did you get?  
> **username_0**: https://tbtc.bitaps.com/broadcast: mandatory-script-verify-flag-failed (Operation not valid with the current stack size) (code 16)  https://live.blockcypher.com/btc-testnet/pushtx/: Error validating transaction: Rejected script for input 0 referencing c3702c819e28360f72cc98474313a44b1f4b0c907c2b002ac815a58595a1a28b at 0  
> **username_2**: What is the value of bitcoin you want to unlock with the transaction described inside the post?  
> **username_0**: UTXO value is 0.03148581 and in this transaction, I want to unlock 0.03148. Earlier I have tried 2-3 MultiSig Transaction and faced no problem. I have always encountered a problem when trying to spend from 2-2 MultiSig Address.  
> **username_2**: @YashMadhwal can you add the code of the scriptSig, please?  
> **username_0**: @username_2 I am manually making the transaction from self-created python Programs. I was able to verify 1-1 P2SH, 2-3 P2SH Transaction. I am getting same error for 1-2 P2SH Script.  

---

## 1 answers

### Answer by username_3 on 2019-11-07. Score: 1 | Accepted answer

1.Sign the Raw_Transaction above with private key1.
The output would be
01000000018ba2a19585a515c82a002b7c900c4b1f4ba413434798cc720f36289e812c70c300000000d200473044022028302ac2842f56c7b77c93e508fdd2ddaae73891a59ffcd00a225761e2f4097c02200b5002b74c2ba90bb70774d0bd449a13ff4d94d267004ad4d04d9e0672d6f33d014c8752410401e52f885e02000e7ec5f410f2e680cfd0ca8be75d5425c75934499fc17e24152e1f9a391764b858ac276877b56253a7a1beafe8f7574f572461c3780a3778c141044bd79509fea54fc8118eed193a295a34b8dcbd030a09c7fcf815c785846dca56b3d6ddfd96e582a96e6e13e90569dbf8ee52c2517bfbed22f8ad17d850d283b452aeffffffff01e0083000000000001976a91490b5f4fc981ff94df22a1f845c0b7074623042d588ac00000000

2.Sign the partially signed transaction above with priavate key2.
The output would be
01000000018ba2a19585a515c82a002b7c900c4b1f4ba413434798cc720f36289e812c70c300000000fd1a0100473044022028302ac2842f56c7b77c93e508fdd2ddaae73891a59ffcd00a225761e2f4097c02200b5002b74c2ba90bb70774d0bd449a13ff4d94d267004ad4d04d9e0672d6f33d0147304402203262e78af66954397c190cdcd69e2cdbc8957d4280caf61e8be15012c4a981d102207d4fc48692d30bdb054f739c8138c2c10901c4edf44bf7f2ff607d5134973ae9014c8752410401e52f885e02000e7ec5f410f2e680cfd0ca8be75d5425c75934499fc17e24152e1f9a391764b858ac276877b56253a7a1beafe8f7574f572461c3780a3778c141044bd79509fea54fc8118eed193a295a34b8dcbd030a09c7fcf815c785846dca56b3d6ddfd96e582a96e6e13e90569dbf8ee52c2517bfbed22f8ad17d850d283b452aeffffffff01e0083000000000001976a91490b5f4fc981ff94df22a1f845c0b7074623042d588ac00000000

3.Now you can broadcast the transaction signed with two keys


---

