I am hoping there is someone out there that can help me with probably a simple bit coin scripting question...but maybe there is something more to it. I am trying to fully test a custom script on a regtest bitcoind node network. I have worked through some online tutorials and I can create the custom locking script, transform it into a P2SH, and send coin to it. The issue is when I try to unlock the script. I am trying to write the unlocking transaction by hand since this is a basic puzzle transaction...with no luck. Here is the detailed info:
- Bitcoin Version: 16.0
- Network: RegTest
- Locking Script Hex: 0x93016387 (OP_ADD 99 OP_EQUAL)
Here is the base transaction serialized, please note this does reference a previous transaction that sends 1.0 coin to that wallet's address.
If you decode this, you will see a vout to the p2sh address:
The next transaction I generated is:
Which references the previous transaction but does not have a signature and it decodes properly. Then I try to insert the solution to the locking script, by adding: 3e5101620493016387a9143f58b4f7b14847a9083694b9b3b52a4cea2569ed87 in the correct spot...which it might not be makes this transaction: 02000000014192c46838cfe8296c9189b7d7e51a57aad2ee31f931d5b9721908f13f87594b00000000003e5101620493016387a9143f58b4f7b14847a9083694b9b3b52a4cea2569ed87ffffffff0140b9ec05000000001976a914351ef68a632b634cdb63d0e2b58b7f795ba1233f88ac00000000
And that is where it breaks, I try to decode it...doesn't work...I try to send it...doesn't work...I believe the hex is correct and I believe it is in the right spot...but any ideas or help you can provide will be helpful.