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

sendrawtransaction tx decode failed #4

Open
Rui2guo opened this issue Sep 20, 2018 · 24 comments
Open

sendrawtransaction tx decode failed #4

Rui2guo opened this issue Sep 20, 2018 · 24 comments

Comments

@Rui2guo
Copy link

Rui2guo commented Sep 20, 2018

./ipchain-cli createrawtransaction "[{"txid":"2657d54951c6e96f92862afa2c48ddcd3b6a40ec5b2652e99eda2a9


error code: -8
error message:
Invalid parameter, txid can't found
but,My txid is there in the exploer :http://exploer.qingdoutech.com/insight/address/ZCBQz2e1a62zw7HvhqzcYxsxdE7Gz4aGK2Bu

i just want to known the reason.

@Rui2guo
Copy link
Author

Rui2guo commented Sep 20, 2018

./ipchain-cli createrawtransaction "[{"txid":"2657d54951c6e96f92862afa2c48ddcd3b6a40ec5b2652e99eda2a916f526d23","vout":0}]" "{"ZCBKie4ejr9a6ZH37B1uTXJiAfeYJqLGcETc":1.0999}"

@xiaohq002
Copy link

I don't know what do you want to? txid is exist in the block chain, why do you want to createrawtransaction use same id? why? If you want to get the tx information, you should use gettransaction RPC function.

@Rui2guo
Copy link
Author

Rui2guo commented Sep 20, 2018

i just want to use that output to make the other transaction's input,I am assembling a transaction.So use this “ createrawtransaction”command to sign。

@FlyLiuYan
Copy link
Collaborator

IPC is based on the UTXO model. So txid is needed to create new transactions. If ZCBQz2e1a62zw7HvhqzcYxsxdE7Gz4aGK2Bu is yours, you can use "Vout": 0. If ZCBhQ9JkxMKDkUmsAVuaMdPGuNFBsFMXVUPh is yours, you can use "Vout": 1.

@xiaohq002
Copy link

Are you sure your wallet correct private key exist or offline to create transaction? (If you change your wallet keys?) This RPC need your wallet to sign use your private key! Otherwise, you couldn't get good information.

@xiaohq002
Copy link

@FlyLiuYan Could you provide a example to use "createrawtransaction" to Rui2guo? Thanks!

@Rui2guo
Copy link
Author

Rui2guo commented Sep 20, 2018

If I am offline signing,using the “createrawtransactionForIsolation” what does the scriptPubKey mean?
./ipchain-cli createrawtransactionForIsolation "[{"amount":1.10000000 ,"scriptPubKey":"483045022100def21cb3d4f7677ad36f089796c72f983261291da653a559ff0b92f93a6a7b3f022046e6e39d6139954bafa89bad847e33b6a18500b30a92a1c7b354358c06a8bcc4012102ce974af73878658cec43cd05d581603725280d25b851258ddd27353b80bd095a","txid":"2657d54951c6e96f92862afa2c48ddcd3b6a40ec5b2652e99eda2a916f526d23","vout":0}]" "{"ZCBKie4ejr9a6ZH37B1uTXJiAfeYJqLGcETc":1.099}"
I got the scriptPubKey from the exploer .
it does not work
error code: -8
error message:
ProduceSignature DummySign error!

@Rui2guo
Copy link
Author

Rui2guo commented Sep 20, 2018

@FlyLiuYan yeah ZCBQz2e1a62zw7HvhqzcYxsxdE7Gz4aGK2Bu is mine,and i use the "vout": 0.instead of"Vout": 0.

@xiaohq002
Copy link

xiaohq002 commented Sep 20, 2018

@Rui2guo You should use "46c90258ad23c2db1b1bba2c7e89cde145494bb0" as your scriptPubKey if you use last TX vout 0 as your New Tx Input. Good luck!

@Rui2guo
Copy link
Author

Rui2guo commented Sep 20, 2018

@xiaohq002 Thank you for your help, but it does not work !./ipchain-cli createrawtransactionForIsolation "[{"amount":1.10000000 ,"scriptPubKey":"46c90258ad23c2db1b1bba2c7e89cde145494bb0","txid":"2657d54951c6e96f92862afa2c48ddcd3b6a40ec5b2652e99eda2a916f526d23","vout":0}]" "{"ZCBKie4ejr9a6ZH37B1uTXJiAfeYJqLGcETc":1.099}"
error code: -8
error message:
ProduceSignature DummySign error!

could you teil me that What is this script, and where can I get it?

@xiaohq002
Copy link

xiaohq002 commented Sep 20, 2018

@Rui2guo :Hi!
OP_DUP OP_HASH160 46c90258ad23c2db1b1bba2c7e89cde145494bb0 OP_EQUALVERIFY OP_CHECKSIG

OP_DUP : 0x76
OP_HASH160 : 0xa9
OP_EQUALVERIFY : 0x88
OP_CHECKSIG : 0xac

so script pubkey is :”76a946c90258ad23c2db1b1bba2c7e89cde145494bb088ac”
You can try again!

@FlyLiuYan
Copy link
Collaborator

Your transaction format is correct.
But createrawtransaction is online .

If offline you need have a online node.
1 At the online node use importaddress to add the address.
2 At the online node use listunspent to find the vout info.
3 At the offline node use createrawtransactionForIsolation to create transaction.

