Title: Get address without pubkey Post by: micaman on February 11, 2016, 01:58:47 AM If you check, as example, this transaction (https://blockchain.info/tx/6f7cf9580f1c2dfb3c4d5d043cdbb128c640e3f20161245aa7372e9666168516) / raw (http://webbtc.com/tx/6f7cf9580f1c2dfb3c4d5d043cdbb128c640e3f20161245aa7372e9666168516.hex):
Code: 0100000002f60b5e96f09422354ab150b0e506c4bffedaf20216d30059cc5a3061b4c83dff000000004a493046022100e26d9ff76a07d68369e5782be3f8532d25ecc8add58ee256da6c550b52e8006b022100b4431f5a9a4dcb51cbdcaae935218c0ae4cfc8aa903fe4e5bac4c208290b7d5d01fffffffff7272ef43189f5553c2baea50f59cde99b3220fd518884d932016d055895b62d000000004a493046022100a2ab7cdc5b67aca032899ea1b262f6e8181060f5a34ee667a82dac9c7b7db4c3022100911bc945c4b435df8227466433e56899fbb65833e4853683ecaa12ee840d16bf01ffffffff0100e40b54020000001976a91412ab8dc588ca9d5787dde7eb29569da63c3a238c88ac00000000 This transaction shows 2 inputs but I can't find any pubkeys: Code: 01000000 - version number How can you determine what are the addresses of the inputs without a pubkey? Title: Re: Get address without pubkey Post by: achow101 on February 11, 2016, 02:03:40 AM This transaction spends from a transaction that used the old format for spending. The old format was pay-to-pubkey so the public key was already stated in the output the input references. Since the input references an output and that output has the necessary information to determine an address, it is not necessary to have the public key anywhere, all you need to do is look at the referenced output to get the input address. Additionally, the input address isn't actually gotten from any public key in the input. Rather that address is retrieved by checking the specified output since there are special p2sh addresses that exist that don't even use public keys anywhere in them.
Title: Re: Get address without pubkey Post by: micaman on February 11, 2016, 02:14:09 AM Additionally, the input address isn't actually gotten from any public key in the input. Rather that address is retrieved by checking the specified output since there are special p2sh addresses that exist that don't even use public keys anywhere in them. It is possible to determine the addresses based on the pubkeys or redeem scripts when those appear in input scripts, without having to check the transaction that is being spent. Maybe I'm using the wrong terminology here, but I can show you an example if you want. Title: Re: Get address without pubkey Post by: achow101 on February 11, 2016, 02:33:55 AM Additionally, the input address isn't actually gotten from any public key in the input. Rather that address is retrieved by checking the specified output since there are special p2sh addresses that exist that don't even use public keys anywhere in them. It is possible to determine the addresses based on the pubkeys or redeem scripts when those appear in input scripts, without having to check the transaction that is being spent. Maybe I'm using the wrong terminology here, but I can show you an example if you want. |