Multisig transaction with metadata

0 votes
Hi,

I'm trying to do a 2 of 3 multi signature transaction. Everything works fine if I use no metadata. However when I add some metadata to the spending transaction the following happens:

1. create funding txn with metadata : OK

2. append metadata to funding txn : OK

3. sign funding txn : OK

4. send funding txn (to multisig address) : OK

5. create spending txn from funding txn output : OK

6. append metadata to spending txn : OK

7. sign spending txn with input, scriptpubkey and redeemscript : OK

8. counter-sign spending txn with input, scriptpubkey and redeemscript : OK

9. send spending transaction : ERROR: <64: Tx with metadata should have at least one SIGHASH_ALL output (code: -26)>

I guess the problem is with the signature which I do the same way as ususal:

["0100000001e34e3ff...",[{"scriptPubKey":"a914f9795744d3629cf80...","txid":"39d1a22376f61d2a6e229e5e19f...","redeemScript":"522102d88e8ff6dcf...","vout":0}],["VAJaGAkGVRd..."]]

Please note, that if I don't append metadata to the same spending transaction, everything works fine.

Can you help me with this? Thanks a lot!
asked Nov 30, 2015 by wmiki
Thanks for this. We are looking into it and will get back to you shortly.

2 Answers

+1 vote

Thanks for this. We've looked into it and it is indeed a bug, where we don't extract the signature type correctly for non-pubkeyhash outputs, specifically for this check that the OP_RETURN is signed by somebody. (The reason for this check is that otherwise anybody could modify the metadata of a transaction and retransmit it.)

It will be fixed in the next alpha. Thanks again.

answered Nov 30, 2015 by MultiChain
Thanks for checking it! In the meanwhile I actually made a workaround by creating an empty transaction with the required metadata and by linking it to the spending transaction, thus a separate transaction carries the message now.
Thanks for your support!
0 votes
Thanks again for this bug report - it was fixed in alpha 13, just released.
answered Dec 17, 2015 by MultiChain
...