Bitcoin Forum
November 11, 2024, 01:18:35 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: how to get the "from address" from the bitcoin server client.  (Read 1679 times)
jaminunit (OP)
Member
**
Offline Offline

Activity: 132
Merit: 14

Co-Founder of TheStandard.io & Vaultoro.com


View Profile WWW
May 06, 2013, 02:21:58 PM
 #1

Hi yall,

So I'm creating a little game for fun and want to automatically send winnings back to the address that funded the game.
I see that http://bitbet.us/ did this. You can send them a bitcoin and they will send you any winnings back to the address it came from.

I have looked all through https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list but can't seem to find the function that does that.

I've been a Bitcoiner since 2010, and currently working on TheStandard.io, a next-generation stablecoin, and lending protocol.
The Standard Protocol Announcement thread
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
May 06, 2013, 02:22:42 PM
 #2

Hi yall,

So I'm creating a little game for fun and want to automatically send winnings back to the address that funded the game.
I see that http://bitbet.us/ did this. You can send them a bitcoin and they will send you any winnings back to the address it came from.

I have looked all through https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list but can't seem to find the function that does that.

Try get txid and then analyze this transaction.
jaminunit (OP)
Member
**
Offline Offline

Activity: 132
Merit: 14

Co-Founder of TheStandard.io & Vaultoro.com


View Profile WWW
May 06, 2013, 02:35:14 PM
 #3

Thanks Come-from-Beyond
Hmmm this only seems to get me the receiving address

I've been a Bitcoiner since 2010, and currently working on TheStandard.io, a next-generation stablecoin, and lending protocol.
The Standard Protocol Announcement thread
jaminunit (OP)
Member
**
Offline Offline

Activity: 132
Merit: 14

Co-Founder of TheStandard.io & Vaultoro.com


View Profile WWW
May 06, 2013, 02:43:21 PM
 #4

Oh ok the address is hashed.

Any tips on how to  unhash it

I've been a Bitcoiner since 2010, and currently working on TheStandard.io, a next-generation stablecoin, and lending protocol.
The Standard Protocol Announcement thread
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
May 06, 2013, 02:55:45 PM
 #5

Oh ok the address is hashed.

Any tips on how to  unhash it

Can't help here. I used to use blockchain.info API - http://blockchain.info/address/660d4ef3a743e3e696ad990364e555c271ad504b?format=json
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1026



View Profile
May 06, 2013, 02:57:24 PM
 #6

The bitcoin system has no such concept of a "from address", as has been explained in hundreds of threads.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
jaminunit (OP)
Member
**
Offline Offline

Activity: 132
Merit: 14

Co-Founder of TheStandard.io & Vaultoro.com


View Profile WWW
May 06, 2013, 03:03:41 PM
Last edit: May 06, 2013, 04:28:26 PM by jaminunit
 #7

Oh ok,
So does satoshi dice use the blockchain.ino api?

I've been a Bitcoiner since 2010, and currently working on TheStandard.io, a next-generation stablecoin, and lending protocol.
The Standard Protocol Announcement thread
jaminunit (OP)
Member
**
Offline Offline

Activity: 132
Merit: 14

Co-Founder of TheStandard.io & Vaultoro.com


View Profile WWW
May 06, 2013, 06:07:21 PM
 #8

Ok after a heap of dry reading I think I'm going to have to change the way I track incoming and outgoing addresses and funding.

I've been a Bitcoiner since 2010, and currently working on TheStandard.io, a next-generation stablecoin, and lending protocol.
The Standard Protocol Announcement thread
bukaj
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
May 06, 2013, 06:51:26 PM
 #9

Ok after a heap of dry reading I think I'm going to have to change the way I track incoming and outgoing addresses and funding.

What was your idea and why you think it is wrong? I'm asking, because I'm working on accepting coins myself.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1026



View Profile
May 06, 2013, 07:38:37 PM
 #10

The short version is that coins don't "come from" anywhere.  If you look at your coins, you can do a little detective work and try to figure out the last place they went to before they went to your wallet.  But when they came to your wallet, they didn't come from that place.

