Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: madmadmax on December 13, 2014, 10:08:56 PM



Title: Signrawtransaction not working
Post by: madmadmax on December 13, 2014, 10:08:56 PM
When I try to sign a raw transaction with the same parameters in bitcoind everything works, when I do so via PHP
Code:
signrawtransaction('01000000014bdd5...', '[{"txid":"ad0c9...', '["cTbyn7kCBAa7y...')
I get an internal server error from Bitcoin.

Keep in mind that I can easily connect from and issue other json-rpc commands and that the signing works (with each parameter enclosed with ')


Title: Re: Signrawtransaction not working
Post by: madmadmax on December 14, 2014, 05:09:25 AM
Anyone?


Title: Re: Signrawtransaction not working
Post by: Muhammed Zakir on December 14, 2014, 06:43:12 AM
For PHP, check https://bitcointalk.org/index.php?topic=117992.0 . It maybe helpful for you. :)

   ~~MZ~~


Title: Re: Signrawtransaction not working
Post by: madmadmax on December 14, 2014, 04:36:34 PM
For PHP, check https://bitcointalk.org/index.php?topic=117992.0 . It maybe helpful for you. :)

   ~~MZ~~

Doesn't help much, would be curious how one of the dev explains this, seems like a bug.


Title: Re: Signrawtransaction not working
Post by: Muhammed Zakir on December 14, 2014, 05:06:39 PM
Code:
I do so via PHP [code]signrawtransaction('01000000014bdd5...', '[{"txid":"ad0c9...', '["cTbyn7kCBAa7y...')

When signing only this much is needed unless you are signing the TX with more than one private key . Try, [ code]signrawtransaction 01000000014bdd5...[/code] .

Try,
Code:
signrawtransaction 01000000010..... '[{"txid":"a9d459....","vout":<no.>,"scriptPubKey":"76a91..."}]'


   ~~MZ~~


Title: Re: Signrawtransaction not working
Post by: madmadmax on December 14, 2014, 10:12:46 PM
Code:
I do so via PHP [code]signrawtransaction('01000000014bdd5...', '[{"txid":"ad0c9...', '["cTbyn7kCBAa7y...')

When signing only this much is needed unless you are signing the TX with more than one private key . Try, [ code]signrawtransaction 01000000014bdd5...[/code][/s] .

Try,
Code:
signrawtransaction 01000000010..... '[{"txid":"a9d459....","vout":<no.>,"scriptPubKey":"76a91..."}]'


   ~~MZ~~

Both work via the console but not using the json-rpc interface.


Title: Re: Signrawtransaction not working
Post by: shorena on December 14, 2014, 10:16:28 PM
-snip-
Both work via the console but not using the json-rpc interface.

Im sorry if this is a stupid thing to suggest (I have never written PHP), but might this be a problem of (non-)escaped chars?

And this [1] is probably redundant info, but it took me a while to find when I wrote a ruby script, so maybe you didnt know about it.

[1] https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29#PHP


Title: Re: Signrawtransaction not working
Post by: BITMIXER.IO on December 16, 2014, 10:30:02 PM
Did you try to sign the same transaction directly via bitcoind? Probably the problem is in data you send.


Title: Re: Signrawtransaction not working
Post by: hhanh00 on December 17, 2014, 01:37:33 AM
Try with curl first to narrow down the issue to JSON vs PHP.