Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Bungeebones on August 04, 2014, 02:40:56 PM



Title: A basic question about addresses
Post by: Bungeebones on August 04, 2014, 02:40:56 PM
Could an address work as either a testnet address or as  a bitcoin address? Can they be interchanged just by changing the first character from a 1 to an N for example? I'm thinking that since they are always the same first character that the address must be the rest of it and the first character is just appended on to it? Right or wrong?

Thanks


Title: Re: A basic question about addresses
Post by: jl2012 on August 04, 2014, 03:38:02 PM
Could an address work as either a testnet address or as  a bitcoin address? Can they be interchanged just by changing the first character from a 1 to an N for example? I'm thinking that since they are always the same first character that the address must be the rest of it and the first character is just appended on to it? Right or wrong?

Thanks

No

https://en.bitcoin.it/wiki/Base58Check_encoding


Title: Re: A basic question about addresses
Post by: DeathAndTaxes on August 04, 2014, 04:29:10 PM
As jl2012 said the answer is no.  The same  keypair can be used on both networks but they will produce different addresses.

Code:
key:             b7b0dcb8cdca3f9a6377cb0f1f5942cec1b3c0f4d6d03dabceced635209aefe1
pubKey:          03e0c6de6ab1c298125368df9973cab1811620cf8349834308acce82dd5ac26419
pubKeyHash:      379800c38269d88e850721399a90e81e91d9eea9
mainnet address: 164xFuP2uhrJX8eVP77k6rrDfboNo21hRR
testnet address: mkauYxU1ijHZJF876g67vn4YXbQ5kASPut

For obvious reasons please nobody use this example key for anything.


Title: Re: A basic question about addresses
Post by: Bungeebones on August 05, 2014, 03:35:41 PM
Thanks