<p>Ok, so for those wanting to see what I did. Here is the following code that IS working:</p>
<pre><code>void Main()
{
    Network network = Network.TestNet4;
    byte[] key1Bytes = (&quot;Removed&quot;).HexToByteArray();
    byte[] key2Bytes = (&quot;Removed&quot;).HexToByteArray();
    byte[] key3Bytes = (&quot;Removed&quot;).HexToByteArray();
    
    Key key1 = new Key(key1Bytes);
    Key key2 = new Key(key2Bytes);
    Key key3 = new Key(key3Bytes);

    // Create a 2-of-3 multi-sig script
    Script scriptPubKey   = PayToMultiSigTemplate.Instance.GenerateScriptPubKey(2, new[] { key1.PubKey, key2.PubKey, key3.PubKey });
    Script redeemScript = scriptPubKey.PaymentScript;
    
    BitcoinAddress multiSigAddress = scriptPubKey.Hash.GetAddress(network);
    var sender = multiSigAddress.ToString();

    Console.WriteLine(&quot;Multi-Sig Address: &quot; + multiSigAddress);
    //cc1e708dd199b390f5103444ff0b131bbc4294ce55cfaa3e0878e41cb21abc14
    //cc0bdc3c691c263407b1060169d44fc2c59b004cd182e6aa72873f0cc389dd96
    //vout 1
    

    OutPoint outPoint = new OutPoint(uint256.Parse(&quot;cc0bdc3c691c263407b1060169d44fc2c59b004cd182e6aa72873f0cc389dd96&quot;), 1);
    Coin coin = new Coin(outPoint, new TxOut(Money.Satoshis(500_000m), redeemScript));
    ScriptCoin coinToSpend = new ScriptCoin(coin, scriptPubKey);
    
    
    var txInAmount = coin.Amount;
    var minerFee = new Money(450, MoneyUnit.Satoshi);
    var sendAmount = new Money(0.00001M, MoneyUnit.BTC);
    var totalSpend = sendAmount - minerFee;

    // Destination address
    BitcoinAddress recipientAddress = BitcoinAddress.Create(&quot;tb1qj3drgzxj7lxs0d73mmaa5c5eyjqkq8vwjx7xak&quot;, network);

    // Create the transaction
    TransactionBuilder builder = network.CreateTransactionBuilder();
    TransactionBuilder builderForKey1 = network.CreateTransactionBuilder();
    TransactionBuilder builderForKey2 = network.CreateTransactionBuilder();

    NBitcoin.Transaction unsigned = builder
        .AddCoins(coinToSpend)
        .Send(recipientAddress, totalSpend)
        .SendFees(minerFee)
        .SetChange(multiSigAddress)
        .SetOptInRBF(true)
        .BuildTransaction(false);

    NBitcoin.Transaction key1Signed =
        builderForKey1
        .AddCoins(coinToSpend)
        .AddKeys(key1)
        .SignTransaction(unsigned);

    NBitcoin.Transaction key2Signed =
        builderForKey2
        .AddCoins(coinToSpend)
        .AddKeys(key2)
        .SignTransaction(key1Signed);

    NBitcoin.Transaction fullySigned =
        builder
        .AddCoins(coinToSpend)
        .CombineSignatures(key1Signed, key2Signed);


    var txVerified = builder.Verify(fullySigned);
    var result = fullySigned.Check();


    txVerified.Dump();
        result.Dump();

    var hexTx = fullySigned.ToHex();
    var hashTX = fullySigned.GetHash();
    hexTx.Dump();

    //Console.WriteLine(fullySigned);

//  var hexTx = fullySigned.ToHex();
//  var hashTX = fullySigned.GetHash();
//
//  hexTx.Dump();
    //BroadcastTransaction(fullySigned);
}
public static decimal BTCMultiplier = 100_000_000M;

void BroadcastTransaction(NBitcoin.Transaction transaction)
{
    using (var node = Node.Connect(Network.TestNet4, &quot;BTCNodeIpGoesHere&quot;))
    {
        node.VersionHandshake();
        node.SendMessage(new InvPayload(InventoryType.MSG_TX, transaction.GetHash()));
        node.SendMessage(new TxPayload(transaction));
        Thread.Sleep(500); // Wait a bit to ensure the transaction is sent
    }
}

