Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
xorq opened this issue Aug 3, 2017 · 12 comments
Closed

Comments

@xorq
Copy link

xorq commented Aug 3, 2017

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))

@eeexception
Copy link

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

@coinables
Copy link

coinables commented Aug 5, 2017

I'm having the same issue. Electron cash had the same issue (Electron-Cash/Electron-Cash#6), this was the patch that fixed it (Electron-Cash/Electron-Cash@b308175#commitcomment-23438589). Any ABC developers going to address this?
EDIT: Same thing is happening with Bitcoin Classic

@dgenr8
Copy link
Contributor

dgenr8 commented Aug 6, 2017

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

@eeexception
Copy link

eeexception commented Aug 6, 2017

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?

@dgenr8
Copy link
Contributor

dgenr8 commented Aug 6, 2017

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

@coinables
Copy link

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.

@dgenr8
Copy link
Contributor

dgenr8 commented Aug 6, 2017

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.

@eeexception
Copy link

@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.

@coinables
Copy link

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

@eeexception
Copy link

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

@xorq
Copy link
Author

xorq commented Aug 6, 2017

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

ftrader pushed a commit to ftrader-bitcoinabc/bitcoin-abc that referenced this issue Aug 10, 2017
…ake it throw an error instead

Summary:
After hard fork, replay protected tx's require the amount field to be non-zero for previous outputs in signed tx's. JSON RPC code was accepting transactions with this field missing when it should have been throwing an error. Users had the impression the transaction that was signed was good, but when trying to sent to network, they would get an error that the tx is bad. See github issue Bitcoin-ABC#63.

Depends on D448

Test Plan:
Depends on D448

make check and also rpc-tests.py

Reviewers: #bitcoin_abc, sickpig, freetrader, dgenr8, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D449
@deadalnix
Copy link
Member

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

Mengerian added a commit to Mengerian/bitcoin-abc that referenced this issue Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants