Hi catman, Command Line Banking gettransaction function only have receiver address, how can I get the sender address?
{
"value" : 99999999.00000000,
"n" : 1,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 f036a60bc1869143fda5443455467178e0183b01 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a914f036a60bc1869143fda5443455467178e0183b0188ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"PWVJo4iZBGxpoqLwSfv87vWc7yo9N9Lmag"
]
}
}
Finding the sender address is not particularly straight forward in any cryptocoin. Instead of gettransaction you need to use:
getrawtransaction txid 1
This will return an array with more detailed information.
Basically every output has an (or many) input(s) so you need to examine the transactions associated with the input(s) to find the address of the originating wallet.
This is why gambling sites that do auto-payouts tell you not to use exchange wallets because the address(es) that are in the transaction inputs could lead to any one of thousands of wallet accounts.
Example:
getrawtransaction 169e41fff64425ec1507ff97e0bfca95a8fbd3dd9276da4cd5022ddc730fa8dd 1
{
"hex" : "01000000c549c652010b459274cb1869d06acb06e2ce25702189b176a19709f160d817f9f1b5fc980f010000004a493046022100f2115b188309136510edaa7ff955a25062a206678d0c2e519509abf481262478022100b77c05f45dd382c359f007bc586cb1ac177ab782cf8cadd1ebf5decdeea04ab301ffffffff018d9e711b000000001976a91473779bed07df4ec2e673cc02d4ac512b22c5856388ac00000000",
"txid" : "169e41fff64425ec1507ff97e0bfca95a8fbd3dd9276da4cd5022ddc730fa8dd",
"version" : 1,
"time" : 1388726725,
"locktime" : 0,
"vin" : [
{
"txid" : "0f98fcb5f1f917d860f10997a176b189217025cee206cb6ad06918cb7492450b",
"vout" : 1,
"scriptSig" : {
"asm" : "3046022100f2115b188309136510edaa7ff955a25062a206678d0c2e519509abf481262478022100b77c05f45dd382c359f007bc586cb1ac177ab782cf8cadd1ebf5decdeea04ab301",
"hex" : "493046022100f2115b188309136510edaa7ff955a25062a206678d0c2e519509abf481262478022100b77c05f45dd382c359f007bc586cb1ac177ab782cf8cadd1ebf5decdeea04ab301"
},
"sequence" : 4294967295
}
],
"vout" : [
{
"value" : 460430989.00000000,
"n" : 0,
"scriptPubKey" : {
"asm" : "OP_DUP OP_HASH160 73779bed07df4ec2e673cc02d4ac512b22c58563 OP_EQUALVERIFY OP_CHECKSIG",
"hex" : "76a91473779bed07df4ec2e673cc02d4ac512b22c5856388ac",
"reqSigs" : 1,
"type" : "pubkeyhash",
"addresses" : [
"PK7i9cqAQruSzXT8BGVT9QNiJYDGep7qTu"
]
}
}
],
"blockhash" : "5fa258ad99b9b5d55c3edc74a0c7be19b70d2683b1ba047463091050e3ab23e5",
"confirmations" : 68,
"time" : 1388726905,
"blocktime" : 1388726905
}
This has 1 input transaction with the txid
0f98fcb5f1f917d860f10997a176b189217025cee206cb6ad06918cb7492450bgetrawtransaction 0f98fcb5f1f917d860f10997a176b189217025cee206cb6ad06918cb7492450b 1
{
"hex" : "010000004245c65201b29e616ffcf1766abf8959303605f405dea56c9162ab227f99105ece0ffcc010010000006b483045022100ebc0dfae1a39e4c6053ab42e1cec54af177a65c3607b35da78600907990c8d4a02204344f3edb8c0c69245078ca6a7a8eb8624c668a6e2c57636ba2762e9f5bb9aaa0121036fa0bdaa3b079d2aa757ba982c9d27e8bb90e2de13b9bb7f285bdfff0daf8616ffffffff030000000000000000008d9e711b000000002321036fa0bdaa3b079d2aa757ba982c9d27e8bb90e2de13b9bb7f285bdfff0daf8616ac8e9e711b000000002321036fa0bdaa3b079d2aa757ba982c9d27e8bb90e2de13b9bb7f285bdfff0daf8616ac00000000",
"txid" : "0f98fcb5f1f917d860f10997a176b189217025cee206cb6ad06918cb7492450b",
"version" : 1,
"time" : 1388725570,
"locktime" : 0,
"vin" : [
{
"txid" : "10c0fc0fce5e10997f22ab62916ca5de05f40536305989bf6a76f1fc6f619eb2",
"vout" : 1,
"scriptSig" : {
"asm" : "3045022100ebc0dfae1a39e4c6053ab42e1cec54af177a65c3607b35da78600907990c8d4a02204344f3edb8c0c69245078ca6a7a8eb8624c668a6e2c57636ba2762e9f5bb9aaa01 036fa0bdaa3b079d2aa757ba982c9d27e8bb90e2de13b9bb7f285bdfff0daf8616",
"hex" : "483045022100ebc0dfae1a39e4c6053ab42e1cec54af177a65c3607b35da78600907990c8d4a02204344f3edb8c0c69245078ca6a7a8eb8624c668a6e2c57636ba2762e9f5bb9aaa0121036fa0bdaa3b079d2aa757ba982c9d27e8bb90e2de13b9bb7f285bdfff0daf8616"
},
"sequence" : 4294967295
}
],
"vout" : [
{
"value" : 0.00000000,
"n" : 0,
"scriptPubKey" : {
"asm" : "",
"hex" : "",
"type" : "nonstandard"
}
},
{
"value" : 460430989.00000000,
"n" : 1,
"scriptPubKey" : {
"asm" : "036fa0bdaa3b079d2aa757ba982c9d27e8bb90e2de13b9bb7f285bdfff0daf8616 OP_CHECKSIG",
"hex" : "21036fa0bdaa3b079d2aa757ba982c9d27e8bb90e2de13b9bb7f285bdfff0daf8616ac",
"reqSigs" : 1,
"type" : "pubkey",
"addresses" : [
"PWoQVYW3j1AoEdQYsCS3b3px1ryUB518aw"
]
}
},
{
"value" : 460430990.00000000,
"n" : 2,
"scriptPubKey" : {
"asm" : "036fa0bdaa3b079d2aa757ba982c9d27e8bb90e2de13b9bb7f285bdfff0daf8616 OP_CHECKSIG",
"hex" : "21036fa0bdaa3b079d2aa757ba982c9d27e8bb90e2de13b9bb7f285bdfff0daf8616ac",
"reqSigs" : 1,
"type" : "pubkey",
"addresses" : [
"PWoQVYW3j1AoEdQYsCS3b3px1ryUB518aw"
]
}
}
],
"blockhash" : "4ccf97e0843ce07544e0cf392e3ef212fc6ed8f3bc84e3d715a8fd4488d25933",
"confirmations" : 132,
"time" : 1388725570,
"blocktime" : 1388725570
}
This transaction was one of two that were paid to the address
PWoQVYW3j1AoEdQYsCS3b3px1ryUB518aw so that should be the originating address (or at least one belonging to that wallet).
I got it, tks Petr1fied.