-
Notifications
You must be signed in to change notification settings - Fork 421
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
Creating transaction for Bitcoin Cash #609
Comments
i use this network:
|
My first guess is that you used the wrong txOut because when signed the public key doesn't match the pubKeyHash in the script: Double check that the txout script you are using is the correct one for that txid,vout. The signer will detect if you are signing a pubKeyHash script with the wrong key. maybe it's the right key for the scriptPubKey, but you are using the wrong scriptPubKey for that output? Btw here's an example, you have to tell the Signer it's redeeming bitcoin cash (not mentioned in docs) |
Ok. Getting there...
|
Thanks for the help, but still not working... :) Even with the code from the test you mentioned. Transaction https://blockdozer.com/insight/address/1APR9o8f7fnSKB3WsQ792xcHdhNEPt79Lo
outputs:
I'm lost... :) |
looks i solved the issue with hash by modifying script like this:
no i've come to the next error... the code looks like:
outputs:
and errors out while broadcasting with:
|
Problem resolved. My fault. I had an error with keys for derived addresses. |
Sorry, was offline this week! Glad to see you got the problem sorted! Generally you should just derive and save the scriptpubkey & address (+ redeem/witness scripts) in a database. It's implied that before you received payment, you took a private key, derived the public key and scriptPubKey and address. Saving those, and then finding the txid/vout/value is normally the way to go. If you have just address you received funds on, you can decode it and use |
i'm saving only address and sequence number in DB. so i can track blocks for my addresses and recover all i need to spend transaction using sequence number from master private key. is it ok? or i can have a problem down the road? |
Cool That's fine - |
Hello.
I'm constructing transaction for Bitcoin Cash using this example
But when i try to broadcast it, I get an error:
What's wrong? How to debug it?
Transaction in hex:
The text was updated successfully, but these errors were encountered: