Hi all,
I'm trying to get the fromAddress of a given trasaction. I can calculate one but I have different values in front of the ones reported on
blockchain.com explorer. Can someone help me?
bitcoinj version: 0.15.1
Script scriptSig = inputTx.getScriptSig();
List<ScriptChunk> chunks = scriptSig.getChunks();
byte[] pubKey = chunks.get(chunks.size() - 1).data;
assert pubKey != null;
byte[] pubKeyHash = Utils.sha256hash160(pubKey);
LegacyAddress fromAddress = LegacyAddress.fromPubKeyHash(np, pubKeyHash);
tx = f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16
fromAddress = 12cbQLTFMXRnSzktFkuoG3eHoMeFtpTu3S
I get: 1N6HfR4j5dnrBPpHET9ZmSwDhLkr5hprCG
for newer transactions, the result is good: tx: 1554a02d4eb1c7a73e3736922ed99530e360784e709896c42e5756e65b2da341
can someone point me how to fix this?
thanks
Claudio