Bitcoin Forum
May 12, 2024, 09:10:41 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Sending use's money back?  (Read 1177 times)
Staring Owl (OP)
Member
**
Offline Offline

Activity: 90
Merit: 10


View Profile
June 10, 2013, 01:02:54 PM
 #1

Let's say you have to send user's account balance back.
For security reasons you have locked it so that it can be cashed out only to the address that sent the money.

Now when user sends money you see  2 addresses. The one that has sent/spent the money and the one that got the "change" back. Right?

To which one of them you think would be wiser to send the money back?

The original one is spent, so i'm not sure what happens with it and for how long it's kept?
The one that got the change is also owned by the user (unless there are some exceptions with web based wallets and the like?)

So do you see any drawbacks or advantages to any of the options?
What would you do?

 Grin SLOT machine with generous payouts and affiliate program. BTC No registration needed BTC Start playing for real within seconds BTC Provably fair and transparent BTC You can win up to 5000 times your bet BTC Or make 30% by referring friends. ->  BitBandit.eu
Each block is stacked on top of the previous one. Adding another block to the top makes all lower blocks more difficult to remove: there is more "weight" above each block. A transaction in a block 6 blocks deep (6 confirmations) will be very difficult to remove.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715548241
Hero Member
*
Offline Offline

Posts: 1715548241

View Profile Personal Message (Offline)

Ignore
1715548241
Reply with quote  #2

1715548241
Report to moderator
niko
Hero Member
*****
Offline Offline

Activity: 756
Merit: 501


There is more to Bitcoin than bitcoins.


View Profile
June 10, 2013, 01:05:27 PM
 #2

Let's say you have to send user's account balance back.
For security reasons you have locked it so that it can be cashed out only to the address that sent the money.

Now when user sends money you see  2 addresses. The one that has sent/spent the money and the one that got the "change" back. Right?

To which one of them you think would be wiser to send the money back?

The original one is spent, so i'm not sure what happens with it and for how long it's kept?
The one that got the change is also owned by the user (unless there are some exceptions with web based wallets and the like?)

So do you see any drawbacks or advantages to any of the options?
What would you do?

I would sit down and read about how Bitcoin works, then come back here and ask a different question.

Seriously.

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

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
June 10, 2013, 02:32:29 PM
 #3

Let's say you have to send user's account balance back.
For security reasons you have locked it so that it can be cashed out only to the address that sent the money.

Now when user sends money you see  2 addresses. The one that has sent/spent the money and the one that got the "change" back. Right?

To which one of them you think would be wiser to send the money back?

The original one is spent, so i'm not sure what happens with it and for how long it's kept?
The one that got the change is also owned by the user (unless there are some exceptions with web based wallets and the like?)

So do you see any drawbacks or advantages to any of the options?
What would you do?

I would sit down and read about how Bitcoin works, then come back here and ask a different question.

Seriously.
Wise words

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
June 11, 2013, 05:29:15 AM
 #4

You should also not assume every address in the inputs is controlled by the sender.  Generally you could send to any of them and the user should be able to receive them, but exceptions are things like sending from an exchange or webwallet where that address isn't owned by the user; or the co-signing stuff people have been playing with, where multiple parties pool their outputs for privacy/taint-confusion purposes (in this case not all input addresses are necessarily owned by the person who sent you the coins.)

So, if you're dead-set on sending back to one of the sending addresses, you should tell the user beforehand, and probably let them choose which one to send it to.

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
Staring Owl (OP)
Member
**
Offline Offline

Activity: 90
Merit: 10


View Profile
June 12, 2013, 11:37:02 AM
 #5

What should I do then guys?
Aren't there some best practices or something?

I understand that my questions might be lame and I have a lot of reading to do. And I'm getting there. But I would appreciate if someone experienced gives me a hand in the meantime, because i'm kinda pressed by time right now.

 Grin SLOT machine with generous payouts and affiliate program. BTC No registration needed BTC Start playing for real within seconds BTC Provably fair and transparent BTC You can win up to 5000 times your bet BTC Or make 30% by referring friends. ->  BitBandit.eu
Staring Owl (OP)
Member
**
Offline Offline

Activity: 90
Merit: 10


View Profile
June 12, 2013, 01:46:07 PM
 #6

What should I do then guys?
Aren't there some best practices or something?

I understand that my questions might be lame and I have a lot of reading to do. And I'm getting there. But I would appreciate if someone experienced gives me a hand in the meantime, because i'm kinda pressed by time right now.

Contact the person you need to send coins to and ask for address he owns.

that's obviosly for an app, so i need a general solution

 Grin SLOT machine with generous payouts and affiliate program. BTC No registration needed BTC Start playing for real within seconds BTC Provably fair and transparent BTC You can win up to 5000 times your bet BTC Or make 30% by referring friends. ->  BitBandit.eu
OnkelPaul
Legendary
*
Offline Offline

Activity: 1039
Merit: 1004



View Profile
June 12, 2013, 01:51:49 PM
 #7

It wasn't obvious from your question that this was for an app, it could just as well have been a single transaction that you needed to reverse.

So for an app, let the user specify a withdrawal address. That way he or she can choose to which address any returned bitcoins will be sent.
Of course, if you want to lock that you'd need a way to unlock and change it, preferrably with something like 2FA to be reasonably sure that it was the user who requested the change.

Onkel Paul

niko
Hero Member
*****
Offline Offline

Activity: 756
Merit: 501


There is more to Bitcoin than bitcoins.


View Profile
June 12, 2013, 02:35:36 PM
 #8

So for an app, let the user specify a withdrawal address.

