it very important for pools and exchanges and wallets with a lot transactions that u are able reduce the automated generation of change addresses
by set a dedicated change address
dGwSYfqEpV8Map4jscwvaQawRziPStoAjz
Diamond v2.0.4 brings new functionality to reduce wallet bloat. I will repeat the premise and reasons here with introduction to the interface.
The Bitcoin protocol is designed in such a way, that when you send coins, you almost always end up with some 'change'. This happens, because the protocol operates on 'amounts' (that you either generated, received or were result of such 'change' operation). The amounts, unlike fiat currencies are not in set number of denominations. Instead, each Bitcoin 'amount' is an number of "satoshi" represented as a number with many decimal places. When you send some amount to someone, a subset of your existing coins is picked up (either automatically, using rather primitive algorithm, or manually via coin control). The total sum of this amount being X is chosen to be larger than the amount you wish to send plus any fees. When you send the amount Y, the remainder, which is Z = X - Y is sent to a new address, which is specifically created for the purpose to hold your 'new change'. The idea here is to assure you of anonymity for your cash flow, because nobody could know which is the sent amount and which is the change. Which in essence 'sits' in your own wallet, because you now have new keys to claim it.
The Bitcoin wallet assumption and claims of privacy are however not always true, as (because of the way amounts in the wallet are chosen) it is often trivial to track whose the change is. From now on, we will talk about Diamond, but please bear in mind this is fundamental protocol principle inherited from Bitcoin and present in virtually all crypto coins.
In summary, imagine you have received an amount of 500 DMD. You believe you have just one Diamond address in your wallet (where you received that amount). This might be the case until that moment. But, one day you decide to send someone 10 DMD. The protocol has no way to subtract from the amount you have. Instead, it needs to destroy the old amount and create two new amounts. Actually three: the amount you wish to send, 10 DMD, the fee, usually 0.001 DMD and the remainder, the change 489.009 DMD. While performing the send operation, your wallet creates a new Diamond address and sends the change there. Now, you have two new addresses in your Diamond wallet (it has grown with the required records). With every send you do, this is repeated. Now, the Diamond wallet makes things convenient for you, and hides these 'change' addresses. You might have thousands of them, and not be aware. As a result, your wallet is working slower and slower -- this includes everything, from opening it to sending to PoS.
Coin control we implemented some time ago lets you select the change address. But this only works in the GUI and is not very convenient. It is also completely useless for pools and exchanges that are the primary victims of wallet bloat. This is why this new functionality was necessary.
The new functionality provides two interfaces:
1. A command line option, -changeaddress which is also available in the configuration file as changeaddress= that lets you give the Diamond address you want the change to go to. This can be an address in the same wallet, or elsewhere. You specify this option/parameter at start up time.
2. A pair of getchangeaddress/setchangeaddress RPC commands that let you programmatically control the change address and also clear it. The commands are as follows:
getchangeaddress
returns the current change address, or nothing if there is no address set.
setchangeaddress DiamondAddress
sets the change address, or if the address is given as '' clears it. You can also clear an change address that was set via the command line of configuration file.
Having an change address set up for the wallet makes the change in any future send transaction go to that specific address. No new addresses are created in the wallet and there is no more bloat.
Unfortunately, this functionality does not 'clean' your existing bloat. We are working on that, but not yet done.