j3d
j3d

Reputation: 9734

BitcoinJ: Is it possible to always use the same receive address?

I need to create a wallet that receives coins from a third party that never changes.

Reading the wallet documentation, I've understood there is a method that returns the public receive address:

Address address = wallet.currentAddress();

Then, the documentation also says that once the current address is seen being used, it changes to a new one.

Does this mean that once my wallet receives some coins I need to tell my third party the address changed? Maybe I've misunderstood things... but I just need to provide my third party with an address and they'll send coins to this address whenever necessary.

Upvotes: 3

Views: 219

Answers (1)

Deepak Agrawal
Deepak Agrawal

Reputation: 1301

No, you can reuse old address. But It is best practise to create new address for each transaction to keep hidden yourself how much money a single person holds. You can iterate over the list of ECKey to check how many addresses being hold by in your wallet.

Upvotes: 2

Related Questions