public static class MyExtensions
{
    public static byte[] HexToByteArray(this string hex)
    {
        var bytes = Enumerable.Range(0, hex.Length / 2)
                .Select(x =&gt; Convert.ToByte(hex.Substring(x * 2, 2), 16))
                .ToArray();

        return bytes;
    }
}
</code></pre>
<p>You can see the TX worked here: <a href="https://mempool.space/testnet4/tx/800f4031f65eb141fc7083d89a29c6987da75c6d282ccb2bc72673e219d027ad" rel="nofollow noreferrer">https://mempool.space/testnet4/tx/800f4031f65eb141fc7083d89a29c6987da75c6d282ccb2bc72673e219d027ad</a></p>
<p>Now that I understand how to do a basic MS, I will attempt to use PSBTs for better support and cleaner code.
This was done in C# and with a modified version of NBitcoin to support Testnet4.</p>

CC BY-SA 4.0
2024-07-14T23:03:52.700Z
2024-07-14T23:10:25.110Z
2024-07-14T23:10:25.110Z
mathis1337
<p>The correct address, derived from the redeem script in your transaction, is actually <a href="https://mempool.space/testnet4/address/2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp" rel="nofollow noreferrer">2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp</a>. Both of these recently received 500,000 testnet sats, you must have mixed them up.</p>

CC BY-SA 4.0
2024-07-14T22:47:03.420Z
well I wasn't sure which one was correct. so I tried with both. I will switch everything to use that and report code. Let me know if you see any issues.
mathis1337
CC BY-SA 4.0
2024-07-14T22:55:36.077Z
I have update source code and information above. I still get the same error, so I must be constructing the TX wrong is all I can think. Any ideas?
mathis1337
CC BY-SA 4.0
2024-07-14T22:57:53.520Z
I believe I see my errors. Thank you for assistance.
mathis1337
CC BY-SA 4.0
2024-07-14T17:07:35.367Z
2024-07-14T17:07:35.367Z
Vojtěch Strnad
<blockquote>
<p>010000000196dd89c30c3f8772aae682d14c009bc5c24fd4690106b10734261c693cdc0bcc010000009100473044022004365796cf079934bc168f07e624eba6fe79dceba3d5ef583674265af9b86a8c02201f5858deec99afb9850af2c5d0db8d7da8987e1922ac98448288f5c466e97ad901473044022072ea4e179b0332349ed62fa0f071d31b6e574145629754ee1bdccba4d0fd180d02205eb0afdb3e34fd39b6d8bc11b833332a9cc8cb3da5b8ca66a8ba2def3a01419601fdffffff022602000000000000160014945a3408d2f7cd07b7d1defbda62992481601d8e389d07000000000017a914e087832bbf2a86debc46b2ffbbf73f85d197ee788700000000</p>
</blockquote>
<p>Looking at this transaction data, there is no P2SH redeem script set at the last of script_sig.</p>
<p>You need to set the redeem script for the P2SH address 2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp.</p>

