I want to send transaction with some data with using p2sh.
But when I inserting my own script in a transaction I'm getting error from my bitcoind client: "
code=-26, message=16: mandatory-script-verify-flag-failed (Data push larger than necessary)".
Script has been written according to the Working Paper Data Insertion in Bitcoin's Blockchain. Which says that I can store with P2SH with using this script:
Input Script: OP_PUSHDATA < Data 1 (520 bytes) > OP_PUSHDATA < Data 2 (520 bytes) > OP_PUSHDATA < Data 3 (520 bytes) > < RedeemScript >
Redeem Script: OP HASH160 OP_PUSHDATA< Data3Hash > OP EQUALVERIFY OP HASH160 OP_PUSHDATA< Data2Hash > OP EQUALVERIFY OP HASH160 OP_PUSHDATA < Data1Hash > OP [/sup]EQUAL
This is example of my signed raw transaction with script written according to that manner. And I'm trying to insert less than 520 bytes, only 20.
020000000001019e1ab6b4683d58a37f969991304798bbbf7687599f057de0ae61f92945fd12160 00000008a4c141f8b0800ffc1765400038d78055c545df3ff5d4a4c141f8b0800ffc1765400038d 78055c545df3ff5d4a4c141f8b0800ffc1765400038d78055c545df3ff5d4aa94c141c18eb2e892 17b39a344622d3eaf2368f220674788a94c141c18eb2e89217b39a344622d3eaf2368f220674788 a94c141c18eb2e89217b39a344622d3eaf2368f220674787ffffffff02BB51D9000000000017a91 4182fd008c33ac992bda3bac7e09297ebe8639aca87800bb2030000000017a914182fd008c33ac9 92bda3bac7e09297ebe8639aca87024730440220110ff8ea143c0e1b14da35103ee285be9c0729a 79a1e70c543627da58c07947c02204afd8d5a29d50d3519735b33ada00a09fbf379e424b137f547 d3f5cd9db24f62012102ada9884dbd1e8bd90968ba66256f017cd77d83595027f7929ae3537f98c 92d4a00000000
I'll be thankful for any help and sorry for my English.