Or make it perfectly visible and clear that user must send coins from address he owns, with some explanation on what it means to own address.
Yes to both. I think letting the user specify an address when signing up is the best practice. The second solution is fine, except it limits the users in what wallets theyvuse every time they send you money.

They're there, in their room.
Your mining rig is on fire, yet you're very calm.
Staring Owl (OP)
Member
**
Offline Offline

Activity: 90
Merit: 10


View Profile
July 24, 2013, 05:44:14 PM
 #9

Ok, when a user sends money, bitcoind sees 2 addresses and if i have understood correctly we can't tell whch is change and which the original input right?
so sending to any of those will be fine as long as the user is not using a web wallet, is that right?


if he is using a web wallet, the only way is to let him set his own receive address, right?

 Grin SLOT machine with generous payouts and affiliate program. BTC No registration needed BTC Start playing for real within seconds BTC Provably fair and transparent BTC You can win up to 5000 times your bet BTC Or make 30% by referring friends. ->  BitBandit.eu
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
July 24, 2013, 05:56:44 PM
 #10

Whatever the case make him specify his address

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
July 24, 2013, 08:50:21 PM
 #11

Ok, when a user sends money, bitcoind sees 2 addresses and if i have understood correctly we can't tell whch is change and which the original input right?
so sending to any of those will be fine as long as the user is not using a web wallet, is that right?

No, this is never right.  There is no such thing as a "from address".  Banish the idea from your mind.

if he is using a web wallet, the only way is to let him set his own receive address, right?

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4172
Merit: 8420



View Profile WWW
July 24, 2013, 09:33:48 PM
 #12

Aren't there some best practices or something?
Sure, when the user establishes their relationship with you request they give you an emergency refund address.  Maybe it's one they use for other things too, maybe not.  Then you have one on file that you can safely use.

Ideally every time a user requests a payment from you, you should prompt for a new address.  Address reuse gums up the privacy of Bitcoin users and fungibility of Bitcoin... but keeping an emergency refund address on file is a best practice for anyone who holds someone elses funds.
alp
Full Member
***
Offline Offline

Activity: 284
Merit: 101


View Profile
July 24, 2013, 09:42:44 PM
 #13

Ok, when a user sends money, bitcoind sees 2 addresses and if i have understood correctly we can't tell whch is change and which the original input right?
so sending to any of those will be fine as long as the user is not using a web wallet, is that right?


if he is using a web wallet, the only way is to let him set his own receive address, right?

First learn to walk before you run.  You have fundamental misunderstandings about how transactions in Bitcoin work.  Start here: https://en.bitcoin.it/wiki/Transactions

If you have this little clue on how things work, you should not even consider writing an app, as it will almost certainly lose a lot of money for whoever uses it.  Try reading before making a lot of dumb assumptions and arguing with people who know a lot more than you.

I am looking for a good signature. Here could be your advertisement
Staring Owl (OP)
Member
**
Offline Offline

Activity: 90
Merit: 10


View Profile
July 25, 2013, 02:42:14 PM
 #14

Ok, when a user sends money, bitcoind sees 2 addresses and if i have understood correctly we can't tell whch is change and which the original input right?
so sending to any of those will be fine as long as the user is not using a web wallet, is that right?

No, this is never right.  There is no such thing as a "from address".  Banish the idea from your mind.

if he is using a web wallet, the only way is to let him set his own receive address, right?


why there is no such thing as from address?

 Grin SLOT machine with generous payouts and affiliate program. BTC No registration needed BTC Start playing for real within seconds BTC Provably fair and transparent BTC You can win up to 5000 times your bet BTC Or make 30% by referring friends. ->  BitBandit.eu
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
July 25, 2013, 02:46:41 PM
 #15

why there is no such thing as from address?

Fundamentally it is because of how *new* coins are created (a tx that goes to an address but has no UTXO that it came *from*).

Also in many tx's there will be more than one UTXO (therefore more than one *from* address if you look at it that way) and in the future things like "multi-sig" tx's just make it even more complicated.

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
July 25, 2013, 02:50:28 PM
Last edit: July 25, 2013, 03:22:58 PM by jackjack
 #16

Coins are not sent to addresses but to portions of scripts...
Seriously, there's a wiki other there. As a developper aren't you supposed to learn about something before coding about it?

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
jl2012
Legendary
*
Offline Offline

Activity: 1792
Merit: 1097


View Profile
July 25, 2013, 03:06:58 PM
 #17

Making a bitcoin-spending bot without knowing how bitcoin works? It's just flushing your money to the toilet

Donation address: 374iXxS4BuqFHsEwwxUuH3nvJ69Y7Hqur3 (Bitcoin ONLY)
LRDGENPLYrcTRssGoZrsCT1hngaH3BVkM4 (LTC)
PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
alp
Full Member
***
Offline Offline

Activity: 284
Merit: 101


View Profile
July 25, 2013, 09:08:32 PM
 #18

Coins are not sent to addresses but to portions of scripts...
Seriously, there's a wiki other there. As a developper aren't you supposed to learn about something before coding about it?

Ready fire aim.

I am looking for a good signature. Here could be your advertisement
paraipan
In memoriam
Legendary
*
Offline Offline

Activity: 924
Merit: 1004


Firstbits: 1pirata


View Profile WWW
July 25, 2013, 09:31:45 PM
 #19

Making a bitcoin-spending bot without knowing how bitcoin works? It's just flushing your money to the toilet

Yeah, can't forget about this one Mtgox did...

https://bitcointalk.org/index.php?topic=50206

BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
Pages: [1]
  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!