And that is for simple transactions, it can get worse.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
bukaj
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
May 06, 2013, 07:44:39 PM
 #11

I get it. Thank you.
niko
Hero Member
*****
Offline Offline

Activity: 756
Merit: 501


There is more to Bitcoin than bitcoins.


View Profile
May 07, 2013, 07:47:36 AM
 #12

The short version is that coins don't "come from" anywhere.  If you look at your coins, you can do a little detective work and try to figure out the last place they went to before they went to your wallet.  But when they came to your wallet, they didn't come from that place.

And that is for simple transactions, it can get worse.
Coins come from tx inputs, and go into tx outputs. If coins "don't come from anywhere," there is no way for any node to validate a transaction, and Bitcoin doesn't work.

They're there, in their room.
Your mining rig is on fire, yet you're very calm.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1026



View Profile
May 07, 2013, 11:18:01 AM
 #13

The short version is that coins don't "come from" anywhere.  If you look at your coins, you can do a little detective work and try to figure out the last place they went to before they went to your wallet.  But when they came to your wallet, they didn't come from that place.

And that is for simple transactions, it can get worse.
Coins come from tx inputs, and go into tx outputs. If coins "don't come from anywhere," there is no way for any node to validate a transaction, and Bitcoin doesn't work.

I think you are taking some metaphors too literally.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
niko
Hero Member
*****
Offline Offline

Activity: 756
Merit: 501


There is more to Bitcoin than bitcoins.


View Profile
May 07, 2013, 11:34:06 AM
 #14

The short version is that coins don't "come from" anywhere.  If you look at your coins, you can do a little detective work and try to figure out the last place they went to before they went to your wallet.  But when they came to your wallet, they didn't come from that place.

And that is for simple transactions, it can get worse.
Coins come from tx inputs, and go into tx outputs. If coins "don't come from anywhere," there is no way for any node to validate a transaction, and Bitcoin doesn't work.

I think you are taking some metaphors too literally.
I think there such thing as "from" address(es), and we can see them for any given transaction.

They're there, in their room.
Your mining rig is on fire, yet you're very calm.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1026



View Profile
May 07, 2013, 11:36:13 AM
 #15

The short version is that coins don't "come from" anywhere.  If you look at your coins, you can do a little detective work and try to figure out the last place they went to before they went to your wallet.  But when they came to your wallet, they didn't come from that place.

And that is for simple transactions, it can get worse.
Coins come from tx inputs, and go into tx outputs. If coins "don't come from anywhere," there is no way for any node to validate a transaction, and Bitcoin doesn't work.

I think you are taking some metaphors too literally.
I think there such thing as "from" address(es), and we can see them for any given transaction.

Well, as long as you don't mind being wrong, you are free to keep thinking that.  Smiley

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
niko
Hero Member
*****
Offline Offline

Activity: 756
Merit: 501


There is more to Bitcoin than bitcoins.


View Profile
May 07, 2013, 12:28:33 PM
 #16

The short version is that coins don't "come from" anywhere.  If you look at your coins, you can do a little detective work and try to figure out the last place they went to before they went to your wallet.  But when they came to your wallet, they didn't come from that place.

And that is for simple transactions, it can get worse.
Coins come from tx inputs, and go into tx outputs. If coins "don't come from anywhere," there is no way for any node to validate a transaction, and Bitcoin doesn't work.

I think you are taking some metaphors too literally.
I think there such thing as "from" address(es), and we can see them for any given transaction.

Well, as long as you don't mind being wrong, you are free to keep thinking that.  Smiley
Explain how this is wrong: every transaction (other than generation-only) includes the public key of the payer (and the ECDSA signature using the corresponding private key of the payer). Payer's public key is thus revealed, and "from" address is simply the RIPEMD-160(SHA-256(PubKey)).

Explicit example:



Of course, if there are multiple inputs, there will be multiple "from" addresses.

They're there, in their room.
Your mining rig is on fire, yet you're very calm.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1026