CC BY-SA 4.0
2024-07-15T15:22:51.867Z
Hey thank you for comment. I figured out was I was doing and posted the response below. You are correct I have  my redeem and scriptpubs mixed up and once sorted TXs were being approved and confirmed
mathis1337
CC BY-SA 4.0
2024-07-15T07:00:03.777Z
2024-07-15T07:00:03.777Z
Shigeyuki Azuchi
<p>Trying to produce a multi-sig transaction. I have this so far.</p>
<p>Sent funds to : <code>2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp</code>
<a href="https://mempool.space/testnet4/address/2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp" rel="nofollow noreferrer">https://mempool.space/testnet4/address/2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp</a></p>
<p>I guess firstly was that the wrong address to send to?</p>
<p>Here is my tx hash:
<code>010000000196dd89c30c3f8772aae682d14c009bc5c24fd4690106b10734261c693cdc0bcc010000009100473044022004365796cf079934bc168f07e624eba6fe79dceba3d5ef583674265af9b86a8c02201f5858deec99afb9850af2c5d0db8d7da8987e1922ac98448288f5c466e97ad901473044022072ea4e179b0332349ed62fa0f071d31b6e574145629754ee1bdccba4d0fd180d02205eb0afdb3e34fd39b6d8bc11b833332a9cc8cb3da5b8ca66a8ba2def3a01419601fdffffff022602000000000000160014945a3408d2f7cd07b7d1defbda62992481601d8e389d07000000000017a914e087832bbf2a86debc46b2ffbbf73f85d197ee788700000000</code></p>
<p>I wrote this code to produce all this:</p>
<pre><code>void Main()
{
    Network network = Network.TestNet4;
    byte[] key1Bytes = (&quot;Removed&quot;).HexToByteArray();
    byte[] key2Bytes = (&quot;Removed&quot;).HexToByteArray();
    byte[] key3Bytes = (&quot;Removed&quot;).HexToByteArray();
    
    Key key1 = new Key(key1Bytes);
    Key key2 = new Key(key2Bytes);
    Key key3 = new Key(key3Bytes);

    // Create a 2-of-3 multi-sig script
    Script scriptPubKey   = PayToMultiSigTemplate.Instance.GenerateScriptPubKey(2, new[] { key1.PubKey, key2.PubKey, key3.PubKey });
    //Script redeemScript = scriptPubKey.PaymentScript;
    
    //Get deposit address '2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp'
    BitcoinAddress multiSigAddress = scriptPubKey.Hash.GetAddress(network);
    var sender = multiSigAddress.ToString();

    Console.WriteLine(&quot;Multi-Sig Address: &quot; + multiSigAddress);
    //cc1e708dd199b390f5103444ff0b131bbc4294ce55cfaa3e0878e41cb21abc14
    //cc0bdc3c691c263407b1060169d44fc2c59b004cd182e6aa72873f0cc389dd96
    //vout 1
    

    OutPoint outPoint = new OutPoint(uint256.Parse(&quot;cc0bdc3c691c263407b1060169d44fc2c59b004cd182e6aa72873f0cc389dd96&quot;), 1);
    Coin coin = new Coin(outPoint, new TxOut(Money.Satoshis(500_000m), scriptPubKey));
    //ScriptCoin coinToSpend = new ScriptCoin(coin, scriptPubKey);
    
    
    var txInAmount = coinToSpend.Amount;
    var minerFee = new Money(450, MoneyUnit.Satoshi);
    var sendAmount = new Money(0.00001M, MoneyUnit.BTC);
    var totalSpend = sendAmount - minerFee;

    // Destination address
    BitcoinAddress recipientAddress = BitcoinAddress.Create(&quot;tb1qj3drgzxj7lxs0d73mmaa5c5eyjqkq8vwjx7xak&quot;, network);

    // Create the transaction
    TransactionBuilder builder = network.CreateTransactionBuilder();
    TransactionBuilder builderForKey1 = network.CreateTransactionBuilder();
    TransactionBuilder builderForKey2 = network.CreateTransactionBuilder();

    NBitcoin.Transaction unsigned = builder
        .AddCoins(coin)
        .Send(recipientAddress, totalSpend)
        .SendFees(minerFee)
        .SetChange(multiSigAddress)
        .SetOptInRBF(true)
        .BuildTransaction(false);

    NBitcoin.Transaction key1Signed =
        builderForKey1
        .AddCoins(coin)
        .AddKeys(key1)
        .SignTransaction(unsigned);

    NBitcoin.Transaction key2Signed =
        builderForKey2
        .AddCoins(coin)
        .AddKeys(key2)
        .SignTransaction(key1Signed);

    NBitcoin.Transaction fullySigned =
        builder
        .AddCoins(coin)
        .CombineSignatures(key1Signed, key2Signed);


    var txVerified = builder.Verify(fullySigned);
    var result = fullySigned.Check();


    txVerified.Dump();
        result.Dump();

    var hexTx = fullySigned.ToHex();
    var hashTX = fullySigned.GetHash();
    hexTx.Dump();

    //Console.WriteLine(fullySigned);

//  var hexTx = fullySigned.ToHex();
//  var hashTX = fullySigned.GetHash();
//
//  hexTx.Dump();
    //BroadcastTransaction(fullySigned);
}
public static decimal BTCMultiplier = 100_000_000M;

void BroadcastTransaction(NBitcoin.Transaction transaction)
{
    using (var node = Node.Connect(Network.TestNet4, &quot;Removed&quot;))
    {
        node.VersionHandshake();
        node.SendMessage(new InvPayload(InventoryType.MSG_TX, transaction.GetHash()));
        node.SendMessage(new TxPayload(transaction));
        Thread.Sleep(500); // Wait a bit to ensure the transaction is sent
    }
}

