after learning a lot about script (and playing with them on the testnet) i made a way longer script.
$ btc decodescript 7455886f94935688789352885279935b88946e935b88945187
{
"asm": "OP_DEPTH 5 OP_EQUALVERIFY OP_3DUP OP_SUB OP_ADD 6 OP_EQUALVERIFY OP_OVER OP_ADD 2 OP_EQUALVERIFY 2 OP_PICK OP_ADD 11 OP_EQUALVERIFY OP_SUB OP_2DUP OP_ADD 11 OP_EQUALVERIFY OP_SUB 1 OP_EQUAL",
...
"segwit": {
...
"address": "tb1q2c0uglp5tg2dhnr3ejuwppalp9urdfu4cxnl2sc495vlzmjy2ggs2wk7ry",
...
}
}
the solution to this script is 6
9
4
2
0
.
however, when redeeming the 1000 sat from the p2wsh address it gives me the error:
$ bitcoin-cli -testnet sendrawtransaction 010000000001019f084303418f25b5a77f36b95f293b052e9d885d98020be3f66fb223939bbbe00000000000ffffffff018c030000000000001600140f4eb1382443259e6d295d8ddf1ade059e4b1f8c0601060109010401020100197455886f94935688789352885279935b88946e935b8894518700000000
error code: -26
error message:
non-mandatory-script-verify-flag (unknown error)
i searched around a bit on bitcoin se and the only useful thing i could find was a post complaining about OP_PICK
. Somebody knows how to fix this?
PS: i really don't care about 1000 test sat but just i want to fix this to learn from it :)