Self to Self Transactions to Optimise Coin Groups

So I have taken to sending all my coins in a single transaction to myself as a way of hopefully avoiding having too many change addresses and maintaining an optimised staking coin grouping.
Its probably not needed but I am a bit paranoid about generated coins somehow becoming orphaned.
I try to back up regularly but not sure I understand the full implications of change addresses so I thought by sending all my coins in single transaction to my wallet will somehow prevent the whole change address issue from becoming a problem as I stake and coins are generated.
I probably dont understand…but this has been my attempt to mitigate it by essentially putting all my eggs in one basket for the wallet to optimise and age in a rational manner. Please excuse my stupidity if this is not needed…

A couple things to put your mind at ease:

  • Change addresses will only be generated if you make an outgoing transaction. So coinstake transactions do not involve change addresses.
  • The Qt wallet by default generates a bunch of change addresses in the background. I think 100. It will then only generate more addresses when it uses these up. So the only way an old backup would cause you to lose coins is if you had a 100+ of outgoing transactions.
  • The the update to HD Qt wallets (hierarchical deterministic, not high definition) will make this a moot point. laudney teased these a few weeks back, and I believe he is in the process of finalizing the code to make them happen.

A little more detail:

  • A change address is used when you send Reddcoins to another person and the amount sent does not equal the exact amount of your input(s). Inputs come from deposit transactions.

  • Say you deposit 1000 RDD, 15000 RDD, and 900 RDD. You have 3 inputs. Now say you send someone 500 RDD. Your wallet will grab one of your inputs (I think the 900 RDD one, but I can’t recall if logical is built in to grab the smallest input that works) and make a new transaction. That transaction will look something like this:

    • input: 900 RDD from your wallet address
    • output:
      • 500 RDD to your friend
      • 399.999 RDD to a change address
      • 0.001 RDD transaction fee (or something like that…) to stakers
  • Let’s say you decided to also send 700 RDD to another friend in the same transaction. That would look something like this:

    • input:

      • 900 RDD from your wallet address
      • 1000 RDD from your wallet address
        (could be the same as the 900 or different - whatever your deposited it as)
    • output:

      • 500 RDD to your friend
      • 700 RDD to your other friend
      • 699.999 RDD to a change address
      • 0.001 RDD transaction fee to stakers
    • Notice the fee didn’t get bigger. In fact, with many transactions the fee will likely be 0 unless you tell it otherwise.

  • How HD wallets derive keys:

    • Basically, an HD wallet uses a defined tree structure to create new branches with very specific references.
    • Most work by generating “Receive” addresses and “Change” addresses by using a numbering system.
    • A wallet might automatically generate 10 receive addresses and 3 change addresses, numbered 0-9 and 0-2, respectively.
    • The wallet would then check if these addresses are used. In the case of Receive addresses, if it sees that #7 is used, it will generate additional addresses. Then it checks again. Say #14 is used… it will make more. It keeps doing this until there are 10 unused addresses at the end.
    • Change addresses work in the same way, though usually the wallet doesn’t keep as large of a store of empty change addresses hanging around. This is because the wallet always uses these addresses sequentially. i.e. the first time it needs a change address it uses 0. The next 1. The next 2. And so on. This differs from the receive addresses, where a users might give 10 addresses out on 10 different sites, and only 0, 2, 6, and 9 get used, for example.

If you would like to learn more about change addresses and something called “coin control” - a way that the Qt wallet lets the user manage inputs - check out the wiki:

– Mike


I also meant to mention, combining your stakes is a double edged sword. Yes, it puts all your coins into bigger clumps, which means they are going to be able to accumulate more weight and thus stake faster. BUT, you burn any weight they had accumulated prior to doing this. So… as a one-time thing, it’s probably fine and maybe advised. But don’t make it a habit. If your deposit is larger than 2 million RDD, would wallet will “split” those coins into two equal deposits the first time you stake. It will keep doing that until they get to be smaller than 2 million. At which point it will alternate between combining and splitting stakes to keep them just ± 2 million coins. This is totally expected behavior, and you should just let it do its thing at this point!

1 Like

Thanks for all that, I understood about burning the weight…and since this is the second time I have done this…once last year and now once this year…I think thats enough lol. Change addresses only come into play when you do transactions…so that will make my life easier…as long as I dont use up more than the 100 addresses then my back ups will be ok as I understand it now…year 2 month 2…misktake…3…oh well live and learn… 1 year of coin age gone in a mouse click LOL

1 year of coin age gone in a mouse click LOL

Worry not, you probably lost a tiny fraction of any potential rewards - unless, like me, you had moved the whole stash before PoSV started. A few weeks into staking and your “left-over coinage” is marginal.

You should pretty much neglect the loss and forget about it, really.

Well its back to 15hours all ready so thats not too bad…it will get back to an hour again no doubt in a week or so…Thanks Didi