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

p2sh address sign #85

Open
DevMinJong opened this issue Nov 13, 2020 · 1 comment
Open

p2sh address sign #85

DevMinJong opened this issue Nov 13, 2020 · 1 comment

Comments

@DevMinJong
Copy link

DevMinJong commented Nov 13, 2020

image
Is it possible to make scriptPubkey by using the bitcoincashj if address p(address 3 in bitcoin) is in input, like the picture above?
I coded like a code below, progressed a signdRawtransaction and found the error saying "script evaluated without error but finished with a false/empty top stack element". Is there any solution?

in.setScriptSig(script);
Sha256Hash sigHash = tx.hashForSignatureWitness(i, in.getScriptSig(), Coin.valueOf(preValue), Transaction.SigHash.ALL, false);

ECKey.ECDSASignature ecdsaSignature = key.sign(sigHash);
TransactionSignature txSignature = new TransactionSignature(ecdsaSignature, Transaction.SigHash.ALL, false, true);
tx.getInput(i).setScriptSig(ScriptBuilder.createInputScript(txSignature, key));

@DevMinJong DevMinJong changed the title p p2sh address sign Nov 13, 2020
@HashEngineering
Copy link
Collaborator

You should use this library instead for bitcoincashj. Mine hasn't been updated in over 1 year and will likely result in many errors.

https://github.com/pokkst/bitcoincashj

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

2 participants