@Rui2guo
Copy link
Author

Rui2guo commented Sep 20, 2018

@xiaohq002 oh god!!

./ipchain-cli createrawtransactionForIsolation "[{"amount":1.1,"scriptPubKey":"76a946c90258ad23c2db1b1bba2c7e89cde145494bb088ac","txid":"2657d54951c6e96f92862afa2c48ddcd3b6a40ec5b2652e99eda2a916f526d23","vout":0}]" "{"ZCBKie4ejr9a6ZH37B1uTXJiAfeYJqLGcETc":1.099}"
error code: -8
error message:
ProduceSignature DummySign error!

I really don't know where there is the problem.

@xiaohq002
Copy link

See these:

"Your transaction format is correct.
But createrawtransaction is online .

If offline you need have a online node.
1 At the online node use importaddress to add the address.
2 At the online node use listunspent to find the vout info.
3 At the offline node use createrawtransactionForIsolation to create transaction."

@summerxue1992
Copy link
Collaborator

@Rui2guo Have you solved your problem?
./ipchain-cli createrawtransactionForIsolation "[{"amount":1.1,"scriptPubKey":"76a946c90258ad23c2db1b1bba2c7e89cde145494bb088ac","txid":"2657d54951c6e96f92862afa2c48ddcd3b6a40ec5b2652e99eda2a916f526d23","vout":0}]" "{"ZCBKie4ejr9a6ZH37B1uTXJiAfeYJqLGcETc":1.099}"

Your scriptPubkey field is OK with the corresponding field in ListunpentNormal.

@Rui2guo
Copy link
Author

Rui2guo commented Sep 21, 2018

it does not work ,Why didn’t your project party develop the sdk corresponding to the signature?It is much more convenient for others to use.
I understand that IPC's signature is similar to bitcoin, it is not clear what I want to sendrawtransaction is not working, therefore, I want to createrawtransaction--signrawtransaction to compare hexstring to known the reason.Can you help me find out which segment of hexstring is incorrect? my hexstring:"0100000001236d526f912ada9ee952265bec406a3bcddd482cfa2a86926fe9c65149d5572600000000fc0047304402204dac94acb35ee80681f6c37524ffc19b5572caf17ea18726b8233e37141fa2f50220271c4c9a58b2c4b7efea770d85421b7cbb36809755203bf670a7d0abac054d5901473044022021b3b3f067c07c492335ecfc373b48433f5ea72c865e67ef66616504abeea2470220244f583f33db060f44697228875c3086ca7464903fba300f637425d36adc1409014c69522102c5e5562c3ad429f4c29a802e89caa0df6c5916a60180ff8918f0250d036374bc2103ffffd432c4526a635598366dd056719443b8a3b19c4c090dbab4f4db7698dcca210316f564435a9a76daeaf645619e7423be8beb8ab3838457aa98efb3d2d71efeac53aeffffffff01e0f08c06000000001976a9140d074bc86bd388a45f1c8911a41b8f0705d9058b88ac00000000"

@summerxue1992
Copy link
Collaborator

@Rui2guo I'd like to know how you can create a transaction with the creatrawtranaction interface, because the hexstring you're sending is in the wrong format and parsed incorrectly。

@Rui2guo
Copy link
Author

Rui2guo commented Sep 21, 2018

Yes, I just want to know why hexstring is the wrong format.My hexstring is a string structure generated by bitcoinj (bitcoin's signature algorithm),and
I want to know what the correct IPC signature hexstring should look like.

@summerxue1992
Copy link
Collaborator

Sure。“02000000017d5ef292b16a02631ddf8322c70982c5f4e05c34a918387c1d48af27a2bd2000000000006a4730440220654e1346ccac668db898ffe7c2d11381825b0d60a9fafc47f0acf660d83a69780220539ea55ad134fd79db746ab41a60792aec5298b6018bc9b594ac203d04cee28801210244de9ab8e30fc4b311ae1f27e0fc0eb0e0d335041fae7d8f53937b7539c7d4ccfeffffff020010a5d4e800000000001976a9149838c6db130ca27dc19241252ad0071360e1eab988ac0060c549a9d101000000001976a91457ddaf97efe60bd0c7b985f52a9d0f17866235c088ac00964f1500”。
This is a deal in our test network.

@summerxue1992
Copy link
Collaborator

@Rui2guo Our signature algorithm is consistent with bitcoin, but there is an increase in transaction structure.

@Rui2guo
Copy link
Author

Rui2guo commented Sep 21, 2018

@summerxue1992
What changes have been made,

@summerxue1992
Copy link
Collaborator

@Rui2guo It is recommended that we first look at the transaction structure in the source code.The transaction structure is modified in part Vout.

@Rui2guo
Copy link
Author

Rui2guo commented Sep 25, 2018

@summerxue1992 I wonder if you can help me to modify the ipc's SDK for offline signing.I really don't know what you serialized, when assembling txhash,I don't know much about c++ 。i can give you my git url : https://github.com/Rui2guo/IPCcoinj.git i already have modified the param, you can also watch it.

@summerxue1992
Copy link
Collaborator

@Rui2guo Sorry, I can't help you. I don't understand java.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants