Bitcoin Forum
June 16, 2024, 06:32:42 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin-QT and Satoshi Dice  (Read 2360 times)
chmod (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
December 24, 2012, 02:26:18 AM
 #1

When I play Satoshi Dice from my Bitcoin-QT client, I see in the block chain that it sends my remaining BTC to another address, but I don't have that address listed in my client as a receiving address. So if I play again, will it send from that new address, and can I claim any rewards that I get?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3430
Merit: 4660



View Profile
December 24, 2012, 02:43:41 AM
 #2

When I play Satoshi Dice from my Bitcoin-QT client, I see in the block chain that it sends my remaining BTC to another address, but I don't have that address listed in my client as a receiving address. So if I play again, will it send from that new address, and can I claim any rewards that I get?

When you spend bitcoin, you spend an entire input all at once.  So if you receive a single transaction that has 3.5 BTC in the output, then later when you want to send 1.5 BTC, you have to spend the entire 3.5 BTC in a single transaction.  Think of it like if someone gave you a $5 bill and you then later wanted to buy something for $2.  You would have to spend the entire $5 bill all at once (you can't just rip it into 5 pieces), but you would get $3 back in change.

The client program hides most of this messiness from you.  It spends the full 3.5 BTC, creating 2 outputs, one for the 1.5 BTC that you are sending to someone, and another output for the remaining 2 BTC in change that gets sent back to you.  The client program chooses a new private key/address, adds it to your wallet, and sends the change back to you with this new address that is now in your wallet.

So, while you don't see this new "change" address in the list of addresses you've generated in your "Receive Coins" tab, it is an address that is in your wallet, hidden from you by the client, and the client will eventually pull coins from that address to send (quite likely generating yet another "change" address). When SatoshiDice receives coins from that address and sends your rewards back to the same address, they will still show up in your wallet.
payb.tc
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000



View Profile
December 24, 2012, 04:00:27 AM
 #3

^ this increases the importance of regularly backing up your wallet; so that the newly-generated change addresses get included in your backups.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3430
Merit: 4660



View Profile
December 24, 2012, 05:02:49 AM
 #4

^ this increases the importance of regularly backing up your wallet; so that the newly-generated change addresses get included in your backups.
Correct, the Bitcoin-Qt client pre-generates a list of 100 addresses to pull from.  It uses these pre-generated addresses both when you click "New Address" on the "Receive Coins" tab and when it needs a "change" address.  As long as you have backed up the wallet recently enough that you haven't used up all 100 pre-generated addresses, you can recover the backup and all the coins will still be there.  However, if you've used up all 100 pre-generated addresses since the last backup, then you will lose some coins that were sent to recent "change" addresses that weren't in the last backup.

Also note that when you encrypt a wallet, it tosses out the entire pool of 100 pre-generated addresses and generates a new pool.  This means that if you backup your wallet BEFORE encrypting it, and then send/receive coins AFTER encrypting it, those coins will be permanently lost if/when you try to recover the backup.  If you encrypt your wallet, it is very important that you backup your wallet after encrypting so you don't lose bitcoins if you have to recover from a backup.
chmod (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
December 24, 2012, 07:01:38 AM
 #5

Thanks guys, that was really helpful.
chmod (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
December 24, 2012, 07:11:07 AM
 #6

One other thing. Each time I play Satoshi Dice, the remaining coins are sent to a new address, while the reward or .00000001 BTC is sent back to the sending address. So if I play 100 times, I could have coins spread across 100 addresses. Should I consolidate them at some point and what's the best way to do that?
payb.tc
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000



View Profile
December 24, 2012, 10:46:10 AM
 #7

Should I consolidate them at some point and what's the best way to do that?

they will automatically get consolidated once you spend them.

if you want them consolidated in your own wallet (why?), you'll have to spend them to one of your own addresses, and most likely pay a fee.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3430
Merit: 4660



View Profile
December 24, 2012, 03:19:41 PM
Last edit: January 08, 2013, 01:02:49 PM by DannyHamilton
 #8

One other thing. Each time I play Satoshi Dice, the remaining coins are sent to a new address, while the reward or .00000001 BTC is sent back to the sending address. So if I play 100 times, I could have coins spread across 100 addresses. Should I consolidate them at some point and what's the best way to do that?
Bitcoin-Qt will force you to pay a transaction fee if the number of inputs necessary create a transaction larger than 10Kb.  So all those 0.00000001 BTC will likely eventually cause you to pay larger fees than otherwise necessary. The only way to "consolidate" them is to include them in a transaction, but since the Bitcoin-Qt doesn't give you control over which outputs are used as inputs for a new transaction, it can be a bit complicated to do that.

One thing you can try would be to send your entire wallet balance to a single address.  This will sweep together all your bitcoins into a single output to be used for future transactions. Unfortunately, it will also destroy your anonymity, as it will tie together all your bitcoin addresses in the blockchain so that anyone who knows any one of your addresses, will easily be able to determine all of them.


chmod (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
December 25, 2012, 02:04:54 AM
 #9

Ok, thanks.
LTC555
Newbie
*
Offline Offline

Activity: 42
Merit: 0



View Profile
January 08, 2013, 04:25:26 AM
 #10

http://www.reddit.com/r/Bitcoin/comments/13126f/this_guy_had_a_bad_day_on_satoshi_dice/

Just a reminder, know your limit.  LOL at that poor guy :/
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!