Author

Topic: Change Address vs Outside Address in Transaction from Core Wallet (Read 1140 times)

donator
Activity: 1218
Merit: 1079
Gerald Davis
After that bug where they trusted the Android random number generator was random and it wasn't, I won't trust the mobile wallet at all until someone pays for a serious 3rd party audit of the code.

You could use deterministic signatures and never use the RNG for singing.  Bitcoin is compatible with RFC6979.  I don't know if any Android wallet supports RFC6979 but that would be a pretty good feature to add.
donator
Activity: 1218
Merit: 1079
Gerald Davis
One disadvantage of generating a new change address for each transaction is that the wallet needs to be backed up after each transaction. This could put you at risk of losing coins if your wallet is on a mobile device.

Not with deterministic wallets.  You could generate an lifetime of keys from a single seed which once backed up never needs to be updated.
full member
Activity: 168
Merit: 100
There is nothing inherently wrong with re-using addresses, but there are a few reasons why using an address only once is better for both the user and Bitcoin.
One disadvantage of generating a new change address for each transaction is that the wallet needs to be backed up after each transaction. This could put you at risk of losing coins if your wallet is on a mobile device.

Mobile devices are inherently insecure anyway. Send coins to them when you think you may need to spend from them but otherwise don't use them for financial storage.

But as stated, the bitcoin qt client creates address in advance so when you back up your wallet, you have backed up 100 private keys (by default) that haven't been used yet.

I don't know about the mobile client. After that bug where they trusted the Android random number generator was random and it wasn't, I won't trust the mobile wallet at all until someone pays for a serious 3rd party audit of the code.

Isn't that the kind of thing the bitcoin foundation should do?
legendary
Activity: 4466
Merit: 3391
There is nothing inherently wrong with re-using addresses, but there are a few reasons why using an address only once is better for both the user and Bitcoin.
One disadvantage of generating a new change address for each transaction is that the wallet needs to be backed up after each transaction. This could put you at risk of losing coins if your wallet is on a mobile device.

I don't think there is any wallet (except perhaps blockchain.info) that would need to be backed up after every transaction. If you are using Bitcoin Core, then you would need to back it up every 100 transactions (note: that's configurable). If you are using a deterministic wallet such as Electrum or Mycelium, then you would only need to back it up once.
full member
Activity: 206
Merit: 100
There is nothing inherently wrong with re-using addresses, but there are a few reasons why using an address only once is better for both the user and Bitcoin.
One disadvantage of generating a new change address for each transaction is that the wallet needs to be backed up after each transaction. This could put you at risk of losing coins if your wallet is on a mobile device.
donator
Activity: 1218
Merit: 1079
Gerald Davis
An address is not a public key.  An address is a hash of a public key (Pay2PubKeyHash) or a hash of a script (Pay2ScriptHash).  In P2PkH and P2SH transactions the public key is unknown until the coins are "spent".

newbie
Activity: 28
Merit: 0
Once upon a time, I read something somewhere that indicated that change addresses had additional information posted in the blockchain vs third party addresses.  I had long since forgotten about this, so I am hoping someone else can confirm whether this was ever true and whether or not it has changed.  Sadly, this newbie post reminded me because it triggered my urge to want to correct the poster:
Actually the transaction only shows the public key of the address you are sending the coins from. That's why some coins are likely lost forever because they were sent to an address which are unlikely to be associated with a public/private key pair.
They are named something like "1DontSendBitCoinsHere"...
That urge was quickly replaced by the same question asked by another newbie that the aforementioned post was supposed to answer:
OK, newbie here but please bear with me because I'm sure many people reading this thread would like to ask this same question but are afraid to look noob. You keep saying not to reuse addresses and keep balances on new addresses. Now as I understand it, in order to send coins to any address the network needs to be made aware of it by means of a transaction which will be forever recorded on the blockchain with the public keys of the addresses. So what's the point in tranferring the coins to a new address if its public key is going to be made public by the transaction anyway, even if the address owner only made that single transaction using that address?
Obviously the "don't re-use addresses" advice would be garbage if transactions work the way I remember reading that they work.  I find it hard to believe (but not impossible based on some other things I have seen) that garbage advice would be quite so rampant, so I have to believe that either A) I am remembering wrong or B) bitcoin core wallet was changed to not broadcast public keys for change addresses in transactions.

Anyone who has been around here long enough to know what I read happen to remember it and know how to find it?


As long as ANYONE can download the whole transaction record and rebuild the blockchain from genesis every address is KNOWN that has had transaction

The only benefit of swiping to new addresses is to keep a vault or cold storage where the public key is 100% controlled by the owner

That's my understanding of btc, alleged anonymous currency system where every transaction is transparent in that the community of btc users can verify every transaction since genesis

hero member
Activity: 807
Merit: 500
Thanks for all the responses everyone, gotta keep learning.
donator
Activity: 1218
Merit: 1079
Gerald Davis
I knew it wasn't needed for change, I just thought it was sent with change just because it was available.  In the "very early days," would the public key have been used for the change instead of the hash?  That could be exactly what I was reading about (whether it was change or coinbase).  I'm pretty sure I would have read it in the first half of 2011, and it could have been out of date info by then.

No.  Change outputs have never been different.  The protocol has no concept of a "change output",  the concept of "change" is a client level concept.  In theory you don't need to use change at all.  Just send as much as you want and donate the rest to miners.  It may not be optimal but the point is the protocol only sees inputs and outputs.  A txn consists of one or more inputs and one or more outputs.  The outputs must be less than or equal to the inputs.  Your wallet can use any type of script for the "change output".  You could use a Pay2PubKey script for the change output but you could also use a Pay2PubKey script for the "main outputs" as well.  Our company internal wallet uses P2SH scripts for change because the entire wallet is multisig.
legendary
Activity: 3472
Merit: 4801
I knew it wasn't needed for change, I just thought it was sent with change just because it was available.  In the "very early days," would the public key have been used for the change instead of the hash?  That could be exactly what I was reading about (whether it was change or coinbase).  I'm pretty sure I would have read it in the first half of 2011, and it could have been out of date info by then.

