Author

Topic: Question about SHA256 address (Read 480 times)

newbie
Activity: 28
Merit: 0
August 29, 2017, 09:25:25 AM
#4
Thanks for your answers! I go back to learn  Grin
legendary
Activity: 3514
Merit: 4895
August 29, 2017, 09:11:58 AM
#3
So, a SHA256 private key

What is a SHA256 private key?

A bitcoin private key is just a random number between 1 and 115792089237316195423570985008687907852837564279074904382605163141518161494336.

While the results of the SHA256 algorithm typically fall within that range, there is no need to use SHA256 when generating private keys. Any number chosen randomly enough will work.

Does it means that I can use a bitcoin address on any coin using the SHA256 algo?

That depends on the signature algorithm that the altcoin is using and how the altcoin generates their addresses.

What about others algo?

If the coin uses a different algorithm for generating addresses, then their address won't be the same for the same private key.

I think I missed something.

I think you missed a LOT.

  • You missed the fact that Bitcoin uses ECDSA key pairs.
  • You missed the fact that the standard version 1 Bitcoin addresses requires hashing the public key with SHA256
  • You missed the fact that the standard version 1 Bitcoin addresses requires hashing the SHA256 hash with RIPEMD160
  • You missed the fact that the standard version 1 Bitcoin addresses requires a version byte in the front that tells the wallet what to do with the address.
  • You missed the fact that the standard version 1 Bitcoin addresses requires the resulting value to be base58check encoded.
staff
Activity: 3458
Merit: 6793
Just writing some code
August 29, 2017, 09:05:45 AM
#2
So, a SHA256 private key is just a random 256 bits number.
There is no such thing as "a SHA256 private key". SHA256 is not a private key generation algorithm, it is a hashing algorithm. Do not use SHA256 to generate your private keys as it is not secure. The data that you are hashing will most likely not be random enough to be a secure private key.

Private keys are ECDSA private keys, specifically private keys for the secp256k1 curve. They are just 256 bit random integers.

Does it means that I can use a bitcoin address on any coin using the SHA256 algo?
You can use your Bitcoin private keys with anything that uses ECDSA and secp256k1. You won't have the same address and the import formats will be different because there is additional encoding to differentiate so that people don't accidentally use the wrong addresses.
newbie
Activity: 28
Merit: 0
August 29, 2017, 08:23:13 AM
#1
So, a SHA256 private key is just a random 256 bits number. Does it means that I can use a bitcoin address on any coin using the SHA256 algo?
What about others algo?
I think I missed something.
Jump to: