0

Despite the fact that bockexplorer allows to navigate through transaction details and discover the sender address, why via bitcoin client the sender address remains 'undefined'.

Is it possible to discover sender address via original Bitcoin API?

  • What you're talking about is not a "sender address". Bitcoin doesn't have that. All you can find out (and the answer below describes) is which address(es) the coins consumed by a transaction were previously assigned to. Unless you're the sender yourself, this is not usually interesting information. – Pieter Wuille Feb 22 '14 at 10:32
2

Yes, it is possible. You can use getrawtransaction <txid> and decoderawtransaction <output from getrawtransaction>. For example:

getrawtransaction 6dcaa5e7f412a9c14d0f87a2660907c37de5abac31823c22fba978b6fd616313
010000000105bbdd4f69478586a192f4904f51229690ae7f17703a8410f983c072658eb611c60200006a47304402200c64714e605c1ad63e5a52b2d4a734c3a6174e2d6a4e0aa7fcff99ec8c1451a902202005bed9f7f2969bf86989cbe295aab3d51ba77b2faf9def6010b04f24183e450121024209026dda4b136d55f92e36fb4fdf23a8beb129d872838a122a9d1e55c9f838ffffffff0240f3ad00000000001976a91452bf43c4d410b5971a37c304ba96b53dc5da7f5f88acc8a10000000000001976a914bcccc2b493e31afd0767448c8f7d7d5d6823164888ac00000000

decoderawtransaction 010000000105bbdd4f69478586a192f4904f51229690ae7f17703a8410f983c072658eb611c60200006a47304402200c64714e605c1ad63e5a52b2d4a734c3a6174e2d6a4e0aa7fcff99ec8c1451a902202005bed9f7f2969bf86989cbe295aab3d51ba77b2faf9def6010b04f24183e450121024209026dda4b136d55f92e36fb4fdf23a8beb129d872838a122a9d1e55c9f838ffffffff0240f3ad00000000001976a91452bf43c4d410b5971a37c304ba96b53dc5da7f5f88acc8a10000000000001976a914bcccc2b493e31afd0767448c8f7d7d5d6823164888ac00000000
{
"txid" : "6dcaa5e7f412a9c14d0f87a2660907c37de5abac31823c22fba978b6fd616313",
"version" : 1,
"locktime" : 0,
"vin" : [{
    "txid" : "11b68e6572c083f910843a70177fae909622514f90f492a1868547694fddbb05",
    "vout" : 710,
    "scriptSig" : {
        "asm" : "304402200c64714e605c1ad63e5a52b2d4a734c3a6174e2d6a4e0aa7fcff99ec8c1451a902202005bed9f7f2969bf86989cbe295aab3d51ba77b2faf9def6010b04f24183e4501 024209026dda4b136d55f92e36fb4fdf23a8beb129d872838a122a9d1e55c9f838",
        "hex" : "47304402200c64714e605c1ad63e5a52b2d4a734c3a6174e2d6a4e0aa7fcff99ec8c1451a902202005bed9f7f2969bf86989cbe295aab3d51ba77b2faf9def6010b04f24183e450121024209026dda4b136d55f92e36fb4fdf23a8beb129d872838a122a9d1e55c9f838"
    },
    "sequence" : 4294967295
}],
"vout" : [{
    "value" : 0.11400000,
    "n" : 0,
    "scriptPubKey" : {
        "asm" : "OP_DUP OP_HASH160 52bf43c4d410b5971a37c304ba96b53dc5da7f5f OP_EQUALVERIFY OP_CHECKSIG",
        "hex" : "76a91452bf43c4d410b5971a37c304ba96b53dc5da7f5f88ac",
        "reqSigs" : 1,
        "type" : "pubkeyhash",
        "addresses" : ["18YXY35z1HgMoKqBFgiShGuqnhR7zdwwC6"]
    }
}, {
    "value" : 0.00041416,
    "n" : 1,
    "scriptPubKey" : {
        "asm" : "OP_DUP OP_HASH160 bcccc2b493e31afd0767448c8f7d7d5d68231648 OP_EQUALVERIFY OP_CHECKSIG",
        "hex" : "76a914bcccc2b493e31afd0767448c8f7d7d5d6823164888ac",
        "reqSigs" : 1,
        "type" : "pubkeyhash",
        "addresses" : ["1JDHL5WhHNrg4HrNksnF7S1ChGVYYUkjVC"]
    }
}]
}

Look at vin[0].scriptSig.asm. It contains 2 values: 3044...4501 and 0242...f838. Second value is a compressed public key. Now you can use it to calculate address: RIPEMD160(SHA256(pubkey)) -> Base58. But you must do this by yourself.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.