public static class MyExtensions
{
    public static byte[] HexToByteArray(this string hex)
    {
        var bytes = Enumerable.Range(0, hex.Length / 2)
                .Select(x =&gt; Convert.ToByte(hex.Substring(x * 2, 2), 16))
                .ToArray();

        return bytes;
    }
}
</code></pre>
<p>I am kind of at a loss and the transaction passes both the verify and the check, but when I go to broadcast in CLI I get <code>Script evaluated without error but finished with a false/empty top stack element)</code></p>
<p>Any help is appreciated.</p>
<p>Updated code to reflect the address <code>2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp</code></p>

<transactions><multi-signature><signature><p2sh><c#>
Multi-Sig Transaction not broadcasting error - Script evaluated without error but finished with a false/empty top stack element
mathis1337
# Multi-Sig Transaction not broadcasting error - Script evaluated without error but finished with a false/empty top stack element

(Asked by: username_0 on 2024-07-14)

Trying to produce a multi-sig transaction. I have this so far.
Sent funds to : 2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp
https://mempool.space/testnet4/address/2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp
I guess firstly was that the wrong address to send to?
Here is my tx hash:
010000000196dd89c30c3f8772aae682d14c009bc5c24fd4690106b10734261c693cdc0bcc010000009100473044022004365796cf079934bc168f07e624eba6fe79dceba3d5ef583674265af9b86a8c02201f5858deec99afb9850af2c5d0db8d7da8987e1922ac98448288f5c466e97ad901473044022072ea4e179b0332349ed62fa0f071d31b6e574145629754ee1bdccba4d0fd180d02205eb0afdb3e34fd39b6d8bc11b833332a9cc8cb3da5b8ca66a8ba2def3a01419601fdffffff022602000000000000160014945a3408d2f7cd07b7d1defbda62992481601d8e389d07000000000017a914e087832bbf2a86debc46b2ffbbf73f85d197ee788700000000
I wrote this code to produce all this:
void Main()
{
    Network network = Network.TestNet4;
    byte[] key1Bytes = ("Removed").HexToByteArray();
    byte[] key2Bytes = ("Removed").HexToByteArray();
    byte[] key3Bytes = ("Removed").HexToByteArray();
    
    Key key1 = new Key(key1Bytes);
    Key key2 = new Key(key2Bytes);
    Key key3 = new Key(key3Bytes);

    // Create a 2-of-3 multi-sig script
    Script scriptPubKey   = PayToMultiSigTemplate.Instance.GenerateScriptPubKey(2, new[] { key1.PubKey, key2.PubKey, key3.PubKey });
    //Script redeemScript = scriptPubKey.PaymentScript;
    
    //Get deposit address '2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp'
    BitcoinAddress multiSigAddress = scriptPubKey.Hash.GetAddress(network);
    var sender = multiSigAddress.ToString();

    Console.WriteLine("Multi-Sig Address: " + multiSigAddress);
    //cc1e708dd199b390f5103444ff0b131bbc4294ce55cfaa3e0878e41cb21abc14
    //cc0bdc3c691c263407b1060169d44fc2c59b004cd182e6aa72873f0cc389dd96
    //vout 1
    

    OutPoint outPoint = new OutPoint(uint256.Parse("cc0bdc3c691c263407b1060169d44fc2c59b004cd182e6aa72873f0cc389dd96"), 1);
    Coin coin = new Coin(outPoint, new TxOut(Money.Satoshis(500_000m), scriptPubKey));
    //ScriptCoin coinToSpend = new ScriptCoin(coin, scriptPubKey);
    
    
    var txInAmount = coinToSpend.Amount;
    var minerFee = new Money(450, MoneyUnit.Satoshi);
    var sendAmount = new Money(0.00001M, MoneyUnit.BTC);
    var totalSpend = sendAmount - minerFee;

    // Destination address
    BitcoinAddress recipientAddress = BitcoinAddress.Create("tb1qj3drgzxj7lxs0d73mmaa5c5eyjqkq8vwjx7xak", network);

    // Create the transaction
    TransactionBuilder builder = network.CreateTransactionBuilder();
    TransactionBuilder builderForKey1 = network.CreateTransactionBuilder();
    TransactionBuilder builderForKey2 = network.CreateTransactionBuilder();

    NBitcoin.Transaction unsigned = builder
        .AddCoins(coin)
        .Send(recipientAddress, totalSpend)
        .SendFees(minerFee)
        .SetChange(multiSigAddress)
        .SetOptInRBF(true)
        .BuildTransaction(false);

    NBitcoin.Transaction key1Signed =
        builderForKey1
        .AddCoins(coin)
        .AddKeys(key1)
        .SignTransaction(unsigned);

    NBitcoin.Transaction key2Signed =
        builderForKey2
        .AddCoins(coin)
        .AddKeys(key2)
        .SignTransaction(key1Signed);

    NBitcoin.Transaction fullySigned =
        builder
        .AddCoins(coin)
        .CombineSignatures(key1Signed, key2Signed);


    var txVerified = builder.Verify(fullySigned);
    var result = fullySigned.Check();


    txVerified.Dump();
        result.Dump();

    var hexTx = fullySigned.ToHex();
    var hashTX = fullySigned.GetHash();
    hexTx.Dump();

    //Console.WriteLine(fullySigned);

//  var hexTx = fullySigned.ToHex();
//  var hashTX = fullySigned.GetHash();
//
//  hexTx.Dump();
    //BroadcastTransaction(fullySigned);
}
public static decimal BTCMultiplier = 100_000_000M;