I'm not certain, but I think in "the very early days" of bitcoin, all payments were made using pay-to-pubkey instead of pay-to-pubkey-hash.  I think the first block to include a pay-to-pubkey-hash was block 728.

Eventually some people began trying some non-standard outputs, so there are other payment types in the blockchain besides pay-to-pubkey and pay-to-pubkey-hash.  More recently, people have begin using pay-to-script-hash, especially for multisig outputs.

hero member
Activity: 807
Merit: 500
I knew it wasn't needed for change, I just thought it was sent with change just because it was available.  In the "very early days," would the public key have been used for the change instead of the hash?  That could be exactly what I was reading about (whether it was change or coinbase).  I'm pretty sure I would have read it in the first half of 2011, and it could have been out of date info by then.
cp1
hero member
Activity: 616
Merit: 500
Stop using branwallets
There's a good article here about what goes into spending.  You can look at when the actual public key is needed.  http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html
legendary
Activity: 3472
Merit: 4801
As odolvlobo has pointed out, in the very early days of Bitcoin, transactions were occasionally sent to publick keys instead of public key hashes.  In that case, a "bitcoin address" wouldn't be used at all (although a block explorer can calculate it after the fact, since it is easy to figure out what the bitcoin address would be if you know the public key).
legendary
Activity: 4466
Merit: 3391
I haven't been able to find the source, however, it may be something I inferred.  For instance, see this block explorer URL.  It indicates that address 12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX has a public key of 0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d 4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee while it says nothing was ever sent from that address.  This blockchain.info URL appears to concur (no sent amount).  Given this, why is the public key there?

Look at the very first transaction for the address. The public key was used in the coinbase transaction. That is how it is known.
hero member
Activity: 807
Merit: 500
If you can find the source of your information, I can let you know if the source is incorrect, or it you are just misunderstanding what they are trying to say.
I haven't been able to find the source, however, it may be something I inferred.  For instance, see this block explorer URL.  It indicates that address 12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX has a public key of 0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d 4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee while it says nothing was ever sent from that address.  This blockchain.info URL appears to concur (no sent amount).  Given this, why is the public key there?
legendary
Activity: 3472
Merit: 4801
Once upon a time, I read something somewhere that indicated that change addresses had additional information posted in the blockchain vs third party addresses.

I suspect you are remembering incorrectly.  The only thing that makes something a "change address" is the fact that the private key to the address is known by the wallet that is creating the transaction.  Other than that, there is no way to tell the difference between bitcoins sent to someone else's address or to a change address from the sender's wallet.

I had long since forgotten about this, so I am hoping someone else can confirm whether this was ever true and whether or not it has changed.

If you can find the source of your information, I can let you know if the source is incorrect, or it you are just misunderstanding what they are trying to say.

Now as I understand it, in order to send coins to any address the network needs to be made aware of it by means of a transaction which will be forever recorded on the blockchain with the public keys of the addresses.

That is incorrect.  The public keys of an address are not recorded in the blockchain until bitcoins received at that address are spent. Unless you tell the sender what your public key is, there is no way for them to know it and therefore no way for them to include it in the transaction.

So what's the point in tranferring the coins to a new address if its public key is going to be made public by the transaction anyway, even if the address owner only made that single transaction using that address?

It isn't.  You've misunderstood something.

so I have to believe that either A) I am remembering wrong or B) bitcoin core wallet was changed to not broadcast public keys for change addresses in transactions.

Public keys are available for addresses after a transaction spends bitcoins that were received at that address.  There is no broadcast of the public key of an address that is receiving bitcoins for the first time.
legendary
Activity: 4466
Merit: 3391
There is nothing special about a change address other than the fact that the sender controls it.

There is nothing inherently wrong with re-using addresses, but there are a few reasons why using an address only once is better for both the user and Bitcoin.
hero member
Activity: 807
Merit: 500
Once upon a time, I read something somewhere that indicated that change addresses had additional information posted in the blockchain vs third party addresses.  I had long since forgotten about this, so I am hoping someone else can confirm whether this was ever true and whether or not it has changed.  Sadly, this newbie post reminded me because it triggered my urge to want to correct the poster:
Actually the transaction only shows the public key of the address you are sending the coins from. That's why some coins are likely lost forever because they were sent to an address which are unlikely to be associated with a public/private key pair.
They are named something like "1DontSendBitCoinsHere"...
That urge was quickly replaced by the same question asked by another newbie that the aforementioned post was supposed to answer:
OK, newbie here but please bear with me because I'm sure many people reading this thread would like to ask this same question but are afraid to look noob. You keep saying not to reuse addresses and keep balances on new addresses. Now as I understand it, in order to send coins to any address the network needs to be made aware of it by means of a transaction which will be forever recorded on the blockchain with the public keys of the addresses. So what's the point in tranferring the coins to a new address if its public key is going to be made public by the transaction anyway, even if the address owner only made that single transaction using that address?
Obviously the "don't re-use addresses" advice would be garbage if transactions work the way I remember reading that they work.  I find it hard to believe (but not impossible based on some other things I have seen) that garbage advice would be quite so rampant, so I have to believe that either A) I am remembering wrong or B) bitcoin core wallet was changed to not broadcast public keys for change addresses in transactions.

Anyone who has been around here long enough to know what I read happen to remember it and know how to find it?
Jump to: