Bitcoin Forum
May 04, 2024, 07:26:11 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Question about SHA256 address  (Read 438 times)
Fizak (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
August 29, 2017, 01:23:13 PM
 #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.
1714807571
Hero Member
*
Offline Offline

Posts: 1714807571

View Profile Personal Message (Offline)

Ignore
1714807571
Reply with quote  #2

1714807571
Report to moderator
"In a nutshell, the network works like a distributed timestamp server, stamping the first transaction to spend a coin. It takes advantage of the nature of information being easy to spread but hard to stifle." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714807571
Hero Member
*
Offline Offline

Posts: 1714807571

View Profile Personal Message (Offline)

Ignore
1714807571
Reply with quote  #2

1714807571
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6578


Just writing some code


View Profile WWW
August 29, 2017, 02:05:45 PM
 #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.

DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4615



View Profile
August 29, 2017, 02:11:58 PM
Merited by ABCbits (3)
 #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.
Fizak (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
August 29, 2017, 02:25:25 PM
 #4

Thanks for your answers! I go back to learn  Grin
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!