void BroadcastTransaction(NBitcoin.Transaction transaction)
{
    using (var node = Node.Connect(Network.TestNet4, "Removed"))
    {
        node.VersionHandshake();
        node.SendMessage(new InvPayload(InventoryType.MSG_TX, transaction.GetHash()));
        node.SendMessage(new TxPayload(transaction));
        Thread.Sleep(500); // Wait a bit to ensure the transaction is sent
    }
}

public static class MyExtensions
{
    public static byte[] HexToByteArray(this string hex)
    {
        var bytes = Enumerable.Range(0, hex.Length / 2)
                .Select(x => Convert.ToByte(hex.Substring(x * 2, 2), 16))
                .ToArray();

        return bytes;
    }
}

I am kind of at a loss and the transaction passes both the verify and the check, but when I go to broadcast in CLI I get Script evaluated without error but finished with a false/empty top stack element)
Any help is appreciated.
Updated code to reflect the address 2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp

**Tags:** transactions, multi-signature, signature, p2sh, c#


---

## 3 answers

### Answer by username_0 on 2024-07-14. Score: 0 | Accepted answer

Ok, so for those wanting to see what I did. Here is the following code that IS working:
void Main()
{
    Network network = Network.TestNet4;
    byte[] key1Bytes = ("Removed").HexToByteArray();
    byte[] key2Bytes = ("Removed").HexToByteArray();
    byte[] key3Bytes = ("Removed").HexToByteArray();
    
    Key key1 = new Key(key1Bytes);
    Key key2 = new Key(key2Bytes);
    Key key3 = new Key(key3Bytes);

    // Create a 2-of-3 multi-sig script
    Script scriptPubKey   = PayToMultiSigTemplate.Instance.GenerateScriptPubKey(2, new[] { key1.PubKey, key2.PubKey, key3.PubKey });
    Script redeemScript = scriptPubKey.PaymentScript;
    
    BitcoinAddress multiSigAddress = scriptPubKey.Hash.GetAddress(network);
    var sender = multiSigAddress.ToString();

    Console.WriteLine("Multi-Sig Address: " + multiSigAddress);
    //cc1e708dd199b390f5103444ff0b131bbc4294ce55cfaa3e0878e41cb21abc14
    //cc0bdc3c691c263407b1060169d44fc2c59b004cd182e6aa72873f0cc389dd96
    //vout 1
    

    OutPoint outPoint = new OutPoint(uint256.Parse("cc0bdc3c691c263407b1060169d44fc2c59b004cd182e6aa72873f0cc389dd96"), 1);
    Coin coin = new Coin(outPoint, new TxOut(Money.Satoshis(500_000m), redeemScript));
    ScriptCoin coinToSpend = new ScriptCoin(coin, scriptPubKey);
    
    
    var txInAmount = coin.Amount;
    var minerFee = new Money(450, MoneyUnit.Satoshi);
    var sendAmount = new Money(0.00001M, MoneyUnit.BTC);
    var totalSpend = sendAmount - minerFee;

    // Destination address
    BitcoinAddress recipientAddress = BitcoinAddress.Create("tb1qj3drgzxj7lxs0d73mmaa5c5eyjqkq8vwjx7xak", network);

    // Create the transaction
    TransactionBuilder builder = network.CreateTransactionBuilder();
    TransactionBuilder builderForKey1 = network.CreateTransactionBuilder();
    TransactionBuilder builderForKey2 = network.CreateTransactionBuilder();

    NBitcoin.Transaction unsigned = builder
        .AddCoins(coinToSpend)
        .Send(recipientAddress, totalSpend)
        .SendFees(minerFee)
        .SetChange(multiSigAddress)
        .SetOptInRBF(true)
        .BuildTransaction(false);

    NBitcoin.Transaction key1Signed =
        builderForKey1
        .AddCoins(coinToSpend)
        .AddKeys(key1)
        .SignTransaction(unsigned);

    NBitcoin.Transaction key2Signed =
        builderForKey2
        .AddCoins(coinToSpend)
        .AddKeys(key2)
        .SignTransaction(key1Signed);

    NBitcoin.Transaction fullySigned =
        builder
        .AddCoins(coinToSpend)
        .CombineSignatures(key1Signed, key2Signed);


    var txVerified = builder.Verify(fullySigned);
    var result = fullySigned.Check();


    txVerified.Dump();
        result.Dump();

    var hexTx = fullySigned.ToHex();
    var hashTX = fullySigned.GetHash();
    hexTx.Dump();

    //Console.WriteLine(fullySigned);

//  var hexTx = fullySigned.ToHex();
//  var hashTX = fullySigned.GetHash();
//
//  hexTx.Dump();
    //BroadcastTransaction(fullySigned);
}
public static decimal BTCMultiplier = 100_000_000M;

