Getting senders account
Say we got txid by listtransactions:
"txid" : "2ca54b92338e52bbb16562dd7a91e8670d9362bb255e21fb568acc13e732b6b7"
then
getrawtransaction 2ca54b92338e52bbb16562dd7a91e8670d9362bb255e21fb568acc13e732b6b7
and
decoderawtransaction 0100000001b2314a1f3d2552d781836cbf266b558eea31fb9f6b0e6da9340ab12e8760df0b000000006b483045022100dab5b2ef5e5be67fc0421c637c60a3d21064bcc7afe69f86909d0a7f91ae99440220762ad9a1d9c20a22378136e5653c2e7134499d1ac0ed86aba883faa7fbf6753f012102f342968588796d7214e189a6fef024bad4f29e7a155c93182a8b6f579b2c1fb2ffffffff02172e0100000000001976a914dc05a2f50f5ae09df42f584f5a5582891a41665088ac2e2f4100000000001976a914380e50d59602e9f9960f893f6f2c0f6eb7791b6088ac00000000
out of which we finally receive:
"asm" : "3045022100dab5b2ef5e5be67fc0421c637c60a3d21064bcc7afe69f86909d0a7f91ae99440220762ad9a1d9c20a22378136e5653c2e7134499d1ac0ed86aba883faa7fbf6753f01 02f342968588796d7214e189a6fef024bad4f29e7a155c93182a8b6f579b2c1fb2"
So far so good. Last part is publickey, if understand correctly:02f342968588796d7214e189a6fef024bad4f29e7a155c93182a8b6f579b2c1fb2, which can be translated to address
Then I do following in python to get senders address: import hashlib
pkey="02f342968588796d7214e189a6fef024bad4f29e7a155c93182a8b6f579b2c1fb2"
ripemd160 = hashlib.new('ripemd160')
ripemd160.update(hashlib.sha256(pkey.decode('hex')).digest())
but ripemd160.hexdigest() returns 8cdd1b71d32e53a9fe326212281a4a99a1c093a8, and thats not what i want.
It should return valid address, and result seems a bit off to me. I think .hexdigest is wrong way to do it, should be converted to base58.
How properly convert ripemd160.digest into account address?
Thanks a lot