Chida (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 13, 2014, 06:17:41 PM Last edit: January 14, 2014, 05:47:28 PM by Chida |
|
hi and sorry,
i try to understand this world and i try to crate a game/services.
My program in c# .net call the wallet by RPC, but how i can get sender address ?
for now i can get the transaction on specific account by listtransactions, i try getrawtransaction verbose or decoderawtransaction, but i can't get the address of sender.
Can you help me?
|
|
|
|
DBordello
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 13, 2014, 06:37:26 PM |
|
This is a dangerous way to do things. There isn't really a "sender address". There are just previous outputs that are used as inputs.
Additionally, people using online wallets, such as Mt.Gox, do not necessarily get credited for transactions that go back to the "sender address".
|
www.BTCPak.com - Exchange your bitcoins for MP: Secure, Anonymous and Easy!
|
|
|
Chida (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 13, 2014, 07:15:39 PM |
|
This is a dangerous way to do things. There isn't really a "sender address". There are just previous outputs that are used as inputs.
Additionally, people using online wallets, such as Mt.Gox, do not necessarily get credited for transactions that go back to the "sender address".
but for betting or dice game is perfect. and for service i think is possible use signed message. even with the difficulty of the case and imperfections, I want to create services without user db. I want to create services where you just have a wallet
|
|
|
|
Chida (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 14, 2014, 05:48:12 PM |
|
From same code on github I understand that is possible or necessary analize all blockchain for get the sender address because is necessary analise all out address. May be sufficient the single raw transaction?
|
|
|
|
DannyHamilton
Legendary
Offline
Activity: 3472
Merit: 4790
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 14, 2014, 09:50:40 PM Last edit: May 18, 2014, 04:32:12 PM by DannyHamilton |
|
I have a MUCH better idea!
Ask your users what address they would like to use for receiving payment!
Brilliant! Each user can tell you where they want their payments sent. You can store this in a database, and when you need to send a payment to your users, you can send it to the address that THEY TOLD YOU THEY WANT IT SENT TO.
This way you don't have to try and guess what address they want the bitcoins sent to. Guessing is a bad idea. It will result in you guessing incorrectly sometimes and will cause problems for you and for your users. Since there is a very simple solution that does not involve guessing, why would you want to take the risks that are associated with the possibility of guessing incorrectly?
|
|
|
|
Chida (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
January 14, 2014, 10:06:12 PM |
|
I have a MUCH better idea!
Ask your users what address they would like to use for receiving payment!
Brialliant! Each user can tell you where they want their payments sent. You can store this in a database, and when you need to send a payment to your users, you can send it to the address that THEY TOLD YOU THEY WANT IT SENT TO.
This way you don't have to try and guess what address they want the bitcoins sent to. Guessing is a bad idea. It will result in you guessing incorrectly sometimes and will cause problems for you and for your users. Since there is a very simple solution that does not involve guessing, why would you want to take the risks that are associated with the possibility of guessing incorrectly?
it's the second that say is wrong. ok i try with signed message of wallet autentication.
|
|
|
|
andytoshi
Full Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif) ![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 179
Merit: 151
-
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
February 08, 2014, 11:32:45 PM |
|
Really? Immediately above the definition of this function there is the comment // Note: Be careful when using GetTransactionSenderAddress(es) as it just gives you an address owned by someone who previously controlled the transaction's outputs // which might not actually be the sender
which tells you that this function is horribly misnamed and actually does not do what the OP asked for. Bitcoin transactions do not contain enough information to determine a sender address. There is therefore no way to obtain this information through the RPC interface.
|
|
|
|
Ins
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
February 09, 2014, 11:11:11 AM |
|
To get sender's address, you can go two ways 1. use getrawtransaction TXID decoderawtransaction TXID then convert first prev_out pubkey to address 2. parse JSON http://blockchain.info/rawtx/TXID
|
|
|
|
maaku
Legendary
Offline
Activity: 905
Merit: 1012
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
February 09, 2014, 11:25:11 AM |
|
To get sender's address, you can go two ways 1. use getrawtransaction TXID decoderawtransaction TXID then convert first prev_out pubkey to address 2. parse JSON http://blockchain.info/rawtx/TXIDThis is a horrible idea, as has already been explained in detail in this very thread. Please don't do this: you will have customers lose money.
|
I'm an independent developer working on bitcoin-core, making my living off community donations. If you like my work, please consider donating yourself: 13snZ4ZyCzaL7358SmgvHGC9AxskqumNxP
|
|
|
RangerK
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
May 18, 2014, 12:38:57 PM |
|
To get sender's address, you can go two ways 1. use getrawtransaction TXID decoderawtransaction TXID then convert first prev_out pubkey to address 2. parse JSON http://blockchain.info/rawtx/TXIDThis is a horrible idea, as has already been explained in detail in this very thread. Please don't do this: you will have customers lose money. maaku, Isn't this exactly the standard by which Satoshi Dice and some other Bitcoin casinos operate? My impression was that with standard standard clients and standard transactions, it's no problem. It will fail only with web-wallets and (Perhaps???) multi-sig transactions. As noted above: As long as the sender uses their own client for the transaction they will always be the previous owners of all transaction's inputs so in this case you actually can get the sender's address(es), this is how SatoshiDice also retrieves the sender's address. Is this not accurate? Is your concern based on the fact that people might use web-wallets?
|
![Cool](https://bitcointalk.org/Smileys/default/cool.gif) ---> Who will mine the next 777 Block??? Place your bets at block777.com!!!
|
|
|
maaku
Legendary
Offline
Activity: 905
Merit: 1012
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
May 18, 2014, 09:53:59 PM |
|
No, that is not accurate. There are an unlimited ways in which this can break (and yes, it does break for SatoshiDice). If it seems relatively safe now, it is because smart contracts, joint transactions, and other on-the-horizon technologies are not being widely deployed. When they are, the assumption that you can simply return funds to a transactions input(s) will be even less valid.
|
I'm an independent developer working on bitcoin-core, making my living off community donations. If you like my work, please consider donating yourself: 13snZ4ZyCzaL7358SmgvHGC9AxskqumNxP
|
|
|
mcaizgk2
Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 66
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
May 20, 2014, 04:22:38 PM |
|
As noted above: As long as the sender uses their own client for the transaction they will always be the previous owners of all transaction's inputs so in this case you actually can get the sender's address(es), this is how SatoshiDice also retrieves the sender's address. Is this not accurate? Is your concern based on the fact that people might use web-wallets? RangerK the only legitimate way of retrieving the transaction sender's address is to ask for one. You might also want to take a closer look to the refund address facility introduced with the 0.9 client, however this is no production ready yet. BitcoinLib's GetTransactionSenderAddress() is not meant for production environment, as also stated in its comments and it will eventually return invalid data for thin clients and e-wallets. SatoshiDice follows the same routine to extract the sender's address but it also fails in exactly the same way.
|
|
|
|
01835113
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
May 31, 2014, 04:43:15 PM |
|
any ideas? I need it.
|
|
|
|
maaku
Legendary
Offline
Activity: 905
Merit: 1012
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
June 01, 2014, 04:38:38 AM |
|
RangerK the only legitimate way of retrieving the transaction sender's address is to ask for one. You might also want to take a closer look to the refund address facility introduced with the 0.9 client, however this is no production ready yet.
You are talking about the payment protocol, right? That's ready for production, and is the right tool to use here.
|
I'm an independent developer working on bitcoin-core, making my living off community donations. If you like my work, please consider donating yourself: 13snZ4ZyCzaL7358SmgvHGC9AxskqumNxP
|
|
|
RangerK
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
June 03, 2014, 02:43:06 PM |
|
For anyone following this thread: With the Payment Protocol, the wallet supplies a refund address along with the payment. This eliminates another potential source of error in refund situations. This approach to refunds works on the block chain, with any wallet software, and does not require the buyers to have a bitpay account. http://blog.bitpay.com/2014/02/20/bitpay-launches-payment-protocol-support.html
|
![Cool](https://bitcointalk.org/Smileys/default/cool.gif) ---> Who will mine the next 777 Block??? Place your bets at block777.com!!!
|
|
|
PHP.guru
Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 154
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
June 03, 2014, 05:16:03 PM |
|
This question pops up every now and then. I will write an "ultimate guide" on how to do this once and for all.
|
|
|
|
RangerK
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
June 03, 2014, 08:31:34 PM |
|
This question pops up every now and then. I will write an "ultimate guide" on how to do this once and for all.
And I will show my gratitude with a modest donation. (very modest)
|
![Cool](https://bitcointalk.org/Smileys/default/cool.gif) ---> Who will mine the next 777 Block??? Place your bets at block777.com!!!
|
|
|
kjj
Legendary
Offline
Activity: 1302
Merit: 1026
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
June 03, 2014, 09:44:45 PM |
|
I wrote the ultimate guide many times. Eventually got sick of it.
The short version is that there is no "sender", much less a "sender address".
|
17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8 I routinely ignore posters with paid advertising in their sigs. You should too.
|
|
|
DannyHamilton
Legendary
Offline
Activity: 3472
Merit: 4790
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
June 03, 2014, 11:38:11 PM |
|
I wrote the ultimate guide many times. Eventually got sick of it.
The short version is that there is no "sender", much less a "sender address".
I was hoping that the "Ultimate Guide" comment was in reference to: With the Payment Protocol, the wallet supplies a refund address along with the payment. An "Ultimate Guide" on how to choose which address your wallet will choose as the "refund address" when you send the payment, and how as a merchant to request a "refund address" from the customer by way of the payment protocol would be nice.
|
|
|
|
Nicolas Dorier
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
June 15, 2014, 12:54:44 AM |
|
hi and sorry,
i try to understand this world and i try to crate a game/services.
My program in c# .net call the wallet by RPC, but how i can get sender address ?
for now i can get the transaction on specific account by listtransactions, i try getrawtransaction verbose or decoderawtransaction, but i can't get the address of sender.
Can you help me?
It was not here when you posted this message, but now, here you go Github : https://github.com/NicolasDorier/NBitcoin Nuget : Install-Package NBitcoin The class that interest you is called RPCClient. I wrote some articles on codeproject, I let you discover that.
|
Bitcoin address 15sYbVpRh6dyWycZMwPdxJWD4xbfxReeHe
|
|
|
|