bitcoin-abc icon indicating copy to clipboard operation
bitcoin-abc copied to clipboard

Spend transaction from a multisig creating the raw transaction doesn't work

Open xorq opened this issue 9 years ago • 12 comments

Spend transaction from a 2 out of 3 Mulitisig is successfully created (complete = true...) But transaction is rejected by the network. (Illegal use of sighash type... ) (the transaction shows the ALL|FORKID flag in front of each signatures)... Push in viaBTC = invalid raw transaction Pusn in Electrum = "error: The transaction was rejected by network rules. (16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation))

xorq avatar Aug 03 '17 19:08 xorq

I've got the same situation using private keys and multisig address and trying to send raw tx after sign it using RPC API of the bitcoin-abc.

I was following this schematic when building my transaction: createrawtransaction '[{"txid":"","vout":}]' '{"receive_address":0.0008}' signrawtransaction 'hash_from_createraw' '[{"txid":"","vout":,"scriptPubKey":"","redeemScript":""}]' '["priv_key"]' signrawtransaction 'hash_from_signraw' '[{"txid":"","vout":,"scriptPubKey":"","redeemScript":""}]' '["priv_key2"]'

And the signed raw tx looks so: 02000000013ed89826f08d7d9ce136a9fa1d1b920158c791f57dc064b27bb5daa65719e45501000000fdfe0000483045022100bd353b21361a06b0841e7ce8fe738cf41d8cd205f55544fbb2275825ef1f474f022044dfe13e8ca1d1cb20605fd5c0ceb26ba0b13f27065b4095cfca8ea3a0c3d53541483045022100f779b0f9815a88e126daceff6365bf35ae1e51bc6e92d20ec1211830f08ad4d202201e0769fa902c21a2c74930924705b8c116ba0058a4ad665509ef4fda16c2f276414c69522102d725f33a2f9dc67981a525473d8fd04d690837f2be092da6a68cac44ae3c96832102773a7c00f9d915e54c438b8e67bbf56f7d4833a2e357dae54fa3a723e77118b12103c97d2e1c5478e48da50e59c8835ccb31e849b5023c1d20add7ed3b6e8e5ca9fb53ae0000000002a0860100000000001976a914cc1d800e7f83edd96a0340a4e269b2956f636e3f88acbc9e63000000000017a914c76fd4ee4e11980b457d00e9dcea6d3a12e9ab5d8700000000

eeexception avatar Aug 05 '17 13:08 eeexception

I'm having the same issue. Electron cash had the same issue (https://github.com/fyookball/electrum/issues/6), this was the patch that fixed it (https://github.com/fyookball/electrum/commit/b3081759c250c0f17f758074c27485551f55f7b8#commitcomment-23438589). Any ABC developers going to address this?
EDIT: Same thing is happening with Bitcoin Classic

coinables avatar Aug 05 '17 22:08 coinables

You now need to specify an "amount" attribute with the multisig input(s) you are spending.

dgenr8 avatar Aug 06 '17 03:08 dgenr8

You now need to specify an "amount" attribute with the multisig input(s) you are spending.

I've tried to use amount attribute inside each input - this did not helped me.

Is any updated documentation how the new parameters for the creating raw tx and signing it should look?

eeexception avatar Aug 06 '17 13:08 eeexception

@eeexception See this line in an updated RPC test, which passes. In this python example you'd have "amount" : Decimal('2.20000000')

dgenr8 avatar Aug 06 '17 15:08 dgenr8

It passes meaning successful broadcast to BCH chain with pre forked coins? Do you have a txid? Because the signing was passing fine before, it's the broadcasting to split coins that's having the issue.

coinables avatar Aug 06 '17 15:08 coinables

Yes, though I've only run it in test. It was previously failing on broadcast, because verification expects the actual amount (not 0) to be signed.

dgenr8 avatar Aug 06 '17 16:08 dgenr8

@dgenr8

See this line in an updated RPC test, which passes. In this python example you'd have "amount" : Decimal('2.20000000')

Thank you. I've could successfully sign and submit multisig transaction.

eeexception avatar Aug 06 '17 17:08 eeexception

@eexception did you have to build from source or just use the python script instead of console inside the ABC client?

coinables avatar Aug 06 '17 17:08 coinables

@coinables I've used 0.14.6 binaries and created, signed and send tx using RPC API using http rest client.

eeexception avatar Aug 06 '17 18:08 eeexception

Ok it works, just need to put the exact same amount input side when using signrawtransaction

xorq avatar Aug 06 '17 23:08 xorq

The fix is ready and will ship with the next version.

deadalnix avatar Aug 16 '17 21:08 deadalnix