void BroadcastTransaction(NBitcoin.Transaction transaction)
{
    using (var node = Node.Connect(Network.TestNet4, "BTCNodeIpGoesHere"))
    {
        node.VersionHandshake();
        node.SendMessage(new InvPayload(InventoryType.MSG_TX, transaction.GetHash()));
        node.SendMessage(new TxPayload(transaction));
        Thread.Sleep(500); // Wait a bit to ensure the transaction is sent
    }
}

public static class MyExtensions
{
    public static byte[] HexToByteArray(this string hex)
    {
        var bytes = Enumerable.Range(0, hex.Length / 2)
                .Select(x => Convert.ToByte(hex.Substring(x * 2, 2), 16))
                .ToArray();

        return bytes;
    }
}

You can see the TX worked here: https://mempool.space/testnet4/tx/800f4031f65eb141fc7083d89a29c6987da75c6d282ccb2bc72673e219d027ad
Now that I understand how to do a basic MS, I will attempt to use PSBTs for better support and cleaner code.
This was done in C# and with a modified version of NBitcoin to support Testnet4.


---

### Answer by username_1 on 2024-07-14. Score: 0

The correct address, derived from the redeem script in your transaction, is actually [2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp](https://mempool.space/testnet4/address/2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp). Both of these recently received 500,000 testnet sats, you must have mixed them up.

> **Comments:**
> **username_0**: well I wasn't sure which one was correct. so I tried with both. I will switch everything to use that and report code. Let me know if you see any issues.  
> **username_0**: I have update source code and information above. I still get the same error, so I must be constructing the TX wrong is all I can think. Any ideas?  
> **username_0**: I believe I see my errors. Thank you for assistance.  

---

### Answer by username_2 on 2024-07-15. Score: 0

> 010000000196dd89c30c3f8772aae682d14c009bc5c24fd4690106b10734261c693cdc0bcc010000009100473044022004365796cf079934bc168f07e624eba6fe79dceba3d5ef583674265af9b86a8c02201f5858deec99afb9850af2c5d0db8d7da8987e1922ac98448288f5c466e97ad901473044022072ea4e179b0332349ed62fa0f071d31b6e574145629754ee1bdccba4d0fd180d02205eb0afdb3e34fd39b6d8bc11b833332a9cc8cb3da5b8ca66a8ba2def3a01419601fdffffff022602000000000000160014945a3408d2f7cd07b7d1defbda62992481601d8e389d07000000000017a914e087832bbf2a86debc46b2ffbbf73f85d197ee788700000000

Looking at this transaction data, there is no P2SH redeem script set at the last of script\_sig.

You need to set the redeem script for the P2SH address 2NDiRgpVVQ3CtYMi962myja69pFW8VSJ9Yp.

> **Comments:**
> **username_0**: Hey thank you for comment. I figured out was I was doing and posted the response below. You are correct I have  my redeem and scriptpubs mixed up and once sorted TXs were being approved and confirmed  

---