View Profile
May 07, 2013, 12:56:54 PM
 #17

Explain how this is wrong: every transaction (other than generation-only) includes the public key of the payer (and the ECDSA signature using the corresponding private key of the payer). Payer's public key is thus revealed, and "from" address is simply the RIPEMD-160(SHA-256(PubKey)).

Explicit example:



Of course, if there are multiple inputs, there will be multiple "from" addresses.

Outputs have scripts, not addresses.  And the recognition that transactions have lists of inputs and outputs should give you pause before thinking that you can connect an output to an input, in general.

Look at these two transactions, and tell me what the "from" address for each one was.

997e5182...
0f463847...

P.S.  blockexplorer.com having a column titled "From Address" doesn't make it so.  And the tooltip note is wrong.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
niko
Hero Member
*****
Offline Offline

Activity: 756
Merit: 501


There is more to Bitcoin than bitcoins.


View Profile
May 07, 2013, 02:57:56 PM
 #18

Outputs have scripts, not addresses. 
Not sure how this relates to the question of (non)existence of "from" addresses.
Quote

And the recognition that transactions have lists of inputs and outputs should give you pause before thinking that you can connect an output to an input, in general.
Again, nothing to do with the issue discussed here. I never mentioned connecting an output to an input in the same transaction (the sum total needs to match, including miner's fees, that is all - no point connecting particular inputs to particular outputs). We agree there, but it is irrelevant.
Quote

Look at these two transactions, and tell me what the "from" address for each one was.

997e5182...
0f463847...

The first one seems to be a multisig attempt from  35nGJpcQr4pYVyFVR3BPbdaWUSk6NBryUD, discussed here.
The second one clearly lists all addresses associated with (many) inputs. These are the "from" addresses.

It's quite simple, can't we agree on this?

OP was asking about "from" addresses, but was told there was no such thing in Bitcoin. I claim this is false, as transaction inputs specify public keys which translate into corresponding addresses. The coins are thus sent from these addresses, in the sense that control (ownership) of coins is reassigned from these "from" addresses (and the corresponding key pairs) to the receiveing addresses (and the corresponding key pairs).

They're there, in their room.
Your mining rig is on fire, yet you're very calm.
Come-from-Beyond
Legendary
*
Offline Offline

Activity: 2142
Merit: 1010

Newbie


View Profile
May 07, 2013, 03:32:55 PM
 #19

Outputs have scripts, not addresses.

Outputs have predicates, not scripts.  Grin
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1026



View Profile
May 07, 2013, 04:55:43 PM
 #20

The second one clearly lists all addresses associated with (many) inputs. These are the "from" addresses.

It's quite simple, can't we agree on this?

OP was asking about "from" addresses, but was told there was no such thing in Bitcoin. I claim this is false, as transaction inputs specify public keys which translate into corresponding addresses. The coins are thus sent from these addresses, in the sense that control (ownership) of coins is reassigned from these "from" addresses (and the corresponding key pairs) to the receiveing addresses (and the corresponding key pairs).

In doing so, you have redefined "from" to mean "the last address that it was sent to".  If muddling the two concepts works for you, then enjoy, I guess.

However, when people come here asking this question, they are trying to do something.  The something that they are doing is dangerous, and never the correct way to solve the (real) problem they have.  Typically, what they really want is a return address.  Bitcoin has no such concepts.  There is no return address, just like there is no sending address.  People working with bitcoin need to accept the system as it really is, not the way they want it to be.  They can choose not to, as you have, but they do so at their own peril, and I won't encourage them down that road.

Bitcoin transactions connect other transactions to scripts.  They do not connect addresses to addresses.  Just because you can sometimes (or even usually) find an address that controlled a now-redeemed transaction does not mean that the new transaction came from that address.  There is no general solution, because the concepts simply do not exist in the system.

Do you understand that?  You are finding things that exist in some transactions that have properties similar to the thing you are looking for, and you claim that they are the thing you are looking for.

What address did this little guy come from?

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!