Open lightswarm124 opened 4 years ago
@lightswarm124 could you provide an example script that generates the error?
bitbox-sdk v8.11.2 includes a new Script.encode2() function that I think will fix this issue.
I believe the error you're seeing is because the TransactionBuilder is calling Script.encode
which is mangling to OP code. If you provide an example that generates the error your seeing, I'd like to play with it and see where I should make the Transaction Builder call the new encode2 function.
The example you give jives with this part of the code.
Looks like that list should be expanded so that users don't need to OR values to get the value they're expecting.
The example you give jives with this part of the code.
Looks like that list should be expanded so that users don't need to OR values to get the value they're expecting.
I'm not sure where this list lives, but I think it may be part of the overall network consensus. One quick-fix would be to add the value of the other hashtypes into ANYONECANPAY (0x80 + 0x*)
transactionBuilder.sign( 0, alice_keypair, redeemScript, transactionBuilder.hashTypes.SIGHASH_ANYONECANPAY, originalAmount );
returns the following error:
It seems that 0x80 ANYONECANPAY needs to append one of SIGHASH ALL/ONE/NONE. The following hashType values work: